From 806dda08d685bc5f9ed71dfe8b61f21848d48066 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Fri, 17 Aug 2012 13:23:19 +0200 Subject: Moving .qdoc files under examples/widgets/doc Updated those .qdoc files to refer to the new relative examples emplacement. Images and snippets to be moved later. Also grouped all widgets related examples under widgets. Change-Id: Ib29696e2d8948524537f53e8dda88f9ee26a597f Reviewed-by: J-P Nurmi --- examples/widgets/README | 13 - examples/widgets/analogclock/analogclock.cpp | 145 -- examples/widgets/analogclock/analogclock.desktop | 11 - examples/widgets/analogclock/analogclock.h | 59 - examples/widgets/analogclock/analogclock.pro | 12 - examples/widgets/analogclock/main.cpp | 51 - examples/widgets/animation/README | 8 + .../animation/animatedtiles/animatedtiles.desktop | 11 + .../animation/animatedtiles/animatedtiles.pro | 10 + .../animation/animatedtiles/animatedtiles.qrc | 11 + .../animatedtiles/images/Time-For-Lunch-2.jpg | Bin 0 -> 32471 bytes .../animation/animatedtiles/images/centered.png | Bin 0 -> 892 bytes .../animation/animatedtiles/images/ellipse.png | Bin 0 -> 10767 bytes .../animation/animatedtiles/images/figure8.png | Bin 0 -> 14050 bytes .../animation/animatedtiles/images/kinetic.png | Bin 0 -> 6776 bytes .../animation/animatedtiles/images/random.png | Bin 0 -> 14969 bytes .../animation/animatedtiles/images/tile.png | Bin 0 -> 16337 bytes examples/widgets/animation/animatedtiles/main.cpp | 256 ++++ examples/widgets/animation/animation.pro | 17 + .../appchooser/accessories-dictionary.png | Bin 0 -> 5396 bytes .../widgets/animation/appchooser/akregator.png | Bin 0 -> 4873 bytes .../animation/appchooser/appchooser.desktop | 11 + .../widgets/animation/appchooser/appchooser.pro | 10 + .../widgets/animation/appchooser/appchooser.qrc | 8 + examples/widgets/animation/appchooser/digikam.png | Bin 0 -> 3334 bytes examples/widgets/animation/appchooser/k3b.png | Bin 0 -> 8220 bytes examples/widgets/animation/appchooser/main.cpp | 173 +++ examples/widgets/animation/easing/animation.h | 100 ++ examples/widgets/animation/easing/easing.desktop | 11 + examples/widgets/animation/easing/easing.pro | 17 + examples/widgets/animation/easing/easing.qrc | 5 + examples/widgets/animation/easing/form.ui | 270 ++++ .../widgets/animation/easing/images/qt-logo.png | Bin 0 -> 5149 bytes examples/widgets/animation/easing/main.cpp | 54 + examples/widgets/animation/easing/window.cpp | 177 +++ examples/widgets/animation/easing/window.h | 76 + examples/widgets/animation/moveblocks/main.cpp | 321 +++++ .../animation/moveblocks/moveblocks.desktop | 11 + .../widgets/animation/moveblocks/moveblocks.pro | 9 + .../animation/states/accessories-dictionary.png | Bin 0 -> 5396 bytes examples/widgets/animation/states/akregator.png | Bin 0 -> 4873 bytes examples/widgets/animation/states/digikam.png | Bin 0 -> 3334 bytes examples/widgets/animation/states/help-browser.png | Bin 0 -> 6984 bytes examples/widgets/animation/states/k3b.png | Bin 0 -> 8220 bytes examples/widgets/animation/states/kchart.png | Bin 0 -> 4887 bytes examples/widgets/animation/states/main.cpp | 285 ++++ examples/widgets/animation/states/states.desktop | 11 + examples/widgets/animation/states/states.pro | 10 + examples/widgets/animation/states/states.qrc | 10 + examples/widgets/animation/stickman/animation.cpp | 189 +++ examples/widgets/animation/stickman/animation.h | 82 ++ .../animation/stickman/animations/chilling.bin | Bin 0 -> 6508 bytes .../animation/stickman/animations/dancing.bin | Bin 0 -> 2348 bytes .../widgets/animation/stickman/animations/dead.bin | Bin 0 -> 268 bytes .../animation/stickman/animations/jumping.bin | Bin 0 -> 1308 bytes .../widgets/animation/stickman/graphicsview.cpp | 60 + examples/widgets/animation/stickman/graphicsview.h | 64 + examples/widgets/animation/stickman/lifecycle.cpp | 217 +++ examples/widgets/animation/stickman/lifecycle.h | 80 ++ examples/widgets/animation/stickman/main.cpp | 106 ++ examples/widgets/animation/stickman/node.cpp | 92 ++ examples/widgets/animation/stickman/node.h | 70 + examples/widgets/animation/stickman/rectbutton.cpp | 73 + examples/widgets/animation/stickman/rectbutton.h | 65 + examples/widgets/animation/stickman/stickman.cpp | 337 +++++ .../widgets/animation/stickman/stickman.desktop | 11 + examples/widgets/animation/stickman/stickman.h | 103 ++ examples/widgets/animation/stickman/stickman.pro | 23 + examples/widgets/animation/stickman/stickman.qrc | 8 + .../animation/sub-attaq/animationmanager.cpp | 98 ++ .../widgets/animation/sub-attaq/animationmanager.h | 73 + examples/widgets/animation/sub-attaq/boat.cpp | 272 ++++ examples/widgets/animation/sub-attaq/boat.h | 95 ++ examples/widgets/animation/sub-attaq/boat_p.h | 232 +++ examples/widgets/animation/sub-attaq/bomb.cpp | 118 ++ examples/widgets/animation/sub-attaq/bomb.h | 67 + examples/widgets/animation/sub-attaq/data.xml | 39 + .../widgets/animation/sub-attaq/graphicsscene.cpp | 282 ++++ .../widgets/animation/sub-attaq/graphicsscene.h | 122 ++ examples/widgets/animation/sub-attaq/main.cpp | 57 + .../widgets/animation/sub-attaq/mainwindow.cpp | 82 ++ examples/widgets/animation/sub-attaq/mainwindow.h | 63 + .../animation/sub-attaq/pics/big/background.png | Bin 0 -> 48858 bytes .../widgets/animation/sub-attaq/pics/big/boat.png | Bin 0 -> 5198 bytes .../widgets/animation/sub-attaq/pics/big/bomb.png | Bin 0 -> 760 bytes .../sub-attaq/pics/big/explosion/boat/step1.png | Bin 0 -> 5760 bytes .../sub-attaq/pics/big/explosion/boat/step2.png | Bin 0 -> 9976 bytes .../sub-attaq/pics/big/explosion/boat/step3.png | Bin 0 -> 12411 bytes .../sub-attaq/pics/big/explosion/boat/step4.png | Bin 0 -> 15438 bytes .../pics/big/explosion/submarine/step1.png | Bin 0 -> 3354 bytes .../pics/big/explosion/submarine/step2.png | Bin 0 -> 6205 bytes .../pics/big/explosion/submarine/step3.png | Bin 0 -> 6678 bytes .../pics/big/explosion/submarine/step4.png | Bin 0 -> 6666 bytes .../animation/sub-attaq/pics/big/submarine.png | Bin 0 -> 3202 bytes .../animation/sub-attaq/pics/big/surface.png | Bin 0 -> 575 bytes .../animation/sub-attaq/pics/big/torpedo.png | Bin 0 -> 951 bytes .../sub-attaq/pics/scalable/background-n810.svg | 171 +++ .../sub-attaq/pics/scalable/background.svg | 171 +++ .../animation/sub-attaq/pics/scalable/boat.svg | 279 ++++ .../animation/sub-attaq/pics/scalable/bomb.svg | 138 ++ .../animation/sub-attaq/pics/scalable/sand.svg | 103 ++ .../animation/sub-attaq/pics/scalable/see.svg | 44 + .../animation/sub-attaq/pics/scalable/sky.svg | 45 + .../sub-attaq/pics/scalable/sub-attaq.svg | 1473 ++++++++++++++++++++ .../sub-attaq/pics/scalable/submarine.svg | 214 +++ .../animation/sub-attaq/pics/scalable/surface.svg | 49 + .../animation/sub-attaq/pics/scalable/torpedo.svg | 127 ++ .../animation/sub-attaq/pics/small/background.png | Bin 0 -> 34634 bytes .../animation/sub-attaq/pics/small/boat.png | Bin 0 -> 2394 bytes .../animation/sub-attaq/pics/small/bomb.png | Bin 0 -> 760 bytes .../animation/sub-attaq/pics/small/submarine.png | Bin 0 -> 1338 bytes .../animation/sub-attaq/pics/small/surface.png | Bin 0 -> 502 bytes .../animation/sub-attaq/pics/small/torpedo.png | Bin 0 -> 951 bytes .../animation/sub-attaq/pics/welcome/logo-a.png | Bin 0 -> 5972 bytes .../animation/sub-attaq/pics/welcome/logo-a2.png | Bin 0 -> 5969 bytes .../animation/sub-attaq/pics/welcome/logo-b.png | Bin 0 -> 6869 bytes .../animation/sub-attaq/pics/welcome/logo-dash.png | Bin 0 -> 2255 bytes .../animation/sub-attaq/pics/welcome/logo-excl.png | Bin 0 -> 2740 bytes .../animation/sub-attaq/pics/welcome/logo-q.png | Bin 0 -> 7016 bytes .../animation/sub-attaq/pics/welcome/logo-s.png | Bin 0 -> 5817 bytes .../animation/sub-attaq/pics/welcome/logo-t.png | Bin 0 -> 3717 bytes .../animation/sub-attaq/pics/welcome/logo-t2.png | Bin 0 -> 3688 bytes .../animation/sub-attaq/pics/welcome/logo-u.png | Bin 0 -> 5374 bytes .../widgets/animation/sub-attaq/pixmapitem.cpp | 76 + examples/widgets/animation/sub-attaq/pixmapitem.h | 63 + .../widgets/animation/sub-attaq/progressitem.cpp | 67 + .../widgets/animation/sub-attaq/progressitem.h | 61 + .../animation/sub-attaq/qanimationstate.cpp | 150 ++ .../widgets/animation/sub-attaq/qanimationstate.h | 91 ++ examples/widgets/animation/sub-attaq/states.cpp | 330 +++++ examples/widgets/animation/sub-attaq/states.h | 180 +++ examples/widgets/animation/sub-attaq/sub-attaq.pro | 42 + examples/widgets/animation/sub-attaq/subattaq.qrc | 39 + examples/widgets/animation/sub-attaq/submarine.cpp | 182 +++ examples/widgets/animation/sub-attaq/submarine.h | 93 ++ examples/widgets/animation/sub-attaq/submarine_p.h | 137 ++ .../animation/sub-attaq/textinformationitem.cpp | 54 + .../animation/sub-attaq/textinformationitem.h | 55 + examples/widgets/animation/sub-attaq/torpedo.cpp | 114 ++ examples/widgets/animation/sub-attaq/torpedo.h | 67 + .../applicationicon/applicationicon.desktop | 11 - .../widgets/applicationicon/applicationicon.png | Bin 4023 -> 0 bytes .../widgets/applicationicon/applicationicon.pro | 17 - .../widgets/applicationicon/applicationicon.svg | 22 - examples/widgets/applicationicon/main.cpp | 50 - examples/widgets/calculator/button.cpp | 63 - examples/widgets/calculator/button.h | 58 - examples/widgets/calculator/calculator.cpp | 396 ------ examples/widgets/calculator/calculator.desktop | 11 - examples/widgets/calculator/calculator.h | 107 -- examples/widgets/calculator/calculator.pro | 14 - examples/widgets/calculator/main.cpp | 51 - examples/widgets/calculator/releasenotes.txt | 4 - .../widgets/calendarwidget/calendarwidget.desktop | 11 - examples/widgets/calendarwidget/calendarwidget.pro | 11 - examples/widgets/calendarwidget/main.cpp | 51 - examples/widgets/calendarwidget/window.cpp | 464 ------ examples/widgets/calendarwidget/window.h | 127 -- examples/widgets/charactermap/charactermap.desktop | 11 - examples/widgets/charactermap/charactermap.pro | 15 - examples/widgets/charactermap/characterwidget.cpp | 177 --- examples/widgets/charactermap/characterwidget.h | 86 -- examples/widgets/charactermap/main.cpp | 51 - examples/widgets/charactermap/mainwindow.cpp | 204 --- examples/widgets/charactermap/mainwindow.h | 87 -- examples/widgets/codeeditor/codeeditor.cpp | 170 --- examples/widgets/codeeditor/codeeditor.desktop | 11 - examples/widgets/codeeditor/codeeditor.h | 105 -- examples/widgets/codeeditor/codeeditor.pro | 11 - examples/widgets/codeeditor/main.cpp | 55 - examples/widgets/desktop/README | 10 + examples/widgets/desktop/desktop.pro | 11 + examples/widgets/desktop/screenshot/main.cpp | 51 + examples/widgets/desktop/screenshot/screenshot.cpp | 199 +++ .../widgets/desktop/screenshot/screenshot.desktop | 11 + examples/widgets/desktop/screenshot/screenshot.h | 99 ++ examples/widgets/desktop/screenshot/screenshot.pro | 12 + examples/widgets/desktop/systray/images/bad.png | Bin 0 -> 2496 bytes examples/widgets/desktop/systray/images/heart.png | Bin 0 -> 25780 bytes examples/widgets/desktop/systray/images/trash.png | Bin 0 -> 12128 bytes examples/widgets/desktop/systray/main.cpp | 63 + examples/widgets/desktop/systray/systray.desktop | 11 + examples/widgets/desktop/systray/systray.pro | 14 + examples/widgets/desktop/systray/systray.qrc | 7 + examples/widgets/desktop/systray/window.cpp | 270 ++++ examples/widgets/desktop/systray/window.h | 112 ++ examples/widgets/dialogs/README | 9 + .../widgets/dialogs/classwizard/classwizard.cpp | 430 ++++++ .../dialogs/classwizard/classwizard.desktop | 11 + examples/widgets/dialogs/classwizard/classwizard.h | 156 +++ .../widgets/dialogs/classwizard/classwizard.pro | 13 + .../widgets/dialogs/classwizard/classwizard.qrc | 11 + .../dialogs/classwizard/images/background.png | Bin 0 -> 22578 bytes .../widgets/dialogs/classwizard/images/banner.png | Bin 0 -> 3947 bytes .../widgets/dialogs/classwizard/images/logo1.png | Bin 0 -> 1619 bytes .../widgets/dialogs/classwizard/images/logo2.png | Bin 0 -> 1619 bytes .../widgets/dialogs/classwizard/images/logo3.png | Bin 0 -> 1619 bytes .../dialogs/classwizard/images/watermark1.png | Bin 0 -> 14516 bytes .../dialogs/classwizard/images/watermark2.png | Bin 0 -> 14912 bytes examples/widgets/dialogs/classwizard/main.cpp | 63 + .../widgets/dialogs/configdialog/configdialog.cpp | 116 ++ .../dialogs/configdialog/configdialog.desktop | 11 + .../widgets/dialogs/configdialog/configdialog.h | 69 + .../widgets/dialogs/configdialog/configdialog.pro | 17 + .../widgets/dialogs/configdialog/configdialog.qrc | 7 + .../widgets/dialogs/configdialog/images/config.png | Bin 0 -> 6758 bytes .../widgets/dialogs/configdialog/images/query.png | Bin 0 -> 2116 bytes .../widgets/dialogs/configdialog/images/update.png | Bin 0 -> 7890 bytes examples/widgets/dialogs/configdialog/main.cpp | 52 + examples/widgets/dialogs/configdialog/pages.cpp | 151 ++ examples/widgets/dialogs/configdialog/pages.h | 64 + examples/widgets/dialogs/dialogs.pro | 19 + .../widgets/dialogs/extension/extension.desktop | 11 + examples/widgets/dialogs/extension/extension.pro | 12 + examples/widgets/dialogs/extension/finddialog.cpp | 114 ++ examples/widgets/dialogs/extension/finddialog.h | 78 ++ examples/widgets/dialogs/extension/main.cpp | 53 + .../widgets/dialogs/findfiles/findfiles.desktop | 11 + examples/widgets/dialogs/findfiles/findfiles.pro | 11 + examples/widgets/dialogs/findfiles/main.cpp | 51 + examples/widgets/dialogs/findfiles/window.cpp | 247 ++++ examples/widgets/dialogs/findfiles/window.h | 90 ++ .../widgets/dialogs/licensewizard/images/logo.png | Bin 0 -> 1810 bytes .../dialogs/licensewizard/images/watermark.png | Bin 0 -> 34998 bytes .../dialogs/licensewizard/licensewizard.cpp | 363 +++++ .../dialogs/licensewizard/licensewizard.desktop | 11 + .../widgets/dialogs/licensewizard/licensewizard.h | 163 +++ .../dialogs/licensewizard/licensewizard.pro | 13 + .../dialogs/licensewizard/licensewizard.qrc | 6 + examples/widgets/dialogs/licensewizard/main.cpp | 63 + examples/widgets/dialogs/sipdialog/dialog.cpp | 122 ++ examples/widgets/dialogs/sipdialog/dialog.h | 63 + examples/widgets/dialogs/sipdialog/main.cpp | 52 + .../widgets/dialogs/sipdialog/sipdialog.desktop | 11 + examples/widgets/dialogs/sipdialog/sipdialog.pro | 15 + .../widgets/dialogs/standarddialogs/dialog.cpp | 471 +++++++ examples/widgets/dialogs/standarddialogs/dialog.h | 101 ++ examples/widgets/dialogs/standarddialogs/main.cpp | 62 + .../standarddialogs/standarddialogs.desktop | 11 + .../dialogs/standarddialogs/standarddialogs.pro | 13 + examples/widgets/dialogs/tabdialog/main.cpp | 59 + examples/widgets/dialogs/tabdialog/tabdialog.cpp | 196 +++ .../widgets/dialogs/tabdialog/tabdialog.desktop | 11 + examples/widgets/dialogs/tabdialog/tabdialog.h | 99 ++ examples/widgets/dialogs/tabdialog/tabdialog.pro | 12 + .../dialogs/trivialwizard/trivialwizard.cpp | 135 ++ .../dialogs/trivialwizard/trivialwizard.desktop | 11 + .../dialogs/trivialwizard/trivialwizard.pro | 10 + examples/widgets/digitalclock/digitalclock.cpp | 72 - examples/widgets/digitalclock/digitalclock.desktop | 11 - examples/widgets/digitalclock/digitalclock.h | 59 - examples/widgets/digitalclock/digitalclock.pro | 11 - examples/widgets/digitalclock/main.cpp | 51 - examples/widgets/doc/addressbook.qdoc | 442 ++++++ examples/widgets/doc/affine.qdoc | 48 + examples/widgets/doc/analogclock.qdoc | 154 ++ examples/widgets/doc/animatedtiles.qdoc | 36 + examples/widgets/doc/appchooser.qdoc | 38 + examples/widgets/doc/application.qdoc | 396 ++++++ examples/widgets/doc/basicdrawing.qdoc | 454 ++++++ examples/widgets/doc/basicgraphicslayouts.qdoc | 164 +++ examples/widgets/doc/basiclayouts.qdoc | 190 +++ examples/widgets/doc/basicsortfiltermodel.qdoc | 37 + examples/widgets/doc/blurpicker.qdoc | 33 + examples/widgets/doc/borderlayout.qdoc | 36 + examples/widgets/doc/boxes.qdoc | 49 + examples/widgets/doc/calculator.qdoc | 375 +++++ examples/widgets/doc/calendar.qdoc | 223 +++ examples/widgets/doc/calendarwidget.qdoc | 291 ++++ examples/widgets/doc/charactermap.qdoc | 274 ++++ examples/widgets/doc/chart.qdoc | 82 ++ examples/widgets/doc/chip.qdoc | 38 + examples/widgets/doc/classwizard.qdoc | 190 +++ examples/widgets/doc/codeeditor.qdoc | 197 +++ examples/widgets/doc/coloreditorfactory.qdoc | 155 ++ examples/widgets/doc/combowidgetmapper.qdoc | 167 +++ examples/widgets/doc/composition.qdoc | 44 + examples/widgets/doc/concentriccircles.qdoc | 231 +++ examples/widgets/doc/configdialog.qdoc | 36 + examples/widgets/doc/customsortfiltermodel.qdoc | 289 ++++ examples/widgets/doc/deform.qdoc | 51 + examples/widgets/doc/diagramscene.qdoc | 834 +++++++++++ examples/widgets/doc/digitalclock.qdoc | 74 + examples/widgets/doc/dirview.qdoc | 36 + examples/widgets/doc/dockwidgets.qdoc | 163 +++ examples/widgets/doc/dragdroprobot.qdoc | 365 +++++ examples/widgets/doc/dynamiclayouts.qdoc | 34 + examples/widgets/doc/easing.qdoc | 37 + examples/widgets/doc/editabletreemodel.qdoc | 446 ++++++ examples/widgets/doc/elasticnodes.qdoc | 430 ++++++ examples/widgets/doc/elidedlabel.qdoc | 162 +++ examples/widgets/doc/embeddeddialogs.qdoc | 37 + examples/widgets/doc/eventtransitions.qdoc | 72 + examples/widgets/doc/extension.qdoc | 138 ++ examples/widgets/doc/factorial.qdoc | 88 ++ examples/widgets/doc/fademessage.qdoc | 37 + examples/widgets/doc/fetchmore.qdoc | 111 ++ examples/widgets/doc/findfiles.qdoc | 249 ++++ examples/widgets/doc/flowlayout.qdoc | 145 ++ examples/widgets/doc/fontsampler.qdoc | 35 + examples/widgets/doc/frozencolumn.qdoc | 133 ++ examples/widgets/doc/gradients.qdoc | 55 + examples/widgets/doc/groupbox.qdoc | 140 ++ examples/widgets/doc/icons.qdoc | 780 +++++++++++ examples/widgets/doc/imagecomposition.qdoc | 165 +++ examples/widgets/doc/imageviewer.qdoc | 326 +++++ examples/widgets/doc/interview.qdoc | 37 + examples/widgets/doc/licensewizard.qdoc | 218 +++ examples/widgets/doc/lighting.qdoc | 33 + examples/widgets/doc/lineedits.qdoc | 161 +++ examples/widgets/doc/mainwindow.qdoc | 36 + examples/widgets/doc/mdi.qdoc | 37 + examples/widgets/doc/menus.qdoc | 218 +++ examples/widgets/doc/moveblocks.qdoc | 214 +++ examples/widgets/doc/movie.qdoc | 39 + examples/widgets/doc/orderform.qdoc | 364 +++++ examples/widgets/doc/padnavigator.qdoc | 583 ++++++++ examples/widgets/doc/painterpaths.qdoc | 418 ++++++ examples/widgets/doc/pathstroke.qdoc | 47 + examples/widgets/doc/pingpong.qdoc | 93 ++ examples/widgets/doc/pixelator.qdoc | 255 ++++ examples/widgets/doc/recentfiles.qdoc | 36 + examples/widgets/doc/rogue.qdoc | 208 +++ examples/widgets/doc/screenshot.qdoc | 247 ++++ examples/widgets/doc/scribble.qdoc | 417 ++++++ examples/widgets/doc/sdi.qdoc | 36 + examples/widgets/doc/shapedclock.qdoc | 131 ++ examples/widgets/doc/simpledommodel.qdoc | 280 ++++ examples/widgets/doc/simpletreemodel.qdoc | 333 +++++ examples/widgets/doc/simplewidgetmapper.qdoc | 125 ++ examples/widgets/doc/sipdialog.qdoc | 127 ++ examples/widgets/doc/sliders.qdoc | 255 ++++ examples/widgets/doc/spinboxdelegate.qdoc | 141 ++ examples/widgets/doc/spinboxes.qdoc | 191 +++ examples/widgets/doc/spreadsheet.qdoc | 37 + examples/widgets/doc/standarddialogs.qdoc | 35 + examples/widgets/doc/stardelegate.qdoc | 296 ++++ examples/widgets/doc/states.qdoc | 36 + examples/widgets/doc/stickman.qdoc | 102 ++ examples/widgets/doc/styles.qdoc | 472 +++++++ examples/widgets/doc/stylesheet.qdoc | 36 + examples/widgets/doc/sub-attaq.qdoc | 40 + examples/widgets/doc/syntaxhighlighter.qdoc | 252 ++++ examples/widgets/doc/tabdialog.qdoc | 134 ++ examples/widgets/doc/tablet.qdoc | 369 +++++ examples/widgets/doc/tetrix.qdoc | 431 ++++++ examples/widgets/doc/textedit.qdoc | 36 + examples/widgets/doc/tooltips.qdoc | 394 ++++++ examples/widgets/doc/trafficlight.qdoc | 85 ++ examples/widgets/doc/transformations.qdoc | 371 +++++ examples/widgets/doc/trivialwizard.qdoc | 82 ++ examples/widgets/doc/twowaybutton.qdoc | 68 + examples/widgets/doc/wiggly.qdoc | 167 +++ examples/widgets/doc/windowflags.qdoc | 216 +++ examples/widgets/draganddrop/README | 9 + .../delayedencoding/delayedencoding.desktop | 11 + examples/widgets/draganddrop/draganddrop.pro | 13 + .../draggableicons/draggableicons.desktop | 11 + .../draganddrop/draggableicons/draggableicons.pro | 12 + .../draganddrop/draggableicons/draggableicons.qrc | 7 + .../draganddrop/draggableicons/dragwidget.cpp | 168 +++ .../draganddrop/draggableicons/dragwidget.h | 65 + .../draganddrop/draggableicons/images/boat.png | Bin 0 -> 2772 bytes .../draganddrop/draggableicons/images/car.png | Bin 0 -> 2963 bytes .../draganddrop/draggableicons/images/house.png | Bin 0 -> 3292 bytes .../widgets/draganddrop/draggableicons/main.cpp | 61 + .../draggabletext/draggabletext.desktop | 11 + .../draganddrop/draggabletext/draggabletext.pro | 15 + .../draganddrop/draggabletext/draggabletext.qrc | 5 + .../draganddrop/draggabletext/draglabel.cpp | 51 + .../widgets/draganddrop/draggabletext/draglabel.h | 58 + .../draganddrop/draggabletext/dragwidget.cpp | 165 +++ .../widgets/draganddrop/draggabletext/dragwidget.h | 62 + .../widgets/draganddrop/draggabletext/main.cpp | 52 + .../widgets/draganddrop/draggabletext/words.txt | 41 + examples/widgets/draganddrop/dropsite/droparea.cpp | 126 ++ examples/widgets/draganddrop/dropsite/droparea.h | 77 + .../widgets/draganddrop/dropsite/dropsite.desktop | 11 + examples/widgets/draganddrop/dropsite/dropsite.pro | 14 + .../draganddrop/dropsite/dropsitewindow.cpp | 143 ++ .../widgets/draganddrop/dropsite/dropsitewindow.h | 77 + examples/widgets/draganddrop/dropsite/main.cpp | 53 + .../draganddrop/fridgemagnets/draglabel.cpp | 89 ++ .../widgets/draganddrop/fridgemagnets/draglabel.h | 64 + .../draganddrop/fridgemagnets/dragwidget.cpp | 212 +++ .../widgets/draganddrop/fridgemagnets/dragwidget.h | 65 + .../fridgemagnets/fridgemagnets.desktop | 11 + .../draganddrop/fridgemagnets/fridgemagnets.pro | 15 + .../draganddrop/fridgemagnets/fridgemagnets.qrc | 5 + .../widgets/draganddrop/fridgemagnets/main.cpp | 61 + .../widgets/draganddrop/fridgemagnets/words.txt | 48 + examples/widgets/draganddrop/puzzle/example.jpg | Bin 0 -> 42654 bytes examples/widgets/draganddrop/puzzle/main.cpp | 54 + examples/widgets/draganddrop/puzzle/mainwindow.cpp | 152 ++ examples/widgets/draganddrop/puzzle/mainwindow.h | 76 + examples/widgets/draganddrop/puzzle/pieceslist.cpp | 121 ++ examples/widgets/draganddrop/puzzle/pieceslist.h | 63 + examples/widgets/draganddrop/puzzle/puzzle.desktop | 11 + examples/widgets/draganddrop/puzzle/puzzle.pro | 23 + examples/widgets/draganddrop/puzzle/puzzle.qrc | 5 + .../widgets/draganddrop/puzzle/puzzlewidget.cpp | 214 +++ examples/widgets/draganddrop/puzzle/puzzlewidget.h | 89 ++ examples/widgets/effects/blurpicker/blureffect.cpp | 68 + examples/widgets/effects/blurpicker/blureffect.h | 66 + examples/widgets/effects/blurpicker/blurpicker.cpp | 161 +++ .../widgets/effects/blurpicker/blurpicker.desktop | 11 + examples/widgets/effects/blurpicker/blurpicker.h | 75 + examples/widgets/effects/blurpicker/blurpicker.pro | 11 + examples/widgets/effects/blurpicker/blurpicker.qrc | 14 + .../widgets/effects/blurpicker/images/README.txt | 5 + .../blurpicker/images/accessories-calculator.png | Bin 0 -> 3760 bytes .../blurpicker/images/accessories-text-editor.png | Bin 0 -> 4746 bytes .../effects/blurpicker/images/background.jpg | Bin 0 -> 16259 bytes .../effects/blurpicker/images/help-browser.png | Bin 0 -> 5392 bytes .../blurpicker/images/internet-group-chat.png | Bin 0 -> 2809 bytes .../effects/blurpicker/images/internet-mail.png | Bin 0 -> 3899 bytes .../blurpicker/images/internet-web-browser.png | Bin 0 -> 6376 bytes .../effects/blurpicker/images/office-calendar.png | Bin 0 -> 4010 bytes .../effects/blurpicker/images/system-users.png | Bin 0 -> 5353 bytes examples/widgets/effects/blurpicker/main.cpp | 55 + examples/widgets/effects/effects.pro | 14 + examples/widgets/effects/fademessage/README.txt | 2 + .../widgets/effects/fademessage/background.jpg | Bin 0 -> 159108 bytes .../widgets/effects/fademessage/fademessage.cpp | 128 ++ .../effects/fademessage/fademessage.desktop | 11 + examples/widgets/effects/fademessage/fademessage.h | 70 + .../widgets/effects/fademessage/fademessage.pro | 18 + .../widgets/effects/fademessage/fademessage.qrc | 5 + examples/widgets/effects/fademessage/main.cpp | 55 + examples/widgets/effects/lighting/lighting.cpp | 139 ++ examples/widgets/effects/lighting/lighting.desktop | 11 + examples/widgets/effects/lighting/lighting.h | 70 + examples/widgets/effects/lighting/lighting.pro | 11 + examples/widgets/effects/lighting/main.cpp | 55 + examples/widgets/elidedlabel/elidedlabel.cpp | 111 -- examples/widgets/elidedlabel/elidedlabel.desktop | 11 - examples/widgets/elidedlabel/elidedlabel.h | 76 - examples/widgets/elidedlabel/elidedlabel.pro | 21 - examples/widgets/elidedlabel/main.cpp | 53 - examples/widgets/elidedlabel/testwidget.cpp | 161 --- examples/widgets/elidedlabel/testwidget.h | 76 - examples/widgets/graphicsview/README | 9 + .../graphicsview/anchorlayout/anchorlayout.desktop | 11 + .../graphicsview/anchorlayout/anchorlayout.pro | 13 + .../widgets/graphicsview/anchorlayout/main.cpp | 129 ++ .../basicgraphicslayouts.desktop | 11 + .../basicgraphicslayouts/basicgraphicslayouts.pro | 14 + .../basicgraphicslayouts/basicgraphicslayouts.qrc | 5 + .../basicgraphicslayouts/images/block.png | Bin 0 -> 2146 bytes .../basicgraphicslayouts/layoutitem.cpp | 130 ++ .../graphicsview/basicgraphicslayouts/layoutitem.h | 65 + .../graphicsview/basicgraphicslayouts/main.cpp | 58 + .../graphicsview/basicgraphicslayouts/window.cpp | 90 ++ .../graphicsview/basicgraphicslayouts/window.h | 57 + examples/widgets/graphicsview/boxes/3rdparty/fbm.c | 207 +++ examples/widgets/graphicsview/boxes/3rdparty/fbm.h | 40 + examples/widgets/graphicsview/boxes/basic.fsh | 73 + examples/widgets/graphicsview/boxes/basic.vsh | 61 + examples/widgets/graphicsview/boxes/boxes.pro | 39 + examples/widgets/graphicsview/boxes/boxes.qrc | 25 + .../widgets/graphicsview/boxes/cubemap_negx.jpg | Bin 0 -> 41060 bytes .../widgets/graphicsview/boxes/cubemap_negy.jpg | Bin 0 -> 15520 bytes .../widgets/graphicsview/boxes/cubemap_negz.jpg | Bin 0 -> 68911 bytes .../widgets/graphicsview/boxes/cubemap_posx.jpg | Bin 0 -> 74915 bytes .../widgets/graphicsview/boxes/cubemap_posy.jpg | Bin 0 -> 24193 bytes .../widgets/graphicsview/boxes/cubemap_posz.jpg | Bin 0 -> 57881 bytes examples/widgets/graphicsview/boxes/dotted.fsh | 66 + examples/widgets/graphicsview/boxes/fresnel.fsh | 79 ++ examples/widgets/graphicsview/boxes/glass.fsh | 76 + examples/widgets/graphicsview/boxes/glbuffers.cpp | 402 ++++++ examples/widgets/graphicsview/boxes/glbuffers.h | 366 +++++ .../widgets/graphicsview/boxes/glextensions.cpp | 98 ++ examples/widgets/graphicsview/boxes/glextensions.h | 202 +++ .../widgets/graphicsview/boxes/gltrianglemesh.h | 91 ++ examples/widgets/graphicsview/boxes/granite.fsh | 76 + examples/widgets/graphicsview/boxes/main.cpp | 150 ++ examples/widgets/graphicsview/boxes/marble.fsh | 71 + examples/widgets/graphicsview/boxes/parameters.par | 5 + examples/widgets/graphicsview/boxes/qt-logo.jpg | Bin 0 -> 40886 bytes examples/widgets/graphicsview/boxes/qt-logo.png | Bin 0 -> 13923 bytes examples/widgets/graphicsview/boxes/qtbox.cpp | 480 +++++++ examples/widgets/graphicsview/boxes/qtbox.h | 118 ++ examples/widgets/graphicsview/boxes/reflection.fsh | 54 + examples/widgets/graphicsview/boxes/refraction.fsh | 70 + examples/widgets/graphicsview/boxes/roundedbox.cpp | 161 +++ examples/widgets/graphicsview/boxes/roundedbox.h | 72 + examples/widgets/graphicsview/boxes/scene.cpp | 1085 ++++++++++++++ examples/widgets/graphicsview/boxes/scene.h | 245 ++++ examples/widgets/graphicsview/boxes/smiley.png | Bin 0 -> 14508 bytes examples/widgets/graphicsview/boxes/square.jpg | Bin 0 -> 14542 bytes examples/widgets/graphicsview/boxes/trackball.cpp | 160 +++ examples/widgets/graphicsview/boxes/trackball.h | 79 ++ examples/widgets/graphicsview/boxes/wood.fsh | 70 + examples/widgets/graphicsview/chip/chip.cpp | 183 +++ examples/widgets/graphicsview/chip/chip.h | 68 + examples/widgets/graphicsview/chip/chip.pro | 21 + examples/widgets/graphicsview/chip/fileprint.png | Bin 0 -> 1456 bytes examples/widgets/graphicsview/chip/images.qrc | 10 + examples/widgets/graphicsview/chip/main.cpp | 57 + examples/widgets/graphicsview/chip/mainwindow.cpp | 109 ++ examples/widgets/graphicsview/chip/mainwindow.h | 68 + examples/widgets/graphicsview/chip/qt4logo.png | Bin 0 -> 48333 bytes examples/widgets/graphicsview/chip/rotateleft.png | Bin 0 -> 1754 bytes examples/widgets/graphicsview/chip/rotateright.png | Bin 0 -> 1732 bytes examples/widgets/graphicsview/chip/view.cpp | 279 ++++ examples/widgets/graphicsview/chip/view.h | 104 ++ examples/widgets/graphicsview/chip/zoomin.png | Bin 0 -> 1622 bytes examples/widgets/graphicsview/chip/zoomout.png | Bin 0 -> 1601 bytes .../collidingmice/collidingmice.desktop | 11 + .../graphicsview/collidingmice/collidingmice.pro | 17 + .../graphicsview/collidingmice/images/cheese.jpg | Bin 0 -> 3029 bytes .../widgets/graphicsview/collidingmice/main.cpp | 91 ++ .../widgets/graphicsview/collidingmice/mice.qrc | 5 + .../widgets/graphicsview/collidingmice/mouse.cpp | 200 +++ .../widgets/graphicsview/collidingmice/mouse.h | 68 + .../widgets/graphicsview/diagramscene/arrow.cpp | 145 ++ examples/widgets/graphicsview/diagramscene/arrow.h | 91 ++ .../graphicsview/diagramscene/diagramitem.cpp | 152 ++ .../graphicsview/diagramscene/diagramitem.h | 96 ++ .../graphicsview/diagramscene/diagramscene.cpp | 240 ++++ .../graphicsview/diagramscene/diagramscene.desktop | 11 + .../graphicsview/diagramscene/diagramscene.h | 112 ++ .../graphicsview/diagramscene/diagramscene.pro | 23 + .../graphicsview/diagramscene/diagramscene.qrc | 20 + .../graphicsview/diagramscene/diagramtextitem.cpp | 81 ++ .../graphicsview/diagramscene/diagramtextitem.h | 78 ++ .../diagramscene/images/background1.png | Bin 0 -> 112 bytes .../diagramscene/images/background2.png | Bin 0 -> 114 bytes .../diagramscene/images/background3.png | Bin 0 -> 116 bytes .../diagramscene/images/background4.png | Bin 0 -> 96 bytes .../graphicsview/diagramscene/images/bold.png | Bin 0 -> 274 bytes .../diagramscene/images/bringtofront.png | Bin 0 -> 293 bytes .../graphicsview/diagramscene/images/delete.png | Bin 0 -> 831 bytes .../graphicsview/diagramscene/images/floodfill.png | Bin 0 -> 282 bytes .../graphicsview/diagramscene/images/italic.png | Bin 0 -> 247 bytes .../graphicsview/diagramscene/images/linecolor.png | Bin 0 -> 145 bytes .../diagramscene/images/linepointer.png | Bin 0 -> 141 bytes .../graphicsview/diagramscene/images/pointer.png | Bin 0 -> 173 bytes .../diagramscene/images/sendtoback.png | Bin 0 -> 318 bytes .../diagramscene/images/textpointer.png | Bin 0 -> 753 bytes .../graphicsview/diagramscene/images/underline.png | Bin 0 -> 250 bytes .../widgets/graphicsview/diagramscene/main.cpp | 55 + .../graphicsview/diagramscene/mainwindow.cpp | 661 +++++++++ .../widgets/graphicsview/diagramscene/mainwindow.h | 150 ++ .../graphicsview/dragdroprobot/coloritem.cpp | 142 ++ .../widgets/graphicsview/dragdroprobot/coloritem.h | 65 + .../dragdroprobot/dragdroprobot.desktop | 11 + .../graphicsview/dragdroprobot/dragdroprobot.pro | 22 + .../graphicsview/dragdroprobot/images/head.png | Bin 0 -> 14972 bytes .../widgets/graphicsview/dragdroprobot/main.cpp | 94 ++ .../widgets/graphicsview/dragdroprobot/robot.cpp | 307 ++++ .../widgets/graphicsview/dragdroprobot/robot.h | 118 ++ .../widgets/graphicsview/dragdroprobot/robot.qrc | 5 + .../widgets/graphicsview/elasticnodes/edge.cpp | 149 ++ examples/widgets/graphicsview/elasticnodes/edge.h | 75 + .../graphicsview/elasticnodes/elasticnodes.desktop | 11 + .../graphicsview/elasticnodes/elasticnodes.pro | 20 + .../graphicsview/elasticnodes/graphwidget.cpp | 250 ++++ .../graphicsview/elasticnodes/graphwidget.h | 77 + .../widgets/graphicsview/elasticnodes/main.cpp | 57 + .../widgets/graphicsview/elasticnodes/node.cpp | 212 +++ examples/widgets/graphicsview/elasticnodes/node.h | 85 ++ .../embeddeddialogs/No-Ones-Laughing-3.jpg | Bin 0 -> 30730 bytes .../graphicsview/embeddeddialogs/customproxy.cpp | 167 +++ .../graphicsview/embeddeddialogs/customproxy.h | 76 + .../embeddeddialogs/embeddeddialog.cpp | 106 ++ .../graphicsview/embeddeddialogs/embeddeddialog.h | 66 + .../graphicsview/embeddeddialogs/embeddeddialog.ui | 87 ++ .../embeddeddialogs/embeddeddialogs.pro | 19 + .../embeddeddialogs/embeddeddialogs.qrc | 5 + .../widgets/graphicsview/embeddeddialogs/main.cpp | 83 ++ .../widgets/graphicsview/flowlayout/flowlayout.cpp | 213 +++ .../graphicsview/flowlayout/flowlayout.desktop | 11 + .../widgets/graphicsview/flowlayout/flowlayout.h | 76 + .../widgets/graphicsview/flowlayout/flowlayout.pro | 14 + examples/widgets/graphicsview/flowlayout/main.cpp | 57 + .../widgets/graphicsview/flowlayout/window.cpp | 62 + examples/widgets/graphicsview/flowlayout/window.h | 47 + examples/widgets/graphicsview/graphicsview.pro | 28 + .../graphicsview/padnavigator/flippablepad.cpp | 98 ++ .../graphicsview/padnavigator/flippablepad.h | 63 + examples/widgets/graphicsview/padnavigator/form.ui | 208 +++ .../padnavigator/images/artsfftscope.png | Bin 0 -> 1291 bytes .../padnavigator/images/blue_angle_swirl.jpg | Bin 0 -> 11826 bytes .../padnavigator/images/kontact_contacts.png | Bin 0 -> 4382 bytes .../padnavigator/images/kontact_journal.png | Bin 0 -> 3261 bytes .../padnavigator/images/kontact_mail.png | Bin 0 -> 3202 bytes .../padnavigator/images/kontact_notes.png | Bin 0 -> 3893 bytes .../padnavigator/images/kopeteavailable.png | Bin 0 -> 2380 bytes .../padnavigator/images/metacontact_online.png | Bin 0 -> 2545 bytes .../graphicsview/padnavigator/images/minitools.png | Bin 0 -> 2087 bytes .../widgets/graphicsview/padnavigator/main.cpp | 55 + .../graphicsview/padnavigator/padnavigator.cpp | 306 ++++ .../graphicsview/padnavigator/padnavigator.desktop | 11 + .../graphicsview/padnavigator/padnavigator.h | 70 + .../graphicsview/padnavigator/padnavigator.pro | 28 + .../graphicsview/padnavigator/padnavigator.qrc | 13 + .../graphicsview/padnavigator/roundrectitem.cpp | 113 ++ .../graphicsview/padnavigator/roundrectitem.h | 75 + .../graphicsview/padnavigator/splashitem.cpp | 83 ++ .../widgets/graphicsview/padnavigator/splashitem.h | 61 + .../portedasteroids/portedasteroids.desktop | 11 + .../graphicsview/portedcanvas/portedcanvas.desktop | 11 + .../graphicsview/simpleanchorlayout/main.cpp | 134 ++ .../simpleanchorlayout/simpleanchorlayout.desktop | 11 + .../simpleanchorlayout/simpleanchorlayout.pro | 12 + .../weatheranchorlayout/images/5days.jpg | Bin 0 -> 5748 bytes .../weatheranchorlayout/images/details.jpg | Bin 0 -> 5323 bytes .../weatheranchorlayout/images/place.jpg | Bin 0 -> 62438 bytes .../weatheranchorlayout/images/tabbar.jpg | Bin 0 -> 849 bytes .../weatheranchorlayout/images/title.jpg | Bin 0 -> 3472 bytes .../images/weather-few-clouds.png | Bin 0 -> 18976 bytes .../graphicsview/weatheranchorlayout/main.cpp | 274 ++++ .../weatheranchorlayout.desktop | 11 + .../weatheranchorlayout/weatheranchorlayout.pro | 12 + .../weatheranchorlayout/weatheranchorlayout.qrc | 10 + examples/widgets/groupbox/groupbox.desktop | 11 - examples/widgets/groupbox/groupbox.pro | 13 - examples/widgets/groupbox/main.cpp | 51 - examples/widgets/groupbox/window.cpp | 189 --- examples/widgets/groupbox/window.h | 66 - examples/widgets/icons/iconpreviewarea.cpp | 141 -- examples/widgets/icons/iconpreviewarea.h | 77 - examples/widgets/icons/icons.desktop | 11 - examples/widgets/icons/icons.pro | 29 - examples/widgets/icons/iconsizespinbox.cpp | 70 - examples/widgets/icons/iconsizespinbox.h | 59 - examples/widgets/icons/imagedelegate.cpp | 105 -- examples/widgets/icons/imagedelegate.h | 68 - examples/widgets/icons/images/designer.png | Bin 4205 -> 0 bytes examples/widgets/icons/images/find_disabled.png | Bin 501 -> 0 bytes examples/widgets/icons/images/find_normal.png | Bin 838 -> 0 bytes .../widgets/icons/images/monkey_off_128x128.png | Bin 7045 -> 0 bytes examples/widgets/icons/images/monkey_off_16x16.png | Bin 683 -> 0 bytes examples/widgets/icons/images/monkey_off_32x32.png | Bin 1609 -> 0 bytes examples/widgets/icons/images/monkey_off_64x64.png | Bin 3533 -> 0 bytes .../widgets/icons/images/monkey_on_128x128.png | Bin 6909 -> 0 bytes examples/widgets/icons/images/monkey_on_16x16.png | Bin 681 -> 0 bytes examples/widgets/icons/images/monkey_on_32x32.png | Bin 1577 -> 0 bytes examples/widgets/icons/images/monkey_on_64x64.png | Bin 3479 -> 0 bytes .../widgets/icons/images/qt_extended_16x16.png | Bin 834 -> 0 bytes .../widgets/icons/images/qt_extended_32x32.png | Bin 1892 -> 0 bytes .../widgets/icons/images/qt_extended_48x48.png | Bin 3672 -> 0 bytes examples/widgets/icons/main.cpp | 51 - examples/widgets/icons/mainwindow.cpp | 442 ------ examples/widgets/icons/mainwindow.h | 116 -- examples/widgets/imageviewer/imageviewer.cpp | 280 ---- examples/widgets/imageviewer/imageviewer.desktop | 11 - examples/widgets/imageviewer/imageviewer.h | 105 -- examples/widgets/imageviewer/imageviewer.pro | 18 - examples/widgets/imageviewer/main.cpp | 51 - examples/widgets/itemviews/README | 8 + .../widgets/itemviews/addressbook/adddialog.cpp | 82 ++ examples/widgets/itemviews/addressbook/adddialog.h | 71 + .../itemviews/addressbook/addressbook.desktop | 11 + .../widgets/itemviews/addressbook/addressbook.pro | 19 + .../itemviews/addressbook/addresswidget.cpp | 236 ++++ .../widgets/itemviews/addressbook/addresswidget.h | 82 ++ examples/widgets/itemviews/addressbook/main.cpp | 52 + .../widgets/itemviews/addressbook/mainwindow.cpp | 137 ++ .../widgets/itemviews/addressbook/mainwindow.h | 75 + .../itemviews/addressbook/newaddresstab.cpp | 77 + .../widgets/itemviews/addressbook/newaddresstab.h | 74 + .../widgets/itemviews/addressbook/tablemodel.cpp | 184 +++ .../widgets/itemviews/addressbook/tablemodel.h | 72 + .../basicsortfiltermodel.desktop | 11 + .../basicsortfiltermodel/basicsortfiltermodel.pro | 12 + .../itemviews/basicsortfiltermodel/main.cpp | 93 ++ .../itemviews/basicsortfiltermodel/window.cpp | 157 +++ .../itemviews/basicsortfiltermodel/window.h | 88 ++ examples/widgets/itemviews/chart/chart.desktop | 11 + examples/widgets/itemviews/chart/chart.pro | 18 + examples/widgets/itemviews/chart/chart.qrc | 5 + examples/widgets/itemviews/chart/main.cpp | 53 + examples/widgets/itemviews/chart/mainwindow.cpp | 172 +++ examples/widgets/itemviews/chart/mainwindow.h | 72 + examples/widgets/itemviews/chart/mydata.cht | 8 + examples/widgets/itemviews/chart/pieview.cpp | 557 ++++++++ examples/widgets/itemviews/chart/pieview.h | 114 ++ examples/widgets/itemviews/chart/qtdata.cht | 14 + .../coloreditorfactory/coloreditorfactory.desktop | 11 + .../coloreditorfactory/coloreditorfactory.pro | 14 + .../coloreditorfactory/colorlisteditor.cpp | 76 + .../itemviews/coloreditorfactory/colorlisteditor.h | 69 + .../widgets/itemviews/coloreditorfactory/main.cpp | 53 + .../itemviews/coloreditorfactory/window.cpp | 94 ++ .../widgets/itemviews/coloreditorfactory/window.h | 57 + .../combowidgetmapper/combowidgetmapper.desktop | 11 + .../combowidgetmapper/combowidgetmapper.pro | 11 + .../widgets/itemviews/combowidgetmapper/main.cpp | 51 + .../widgets/itemviews/combowidgetmapper/window.cpp | 136 ++ .../widgets/itemviews/combowidgetmapper/window.h | 86 ++ .../customsortfiltermodel.desktop | 11 + .../customsortfiltermodel.pro | 14 + .../itemviews/customsortfiltermodel/main.cpp | 95 ++ .../mysortfilterproxymodel.cpp | 115 ++ .../customsortfiltermodel/mysortfilterproxymodel.h | 73 + .../itemviews/customsortfiltermodel/window.cpp | 166 +++ .../itemviews/customsortfiltermodel/window.h | 90 ++ examples/widgets/itemviews/dirview/dirview.desktop | 11 + examples/widgets/itemviews/dirview/dirview.pro | 9 + examples/widgets/itemviews/dirview/main.cpp | 62 + .../itemviews/editabletreemodel/default.txt | 40 + .../editabletreemodel/editabletreemodel.desktop | 11 + .../editabletreemodel/editabletreemodel.pro | 18 + .../editabletreemodel/editabletreemodel.qrc | 5 + .../widgets/itemviews/editabletreemodel/main.cpp | 53 + .../itemviews/editabletreemodel/mainwindow.cpp | 181 +++ .../itemviews/editabletreemodel/mainwindow.h | 71 + .../itemviews/editabletreemodel/mainwindow.ui | 128 ++ .../itemviews/editabletreemodel/treeitem.cpp | 179 +++ .../widgets/itemviews/editabletreemodel/treeitem.h | 74 + .../itemviews/editabletreemodel/treemodel.cpp | 288 ++++ .../itemviews/editabletreemodel/treemodel.h | 97 ++ .../widgets/itemviews/fetchmore/fetchmore.desktop | 11 + examples/widgets/itemviews/fetchmore/fetchmore.pro | 13 + .../widgets/itemviews/fetchmore/filelistmodel.cpp | 116 ++ .../widgets/itemviews/fetchmore/filelistmodel.h | 75 + examples/widgets/itemviews/fetchmore/main.cpp | 50 + examples/widgets/itemviews/fetchmore/window.cpp | 81 ++ examples/widgets/itemviews/fetchmore/window.h | 64 + .../itemviews/frozencolumn/freezetablewidget.cpp | 165 +++ .../itemviews/frozencolumn/freezetablewidget.h | 72 + .../itemviews/frozencolumn/frozencolumn.desktop | 11 + .../itemviews/frozencolumn/frozencolumn.pro | 11 + examples/widgets/itemviews/frozencolumn/grades.qrc | 5 + examples/widgets/itemviews/frozencolumn/grades.txt | 36 + examples/widgets/itemviews/frozencolumn/main.cpp | 88 ++ examples/widgets/itemviews/interview/README | 2 + .../widgets/itemviews/interview/images/folder.png | Bin 0 -> 3910 bytes .../itemviews/interview/images/interview.png | Bin 0 -> 174 bytes .../itemviews/interview/images/services.png | Bin 0 -> 3749 bytes examples/widgets/itemviews/interview/interview.pro | 19 + examples/widgets/itemviews/interview/interview.qrc | 7 + examples/widgets/itemviews/interview/main.cpp | 95 ++ examples/widgets/itemviews/interview/model.cpp | 147 ++ examples/widgets/itemviews/interview/model.h | 90 ++ examples/widgets/itemviews/itemviews.pro | 25 + .../widgets/itemviews/pixelator/imagemodel.cpp | 92 ++ examples/widgets/itemviews/pixelator/imagemodel.h | 68 + examples/widgets/itemviews/pixelator/images.qrc | 5 + examples/widgets/itemviews/pixelator/images/qt.png | Bin 0 -> 656 bytes examples/widgets/itemviews/pixelator/main.cpp | 54 + .../widgets/itemviews/pixelator/mainwindow.cpp | 248 ++++ examples/widgets/itemviews/pixelator/mainwindow.h | 74 + .../widgets/itemviews/pixelator/pixelator.desktop | 11 + examples/widgets/itemviews/pixelator/pixelator.pro | 17 + .../widgets/itemviews/pixelator/pixeldelegate.cpp | 107 ++ .../widgets/itemviews/pixelator/pixeldelegate.h | 79 ++ examples/widgets/itemviews/puzzle/example.jpg | Bin 0 -> 42654 bytes examples/widgets/itemviews/puzzle/main.cpp | 54 + examples/widgets/itemviews/puzzle/mainwindow.cpp | 149 ++ examples/widgets/itemviews/puzzle/mainwindow.h | 77 + examples/widgets/itemviews/puzzle/piecesmodel.cpp | 203 +++ examples/widgets/itemviews/puzzle/piecesmodel.h | 82 ++ examples/widgets/itemviews/puzzle/puzzle.desktop | 11 + examples/widgets/itemviews/puzzle/puzzle.pro | 22 + examples/widgets/itemviews/puzzle/puzzle.qrc | 5 + examples/widgets/itemviews/puzzle/puzzlewidget.cpp | 214 +++ examples/widgets/itemviews/puzzle/puzzlewidget.h | 89 ++ .../widgets/itemviews/simpledommodel/domitem.cpp | 101 ++ .../widgets/itemviews/simpledommodel/domitem.h | 66 + .../widgets/itemviews/simpledommodel/dommodel.cpp | 189 +++ .../widgets/itemviews/simpledommodel/dommodel.h | 76 + examples/widgets/itemviews/simpledommodel/main.cpp | 52 + .../itemviews/simpledommodel/mainwindow.cpp | 84 ++ .../widgets/itemviews/simpledommodel/mainwindow.h | 70 + .../simpledommodel/simpledommodel.desktop | 11 + .../itemviews/simpledommodel/simpledommodel.pro | 16 + .../widgets/itemviews/simpletreemodel/default.txt | 40 + .../widgets/itemviews/simpletreemodel/main.cpp | 61 + .../simpletreemodel/simpletreemodel.desktop | 11 + .../itemviews/simpletreemodel/simpletreemodel.pro | 15 + .../itemviews/simpletreemodel/simpletreemodel.qrc | 5 + .../widgets/itemviews/simpletreemodel/treeitem.cpp | 116 ++ .../widgets/itemviews/simpletreemodel/treeitem.h | 70 + .../itemviews/simpletreemodel/treemodel.cpp | 218 +++ .../widgets/itemviews/simpletreemodel/treemodel.h | 76 + .../widgets/itemviews/simplewidgetmapper/main.cpp | 51 + .../simplewidgetmapper/simplewidgetmapper.desktop | 11 + .../simplewidgetmapper/simplewidgetmapper.pro | 11 + .../itemviews/simplewidgetmapper/window.cpp | 133 ++ .../widgets/itemviews/simplewidgetmapper/window.h | 84 ++ .../widgets/itemviews/spinboxdelegate/delegate.cpp | 102 ++ .../widgets/itemviews/spinboxdelegate/delegate.h | 70 + .../widgets/itemviews/spinboxdelegate/main.cpp | 86 ++ .../spinboxdelegate/spinboxdelegate.desktop | 11 + .../itemviews/spinboxdelegate/spinboxdelegate.pro | 13 + .../itemviews/spreadsheet/images/interview.png | Bin 0 -> 174 bytes examples/widgets/itemviews/spreadsheet/main.cpp | 55 + .../widgets/itemviews/spreadsheet/printview.cpp | 62 + examples/widgets/itemviews/spreadsheet/printview.h | 63 + .../widgets/itemviews/spreadsheet/spreadsheet.cpp | 639 +++++++++ .../widgets/itemviews/spreadsheet/spreadsheet.h | 124 ++ .../widgets/itemviews/spreadsheet/spreadsheet.pro | 23 + .../widgets/itemviews/spreadsheet/spreadsheet.qrc | 5 + .../itemviews/spreadsheet/spreadsheetdelegate.cpp | 114 ++ .../itemviews/spreadsheet/spreadsheetdelegate.h | 65 + .../itemviews/spreadsheet/spreadsheetitem.cpp | 167 +++ .../itemviews/spreadsheet/spreadsheetitem.h | 73 + examples/widgets/itemviews/stardelegate/main.cpp | 107 ++ .../itemviews/stardelegate/stardelegate.cpp | 129 ++ .../itemviews/stardelegate/stardelegate.desktop | 11 + .../widgets/itemviews/stardelegate/stardelegate.h | 69 + .../itemviews/stardelegate/stardelegate.pro | 17 + .../widgets/itemviews/stardelegate/stareditor.cpp | 98 ++ .../widgets/itemviews/stardelegate/stareditor.h | 77 + .../widgets/itemviews/stardelegate/starrating.cpp | 102 ++ .../widgets/itemviews/stardelegate/starrating.h | 76 + examples/widgets/layouts/README | 10 + .../layouts/basiclayouts/basiclayouts.desktop | 11 + .../widgets/layouts/basiclayouts/basiclayouts.pro | 13 + examples/widgets/layouts/basiclayouts/dialog.cpp | 149 ++ examples/widgets/layouts/basiclayouts/dialog.h | 90 ++ examples/widgets/layouts/basiclayouts/main.cpp | 52 + .../widgets/layouts/borderlayout/borderlayout.cpp | 213 +++ .../layouts/borderlayout/borderlayout.desktop | 11 + .../widgets/layouts/borderlayout/borderlayout.h | 88 ++ .../widgets/layouts/borderlayout/borderlayout.pro | 13 + examples/widgets/layouts/borderlayout/main.cpp | 51 + examples/widgets/layouts/borderlayout/window.cpp | 68 + examples/widgets/layouts/borderlayout/window.h | 61 + examples/widgets/layouts/dynamiclayouts/dialog.cpp | 169 +++ examples/widgets/layouts/dynamiclayouts/dialog.h | 91 ++ .../layouts/dynamiclayouts/dynamiclayouts.desktop | 11 + .../layouts/dynamiclayouts/dynamiclayouts.pro | 13 + examples/widgets/layouts/dynamiclayouts/main.cpp | 51 + examples/widgets/layouts/flowlayout/flowlayout.cpp | 213 +++ .../widgets/layouts/flowlayout/flowlayout.desktop | 11 + examples/widgets/layouts/flowlayout/flowlayout.h | 78 ++ examples/widgets/layouts/flowlayout/flowlayout.pro | 13 + examples/widgets/layouts/flowlayout/main.cpp | 51 + examples/widgets/layouts/flowlayout/window.cpp | 59 + examples/widgets/layouts/flowlayout/window.h | 59 + examples/widgets/layouts/layouts.pro | 12 + examples/widgets/lineedits/lineedits.desktop | 11 - examples/widgets/lineedits/lineedits.pro | 11 - examples/widgets/lineedits/main.cpp | 51 - examples/widgets/lineedits/window.cpp | 256 ---- examples/widgets/lineedits/window.h | 75 - examples/widgets/mainwindows/README | 9 + .../mainwindows/application/application.desktop | 11 + .../mainwindows/application/application.pro | 16 + .../mainwindows/application/application.qrc | 10 + .../mainwindows/application/images/copy.png | Bin 0 -> 1338 bytes .../widgets/mainwindows/application/images/cut.png | Bin 0 -> 1323 bytes .../widgets/mainwindows/application/images/new.png | Bin 0 -> 852 bytes .../mainwindows/application/images/open.png | Bin 0 -> 2073 bytes .../mainwindows/application/images/paste.png | Bin 0 -> 1645 bytes .../mainwindows/application/images/save.png | Bin 0 -> 1187 bytes examples/widgets/mainwindows/application/main.cpp | 57 + .../widgets/mainwindows/application/mainwindow.cpp | 392 ++++++ .../widgets/mainwindows/application/mainwindow.h | 105 ++ .../mainwindows/dockwidgets/dockwidgets.desktop | 11 + .../mainwindows/dockwidgets/dockwidgets.pro | 15 + .../mainwindows/dockwidgets/dockwidgets.qrc | 8 + .../widgets/mainwindows/dockwidgets/images/new.png | Bin 0 -> 977 bytes .../mainwindows/dockwidgets/images/print.png | Bin 0 -> 1732 bytes .../mainwindows/dockwidgets/images/save.png | Bin 0 -> 1894 bytes .../mainwindows/dockwidgets/images/undo.png | Bin 0 -> 1768 bytes examples/widgets/mainwindows/dockwidgets/main.cpp | 52 + .../widgets/mainwindows/dockwidgets/mainwindow.cpp | 345 +++++ .../widgets/mainwindows/dockwidgets/mainwindow.h | 97 ++ .../widgets/mainwindows/mainwindow/colorswatch.cpp | 746 ++++++++++ .../widgets/mainwindows/mainwindow/colorswatch.h | 136 ++ examples/widgets/mainwindows/mainwindow/main.cpp | 164 +++ .../widgets/mainwindows/mainwindow/mainwindow.cpp | 509 +++++++ .../widgets/mainwindows/mainwindow/mainwindow.h | 90 ++ .../widgets/mainwindows/mainwindow/mainwindow.pro | 17 + .../widgets/mainwindows/mainwindow/mainwindow.qrc | 8 + examples/widgets/mainwindows/mainwindow/qt.png | Bin 0 -> 2037 bytes .../mainwindows/mainwindow/titlebarCenter.png | Bin 0 -> 146 bytes .../mainwindows/mainwindow/titlebarLeft.png | Bin 0 -> 5148 bytes .../mainwindows/mainwindow/titlebarRight.png | Bin 0 -> 2704 bytes .../widgets/mainwindows/mainwindow/toolbar.cpp | 383 +++++ examples/widgets/mainwindows/mainwindow/toolbar.h | 118 ++ examples/widgets/mainwindows/mainwindows.pro | 16 + examples/widgets/mainwindows/mdi/images/copy.png | Bin 0 -> 1338 bytes examples/widgets/mainwindows/mdi/images/cut.png | Bin 0 -> 1323 bytes examples/widgets/mainwindows/mdi/images/new.png | Bin 0 -> 852 bytes examples/widgets/mainwindows/mdi/images/open.png | Bin 0 -> 2073 bytes examples/widgets/mainwindows/mdi/images/paste.png | Bin 0 -> 1645 bytes examples/widgets/mainwindows/mdi/images/save.png | Bin 0 -> 1187 bytes examples/widgets/mainwindows/mdi/main.cpp | 53 + examples/widgets/mainwindows/mdi/mainwindow.cpp | 411 ++++++ examples/widgets/mainwindows/mdi/mainwindow.h | 122 ++ examples/widgets/mainwindows/mdi/mdi.desktop | 11 + examples/widgets/mainwindows/mdi/mdi.pro | 16 + examples/widgets/mainwindows/mdi/mdi.qrc | 10 + examples/widgets/mainwindows/mdi/mdichild.cpp | 175 +++ examples/widgets/mainwindows/mdi/mdichild.h | 76 + examples/widgets/mainwindows/menus/main.cpp | 51 + examples/widgets/mainwindows/menus/mainwindow.cpp | 370 +++++ examples/widgets/mainwindows/menus/mainwindow.h | 124 ++ examples/widgets/mainwindows/menus/menus.desktop | 11 + examples/widgets/mainwindows/menus/menus.pro | 11 + examples/widgets/mainwindows/recentfiles/main.cpp | 53 + .../widgets/mainwindows/recentfiles/mainwindow.cpp | 251 ++++ .../widgets/mainwindows/recentfiles/mainwindow.h | 96 ++ .../mainwindows/recentfiles/recentfiles.desktop | 11 + .../mainwindows/recentfiles/recentfiles.pro | 13 + examples/widgets/mainwindows/sdi/images/copy.png | Bin 0 -> 1338 bytes examples/widgets/mainwindows/sdi/images/cut.png | Bin 0 -> 1323 bytes examples/widgets/mainwindows/sdi/images/new.png | Bin 0 -> 852 bytes examples/widgets/mainwindows/sdi/images/open.png | Bin 0 -> 2073 bytes examples/widgets/mainwindows/sdi/images/paste.png | Bin 0 -> 1645 bytes examples/widgets/mainwindows/sdi/images/save.png | Bin 0 -> 1187 bytes examples/widgets/mainwindows/sdi/main.cpp | 54 + examples/widgets/mainwindows/sdi/mainwindow.cpp | 372 +++++ examples/widgets/mainwindows/sdi/mainwindow.h | 110 ++ examples/widgets/mainwindows/sdi/sdi.desktop | 11 + examples/widgets/mainwindows/sdi/sdi.pro | 14 + examples/widgets/mainwindows/sdi/sdi.qrc | 10 + examples/widgets/mousebuttons/buttontester.cpp | 172 --- examples/widgets/mousebuttons/buttontester.h | 64 - examples/widgets/mousebuttons/main.cpp | 66 - examples/widgets/mousebuttons/mousebuttons.pro | 18 - examples/widgets/movie/animation.gif | Bin 42629 -> 0 bytes examples/widgets/movie/main.cpp | 52 - examples/widgets/movie/movie.desktop | 11 - examples/widgets/movie/movie.pro | 20 - examples/widgets/movie/movieplayer.cpp | 210 --- examples/widgets/movie/movieplayer.h | 96 -- examples/widgets/orientation/image_a.png | Bin 1075 -> 0 bytes examples/widgets/orientation/image_b.png | Bin 1020 -> 0 bytes examples/widgets/orientation/image_c.png | Bin 1163 -> 0 bytes examples/widgets/orientation/images.qrc | 7 - examples/widgets/orientation/landscape.ui | 114 -- examples/widgets/orientation/main.cpp | 55 - examples/widgets/orientation/mainwindow.cpp | 112 -- examples/widgets/orientation/mainwindow.h | 75 - examples/widgets/orientation/orientation.desktop | 11 - examples/widgets/orientation/orientation.pro | 31 - examples/widgets/orientation/portrait.ui | 61 - examples/widgets/painting/README | 11 + examples/widgets/painting/affine/affine.pro | 24 + examples/widgets/painting/affine/affine.qrc | 7 + examples/widgets/painting/affine/bg1.jpg | Bin 0 -> 23771 bytes examples/widgets/painting/affine/main.cpp | 65 + examples/widgets/painting/affine/xform.cpp | 902 ++++++++++++ examples/widgets/painting/affine/xform.h | 141 ++ examples/widgets/painting/affine/xform.html | 23 + .../painting/basicdrawing/basicdrawing.desktop | 11 + .../widgets/painting/basicdrawing/basicdrawing.pro | 14 + .../widgets/painting/basicdrawing/basicdrawing.qrc | 6 + .../widgets/painting/basicdrawing/images/brick.png | Bin 0 -> 767 bytes .../painting/basicdrawing/images/qt-logo.png | Bin 0 -> 3696 bytes examples/widgets/painting/basicdrawing/main.cpp | 53 + .../widgets/painting/basicdrawing/renderarea.cpp | 207 +++ .../widgets/painting/basicdrawing/renderarea.h | 83 ++ examples/widgets/painting/basicdrawing/window.cpp | 259 ++++ examples/widgets/painting/basicdrawing/window.h | 87 ++ .../widgets/painting/composition/composition.cpp | 522 +++++++ .../widgets/painting/composition/composition.h | 187 +++ .../widgets/painting/composition/composition.html | 23 + .../widgets/painting/composition/composition.pro | 29 + .../widgets/painting/composition/composition.qrc | 8 + examples/widgets/painting/composition/flower.jpg | Bin 0 -> 49616 bytes .../widgets/painting/composition/flower_alpha.jpg | Bin 0 -> 67326 bytes examples/widgets/painting/composition/main.cpp | 65 + .../painting/concentriccircles/circlewidget.cpp | 124 ++ .../painting/concentriccircles/circlewidget.h | 73 + .../concentriccircles/concentriccircles.desktop | 11 + .../concentriccircles/concentriccircles.pro | 14 + .../widgets/painting/concentriccircles/main.cpp | 51 + .../widgets/painting/concentriccircles/window.cpp | 93 ++ .../widgets/painting/concentriccircles/window.h | 70 + examples/widgets/painting/deform/deform.pro | 20 + examples/widgets/painting/deform/deform.qrc | 6 + examples/widgets/painting/deform/main.cpp | 72 + examples/widgets/painting/deform/pathdeform.cpp | 646 +++++++++ examples/widgets/painting/deform/pathdeform.h | 153 ++ examples/widgets/painting/deform/pathdeform.html | 24 + .../painting/fontsampler/fontsampler.desktop | 11 + .../widgets/painting/fontsampler/fontsampler.pro | 13 + examples/widgets/painting/fontsampler/main.cpp | 51 + .../widgets/painting/fontsampler/mainwindow.cpp | 380 +++++ examples/widgets/painting/fontsampler/mainwindow.h | 87 ++ .../widgets/painting/fontsampler/mainwindowbase.ui | 142 ++ examples/widgets/painting/gradients/gradients.cpp | 516 +++++++ examples/widgets/painting/gradients/gradients.h | 170 +++ examples/widgets/painting/gradients/gradients.html | 31 + examples/widgets/painting/gradients/gradients.pro | 20 + examples/widgets/painting/gradients/gradients.qrc | 6 + examples/widgets/painting/gradients/main.cpp | 63 + .../painting/imagecomposition/imagecomposer.cpp | 211 +++ .../painting/imagecomposition/imagecomposer.h | 87 ++ .../imagecomposition/imagecomposition.desktop | 11 + .../painting/imagecomposition/imagecomposition.pro | 13 + .../painting/imagecomposition/imagecomposition.qrc | 6 + .../imagecomposition/images/background.png | Bin 0 -> 18579 bytes .../imagecomposition/images/blackrectangle.png | Bin 0 -> 90 bytes .../painting/imagecomposition/images/butterfly.png | Bin 0 -> 36868 bytes .../painting/imagecomposition/images/checker.png | Bin 0 -> 10384 bytes .../widgets/painting/imagecomposition/main.cpp | 55 + examples/widgets/painting/painterpaths/main.cpp | 51 + .../painting/painterpaths/painterpaths.desktop | 11 + .../widgets/painting/painterpaths/painterpaths.pro | 15 + .../widgets/painting/painterpaths/renderarea.cpp | 130 ++ .../widgets/painting/painterpaths/renderarea.h | 80 ++ examples/widgets/painting/painterpaths/window.cpp | 289 ++++ examples/widgets/painting/painterpaths/window.h | 90 ++ examples/widgets/painting/painting.pro | 36 + examples/widgets/painting/pathstroke/main.cpp | 71 + .../widgets/painting/pathstroke/pathstroke.cpp | 685 +++++++++ examples/widgets/painting/pathstroke/pathstroke.h | 171 +++ .../widgets/painting/pathstroke/pathstroke.html | 20 + .../widgets/painting/pathstroke/pathstroke.pro | 21 + .../widgets/painting/pathstroke/pathstroke.qrc | 6 + examples/widgets/painting/shared/arthurstyle.cpp | 452 ++++++ examples/widgets/painting/shared/arthurstyle.h | 79 ++ examples/widgets/painting/shared/arthurwidgets.cpp | 355 +++++ examples/widgets/painting/shared/arthurwidgets.h | 137 ++ examples/widgets/painting/shared/hoverpoints.cpp | 415 ++++++ examples/widgets/painting/shared/hoverpoints.h | 162 +++ .../widgets/painting/shared/images/bg_pattern.png | Bin 0 -> 104 bytes .../shared/images/button_normal_cap_left.png | Bin 0 -> 654 bytes .../shared/images/button_normal_cap_right.png | Bin 0 -> 674 bytes .../shared/images/button_normal_stretch.png | Bin 0 -> 185 bytes .../shared/images/button_pressed_cap_left.png | Bin 0 -> 710 bytes .../shared/images/button_pressed_cap_right.png | Bin 0 -> 785 bytes .../shared/images/button_pressed_stretch.png | Bin 0 -> 217 bytes .../painting/shared/images/curve_thing_edit-6.png | Bin 0 -> 58097 bytes .../painting/shared/images/frame_bottom.png | Bin 0 -> 166 bytes .../painting/shared/images/frame_bottomleft.png | Bin 0 -> 602 bytes .../painting/shared/images/frame_bottomright.png | Bin 0 -> 553 bytes .../widgets/painting/shared/images/frame_left.png | Bin 0 -> 182 bytes .../widgets/painting/shared/images/frame_right.png | Bin 0 -> 175 bytes .../widgets/painting/shared/images/frame_top.png | Bin 0 -> 188 bytes .../painting/shared/images/frame_topleft.png | Bin 0 -> 801 bytes .../painting/shared/images/frame_topright.png | Bin 0 -> 851 bytes .../shared/images/groupframe_bottom_left.png | Bin 0 -> 397 bytes .../shared/images/groupframe_bottom_right.png | Bin 0 -> 383 bytes .../shared/images/groupframe_bottom_stretch.png | Bin 0 -> 141 bytes .../shared/images/groupframe_left_stretch.png | Bin 0 -> 132 bytes .../shared/images/groupframe_right_stretch.png | Bin 0 -> 113 bytes .../shared/images/groupframe_top_stretch.png | Bin 0 -> 115 bytes .../painting/shared/images/groupframe_topleft.png | Bin 0 -> 412 bytes .../painting/shared/images/groupframe_topright.png | Bin 0 -> 449 bytes .../painting/shared/images/line_dash_dot.png | Bin 0 -> 151 bytes .../painting/shared/images/line_dash_dot_dot.png | Bin 0 -> 155 bytes .../widgets/painting/shared/images/line_dashed.png | Bin 0 -> 121 bytes .../widgets/painting/shared/images/line_dotted.png | Bin 0 -> 116 bytes .../widgets/painting/shared/images/line_solid.png | Bin 0 -> 110 bytes .../painting/shared/images/radiobutton-off.png | Bin 0 -> 442 bytes .../painting/shared/images/radiobutton-on.png | Bin 0 -> 474 bytes .../painting/shared/images/radiobutton_off.png | Bin 0 -> 442 bytes .../painting/shared/images/radiobutton_on.png | Bin 0 -> 499 bytes .../widgets/painting/shared/images/slider_bar.png | Bin 0 -> 748 bytes .../painting/shared/images/slider_thumb_off.png | Bin 0 -> 823 bytes .../painting/shared/images/slider_thumb_on.png | Bin 0 -> 798 bytes .../painting/shared/images/title_cap_left.png | Bin 0 -> 179 bytes .../painting/shared/images/title_cap_right.png | Bin 0 -> 184 bytes .../painting/shared/images/title_stretch.png | Bin 0 -> 106 bytes examples/widgets/painting/shared/shared.pri | 20 + examples/widgets/painting/shared/shared.pro | 34 + examples/widgets/painting/shared/shared.qrc | 39 + .../painting/svggenerator/svggenerator.desktop | 11 + .../widgets/painting/svgviewer/svgviewer.desktop | 11 + examples/widgets/painting/transformations/main.cpp | 51 + .../painting/transformations/renderarea.cpp | 172 +++ .../widgets/painting/transformations/renderarea.h | 90 ++ .../transformations/transformations.desktop | 11 + .../painting/transformations/transformations.pro | 13 + .../widgets/painting/transformations/window.cpp | 180 +++ examples/widgets/painting/transformations/window.h | 80 ++ examples/widgets/richtext/README | 11 + .../widgets/richtext/calendar/calendar.desktop | 11 + examples/widgets/richtext/calendar/calendar.pro | 11 + examples/widgets/richtext/calendar/main.cpp | 52 + examples/widgets/richtext/calendar/mainwindow.cpp | 215 +++ examples/widgets/richtext/calendar/mainwindow.h | 73 + .../widgets/richtext/orderform/detailsdialog.cpp | 156 +++ .../widgets/richtext/orderform/detailsdialog.h | 90 ++ examples/widgets/richtext/orderform/main.cpp | 55 + examples/widgets/richtext/orderform/mainwindow.cpp | 253 ++++ examples/widgets/richtext/orderform/mainwindow.h | 76 + .../widgets/richtext/orderform/orderform.desktop | 11 + examples/widgets/richtext/orderform/orderform.pro | 14 + examples/widgets/richtext/richtext.pro | 11 + .../richtext/syntaxhighlighter/highlighter.cpp | 147 ++ .../richtext/syntaxhighlighter/highlighter.h | 84 ++ .../widgets/richtext/syntaxhighlighter/main.cpp | 52 + .../richtext/syntaxhighlighter/mainwindow.cpp | 128 ++ .../richtext/syntaxhighlighter/mainwindow.h | 75 + .../syntaxhighlighter/syntaxhighlighter.desktop | 11 + .../syntaxhighlighter/syntaxhighlighter.pro | 20 + examples/widgets/richtext/textedit/example.html | 79 ++ .../widgets/richtext/textedit/images/logo32.png | Bin 0 -> 1410 bytes .../richtext/textedit/images/mac/editcopy.png | Bin 0 -> 1468 bytes .../richtext/textedit/images/mac/editcut.png | Bin 0 -> 1512 bytes .../richtext/textedit/images/mac/editpaste.png | Bin 0 -> 1906 bytes .../richtext/textedit/images/mac/editredo.png | Bin 0 -> 1752 bytes .../richtext/textedit/images/mac/editundo.png | Bin 0 -> 1746 bytes .../richtext/textedit/images/mac/exportpdf.png | Bin 0 -> 1215 bytes .../richtext/textedit/images/mac/filenew.png | Bin 0 -> 1172 bytes .../richtext/textedit/images/mac/fileopen.png | Bin 0 -> 2168 bytes .../richtext/textedit/images/mac/fileprint.png | Bin 0 -> 2087 bytes .../richtext/textedit/images/mac/filesave.png | Bin 0 -> 1206 bytes .../richtext/textedit/images/mac/textbold.png | Bin 0 -> 1611 bytes .../richtext/textedit/images/mac/textcenter.png | Bin 0 -> 1404 bytes .../richtext/textedit/images/mac/textitalic.png | Bin 0 -> 1164 bytes .../richtext/textedit/images/mac/textjustify.png | Bin 0 -> 1257 bytes .../richtext/textedit/images/mac/textleft.png | Bin 0 -> 1235 bytes .../richtext/textedit/images/mac/textright.png | Bin 0 -> 1406 bytes .../richtext/textedit/images/mac/textunder.png | Bin 0 -> 1183 bytes .../richtext/textedit/images/mac/zoomin.png | Bin 0 -> 1696 bytes .../richtext/textedit/images/mac/zoomout.png | Bin 0 -> 1662 bytes .../richtext/textedit/images/win/editcopy.png | Bin 0 -> 1325 bytes .../richtext/textedit/images/win/editcut.png | Bin 0 -> 1896 bytes .../richtext/textedit/images/win/editpaste.png | Bin 0 -> 1482 bytes .../richtext/textedit/images/win/editredo.png | Bin 0 -> 1787 bytes .../richtext/textedit/images/win/editundo.png | Bin 0 -> 1768 bytes .../richtext/textedit/images/win/exportpdf.png | Bin 0 -> 1059 bytes .../richtext/textedit/images/win/filenew.png | Bin 0 -> 768 bytes .../richtext/textedit/images/win/fileopen.png | Bin 0 -> 1662 bytes .../richtext/textedit/images/win/fileprint.png | Bin 0 -> 1456 bytes .../richtext/textedit/images/win/filesave.png | Bin 0 -> 1205 bytes .../richtext/textedit/images/win/textbold.png | Bin 0 -> 1134 bytes .../richtext/textedit/images/win/textcenter.png | Bin 0 -> 627 bytes .../richtext/textedit/images/win/textitalic.png | Bin 0 -> 829 bytes .../richtext/textedit/images/win/textjustify.png | Bin 0 -> 695 bytes .../richtext/textedit/images/win/textleft.png | Bin 0 -> 673 bytes .../richtext/textedit/images/win/textright.png | Bin 0 -> 677 bytes .../richtext/textedit/images/win/textunder.png | Bin 0 -> 971 bytes .../richtext/textedit/images/win/zoomin.png | Bin 0 -> 1208 bytes .../richtext/textedit/images/win/zoomout.png | Bin 0 -> 1226 bytes examples/widgets/richtext/textedit/main.cpp | 54 + examples/widgets/richtext/textedit/textedit.cpp | 737 ++++++++++ examples/widgets/richtext/textedit/textedit.h | 130 ++ examples/widgets/richtext/textedit/textedit.pro | 23 + examples/widgets/richtext/textedit/textedit.qdoc | 45 + examples/widgets/richtext/textedit/textedit.qrc | 44 + examples/widgets/scribble/main.cpp | 51 - examples/widgets/scribble/mainwindow.cpp | 250 ---- examples/widgets/scribble/mainwindow.h | 92 -- examples/widgets/scribble/scribble.desktop | 11 - examples/widgets/scribble/scribble.pro | 14 - examples/widgets/scribble/scribblearea.cpp | 219 --- examples/widgets/scribble/scribblearea.h | 90 -- .../widgets/scroller/graphicsview/graphicsview.pro | 9 + examples/widgets/scroller/graphicsview/main.cpp | 291 ++++ examples/widgets/scroller/scroller.pro | 2 + examples/widgets/shapedclock/main.cpp | 51 - examples/widgets/shapedclock/shapedclock.cpp | 158 --- examples/widgets/shapedclock/shapedclock.desktop | 11 - examples/widgets/shapedclock/shapedclock.h | 66 - examples/widgets/shapedclock/shapedclock.pro | 12 - examples/widgets/sliders/main.cpp | 51 - examples/widgets/sliders/sliders.desktop | 11 - examples/widgets/sliders/sliders.pro | 15 - examples/widgets/sliders/slidersgroup.cpp | 132 -- examples/widgets/sliders/slidersgroup.h | 78 -- examples/widgets/sliders/window.cpp | 145 -- examples/widgets/sliders/window.h | 84 -- examples/widgets/softkeys/main.cpp | 50 - examples/widgets/softkeys/softkeys.cpp | 188 --- examples/widgets/softkeys/softkeys.desktop | 11 - examples/widgets/softkeys/softkeys.h | 88 -- examples/widgets/softkeys/softkeys.pro | 13 - examples/widgets/spinboxes/main.cpp | 51 - examples/widgets/spinboxes/spinboxes.desktop | 11 - examples/widgets/spinboxes/spinboxes.pro | 13 - examples/widgets/spinboxes/window.cpp | 251 ---- examples/widgets/spinboxes/window.h | 81 -- examples/widgets/statemachine/README | 6 + .../eventtransitions/eventtransitions.desktop | 11 + .../eventtransitions/eventtransitions.pro | 11 + .../widgets/statemachine/eventtransitions/main.cpp | 115 ++ .../statemachine/factorial/factorial.desktop | 11 + .../widgets/statemachine/factorial/factorial.pro | 13 + examples/widgets/statemachine/factorial/main.cpp | 175 +++ examples/widgets/statemachine/pingpong/main.cpp | 139 ++ .../widgets/statemachine/pingpong/pingpong.desktop | 11 + .../widgets/statemachine/pingpong/pingpong.pro | 13 + examples/widgets/statemachine/rogue/main.cpp | 54 + .../statemachine/rogue/movementtransition.h | 112 ++ examples/widgets/statemachine/rogue/rogue.desktop | 11 + examples/widgets/statemachine/rogue/rogue.pro | 13 + examples/widgets/statemachine/rogue/window.cpp | 251 ++++ examples/widgets/statemachine/rogue/window.h | 90 ++ examples/widgets/statemachine/statemachine.pro | 18 + .../widgets/statemachine/trafficlight/main.cpp | 184 +++ .../statemachine/trafficlight/trafficlight.desktop | 11 + .../statemachine/trafficlight/trafficlight.pro | 10 + .../widgets/statemachine/twowaybutton/main.cpp | 81 ++ .../statemachine/twowaybutton/twowaybutton.desktop | 11 + .../statemachine/twowaybutton/twowaybutton.pro | 10 + examples/widgets/styles/images/woodbackground.png | Bin 7691 -> 0 bytes examples/widgets/styles/images/woodbutton.png | Bin 7689 -> 0 bytes examples/widgets/styles/main.cpp | 53 - examples/widgets/styles/norwegianwoodstyle.cpp | 330 ----- examples/widgets/styles/norwegianwoodstyle.h | 78 -- examples/widgets/styles/styles.desktop | 11 - examples/widgets/styles/styles.pro | 18 - examples/widgets/styles/styles.qrc | 6 - examples/widgets/styles/widgetgallery.cpp | 275 ---- examples/widgets/styles/widgetgallery.h | 121 -- .../widgets/stylesheet/images/checkbox_checked.png | Bin 263 -> 0 bytes .../stylesheet/images/checkbox_checked_hover.png | Bin 266 -> 0 bytes .../stylesheet/images/checkbox_checked_pressed.png | Bin 425 -> 0 bytes .../stylesheet/images/checkbox_unchecked.png | Bin 159 -> 0 bytes .../stylesheet/images/checkbox_unchecked_hover.png | Bin 159 -> 0 bytes .../images/checkbox_unchecked_pressed.png | Bin 320 -> 0 bytes examples/widgets/stylesheet/images/down_arrow.png | Bin 175 -> 0 bytes .../stylesheet/images/down_arrow_disabled.png | Bin 174 -> 0 bytes examples/widgets/stylesheet/images/frame.png | Bin 253 -> 0 bytes examples/widgets/stylesheet/images/pagefold.png | Bin 1545 -> 0 bytes examples/widgets/stylesheet/images/pushbutton.png | Bin 533 -> 0 bytes .../widgets/stylesheet/images/pushbutton_hover.png | Bin 525 -> 0 bytes .../stylesheet/images/pushbutton_pressed.png | Bin 513 -> 0 bytes .../stylesheet/images/radiobutton_checked.png | Bin 355 -> 0 bytes .../images/radiobutton_checked_hover.png | Bin 532 -> 0 bytes .../images/radiobutton_checked_pressed.png | Bin 599 -> 0 bytes .../stylesheet/images/radiobutton_unchecked.png | Bin 240 -> 0 bytes .../images/radiobutton_unchecked_hover.png | Bin 492 -> 0 bytes .../images/radiobutton_unchecked_pressed.png | Bin 556 -> 0 bytes examples/widgets/stylesheet/images/sizegrip.png | Bin 129 -> 0 bytes examples/widgets/stylesheet/images/spindown.png | Bin 276 -> 0 bytes .../widgets/stylesheet/images/spindown_hover.png | Bin 268 -> 0 bytes .../widgets/stylesheet/images/spindown_off.png | Bin 249 -> 0 bytes .../widgets/stylesheet/images/spindown_pressed.png | Bin 264 -> 0 bytes examples/widgets/stylesheet/images/spinup.png | Bin 283 -> 0 bytes .../widgets/stylesheet/images/spinup_hover.png | Bin 277 -> 0 bytes examples/widgets/stylesheet/images/spinup_off.png | Bin 274 -> 0 bytes .../widgets/stylesheet/images/spinup_pressed.png | Bin 277 -> 0 bytes examples/widgets/stylesheet/images/up_arrow.png | Bin 197 -> 0 bytes .../stylesheet/images/up_arrow_disabled.png | Bin 172 -> 0 bytes examples/widgets/stylesheet/layouts/default.ui | 329 ----- examples/widgets/stylesheet/layouts/pagefold.ui | 349 ----- examples/widgets/stylesheet/main.cpp | 53 - examples/widgets/stylesheet/mainwindow.cpp | 74 - examples/widgets/stylesheet/mainwindow.h | 66 - examples/widgets/stylesheet/mainwindow.ui | 356 ----- examples/widgets/stylesheet/qss/coffee.qss | 112 -- examples/widgets/stylesheet/qss/default.qss | 1 - examples/widgets/stylesheet/qss/pagefold.qss | 299 ---- examples/widgets/stylesheet/stylesheet.desktop | 11 - examples/widgets/stylesheet/stylesheet.pro | 18 - examples/widgets/stylesheet/stylesheet.qrc | 39 - examples/widgets/stylesheet/stylesheeteditor.cpp | 93 -- examples/widgets/stylesheet/stylesheeteditor.h | 67 - examples/widgets/stylesheet/stylesheeteditor.ui | 171 --- examples/widgets/tablet/main.cpp | 59 - examples/widgets/tablet/mainwindow.cpp | 274 ---- examples/widgets/tablet/mainwindow.h | 113 -- examples/widgets/tablet/tablet.desktop | 11 - examples/widgets/tablet/tablet.pro | 17 - examples/widgets/tablet/tabletapplication.cpp | 56 - examples/widgets/tablet/tabletapplication.h | 66 - examples/widgets/tablet/tabletcanvas.cpp | 275 ---- examples/widgets/tablet/tabletcanvas.h | 114 -- examples/widgets/tetrix/main.cpp | 54 - examples/widgets/tetrix/tetrix.desktop | 11 - examples/widgets/tetrix/tetrix.pro | 16 - examples/widgets/tetrix/tetrixboard.cpp | 408 ------ examples/widgets/tetrix/tetrixboard.h | 116 -- examples/widgets/tetrix/tetrixpiece.cpp | 145 -- examples/widgets/tetrix/tetrixpiece.h | 75 - examples/widgets/tetrix/tetrixwindow.cpp | 115 -- examples/widgets/tetrix/tetrixwindow.h | 76 - examples/widgets/tooltips/images/circle.png | Bin 165 -> 0 bytes examples/widgets/tooltips/images/square.png | Bin 94 -> 0 bytes examples/widgets/tooltips/images/triangle.png | Bin 170 -> 0 bytes examples/widgets/tooltips/main.cpp | 54 - examples/widgets/tooltips/shapeitem.cpp | 99 -- examples/widgets/tooltips/shapeitem.h | 70 - examples/widgets/tooltips/sortingbox.cpp | 301 ---- examples/widgets/tooltips/sortingbox.h | 106 -- examples/widgets/tooltips/tooltips.desktop | 11 - examples/widgets/tooltips/tooltips.pro | 14 - examples/widgets/tooltips/tooltips.qrc | 7 - examples/widgets/validators/ledoff.png | Bin 562 -> 0 bytes examples/widgets/validators/ledon.png | Bin 486 -> 0 bytes examples/widgets/validators/ledwidget.cpp | 62 - examples/widgets/validators/ledwidget.h | 64 - examples/widgets/validators/localeselector.cpp | 312 ----- examples/widgets/validators/localeselector.h | 60 - examples/widgets/validators/main.cpp | 136 -- examples/widgets/validators/validators.desktop | 11 - examples/widgets/validators/validators.pro | 15 - examples/widgets/validators/validators.qrc | 6 - examples/widgets/validators/validators.ui | 468 ------- examples/widgets/widgets.pro | 52 +- examples/widgets/widgets/README | 13 + .../widgets/widgets/analogclock/analogclock.cpp | 145 ++ .../widgets/analogclock/analogclock.desktop | 11 + examples/widgets/widgets/analogclock/analogclock.h | 59 + .../widgets/widgets/analogclock/analogclock.pro | 12 + examples/widgets/widgets/analogclock/main.cpp | 51 + .../applicationicon/applicationicon.desktop | 11 + .../widgets/applicationicon/applicationicon.png | Bin 0 -> 4023 bytes .../widgets/applicationicon/applicationicon.pro | 17 + .../widgets/applicationicon/applicationicon.svg | 22 + examples/widgets/widgets/applicationicon/main.cpp | 50 + examples/widgets/widgets/calculator/button.cpp | 63 + examples/widgets/widgets/calculator/button.h | 58 + examples/widgets/widgets/calculator/calculator.cpp | 396 ++++++ .../widgets/widgets/calculator/calculator.desktop | 11 + examples/widgets/widgets/calculator/calculator.h | 107 ++ examples/widgets/widgets/calculator/calculator.pro | 14 + examples/widgets/widgets/calculator/main.cpp | 51 + .../widgets/widgets/calculator/releasenotes.txt | 4 + .../widgets/calendarwidget/calendarwidget.desktop | 11 + .../widgets/calendarwidget/calendarwidget.pro | 11 + examples/widgets/widgets/calendarwidget/main.cpp | 51 + examples/widgets/widgets/calendarwidget/window.cpp | 464 ++++++ examples/widgets/widgets/calendarwidget/window.h | 127 ++ .../widgets/charactermap/charactermap.desktop | 11 + .../widgets/widgets/charactermap/charactermap.pro | 15 + .../widgets/charactermap/characterwidget.cpp | 177 +++ .../widgets/widgets/charactermap/characterwidget.h | 86 ++ examples/widgets/widgets/charactermap/main.cpp | 51 + .../widgets/widgets/charactermap/mainwindow.cpp | 204 +++ examples/widgets/widgets/charactermap/mainwindow.h | 87 ++ examples/widgets/widgets/codeeditor/codeeditor.cpp | 170 +++ .../widgets/widgets/codeeditor/codeeditor.desktop | 11 + examples/widgets/widgets/codeeditor/codeeditor.h | 105 ++ examples/widgets/widgets/codeeditor/codeeditor.pro | 11 + examples/widgets/widgets/codeeditor/main.cpp | 55 + .../widgets/widgets/digitalclock/digitalclock.cpp | 72 + .../widgets/digitalclock/digitalclock.desktop | 11 + .../widgets/widgets/digitalclock/digitalclock.h | 59 + .../widgets/widgets/digitalclock/digitalclock.pro | 11 + examples/widgets/widgets/digitalclock/main.cpp | 51 + .../widgets/widgets/elidedlabel/elidedlabel.cpp | 111 ++ .../widgets/elidedlabel/elidedlabel.desktop | 11 + examples/widgets/widgets/elidedlabel/elidedlabel.h | 76 + .../widgets/widgets/elidedlabel/elidedlabel.pro | 21 + examples/widgets/widgets/elidedlabel/main.cpp | 53 + .../widgets/widgets/elidedlabel/testwidget.cpp | 161 +++ examples/widgets/widgets/elidedlabel/testwidget.h | 76 + examples/widgets/widgets/groupbox/groupbox.desktop | 11 + examples/widgets/widgets/groupbox/groupbox.pro | 13 + examples/widgets/widgets/groupbox/main.cpp | 51 + examples/widgets/widgets/groupbox/window.cpp | 189 +++ examples/widgets/widgets/groupbox/window.h | 66 + examples/widgets/widgets/icons/iconpreviewarea.cpp | 141 ++ examples/widgets/widgets/icons/iconpreviewarea.h | 77 + examples/widgets/widgets/icons/icons.desktop | 11 + examples/widgets/widgets/icons/icons.pro | 29 + examples/widgets/widgets/icons/iconsizespinbox.cpp | 70 + examples/widgets/widgets/icons/iconsizespinbox.h | 59 + examples/widgets/widgets/icons/imagedelegate.cpp | 105 ++ examples/widgets/widgets/icons/imagedelegate.h | 68 + examples/widgets/widgets/icons/images/designer.png | Bin 0 -> 4205 bytes .../widgets/widgets/icons/images/find_disabled.png | Bin 0 -> 501 bytes .../widgets/widgets/icons/images/find_normal.png | Bin 0 -> 838 bytes .../widgets/icons/images/monkey_off_128x128.png | Bin 0 -> 7045 bytes .../widgets/icons/images/monkey_off_16x16.png | Bin 0 -> 683 bytes .../widgets/icons/images/monkey_off_32x32.png | Bin 0 -> 1609 bytes .../widgets/icons/images/monkey_off_64x64.png | Bin 0 -> 3533 bytes .../widgets/icons/images/monkey_on_128x128.png | Bin 0 -> 6909 bytes .../widgets/icons/images/monkey_on_16x16.png | Bin 0 -> 681 bytes .../widgets/icons/images/monkey_on_32x32.png | Bin 0 -> 1577 bytes .../widgets/icons/images/monkey_on_64x64.png | Bin 0 -> 3479 bytes .../widgets/icons/images/qt_extended_16x16.png | Bin 0 -> 834 bytes .../widgets/icons/images/qt_extended_32x32.png | Bin 0 -> 1892 bytes .../widgets/icons/images/qt_extended_48x48.png | Bin 0 -> 3672 bytes examples/widgets/widgets/icons/main.cpp | 51 + examples/widgets/widgets/icons/mainwindow.cpp | 442 ++++++ examples/widgets/widgets/icons/mainwindow.h | 116 ++ .../widgets/widgets/imageviewer/imageviewer.cpp | 280 ++++ .../widgets/imageviewer/imageviewer.desktop | 11 + examples/widgets/widgets/imageviewer/imageviewer.h | 105 ++ .../widgets/widgets/imageviewer/imageviewer.pro | 18 + examples/widgets/widgets/imageviewer/main.cpp | 51 + .../widgets/widgets/lineedits/lineedits.desktop | 11 + examples/widgets/widgets/lineedits/lineedits.pro | 11 + examples/widgets/widgets/lineedits/main.cpp | 51 + examples/widgets/widgets/lineedits/window.cpp | 256 ++++ examples/widgets/widgets/lineedits/window.h | 75 + .../widgets/widgets/mousebuttons/buttontester.cpp | 172 +++ .../widgets/widgets/mousebuttons/buttontester.h | 64 + examples/widgets/widgets/mousebuttons/main.cpp | 66 + .../widgets/widgets/mousebuttons/mousebuttons.pro | 18 + examples/widgets/widgets/movie/animation.gif | Bin 0 -> 42629 bytes examples/widgets/widgets/movie/main.cpp | 52 + examples/widgets/widgets/movie/movie.desktop | 11 + examples/widgets/widgets/movie/movie.pro | 20 + examples/widgets/widgets/movie/movieplayer.cpp | 210 +++ examples/widgets/widgets/movie/movieplayer.h | 96 ++ examples/widgets/widgets/orientation/image_a.png | Bin 0 -> 1075 bytes examples/widgets/widgets/orientation/image_b.png | Bin 0 -> 1020 bytes examples/widgets/widgets/orientation/image_c.png | Bin 0 -> 1163 bytes examples/widgets/widgets/orientation/images.qrc | 7 + examples/widgets/widgets/orientation/landscape.ui | 114 ++ examples/widgets/widgets/orientation/main.cpp | 55 + .../widgets/widgets/orientation/mainwindow.cpp | 112 ++ examples/widgets/widgets/orientation/mainwindow.h | 75 + .../widgets/orientation/orientation.desktop | 11 + .../widgets/widgets/orientation/orientation.pro | 31 + examples/widgets/widgets/orientation/portrait.ui | 61 + examples/widgets/widgets/scribble/main.cpp | 51 + examples/widgets/widgets/scribble/mainwindow.cpp | 250 ++++ examples/widgets/widgets/scribble/mainwindow.h | 92 ++ examples/widgets/widgets/scribble/scribble.desktop | 11 + examples/widgets/widgets/scribble/scribble.pro | 14 + examples/widgets/widgets/scribble/scribblearea.cpp | 219 +++ examples/widgets/widgets/scribble/scribblearea.h | 90 ++ examples/widgets/widgets/shapedclock/main.cpp | 51 + .../widgets/widgets/shapedclock/shapedclock.cpp | 158 +++ .../widgets/shapedclock/shapedclock.desktop | 11 + examples/widgets/widgets/shapedclock/shapedclock.h | 66 + .../widgets/widgets/shapedclock/shapedclock.pro | 12 + examples/widgets/widgets/sliders/main.cpp | 51 + examples/widgets/widgets/sliders/sliders.desktop | 11 + examples/widgets/widgets/sliders/sliders.pro | 15 + examples/widgets/widgets/sliders/slidersgroup.cpp | 132 ++ examples/widgets/widgets/sliders/slidersgroup.h | 78 ++ examples/widgets/widgets/sliders/window.cpp | 145 ++ examples/widgets/widgets/sliders/window.h | 84 ++ examples/widgets/widgets/softkeys/main.cpp | 50 + examples/widgets/widgets/softkeys/softkeys.cpp | 188 +++ examples/widgets/widgets/softkeys/softkeys.desktop | 11 + examples/widgets/widgets/softkeys/softkeys.h | 88 ++ examples/widgets/widgets/softkeys/softkeys.pro | 13 + examples/widgets/widgets/spinboxes/main.cpp | 51 + .../widgets/widgets/spinboxes/spinboxes.desktop | 11 + examples/widgets/widgets/spinboxes/spinboxes.pro | 13 + examples/widgets/widgets/spinboxes/window.cpp | 251 ++++ examples/widgets/widgets/spinboxes/window.h | 81 ++ .../widgets/styles/images/woodbackground.png | Bin 0 -> 7691 bytes .../widgets/widgets/styles/images/woodbutton.png | Bin 0 -> 7689 bytes examples/widgets/widgets/styles/main.cpp | 53 + .../widgets/widgets/styles/norwegianwoodstyle.cpp | 330 +++++ .../widgets/widgets/styles/norwegianwoodstyle.h | 78 ++ examples/widgets/widgets/styles/styles.desktop | 11 + examples/widgets/widgets/styles/styles.pro | 18 + examples/widgets/widgets/styles/styles.qrc | 6 + examples/widgets/widgets/styles/widgetgallery.cpp | 275 ++++ examples/widgets/widgets/styles/widgetgallery.h | 121 ++ .../widgets/stylesheet/images/checkbox_checked.png | Bin 0 -> 263 bytes .../stylesheet/images/checkbox_checked_hover.png | Bin 0 -> 266 bytes .../stylesheet/images/checkbox_checked_pressed.png | Bin 0 -> 425 bytes .../stylesheet/images/checkbox_unchecked.png | Bin 0 -> 159 bytes .../stylesheet/images/checkbox_unchecked_hover.png | Bin 0 -> 159 bytes .../images/checkbox_unchecked_pressed.png | Bin 0 -> 320 bytes .../widgets/stylesheet/images/down_arrow.png | Bin 0 -> 175 bytes .../stylesheet/images/down_arrow_disabled.png | Bin 0 -> 174 bytes .../widgets/widgets/stylesheet/images/frame.png | Bin 0 -> 253 bytes .../widgets/widgets/stylesheet/images/pagefold.png | Bin 0 -> 1545 bytes .../widgets/stylesheet/images/pushbutton.png | Bin 0 -> 533 bytes .../widgets/stylesheet/images/pushbutton_hover.png | Bin 0 -> 525 bytes .../stylesheet/images/pushbutton_pressed.png | Bin 0 -> 513 bytes .../stylesheet/images/radiobutton_checked.png | Bin 0 -> 355 bytes .../images/radiobutton_checked_hover.png | Bin 0 -> 532 bytes .../images/radiobutton_checked_pressed.png | Bin 0 -> 599 bytes .../stylesheet/images/radiobutton_unchecked.png | Bin 0 -> 240 bytes .../images/radiobutton_unchecked_hover.png | Bin 0 -> 492 bytes .../images/radiobutton_unchecked_pressed.png | Bin 0 -> 556 bytes .../widgets/widgets/stylesheet/images/sizegrip.png | Bin 0 -> 129 bytes .../widgets/widgets/stylesheet/images/spindown.png | Bin 0 -> 276 bytes .../widgets/stylesheet/images/spindown_hover.png | Bin 0 -> 268 bytes .../widgets/stylesheet/images/spindown_off.png | Bin 0 -> 249 bytes .../widgets/stylesheet/images/spindown_pressed.png | Bin 0 -> 264 bytes .../widgets/widgets/stylesheet/images/spinup.png | Bin 0 -> 283 bytes .../widgets/stylesheet/images/spinup_hover.png | Bin 0 -> 277 bytes .../widgets/stylesheet/images/spinup_off.png | Bin 0 -> 274 bytes .../widgets/stylesheet/images/spinup_pressed.png | Bin 0 -> 277 bytes .../widgets/widgets/stylesheet/images/up_arrow.png | Bin 0 -> 197 bytes .../stylesheet/images/up_arrow_disabled.png | Bin 0 -> 172 bytes .../widgets/widgets/stylesheet/layouts/default.ui | 329 +++++ .../widgets/widgets/stylesheet/layouts/pagefold.ui | 349 +++++ examples/widgets/widgets/stylesheet/main.cpp | 53 + examples/widgets/widgets/stylesheet/mainwindow.cpp | 74 + examples/widgets/widgets/stylesheet/mainwindow.h | 66 + examples/widgets/widgets/stylesheet/mainwindow.ui | 356 +++++ examples/widgets/widgets/stylesheet/qss/coffee.qss | 112 ++ .../widgets/widgets/stylesheet/qss/default.qss | 1 + .../widgets/widgets/stylesheet/qss/pagefold.qss | 299 ++++ .../widgets/widgets/stylesheet/stylesheet.desktop | 11 + examples/widgets/widgets/stylesheet/stylesheet.pro | 18 + examples/widgets/widgets/stylesheet/stylesheet.qrc | 39 + .../widgets/stylesheet/stylesheeteditor.cpp | 93 ++ .../widgets/widgets/stylesheet/stylesheeteditor.h | 67 + .../widgets/widgets/stylesheet/stylesheeteditor.ui | 171 +++ examples/widgets/widgets/tablet/main.cpp | 59 + examples/widgets/widgets/tablet/mainwindow.cpp | 274 ++++ examples/widgets/widgets/tablet/mainwindow.h | 113 ++ examples/widgets/widgets/tablet/tablet.desktop | 11 + examples/widgets/widgets/tablet/tablet.pro | 17 + .../widgets/widgets/tablet/tabletapplication.cpp | 56 + .../widgets/widgets/tablet/tabletapplication.h | 66 + examples/widgets/widgets/tablet/tabletcanvas.cpp | 275 ++++ examples/widgets/widgets/tablet/tabletcanvas.h | 114 ++ examples/widgets/widgets/tetrix/main.cpp | 54 + examples/widgets/widgets/tetrix/tetrix.desktop | 11 + examples/widgets/widgets/tetrix/tetrix.pro | 16 + examples/widgets/widgets/tetrix/tetrixboard.cpp | 408 ++++++ examples/widgets/widgets/tetrix/tetrixboard.h | 116 ++ examples/widgets/widgets/tetrix/tetrixpiece.cpp | 145 ++ examples/widgets/widgets/tetrix/tetrixpiece.h | 75 + examples/widgets/widgets/tetrix/tetrixwindow.cpp | 115 ++ examples/widgets/widgets/tetrix/tetrixwindow.h | 76 + .../widgets/widgets/tooltips/images/circle.png | Bin 0 -> 165 bytes .../widgets/widgets/tooltips/images/square.png | Bin 0 -> 94 bytes .../widgets/widgets/tooltips/images/triangle.png | Bin 0 -> 170 bytes examples/widgets/widgets/tooltips/main.cpp | 54 + examples/widgets/widgets/tooltips/shapeitem.cpp | 99 ++ examples/widgets/widgets/tooltips/shapeitem.h | 70 + examples/widgets/widgets/tooltips/sortingbox.cpp | 301 ++++ examples/widgets/widgets/tooltips/sortingbox.h | 106 ++ examples/widgets/widgets/tooltips/tooltips.desktop | 11 + examples/widgets/widgets/tooltips/tooltips.pro | 14 + examples/widgets/widgets/tooltips/tooltips.qrc | 7 + examples/widgets/widgets/validators/ledoff.png | Bin 0 -> 562 bytes examples/widgets/widgets/validators/ledon.png | Bin 0 -> 486 bytes examples/widgets/widgets/validators/ledwidget.cpp | 62 + examples/widgets/widgets/validators/ledwidget.h | 64 + .../widgets/widgets/validators/localeselector.cpp | 312 +++++ .../widgets/widgets/validators/localeselector.h | 60 + examples/widgets/widgets/validators/main.cpp | 136 ++ .../widgets/widgets/validators/validators.desktop | 11 + examples/widgets/widgets/validators/validators.pro | 15 + examples/widgets/widgets/validators/validators.qrc | 6 + examples/widgets/widgets/validators/validators.ui | 468 +++++++ examples/widgets/widgets/widgets.pro | 34 + examples/widgets/widgets/wiggly/dialog.cpp | 81 ++ examples/widgets/widgets/wiggly/dialog.h | 56 + examples/widgets/widgets/wiggly/main.cpp | 58 + examples/widgets/widgets/wiggly/wiggly.desktop | 11 + examples/widgets/widgets/wiggly/wiggly.pro | 13 + examples/widgets/widgets/wiggly/wigglywidget.cpp | 100 ++ examples/widgets/widgets/wiggly/wigglywidget.h | 69 + .../widgets/windowflags/controllerwindow.cpp | 220 +++ .../widgets/widgets/windowflags/controllerwindow.h | 104 ++ examples/widgets/widgets/windowflags/main.cpp | 51 + .../widgets/widgets/windowflags/previewwindow.cpp | 118 ++ .../widgets/widgets/windowflags/previewwindow.h | 67 + .../widgets/windowflags/windowflags.desktop | 11 + .../widgets/widgets/windowflags/windowflags.pro | 15 + examples/widgets/wiggly/dialog.cpp | 81 -- examples/widgets/wiggly/dialog.h | 56 - examples/widgets/wiggly/main.cpp | 58 - examples/widgets/wiggly/wiggly.desktop | 11 - examples/widgets/wiggly/wiggly.pro | 13 - examples/widgets/wiggly/wigglywidget.cpp | 100 -- examples/widgets/wiggly/wigglywidget.h | 69 - examples/widgets/windowflags/controllerwindow.cpp | 220 --- examples/widgets/windowflags/controllerwindow.h | 104 -- examples/widgets/windowflags/main.cpp | 51 - examples/widgets/windowflags/previewwindow.cpp | 118 -- examples/widgets/windowflags/previewwindow.h | 67 - examples/widgets/windowflags/windowflags.desktop | 11 - examples/widgets/windowflags/windowflags.pro | 15 - 1546 files changed, 100539 insertions(+), 17028 deletions(-) delete mode 100644 examples/widgets/README delete mode 100644 examples/widgets/analogclock/analogclock.cpp delete mode 100644 examples/widgets/analogclock/analogclock.desktop delete mode 100644 examples/widgets/analogclock/analogclock.h delete mode 100644 examples/widgets/analogclock/analogclock.pro delete mode 100644 examples/widgets/analogclock/main.cpp create mode 100644 examples/widgets/animation/README create mode 100644 examples/widgets/animation/animatedtiles/animatedtiles.desktop create mode 100644 examples/widgets/animation/animatedtiles/animatedtiles.pro create mode 100644 examples/widgets/animation/animatedtiles/animatedtiles.qrc create mode 100644 examples/widgets/animation/animatedtiles/images/Time-For-Lunch-2.jpg create mode 100644 examples/widgets/animation/animatedtiles/images/centered.png create mode 100644 examples/widgets/animation/animatedtiles/images/ellipse.png create mode 100644 examples/widgets/animation/animatedtiles/images/figure8.png create mode 100644 examples/widgets/animation/animatedtiles/images/kinetic.png create mode 100644 examples/widgets/animation/animatedtiles/images/random.png create mode 100644 examples/widgets/animation/animatedtiles/images/tile.png create mode 100644 examples/widgets/animation/animatedtiles/main.cpp create mode 100644 examples/widgets/animation/animation.pro create mode 100644 examples/widgets/animation/appchooser/accessories-dictionary.png create mode 100644 examples/widgets/animation/appchooser/akregator.png create mode 100644 examples/widgets/animation/appchooser/appchooser.desktop create mode 100644 examples/widgets/animation/appchooser/appchooser.pro create mode 100644 examples/widgets/animation/appchooser/appchooser.qrc create mode 100644 examples/widgets/animation/appchooser/digikam.png create mode 100644 examples/widgets/animation/appchooser/k3b.png create mode 100644 examples/widgets/animation/appchooser/main.cpp create mode 100644 examples/widgets/animation/easing/animation.h create mode 100644 examples/widgets/animation/easing/easing.desktop create mode 100644 examples/widgets/animation/easing/easing.pro create mode 100644 examples/widgets/animation/easing/easing.qrc create mode 100644 examples/widgets/animation/easing/form.ui create mode 100644 examples/widgets/animation/easing/images/qt-logo.png create mode 100644 examples/widgets/animation/easing/main.cpp create mode 100644 examples/widgets/animation/easing/window.cpp create mode 100644 examples/widgets/animation/easing/window.h create mode 100644 examples/widgets/animation/moveblocks/main.cpp create mode 100644 examples/widgets/animation/moveblocks/moveblocks.desktop create mode 100644 examples/widgets/animation/moveblocks/moveblocks.pro create mode 100644 examples/widgets/animation/states/accessories-dictionary.png create mode 100644 examples/widgets/animation/states/akregator.png create mode 100644 examples/widgets/animation/states/digikam.png create mode 100644 examples/widgets/animation/states/help-browser.png create mode 100644 examples/widgets/animation/states/k3b.png create mode 100644 examples/widgets/animation/states/kchart.png create mode 100644 examples/widgets/animation/states/main.cpp create mode 100644 examples/widgets/animation/states/states.desktop create mode 100644 examples/widgets/animation/states/states.pro create mode 100644 examples/widgets/animation/states/states.qrc create mode 100644 examples/widgets/animation/stickman/animation.cpp create mode 100644 examples/widgets/animation/stickman/animation.h create mode 100644 examples/widgets/animation/stickman/animations/chilling.bin create mode 100644 examples/widgets/animation/stickman/animations/dancing.bin create mode 100644 examples/widgets/animation/stickman/animations/dead.bin create mode 100644 examples/widgets/animation/stickman/animations/jumping.bin create mode 100644 examples/widgets/animation/stickman/graphicsview.cpp create mode 100644 examples/widgets/animation/stickman/graphicsview.h create mode 100644 examples/widgets/animation/stickman/lifecycle.cpp create mode 100644 examples/widgets/animation/stickman/lifecycle.h create mode 100644 examples/widgets/animation/stickman/main.cpp create mode 100644 examples/widgets/animation/stickman/node.cpp create mode 100644 examples/widgets/animation/stickman/node.h create mode 100644 examples/widgets/animation/stickman/rectbutton.cpp create mode 100644 examples/widgets/animation/stickman/rectbutton.h create mode 100644 examples/widgets/animation/stickman/stickman.cpp create mode 100644 examples/widgets/animation/stickman/stickman.desktop create mode 100644 examples/widgets/animation/stickman/stickman.h create mode 100644 examples/widgets/animation/stickman/stickman.pro create mode 100644 examples/widgets/animation/stickman/stickman.qrc create mode 100644 examples/widgets/animation/sub-attaq/animationmanager.cpp create mode 100644 examples/widgets/animation/sub-attaq/animationmanager.h create mode 100644 examples/widgets/animation/sub-attaq/boat.cpp create mode 100644 examples/widgets/animation/sub-attaq/boat.h create mode 100644 examples/widgets/animation/sub-attaq/boat_p.h create mode 100644 examples/widgets/animation/sub-attaq/bomb.cpp create mode 100644 examples/widgets/animation/sub-attaq/bomb.h create mode 100644 examples/widgets/animation/sub-attaq/data.xml create mode 100644 examples/widgets/animation/sub-attaq/graphicsscene.cpp create mode 100644 examples/widgets/animation/sub-attaq/graphicsscene.h create mode 100644 examples/widgets/animation/sub-attaq/main.cpp create mode 100644 examples/widgets/animation/sub-attaq/mainwindow.cpp create mode 100644 examples/widgets/animation/sub-attaq/mainwindow.h create mode 100644 examples/widgets/animation/sub-attaq/pics/big/background.png create mode 100644 examples/widgets/animation/sub-attaq/pics/big/boat.png create mode 100644 examples/widgets/animation/sub-attaq/pics/big/bomb.png create mode 100644 examples/widgets/animation/sub-attaq/pics/big/explosion/boat/step1.png create mode 100644 examples/widgets/animation/sub-attaq/pics/big/explosion/boat/step2.png create mode 100644 examples/widgets/animation/sub-attaq/pics/big/explosion/boat/step3.png create mode 100644 examples/widgets/animation/sub-attaq/pics/big/explosion/boat/step4.png create mode 100644 examples/widgets/animation/sub-attaq/pics/big/explosion/submarine/step1.png create mode 100644 examples/widgets/animation/sub-attaq/pics/big/explosion/submarine/step2.png create mode 100644 examples/widgets/animation/sub-attaq/pics/big/explosion/submarine/step3.png create mode 100644 examples/widgets/animation/sub-attaq/pics/big/explosion/submarine/step4.png create mode 100644 examples/widgets/animation/sub-attaq/pics/big/submarine.png create mode 100644 examples/widgets/animation/sub-attaq/pics/big/surface.png create mode 100644 examples/widgets/animation/sub-attaq/pics/big/torpedo.png create mode 100644 examples/widgets/animation/sub-attaq/pics/scalable/background-n810.svg create mode 100644 examples/widgets/animation/sub-attaq/pics/scalable/background.svg create mode 100644 examples/widgets/animation/sub-attaq/pics/scalable/boat.svg create mode 100644 examples/widgets/animation/sub-attaq/pics/scalable/bomb.svg create mode 100644 examples/widgets/animation/sub-attaq/pics/scalable/sand.svg create mode 100644 examples/widgets/animation/sub-attaq/pics/scalable/see.svg create mode 100644 examples/widgets/animation/sub-attaq/pics/scalable/sky.svg create mode 100644 examples/widgets/animation/sub-attaq/pics/scalable/sub-attaq.svg create mode 100644 examples/widgets/animation/sub-attaq/pics/scalable/submarine.svg create mode 100644 examples/widgets/animation/sub-attaq/pics/scalable/surface.svg create mode 100644 examples/widgets/animation/sub-attaq/pics/scalable/torpedo.svg create mode 100644 examples/widgets/animation/sub-attaq/pics/small/background.png create mode 100644 examples/widgets/animation/sub-attaq/pics/small/boat.png create mode 100644 examples/widgets/animation/sub-attaq/pics/small/bomb.png create mode 100644 examples/widgets/animation/sub-attaq/pics/small/submarine.png create mode 100644 examples/widgets/animation/sub-attaq/pics/small/surface.png create mode 100644 examples/widgets/animation/sub-attaq/pics/small/torpedo.png create mode 100644 examples/widgets/animation/sub-attaq/pics/welcome/logo-a.png create mode 100644 examples/widgets/animation/sub-attaq/pics/welcome/logo-a2.png create mode 100644 examples/widgets/animation/sub-attaq/pics/welcome/logo-b.png create mode 100644 examples/widgets/animation/sub-attaq/pics/welcome/logo-dash.png create mode 100644 examples/widgets/animation/sub-attaq/pics/welcome/logo-excl.png create mode 100644 examples/widgets/animation/sub-attaq/pics/welcome/logo-q.png create mode 100644 examples/widgets/animation/sub-attaq/pics/welcome/logo-s.png create mode 100644 examples/widgets/animation/sub-attaq/pics/welcome/logo-t.png create mode 100644 examples/widgets/animation/sub-attaq/pics/welcome/logo-t2.png create mode 100644 examples/widgets/animation/sub-attaq/pics/welcome/logo-u.png create mode 100644 examples/widgets/animation/sub-attaq/pixmapitem.cpp create mode 100644 examples/widgets/animation/sub-attaq/pixmapitem.h create mode 100644 examples/widgets/animation/sub-attaq/progressitem.cpp create mode 100644 examples/widgets/animation/sub-attaq/progressitem.h create mode 100644 examples/widgets/animation/sub-attaq/qanimationstate.cpp create mode 100644 examples/widgets/animation/sub-attaq/qanimationstate.h create mode 100644 examples/widgets/animation/sub-attaq/states.cpp create mode 100644 examples/widgets/animation/sub-attaq/states.h create mode 100644 examples/widgets/animation/sub-attaq/sub-attaq.pro create mode 100644 examples/widgets/animation/sub-attaq/subattaq.qrc create mode 100644 examples/widgets/animation/sub-attaq/submarine.cpp create mode 100644 examples/widgets/animation/sub-attaq/submarine.h create mode 100644 examples/widgets/animation/sub-attaq/submarine_p.h create mode 100644 examples/widgets/animation/sub-attaq/textinformationitem.cpp create mode 100644 examples/widgets/animation/sub-attaq/textinformationitem.h create mode 100644 examples/widgets/animation/sub-attaq/torpedo.cpp create mode 100644 examples/widgets/animation/sub-attaq/torpedo.h delete mode 100644 examples/widgets/applicationicon/applicationicon.desktop delete mode 100644 examples/widgets/applicationicon/applicationicon.png delete mode 100644 examples/widgets/applicationicon/applicationicon.pro delete mode 100644 examples/widgets/applicationicon/applicationicon.svg delete mode 100644 examples/widgets/applicationicon/main.cpp delete mode 100644 examples/widgets/calculator/button.cpp delete mode 100644 examples/widgets/calculator/button.h delete mode 100644 examples/widgets/calculator/calculator.cpp delete mode 100644 examples/widgets/calculator/calculator.desktop delete mode 100644 examples/widgets/calculator/calculator.h delete mode 100644 examples/widgets/calculator/calculator.pro delete mode 100644 examples/widgets/calculator/main.cpp delete mode 100644 examples/widgets/calculator/releasenotes.txt delete mode 100644 examples/widgets/calendarwidget/calendarwidget.desktop delete mode 100644 examples/widgets/calendarwidget/calendarwidget.pro delete mode 100644 examples/widgets/calendarwidget/main.cpp delete mode 100644 examples/widgets/calendarwidget/window.cpp delete mode 100644 examples/widgets/calendarwidget/window.h delete mode 100644 examples/widgets/charactermap/charactermap.desktop delete mode 100644 examples/widgets/charactermap/charactermap.pro delete mode 100644 examples/widgets/charactermap/characterwidget.cpp delete mode 100644 examples/widgets/charactermap/characterwidget.h delete mode 100644 examples/widgets/charactermap/main.cpp delete mode 100644 examples/widgets/charactermap/mainwindow.cpp delete mode 100644 examples/widgets/charactermap/mainwindow.h delete mode 100644 examples/widgets/codeeditor/codeeditor.cpp delete mode 100644 examples/widgets/codeeditor/codeeditor.desktop delete mode 100644 examples/widgets/codeeditor/codeeditor.h delete mode 100644 examples/widgets/codeeditor/codeeditor.pro delete mode 100644 examples/widgets/codeeditor/main.cpp create mode 100644 examples/widgets/desktop/README create mode 100644 examples/widgets/desktop/desktop.pro create mode 100644 examples/widgets/desktop/screenshot/main.cpp create mode 100644 examples/widgets/desktop/screenshot/screenshot.cpp create mode 100644 examples/widgets/desktop/screenshot/screenshot.desktop create mode 100644 examples/widgets/desktop/screenshot/screenshot.h create mode 100644 examples/widgets/desktop/screenshot/screenshot.pro create mode 100644 examples/widgets/desktop/systray/images/bad.png create mode 100644 examples/widgets/desktop/systray/images/heart.png create mode 100644 examples/widgets/desktop/systray/images/trash.png create mode 100644 examples/widgets/desktop/systray/main.cpp create mode 100644 examples/widgets/desktop/systray/systray.desktop create mode 100644 examples/widgets/desktop/systray/systray.pro create mode 100644 examples/widgets/desktop/systray/systray.qrc create mode 100644 examples/widgets/desktop/systray/window.cpp create mode 100644 examples/widgets/desktop/systray/window.h create mode 100644 examples/widgets/dialogs/README create mode 100644 examples/widgets/dialogs/classwizard/classwizard.cpp create mode 100644 examples/widgets/dialogs/classwizard/classwizard.desktop create mode 100644 examples/widgets/dialogs/classwizard/classwizard.h create mode 100644 examples/widgets/dialogs/classwizard/classwizard.pro create mode 100644 examples/widgets/dialogs/classwizard/classwizard.qrc create mode 100644 examples/widgets/dialogs/classwizard/images/background.png create mode 100644 examples/widgets/dialogs/classwizard/images/banner.png create mode 100644 examples/widgets/dialogs/classwizard/images/logo1.png create mode 100644 examples/widgets/dialogs/classwizard/images/logo2.png create mode 100644 examples/widgets/dialogs/classwizard/images/logo3.png create mode 100644 examples/widgets/dialogs/classwizard/images/watermark1.png create mode 100644 examples/widgets/dialogs/classwizard/images/watermark2.png create mode 100644 examples/widgets/dialogs/classwizard/main.cpp create mode 100644 examples/widgets/dialogs/configdialog/configdialog.cpp create mode 100644 examples/widgets/dialogs/configdialog/configdialog.desktop create mode 100644 examples/widgets/dialogs/configdialog/configdialog.h create mode 100644 examples/widgets/dialogs/configdialog/configdialog.pro create mode 100644 examples/widgets/dialogs/configdialog/configdialog.qrc create mode 100644 examples/widgets/dialogs/configdialog/images/config.png create mode 100644 examples/widgets/dialogs/configdialog/images/query.png create mode 100644 examples/widgets/dialogs/configdialog/images/update.png create mode 100644 examples/widgets/dialogs/configdialog/main.cpp create mode 100644 examples/widgets/dialogs/configdialog/pages.cpp create mode 100644 examples/widgets/dialogs/configdialog/pages.h create mode 100644 examples/widgets/dialogs/dialogs.pro create mode 100644 examples/widgets/dialogs/extension/extension.desktop create mode 100644 examples/widgets/dialogs/extension/extension.pro create mode 100644 examples/widgets/dialogs/extension/finddialog.cpp create mode 100644 examples/widgets/dialogs/extension/finddialog.h create mode 100644 examples/widgets/dialogs/extension/main.cpp create mode 100644 examples/widgets/dialogs/findfiles/findfiles.desktop create mode 100644 examples/widgets/dialogs/findfiles/findfiles.pro create mode 100644 examples/widgets/dialogs/findfiles/main.cpp create mode 100644 examples/widgets/dialogs/findfiles/window.cpp create mode 100644 examples/widgets/dialogs/findfiles/window.h create mode 100644 examples/widgets/dialogs/licensewizard/images/logo.png create mode 100644 examples/widgets/dialogs/licensewizard/images/watermark.png create mode 100644 examples/widgets/dialogs/licensewizard/licensewizard.cpp create mode 100644 examples/widgets/dialogs/licensewizard/licensewizard.desktop create mode 100644 examples/widgets/dialogs/licensewizard/licensewizard.h create mode 100644 examples/widgets/dialogs/licensewizard/licensewizard.pro create mode 100644 examples/widgets/dialogs/licensewizard/licensewizard.qrc create mode 100644 examples/widgets/dialogs/licensewizard/main.cpp create mode 100644 examples/widgets/dialogs/sipdialog/dialog.cpp create mode 100644 examples/widgets/dialogs/sipdialog/dialog.h create mode 100644 examples/widgets/dialogs/sipdialog/main.cpp create mode 100644 examples/widgets/dialogs/sipdialog/sipdialog.desktop create mode 100644 examples/widgets/dialogs/sipdialog/sipdialog.pro create mode 100644 examples/widgets/dialogs/standarddialogs/dialog.cpp create mode 100644 examples/widgets/dialogs/standarddialogs/dialog.h create mode 100644 examples/widgets/dialogs/standarddialogs/main.cpp create mode 100644 examples/widgets/dialogs/standarddialogs/standarddialogs.desktop create mode 100644 examples/widgets/dialogs/standarddialogs/standarddialogs.pro create mode 100644 examples/widgets/dialogs/tabdialog/main.cpp create mode 100644 examples/widgets/dialogs/tabdialog/tabdialog.cpp create mode 100644 examples/widgets/dialogs/tabdialog/tabdialog.desktop create mode 100644 examples/widgets/dialogs/tabdialog/tabdialog.h create mode 100644 examples/widgets/dialogs/tabdialog/tabdialog.pro create mode 100644 examples/widgets/dialogs/trivialwizard/trivialwizard.cpp create mode 100644 examples/widgets/dialogs/trivialwizard/trivialwizard.desktop create mode 100644 examples/widgets/dialogs/trivialwizard/trivialwizard.pro delete mode 100644 examples/widgets/digitalclock/digitalclock.cpp delete mode 100644 examples/widgets/digitalclock/digitalclock.desktop delete mode 100644 examples/widgets/digitalclock/digitalclock.h delete mode 100644 examples/widgets/digitalclock/digitalclock.pro delete mode 100644 examples/widgets/digitalclock/main.cpp create mode 100644 examples/widgets/doc/addressbook.qdoc create mode 100644 examples/widgets/doc/affine.qdoc create mode 100644 examples/widgets/doc/analogclock.qdoc create mode 100644 examples/widgets/doc/animatedtiles.qdoc create mode 100644 examples/widgets/doc/appchooser.qdoc create mode 100644 examples/widgets/doc/application.qdoc create mode 100644 examples/widgets/doc/basicdrawing.qdoc create mode 100644 examples/widgets/doc/basicgraphicslayouts.qdoc create mode 100644 examples/widgets/doc/basiclayouts.qdoc create mode 100644 examples/widgets/doc/basicsortfiltermodel.qdoc create mode 100644 examples/widgets/doc/blurpicker.qdoc create mode 100644 examples/widgets/doc/borderlayout.qdoc create mode 100644 examples/widgets/doc/boxes.qdoc create mode 100644 examples/widgets/doc/calculator.qdoc create mode 100644 examples/widgets/doc/calendar.qdoc create mode 100644 examples/widgets/doc/calendarwidget.qdoc create mode 100644 examples/widgets/doc/charactermap.qdoc create mode 100644 examples/widgets/doc/chart.qdoc create mode 100644 examples/widgets/doc/chip.qdoc create mode 100644 examples/widgets/doc/classwizard.qdoc create mode 100644 examples/widgets/doc/codeeditor.qdoc create mode 100644 examples/widgets/doc/coloreditorfactory.qdoc create mode 100644 examples/widgets/doc/combowidgetmapper.qdoc create mode 100644 examples/widgets/doc/composition.qdoc create mode 100644 examples/widgets/doc/concentriccircles.qdoc create mode 100644 examples/widgets/doc/configdialog.qdoc create mode 100644 examples/widgets/doc/customsortfiltermodel.qdoc create mode 100644 examples/widgets/doc/deform.qdoc create mode 100644 examples/widgets/doc/diagramscene.qdoc create mode 100644 examples/widgets/doc/digitalclock.qdoc create mode 100644 examples/widgets/doc/dirview.qdoc create mode 100644 examples/widgets/doc/dockwidgets.qdoc create mode 100644 examples/widgets/doc/dragdroprobot.qdoc create mode 100644 examples/widgets/doc/dynamiclayouts.qdoc create mode 100644 examples/widgets/doc/easing.qdoc create mode 100644 examples/widgets/doc/editabletreemodel.qdoc create mode 100644 examples/widgets/doc/elasticnodes.qdoc create mode 100644 examples/widgets/doc/elidedlabel.qdoc create mode 100644 examples/widgets/doc/embeddeddialogs.qdoc create mode 100644 examples/widgets/doc/eventtransitions.qdoc create mode 100644 examples/widgets/doc/extension.qdoc create mode 100644 examples/widgets/doc/factorial.qdoc create mode 100644 examples/widgets/doc/fademessage.qdoc create mode 100644 examples/widgets/doc/fetchmore.qdoc create mode 100644 examples/widgets/doc/findfiles.qdoc create mode 100644 examples/widgets/doc/flowlayout.qdoc create mode 100644 examples/widgets/doc/fontsampler.qdoc create mode 100644 examples/widgets/doc/frozencolumn.qdoc create mode 100644 examples/widgets/doc/gradients.qdoc create mode 100644 examples/widgets/doc/groupbox.qdoc create mode 100644 examples/widgets/doc/icons.qdoc create mode 100644 examples/widgets/doc/imagecomposition.qdoc create mode 100644 examples/widgets/doc/imageviewer.qdoc create mode 100644 examples/widgets/doc/interview.qdoc create mode 100644 examples/widgets/doc/licensewizard.qdoc create mode 100644 examples/widgets/doc/lighting.qdoc create mode 100644 examples/widgets/doc/lineedits.qdoc create mode 100644 examples/widgets/doc/mainwindow.qdoc create mode 100644 examples/widgets/doc/mdi.qdoc create mode 100644 examples/widgets/doc/menus.qdoc create mode 100644 examples/widgets/doc/moveblocks.qdoc create mode 100644 examples/widgets/doc/movie.qdoc create mode 100644 examples/widgets/doc/orderform.qdoc create mode 100644 examples/widgets/doc/padnavigator.qdoc create mode 100644 examples/widgets/doc/painterpaths.qdoc create mode 100644 examples/widgets/doc/pathstroke.qdoc create mode 100644 examples/widgets/doc/pingpong.qdoc create mode 100644 examples/widgets/doc/pixelator.qdoc create mode 100644 examples/widgets/doc/recentfiles.qdoc create mode 100644 examples/widgets/doc/rogue.qdoc create mode 100644 examples/widgets/doc/screenshot.qdoc create mode 100644 examples/widgets/doc/scribble.qdoc create mode 100644 examples/widgets/doc/sdi.qdoc create mode 100644 examples/widgets/doc/shapedclock.qdoc create mode 100644 examples/widgets/doc/simpledommodel.qdoc create mode 100644 examples/widgets/doc/simpletreemodel.qdoc create mode 100644 examples/widgets/doc/simplewidgetmapper.qdoc create mode 100644 examples/widgets/doc/sipdialog.qdoc create mode 100644 examples/widgets/doc/sliders.qdoc create mode 100644 examples/widgets/doc/spinboxdelegate.qdoc create mode 100644 examples/widgets/doc/spinboxes.qdoc create mode 100644 examples/widgets/doc/spreadsheet.qdoc create mode 100644 examples/widgets/doc/standarddialogs.qdoc create mode 100644 examples/widgets/doc/stardelegate.qdoc create mode 100644 examples/widgets/doc/states.qdoc create mode 100644 examples/widgets/doc/stickman.qdoc create mode 100644 examples/widgets/doc/styles.qdoc create mode 100644 examples/widgets/doc/stylesheet.qdoc create mode 100644 examples/widgets/doc/sub-attaq.qdoc create mode 100644 examples/widgets/doc/syntaxhighlighter.qdoc create mode 100644 examples/widgets/doc/tabdialog.qdoc create mode 100644 examples/widgets/doc/tablet.qdoc create mode 100644 examples/widgets/doc/tetrix.qdoc create mode 100644 examples/widgets/doc/textedit.qdoc create mode 100644 examples/widgets/doc/tooltips.qdoc create mode 100644 examples/widgets/doc/trafficlight.qdoc create mode 100644 examples/widgets/doc/transformations.qdoc create mode 100644 examples/widgets/doc/trivialwizard.qdoc create mode 100644 examples/widgets/doc/twowaybutton.qdoc create mode 100644 examples/widgets/doc/wiggly.qdoc create mode 100644 examples/widgets/doc/windowflags.qdoc create mode 100644 examples/widgets/draganddrop/README create mode 100644 examples/widgets/draganddrop/delayedencoding/delayedencoding.desktop create mode 100644 examples/widgets/draganddrop/draganddrop.pro create mode 100644 examples/widgets/draganddrop/draggableicons/draggableicons.desktop create mode 100644 examples/widgets/draganddrop/draggableicons/draggableicons.pro create mode 100644 examples/widgets/draganddrop/draggableicons/draggableicons.qrc create mode 100644 examples/widgets/draganddrop/draggableicons/dragwidget.cpp create mode 100644 examples/widgets/draganddrop/draggableicons/dragwidget.h create mode 100644 examples/widgets/draganddrop/draggableicons/images/boat.png create mode 100644 examples/widgets/draganddrop/draggableicons/images/car.png create mode 100644 examples/widgets/draganddrop/draggableicons/images/house.png create mode 100644 examples/widgets/draganddrop/draggableicons/main.cpp create mode 100644 examples/widgets/draganddrop/draggabletext/draggabletext.desktop create mode 100644 examples/widgets/draganddrop/draggabletext/draggabletext.pro create mode 100644 examples/widgets/draganddrop/draggabletext/draggabletext.qrc create mode 100644 examples/widgets/draganddrop/draggabletext/draglabel.cpp create mode 100644 examples/widgets/draganddrop/draggabletext/draglabel.h create mode 100644 examples/widgets/draganddrop/draggabletext/dragwidget.cpp create mode 100644 examples/widgets/draganddrop/draggabletext/dragwidget.h create mode 100644 examples/widgets/draganddrop/draggabletext/main.cpp create mode 100644 examples/widgets/draganddrop/draggabletext/words.txt create mode 100644 examples/widgets/draganddrop/dropsite/droparea.cpp create mode 100644 examples/widgets/draganddrop/dropsite/droparea.h create mode 100644 examples/widgets/draganddrop/dropsite/dropsite.desktop create mode 100644 examples/widgets/draganddrop/dropsite/dropsite.pro create mode 100644 examples/widgets/draganddrop/dropsite/dropsitewindow.cpp create mode 100644 examples/widgets/draganddrop/dropsite/dropsitewindow.h create mode 100644 examples/widgets/draganddrop/dropsite/main.cpp create mode 100644 examples/widgets/draganddrop/fridgemagnets/draglabel.cpp create mode 100644 examples/widgets/draganddrop/fridgemagnets/draglabel.h create mode 100644 examples/widgets/draganddrop/fridgemagnets/dragwidget.cpp create mode 100644 examples/widgets/draganddrop/fridgemagnets/dragwidget.h create mode 100644 examples/widgets/draganddrop/fridgemagnets/fridgemagnets.desktop create mode 100644 examples/widgets/draganddrop/fridgemagnets/fridgemagnets.pro create mode 100644 examples/widgets/draganddrop/fridgemagnets/fridgemagnets.qrc create mode 100644 examples/widgets/draganddrop/fridgemagnets/main.cpp create mode 100644 examples/widgets/draganddrop/fridgemagnets/words.txt create mode 100644 examples/widgets/draganddrop/puzzle/example.jpg create mode 100644 examples/widgets/draganddrop/puzzle/main.cpp create mode 100644 examples/widgets/draganddrop/puzzle/mainwindow.cpp create mode 100644 examples/widgets/draganddrop/puzzle/mainwindow.h create mode 100644 examples/widgets/draganddrop/puzzle/pieceslist.cpp create mode 100644 examples/widgets/draganddrop/puzzle/pieceslist.h create mode 100644 examples/widgets/draganddrop/puzzle/puzzle.desktop create mode 100644 examples/widgets/draganddrop/puzzle/puzzle.pro create mode 100644 examples/widgets/draganddrop/puzzle/puzzle.qrc create mode 100644 examples/widgets/draganddrop/puzzle/puzzlewidget.cpp create mode 100644 examples/widgets/draganddrop/puzzle/puzzlewidget.h create mode 100644 examples/widgets/effects/blurpicker/blureffect.cpp create mode 100644 examples/widgets/effects/blurpicker/blureffect.h create mode 100644 examples/widgets/effects/blurpicker/blurpicker.cpp create mode 100644 examples/widgets/effects/blurpicker/blurpicker.desktop create mode 100644 examples/widgets/effects/blurpicker/blurpicker.h create mode 100644 examples/widgets/effects/blurpicker/blurpicker.pro create mode 100644 examples/widgets/effects/blurpicker/blurpicker.qrc create mode 100644 examples/widgets/effects/blurpicker/images/README.txt create mode 100644 examples/widgets/effects/blurpicker/images/accessories-calculator.png create mode 100644 examples/widgets/effects/blurpicker/images/accessories-text-editor.png create mode 100644 examples/widgets/effects/blurpicker/images/background.jpg create mode 100644 examples/widgets/effects/blurpicker/images/help-browser.png create mode 100644 examples/widgets/effects/blurpicker/images/internet-group-chat.png create mode 100644 examples/widgets/effects/blurpicker/images/internet-mail.png create mode 100644 examples/widgets/effects/blurpicker/images/internet-web-browser.png create mode 100644 examples/widgets/effects/blurpicker/images/office-calendar.png create mode 100644 examples/widgets/effects/blurpicker/images/system-users.png create mode 100644 examples/widgets/effects/blurpicker/main.cpp create mode 100644 examples/widgets/effects/effects.pro create mode 100644 examples/widgets/effects/fademessage/README.txt create mode 100644 examples/widgets/effects/fademessage/background.jpg create mode 100644 examples/widgets/effects/fademessage/fademessage.cpp create mode 100644 examples/widgets/effects/fademessage/fademessage.desktop create mode 100644 examples/widgets/effects/fademessage/fademessage.h create mode 100644 examples/widgets/effects/fademessage/fademessage.pro create mode 100644 examples/widgets/effects/fademessage/fademessage.qrc create mode 100644 examples/widgets/effects/fademessage/main.cpp create mode 100644 examples/widgets/effects/lighting/lighting.cpp create mode 100644 examples/widgets/effects/lighting/lighting.desktop create mode 100644 examples/widgets/effects/lighting/lighting.h create mode 100644 examples/widgets/effects/lighting/lighting.pro create mode 100644 examples/widgets/effects/lighting/main.cpp delete mode 100644 examples/widgets/elidedlabel/elidedlabel.cpp delete mode 100644 examples/widgets/elidedlabel/elidedlabel.desktop delete mode 100644 examples/widgets/elidedlabel/elidedlabel.h delete mode 100644 examples/widgets/elidedlabel/elidedlabel.pro delete mode 100644 examples/widgets/elidedlabel/main.cpp delete mode 100644 examples/widgets/elidedlabel/testwidget.cpp delete mode 100644 examples/widgets/elidedlabel/testwidget.h create mode 100644 examples/widgets/graphicsview/README create mode 100644 examples/widgets/graphicsview/anchorlayout/anchorlayout.desktop create mode 100644 examples/widgets/graphicsview/anchorlayout/anchorlayout.pro create mode 100644 examples/widgets/graphicsview/anchorlayout/main.cpp create mode 100644 examples/widgets/graphicsview/basicgraphicslayouts/basicgraphicslayouts.desktop create mode 100644 examples/widgets/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro create mode 100644 examples/widgets/graphicsview/basicgraphicslayouts/basicgraphicslayouts.qrc create mode 100644 examples/widgets/graphicsview/basicgraphicslayouts/images/block.png create mode 100644 examples/widgets/graphicsview/basicgraphicslayouts/layoutitem.cpp create mode 100644 examples/widgets/graphicsview/basicgraphicslayouts/layoutitem.h create mode 100644 examples/widgets/graphicsview/basicgraphicslayouts/main.cpp create mode 100644 examples/widgets/graphicsview/basicgraphicslayouts/window.cpp create mode 100644 examples/widgets/graphicsview/basicgraphicslayouts/window.h create mode 100644 examples/widgets/graphicsview/boxes/3rdparty/fbm.c create mode 100644 examples/widgets/graphicsview/boxes/3rdparty/fbm.h create mode 100644 examples/widgets/graphicsview/boxes/basic.fsh create mode 100644 examples/widgets/graphicsview/boxes/basic.vsh create mode 100644 examples/widgets/graphicsview/boxes/boxes.pro create mode 100644 examples/widgets/graphicsview/boxes/boxes.qrc create mode 100644 examples/widgets/graphicsview/boxes/cubemap_negx.jpg create mode 100644 examples/widgets/graphicsview/boxes/cubemap_negy.jpg create mode 100644 examples/widgets/graphicsview/boxes/cubemap_negz.jpg create mode 100644 examples/widgets/graphicsview/boxes/cubemap_posx.jpg create mode 100644 examples/widgets/graphicsview/boxes/cubemap_posy.jpg create mode 100644 examples/widgets/graphicsview/boxes/cubemap_posz.jpg create mode 100644 examples/widgets/graphicsview/boxes/dotted.fsh create mode 100644 examples/widgets/graphicsview/boxes/fresnel.fsh create mode 100644 examples/widgets/graphicsview/boxes/glass.fsh create mode 100644 examples/widgets/graphicsview/boxes/glbuffers.cpp create mode 100644 examples/widgets/graphicsview/boxes/glbuffers.h create mode 100644 examples/widgets/graphicsview/boxes/glextensions.cpp create mode 100644 examples/widgets/graphicsview/boxes/glextensions.h create mode 100644 examples/widgets/graphicsview/boxes/gltrianglemesh.h create mode 100644 examples/widgets/graphicsview/boxes/granite.fsh create mode 100644 examples/widgets/graphicsview/boxes/main.cpp create mode 100644 examples/widgets/graphicsview/boxes/marble.fsh create mode 100644 examples/widgets/graphicsview/boxes/parameters.par create mode 100644 examples/widgets/graphicsview/boxes/qt-logo.jpg create mode 100644 examples/widgets/graphicsview/boxes/qt-logo.png create mode 100644 examples/widgets/graphicsview/boxes/qtbox.cpp create mode 100644 examples/widgets/graphicsview/boxes/qtbox.h create mode 100644 examples/widgets/graphicsview/boxes/reflection.fsh create mode 100644 examples/widgets/graphicsview/boxes/refraction.fsh create mode 100644 examples/widgets/graphicsview/boxes/roundedbox.cpp create mode 100644 examples/widgets/graphicsview/boxes/roundedbox.h create mode 100644 examples/widgets/graphicsview/boxes/scene.cpp create mode 100644 examples/widgets/graphicsview/boxes/scene.h create mode 100644 examples/widgets/graphicsview/boxes/smiley.png create mode 100644 examples/widgets/graphicsview/boxes/square.jpg create mode 100644 examples/widgets/graphicsview/boxes/trackball.cpp create mode 100644 examples/widgets/graphicsview/boxes/trackball.h create mode 100644 examples/widgets/graphicsview/boxes/wood.fsh create mode 100644 examples/widgets/graphicsview/chip/chip.cpp create mode 100644 examples/widgets/graphicsview/chip/chip.h create mode 100644 examples/widgets/graphicsview/chip/chip.pro create mode 100644 examples/widgets/graphicsview/chip/fileprint.png create mode 100644 examples/widgets/graphicsview/chip/images.qrc create mode 100644 examples/widgets/graphicsview/chip/main.cpp create mode 100644 examples/widgets/graphicsview/chip/mainwindow.cpp create mode 100644 examples/widgets/graphicsview/chip/mainwindow.h create mode 100644 examples/widgets/graphicsview/chip/qt4logo.png create mode 100644 examples/widgets/graphicsview/chip/rotateleft.png create mode 100644 examples/widgets/graphicsview/chip/rotateright.png create mode 100644 examples/widgets/graphicsview/chip/view.cpp create mode 100644 examples/widgets/graphicsview/chip/view.h create mode 100644 examples/widgets/graphicsview/chip/zoomin.png create mode 100644 examples/widgets/graphicsview/chip/zoomout.png create mode 100644 examples/widgets/graphicsview/collidingmice/collidingmice.desktop create mode 100644 examples/widgets/graphicsview/collidingmice/collidingmice.pro create mode 100644 examples/widgets/graphicsview/collidingmice/images/cheese.jpg create mode 100644 examples/widgets/graphicsview/collidingmice/main.cpp create mode 100644 examples/widgets/graphicsview/collidingmice/mice.qrc create mode 100644 examples/widgets/graphicsview/collidingmice/mouse.cpp create mode 100644 examples/widgets/graphicsview/collidingmice/mouse.h create mode 100644 examples/widgets/graphicsview/diagramscene/arrow.cpp create mode 100644 examples/widgets/graphicsview/diagramscene/arrow.h create mode 100644 examples/widgets/graphicsview/diagramscene/diagramitem.cpp create mode 100644 examples/widgets/graphicsview/diagramscene/diagramitem.h create mode 100644 examples/widgets/graphicsview/diagramscene/diagramscene.cpp create mode 100644 examples/widgets/graphicsview/diagramscene/diagramscene.desktop create mode 100644 examples/widgets/graphicsview/diagramscene/diagramscene.h create mode 100644 examples/widgets/graphicsview/diagramscene/diagramscene.pro create mode 100644 examples/widgets/graphicsview/diagramscene/diagramscene.qrc create mode 100644 examples/widgets/graphicsview/diagramscene/diagramtextitem.cpp create mode 100644 examples/widgets/graphicsview/diagramscene/diagramtextitem.h create mode 100644 examples/widgets/graphicsview/diagramscene/images/background1.png create mode 100644 examples/widgets/graphicsview/diagramscene/images/background2.png create mode 100644 examples/widgets/graphicsview/diagramscene/images/background3.png create mode 100644 examples/widgets/graphicsview/diagramscene/images/background4.png create mode 100644 examples/widgets/graphicsview/diagramscene/images/bold.png create mode 100644 examples/widgets/graphicsview/diagramscene/images/bringtofront.png create mode 100644 examples/widgets/graphicsview/diagramscene/images/delete.png create mode 100644 examples/widgets/graphicsview/diagramscene/images/floodfill.png create mode 100644 examples/widgets/graphicsview/diagramscene/images/italic.png create mode 100644 examples/widgets/graphicsview/diagramscene/images/linecolor.png create mode 100644 examples/widgets/graphicsview/diagramscene/images/linepointer.png create mode 100644 examples/widgets/graphicsview/diagramscene/images/pointer.png create mode 100644 examples/widgets/graphicsview/diagramscene/images/sendtoback.png create mode 100644 examples/widgets/graphicsview/diagramscene/images/textpointer.png create mode 100644 examples/widgets/graphicsview/diagramscene/images/underline.png create mode 100644 examples/widgets/graphicsview/diagramscene/main.cpp create mode 100644 examples/widgets/graphicsview/diagramscene/mainwindow.cpp create mode 100644 examples/widgets/graphicsview/diagramscene/mainwindow.h create mode 100644 examples/widgets/graphicsview/dragdroprobot/coloritem.cpp create mode 100644 examples/widgets/graphicsview/dragdroprobot/coloritem.h create mode 100644 examples/widgets/graphicsview/dragdroprobot/dragdroprobot.desktop create mode 100644 examples/widgets/graphicsview/dragdroprobot/dragdroprobot.pro create mode 100644 examples/widgets/graphicsview/dragdroprobot/images/head.png create mode 100644 examples/widgets/graphicsview/dragdroprobot/main.cpp create mode 100644 examples/widgets/graphicsview/dragdroprobot/robot.cpp create mode 100644 examples/widgets/graphicsview/dragdroprobot/robot.h create mode 100644 examples/widgets/graphicsview/dragdroprobot/robot.qrc create mode 100644 examples/widgets/graphicsview/elasticnodes/edge.cpp create mode 100644 examples/widgets/graphicsview/elasticnodes/edge.h create mode 100644 examples/widgets/graphicsview/elasticnodes/elasticnodes.desktop create mode 100644 examples/widgets/graphicsview/elasticnodes/elasticnodes.pro create mode 100644 examples/widgets/graphicsview/elasticnodes/graphwidget.cpp create mode 100644 examples/widgets/graphicsview/elasticnodes/graphwidget.h create mode 100644 examples/widgets/graphicsview/elasticnodes/main.cpp create mode 100644 examples/widgets/graphicsview/elasticnodes/node.cpp create mode 100644 examples/widgets/graphicsview/elasticnodes/node.h create mode 100644 examples/widgets/graphicsview/embeddeddialogs/No-Ones-Laughing-3.jpg create mode 100644 examples/widgets/graphicsview/embeddeddialogs/customproxy.cpp create mode 100644 examples/widgets/graphicsview/embeddeddialogs/customproxy.h create mode 100644 examples/widgets/graphicsview/embeddeddialogs/embeddeddialog.cpp create mode 100644 examples/widgets/graphicsview/embeddeddialogs/embeddeddialog.h create mode 100644 examples/widgets/graphicsview/embeddeddialogs/embeddeddialog.ui create mode 100644 examples/widgets/graphicsview/embeddeddialogs/embeddeddialogs.pro create mode 100644 examples/widgets/graphicsview/embeddeddialogs/embeddeddialogs.qrc create mode 100644 examples/widgets/graphicsview/embeddeddialogs/main.cpp create mode 100644 examples/widgets/graphicsview/flowlayout/flowlayout.cpp create mode 100644 examples/widgets/graphicsview/flowlayout/flowlayout.desktop create mode 100644 examples/widgets/graphicsview/flowlayout/flowlayout.h create mode 100644 examples/widgets/graphicsview/flowlayout/flowlayout.pro create mode 100644 examples/widgets/graphicsview/flowlayout/main.cpp create mode 100644 examples/widgets/graphicsview/flowlayout/window.cpp create mode 100644 examples/widgets/graphicsview/flowlayout/window.h create mode 100644 examples/widgets/graphicsview/graphicsview.pro create mode 100644 examples/widgets/graphicsview/padnavigator/flippablepad.cpp create mode 100644 examples/widgets/graphicsview/padnavigator/flippablepad.h create mode 100644 examples/widgets/graphicsview/padnavigator/form.ui create mode 100644 examples/widgets/graphicsview/padnavigator/images/artsfftscope.png create mode 100644 examples/widgets/graphicsview/padnavigator/images/blue_angle_swirl.jpg create mode 100644 examples/widgets/graphicsview/padnavigator/images/kontact_contacts.png create mode 100644 examples/widgets/graphicsview/padnavigator/images/kontact_journal.png create mode 100644 examples/widgets/graphicsview/padnavigator/images/kontact_mail.png create mode 100644 examples/widgets/graphicsview/padnavigator/images/kontact_notes.png create mode 100644 examples/widgets/graphicsview/padnavigator/images/kopeteavailable.png create mode 100644 examples/widgets/graphicsview/padnavigator/images/metacontact_online.png create mode 100644 examples/widgets/graphicsview/padnavigator/images/minitools.png create mode 100644 examples/widgets/graphicsview/padnavigator/main.cpp create mode 100644 examples/widgets/graphicsview/padnavigator/padnavigator.cpp create mode 100644 examples/widgets/graphicsview/padnavigator/padnavigator.desktop create mode 100644 examples/widgets/graphicsview/padnavigator/padnavigator.h create mode 100644 examples/widgets/graphicsview/padnavigator/padnavigator.pro create mode 100644 examples/widgets/graphicsview/padnavigator/padnavigator.qrc create mode 100644 examples/widgets/graphicsview/padnavigator/roundrectitem.cpp create mode 100644 examples/widgets/graphicsview/padnavigator/roundrectitem.h create mode 100644 examples/widgets/graphicsview/padnavigator/splashitem.cpp create mode 100644 examples/widgets/graphicsview/padnavigator/splashitem.h create mode 100644 examples/widgets/graphicsview/portedasteroids/portedasteroids.desktop create mode 100644 examples/widgets/graphicsview/portedcanvas/portedcanvas.desktop create mode 100644 examples/widgets/graphicsview/simpleanchorlayout/main.cpp create mode 100644 examples/widgets/graphicsview/simpleanchorlayout/simpleanchorlayout.desktop create mode 100644 examples/widgets/graphicsview/simpleanchorlayout/simpleanchorlayout.pro create mode 100644 examples/widgets/graphicsview/weatheranchorlayout/images/5days.jpg create mode 100644 examples/widgets/graphicsview/weatheranchorlayout/images/details.jpg create mode 100644 examples/widgets/graphicsview/weatheranchorlayout/images/place.jpg create mode 100644 examples/widgets/graphicsview/weatheranchorlayout/images/tabbar.jpg create mode 100644 examples/widgets/graphicsview/weatheranchorlayout/images/title.jpg create mode 100644 examples/widgets/graphicsview/weatheranchorlayout/images/weather-few-clouds.png create mode 100644 examples/widgets/graphicsview/weatheranchorlayout/main.cpp create mode 100644 examples/widgets/graphicsview/weatheranchorlayout/weatheranchorlayout.desktop create mode 100644 examples/widgets/graphicsview/weatheranchorlayout/weatheranchorlayout.pro create mode 100644 examples/widgets/graphicsview/weatheranchorlayout/weatheranchorlayout.qrc delete mode 100644 examples/widgets/groupbox/groupbox.desktop delete mode 100644 examples/widgets/groupbox/groupbox.pro delete mode 100644 examples/widgets/groupbox/main.cpp delete mode 100644 examples/widgets/groupbox/window.cpp delete mode 100644 examples/widgets/groupbox/window.h delete mode 100644 examples/widgets/icons/iconpreviewarea.cpp delete mode 100644 examples/widgets/icons/iconpreviewarea.h delete mode 100644 examples/widgets/icons/icons.desktop delete mode 100644 examples/widgets/icons/icons.pro delete mode 100644 examples/widgets/icons/iconsizespinbox.cpp delete mode 100644 examples/widgets/icons/iconsizespinbox.h delete mode 100644 examples/widgets/icons/imagedelegate.cpp delete mode 100644 examples/widgets/icons/imagedelegate.h delete mode 100644 examples/widgets/icons/images/designer.png delete mode 100644 examples/widgets/icons/images/find_disabled.png delete mode 100644 examples/widgets/icons/images/find_normal.png delete mode 100644 examples/widgets/icons/images/monkey_off_128x128.png delete mode 100644 examples/widgets/icons/images/monkey_off_16x16.png delete mode 100644 examples/widgets/icons/images/monkey_off_32x32.png delete mode 100644 examples/widgets/icons/images/monkey_off_64x64.png delete mode 100644 examples/widgets/icons/images/monkey_on_128x128.png delete mode 100644 examples/widgets/icons/images/monkey_on_16x16.png delete mode 100644 examples/widgets/icons/images/monkey_on_32x32.png delete mode 100644 examples/widgets/icons/images/monkey_on_64x64.png delete mode 100644 examples/widgets/icons/images/qt_extended_16x16.png delete mode 100644 examples/widgets/icons/images/qt_extended_32x32.png delete mode 100644 examples/widgets/icons/images/qt_extended_48x48.png delete mode 100644 examples/widgets/icons/main.cpp delete mode 100644 examples/widgets/icons/mainwindow.cpp delete mode 100644 examples/widgets/icons/mainwindow.h delete mode 100644 examples/widgets/imageviewer/imageviewer.cpp delete mode 100644 examples/widgets/imageviewer/imageviewer.desktop delete mode 100644 examples/widgets/imageviewer/imageviewer.h delete mode 100644 examples/widgets/imageviewer/imageviewer.pro delete mode 100644 examples/widgets/imageviewer/main.cpp create mode 100644 examples/widgets/itemviews/README create mode 100644 examples/widgets/itemviews/addressbook/adddialog.cpp create mode 100644 examples/widgets/itemviews/addressbook/adddialog.h create mode 100644 examples/widgets/itemviews/addressbook/addressbook.desktop create mode 100644 examples/widgets/itemviews/addressbook/addressbook.pro create mode 100644 examples/widgets/itemviews/addressbook/addresswidget.cpp create mode 100644 examples/widgets/itemviews/addressbook/addresswidget.h create mode 100644 examples/widgets/itemviews/addressbook/main.cpp create mode 100644 examples/widgets/itemviews/addressbook/mainwindow.cpp create mode 100644 examples/widgets/itemviews/addressbook/mainwindow.h create mode 100644 examples/widgets/itemviews/addressbook/newaddresstab.cpp create mode 100644 examples/widgets/itemviews/addressbook/newaddresstab.h create mode 100644 examples/widgets/itemviews/addressbook/tablemodel.cpp create mode 100644 examples/widgets/itemviews/addressbook/tablemodel.h create mode 100644 examples/widgets/itemviews/basicsortfiltermodel/basicsortfiltermodel.desktop create mode 100644 examples/widgets/itemviews/basicsortfiltermodel/basicsortfiltermodel.pro create mode 100644 examples/widgets/itemviews/basicsortfiltermodel/main.cpp create mode 100644 examples/widgets/itemviews/basicsortfiltermodel/window.cpp create mode 100644 examples/widgets/itemviews/basicsortfiltermodel/window.h create mode 100644 examples/widgets/itemviews/chart/chart.desktop create mode 100644 examples/widgets/itemviews/chart/chart.pro create mode 100644 examples/widgets/itemviews/chart/chart.qrc create mode 100644 examples/widgets/itemviews/chart/main.cpp create mode 100644 examples/widgets/itemviews/chart/mainwindow.cpp create mode 100644 examples/widgets/itemviews/chart/mainwindow.h create mode 100644 examples/widgets/itemviews/chart/mydata.cht create mode 100644 examples/widgets/itemviews/chart/pieview.cpp create mode 100644 examples/widgets/itemviews/chart/pieview.h create mode 100644 examples/widgets/itemviews/chart/qtdata.cht create mode 100644 examples/widgets/itemviews/coloreditorfactory/coloreditorfactory.desktop create mode 100644 examples/widgets/itemviews/coloreditorfactory/coloreditorfactory.pro create mode 100644 examples/widgets/itemviews/coloreditorfactory/colorlisteditor.cpp create mode 100644 examples/widgets/itemviews/coloreditorfactory/colorlisteditor.h create mode 100644 examples/widgets/itemviews/coloreditorfactory/main.cpp create mode 100644 examples/widgets/itemviews/coloreditorfactory/window.cpp create mode 100644 examples/widgets/itemviews/coloreditorfactory/window.h create mode 100644 examples/widgets/itemviews/combowidgetmapper/combowidgetmapper.desktop create mode 100644 examples/widgets/itemviews/combowidgetmapper/combowidgetmapper.pro create mode 100644 examples/widgets/itemviews/combowidgetmapper/main.cpp create mode 100644 examples/widgets/itemviews/combowidgetmapper/window.cpp create mode 100644 examples/widgets/itemviews/combowidgetmapper/window.h create mode 100644 examples/widgets/itemviews/customsortfiltermodel/customsortfiltermodel.desktop create mode 100644 examples/widgets/itemviews/customsortfiltermodel/customsortfiltermodel.pro create mode 100644 examples/widgets/itemviews/customsortfiltermodel/main.cpp create mode 100644 examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp create mode 100644 examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.h create mode 100644 examples/widgets/itemviews/customsortfiltermodel/window.cpp create mode 100644 examples/widgets/itemviews/customsortfiltermodel/window.h create mode 100644 examples/widgets/itemviews/dirview/dirview.desktop create mode 100644 examples/widgets/itemviews/dirview/dirview.pro create mode 100644 examples/widgets/itemviews/dirview/main.cpp create mode 100644 examples/widgets/itemviews/editabletreemodel/default.txt create mode 100644 examples/widgets/itemviews/editabletreemodel/editabletreemodel.desktop create mode 100644 examples/widgets/itemviews/editabletreemodel/editabletreemodel.pro create mode 100644 examples/widgets/itemviews/editabletreemodel/editabletreemodel.qrc create mode 100644 examples/widgets/itemviews/editabletreemodel/main.cpp create mode 100644 examples/widgets/itemviews/editabletreemodel/mainwindow.cpp create mode 100644 examples/widgets/itemviews/editabletreemodel/mainwindow.h create mode 100644 examples/widgets/itemviews/editabletreemodel/mainwindow.ui create mode 100644 examples/widgets/itemviews/editabletreemodel/treeitem.cpp create mode 100644 examples/widgets/itemviews/editabletreemodel/treeitem.h create mode 100644 examples/widgets/itemviews/editabletreemodel/treemodel.cpp create mode 100644 examples/widgets/itemviews/editabletreemodel/treemodel.h create mode 100644 examples/widgets/itemviews/fetchmore/fetchmore.desktop create mode 100644 examples/widgets/itemviews/fetchmore/fetchmore.pro create mode 100644 examples/widgets/itemviews/fetchmore/filelistmodel.cpp create mode 100644 examples/widgets/itemviews/fetchmore/filelistmodel.h create mode 100644 examples/widgets/itemviews/fetchmore/main.cpp create mode 100644 examples/widgets/itemviews/fetchmore/window.cpp create mode 100644 examples/widgets/itemviews/fetchmore/window.h create mode 100644 examples/widgets/itemviews/frozencolumn/freezetablewidget.cpp create mode 100644 examples/widgets/itemviews/frozencolumn/freezetablewidget.h create mode 100644 examples/widgets/itemviews/frozencolumn/frozencolumn.desktop create mode 100644 examples/widgets/itemviews/frozencolumn/frozencolumn.pro create mode 100644 examples/widgets/itemviews/frozencolumn/grades.qrc create mode 100644 examples/widgets/itemviews/frozencolumn/grades.txt create mode 100644 examples/widgets/itemviews/frozencolumn/main.cpp create mode 100644 examples/widgets/itemviews/interview/README create mode 100644 examples/widgets/itemviews/interview/images/folder.png create mode 100644 examples/widgets/itemviews/interview/images/interview.png create mode 100644 examples/widgets/itemviews/interview/images/services.png create mode 100644 examples/widgets/itemviews/interview/interview.pro create mode 100644 examples/widgets/itemviews/interview/interview.qrc create mode 100644 examples/widgets/itemviews/interview/main.cpp create mode 100644 examples/widgets/itemviews/interview/model.cpp create mode 100644 examples/widgets/itemviews/interview/model.h create mode 100644 examples/widgets/itemviews/itemviews.pro create mode 100644 examples/widgets/itemviews/pixelator/imagemodel.cpp create mode 100644 examples/widgets/itemviews/pixelator/imagemodel.h create mode 100644 examples/widgets/itemviews/pixelator/images.qrc create mode 100644 examples/widgets/itemviews/pixelator/images/qt.png create mode 100644 examples/widgets/itemviews/pixelator/main.cpp create mode 100644 examples/widgets/itemviews/pixelator/mainwindow.cpp create mode 100644 examples/widgets/itemviews/pixelator/mainwindow.h create mode 100644 examples/widgets/itemviews/pixelator/pixelator.desktop create mode 100644 examples/widgets/itemviews/pixelator/pixelator.pro create mode 100644 examples/widgets/itemviews/pixelator/pixeldelegate.cpp create mode 100644 examples/widgets/itemviews/pixelator/pixeldelegate.h create mode 100644 examples/widgets/itemviews/puzzle/example.jpg create mode 100644 examples/widgets/itemviews/puzzle/main.cpp create mode 100644 examples/widgets/itemviews/puzzle/mainwindow.cpp create mode 100644 examples/widgets/itemviews/puzzle/mainwindow.h create mode 100644 examples/widgets/itemviews/puzzle/piecesmodel.cpp create mode 100644 examples/widgets/itemviews/puzzle/piecesmodel.h create mode 100644 examples/widgets/itemviews/puzzle/puzzle.desktop create mode 100644 examples/widgets/itemviews/puzzle/puzzle.pro create mode 100644 examples/widgets/itemviews/puzzle/puzzle.qrc create mode 100644 examples/widgets/itemviews/puzzle/puzzlewidget.cpp create mode 100644 examples/widgets/itemviews/puzzle/puzzlewidget.h create mode 100644 examples/widgets/itemviews/simpledommodel/domitem.cpp create mode 100644 examples/widgets/itemviews/simpledommodel/domitem.h create mode 100644 examples/widgets/itemviews/simpledommodel/dommodel.cpp create mode 100644 examples/widgets/itemviews/simpledommodel/dommodel.h create mode 100644 examples/widgets/itemviews/simpledommodel/main.cpp create mode 100644 examples/widgets/itemviews/simpledommodel/mainwindow.cpp create mode 100644 examples/widgets/itemviews/simpledommodel/mainwindow.h create mode 100644 examples/widgets/itemviews/simpledommodel/simpledommodel.desktop create mode 100644 examples/widgets/itemviews/simpledommodel/simpledommodel.pro create mode 100644 examples/widgets/itemviews/simpletreemodel/default.txt create mode 100644 examples/widgets/itemviews/simpletreemodel/main.cpp create mode 100644 examples/widgets/itemviews/simpletreemodel/simpletreemodel.desktop create mode 100644 examples/widgets/itemviews/simpletreemodel/simpletreemodel.pro create mode 100644 examples/widgets/itemviews/simpletreemodel/simpletreemodel.qrc create mode 100644 examples/widgets/itemviews/simpletreemodel/treeitem.cpp create mode 100644 examples/widgets/itemviews/simpletreemodel/treeitem.h create mode 100644 examples/widgets/itemviews/simpletreemodel/treemodel.cpp create mode 100644 examples/widgets/itemviews/simpletreemodel/treemodel.h create mode 100644 examples/widgets/itemviews/simplewidgetmapper/main.cpp create mode 100644 examples/widgets/itemviews/simplewidgetmapper/simplewidgetmapper.desktop create mode 100644 examples/widgets/itemviews/simplewidgetmapper/simplewidgetmapper.pro create mode 100644 examples/widgets/itemviews/simplewidgetmapper/window.cpp create mode 100644 examples/widgets/itemviews/simplewidgetmapper/window.h create mode 100644 examples/widgets/itemviews/spinboxdelegate/delegate.cpp create mode 100644 examples/widgets/itemviews/spinboxdelegate/delegate.h create mode 100644 examples/widgets/itemviews/spinboxdelegate/main.cpp create mode 100644 examples/widgets/itemviews/spinboxdelegate/spinboxdelegate.desktop create mode 100644 examples/widgets/itemviews/spinboxdelegate/spinboxdelegate.pro create mode 100644 examples/widgets/itemviews/spreadsheet/images/interview.png create mode 100644 examples/widgets/itemviews/spreadsheet/main.cpp create mode 100644 examples/widgets/itemviews/spreadsheet/printview.cpp create mode 100644 examples/widgets/itemviews/spreadsheet/printview.h create mode 100644 examples/widgets/itemviews/spreadsheet/spreadsheet.cpp create mode 100644 examples/widgets/itemviews/spreadsheet/spreadsheet.h create mode 100644 examples/widgets/itemviews/spreadsheet/spreadsheet.pro create mode 100644 examples/widgets/itemviews/spreadsheet/spreadsheet.qrc create mode 100644 examples/widgets/itemviews/spreadsheet/spreadsheetdelegate.cpp create mode 100644 examples/widgets/itemviews/spreadsheet/spreadsheetdelegate.h create mode 100644 examples/widgets/itemviews/spreadsheet/spreadsheetitem.cpp create mode 100644 examples/widgets/itemviews/spreadsheet/spreadsheetitem.h create mode 100644 examples/widgets/itemviews/stardelegate/main.cpp create mode 100644 examples/widgets/itemviews/stardelegate/stardelegate.cpp create mode 100644 examples/widgets/itemviews/stardelegate/stardelegate.desktop create mode 100644 examples/widgets/itemviews/stardelegate/stardelegate.h create mode 100644 examples/widgets/itemviews/stardelegate/stardelegate.pro create mode 100644 examples/widgets/itemviews/stardelegate/stareditor.cpp create mode 100644 examples/widgets/itemviews/stardelegate/stareditor.h create mode 100644 examples/widgets/itemviews/stardelegate/starrating.cpp create mode 100644 examples/widgets/itemviews/stardelegate/starrating.h create mode 100644 examples/widgets/layouts/README create mode 100644 examples/widgets/layouts/basiclayouts/basiclayouts.desktop create mode 100644 examples/widgets/layouts/basiclayouts/basiclayouts.pro create mode 100644 examples/widgets/layouts/basiclayouts/dialog.cpp create mode 100644 examples/widgets/layouts/basiclayouts/dialog.h create mode 100644 examples/widgets/layouts/basiclayouts/main.cpp create mode 100644 examples/widgets/layouts/borderlayout/borderlayout.cpp create mode 100644 examples/widgets/layouts/borderlayout/borderlayout.desktop create mode 100644 examples/widgets/layouts/borderlayout/borderlayout.h create mode 100644 examples/widgets/layouts/borderlayout/borderlayout.pro create mode 100644 examples/widgets/layouts/borderlayout/main.cpp create mode 100644 examples/widgets/layouts/borderlayout/window.cpp create mode 100644 examples/widgets/layouts/borderlayout/window.h create mode 100644 examples/widgets/layouts/dynamiclayouts/dialog.cpp create mode 100644 examples/widgets/layouts/dynamiclayouts/dialog.h create mode 100644 examples/widgets/layouts/dynamiclayouts/dynamiclayouts.desktop create mode 100644 examples/widgets/layouts/dynamiclayouts/dynamiclayouts.pro create mode 100644 examples/widgets/layouts/dynamiclayouts/main.cpp create mode 100644 examples/widgets/layouts/flowlayout/flowlayout.cpp create mode 100644 examples/widgets/layouts/flowlayout/flowlayout.desktop create mode 100644 examples/widgets/layouts/flowlayout/flowlayout.h create mode 100644 examples/widgets/layouts/flowlayout/flowlayout.pro create mode 100644 examples/widgets/layouts/flowlayout/main.cpp create mode 100644 examples/widgets/layouts/flowlayout/window.cpp create mode 100644 examples/widgets/layouts/flowlayout/window.h create mode 100644 examples/widgets/layouts/layouts.pro delete mode 100644 examples/widgets/lineedits/lineedits.desktop delete mode 100644 examples/widgets/lineedits/lineedits.pro delete mode 100644 examples/widgets/lineedits/main.cpp delete mode 100644 examples/widgets/lineedits/window.cpp delete mode 100644 examples/widgets/lineedits/window.h create mode 100644 examples/widgets/mainwindows/README create mode 100644 examples/widgets/mainwindows/application/application.desktop create mode 100644 examples/widgets/mainwindows/application/application.pro create mode 100644 examples/widgets/mainwindows/application/application.qrc create mode 100644 examples/widgets/mainwindows/application/images/copy.png create mode 100644 examples/widgets/mainwindows/application/images/cut.png create mode 100644 examples/widgets/mainwindows/application/images/new.png create mode 100644 examples/widgets/mainwindows/application/images/open.png create mode 100644 examples/widgets/mainwindows/application/images/paste.png create mode 100644 examples/widgets/mainwindows/application/images/save.png create mode 100644 examples/widgets/mainwindows/application/main.cpp create mode 100644 examples/widgets/mainwindows/application/mainwindow.cpp create mode 100644 examples/widgets/mainwindows/application/mainwindow.h create mode 100644 examples/widgets/mainwindows/dockwidgets/dockwidgets.desktop create mode 100644 examples/widgets/mainwindows/dockwidgets/dockwidgets.pro create mode 100644 examples/widgets/mainwindows/dockwidgets/dockwidgets.qrc create mode 100644 examples/widgets/mainwindows/dockwidgets/images/new.png create mode 100644 examples/widgets/mainwindows/dockwidgets/images/print.png create mode 100644 examples/widgets/mainwindows/dockwidgets/images/save.png create mode 100644 examples/widgets/mainwindows/dockwidgets/images/undo.png create mode 100644 examples/widgets/mainwindows/dockwidgets/main.cpp create mode 100644 examples/widgets/mainwindows/dockwidgets/mainwindow.cpp create mode 100644 examples/widgets/mainwindows/dockwidgets/mainwindow.h create mode 100644 examples/widgets/mainwindows/mainwindow/colorswatch.cpp create mode 100644 examples/widgets/mainwindows/mainwindow/colorswatch.h create mode 100644 examples/widgets/mainwindows/mainwindow/main.cpp create mode 100644 examples/widgets/mainwindows/mainwindow/mainwindow.cpp create mode 100644 examples/widgets/mainwindows/mainwindow/mainwindow.h create mode 100644 examples/widgets/mainwindows/mainwindow/mainwindow.pro create mode 100644 examples/widgets/mainwindows/mainwindow/mainwindow.qrc create mode 100644 examples/widgets/mainwindows/mainwindow/qt.png create mode 100644 examples/widgets/mainwindows/mainwindow/titlebarCenter.png create mode 100644 examples/widgets/mainwindows/mainwindow/titlebarLeft.png create mode 100644 examples/widgets/mainwindows/mainwindow/titlebarRight.png create mode 100644 examples/widgets/mainwindows/mainwindow/toolbar.cpp create mode 100644 examples/widgets/mainwindows/mainwindow/toolbar.h create mode 100644 examples/widgets/mainwindows/mainwindows.pro create mode 100644 examples/widgets/mainwindows/mdi/images/copy.png create mode 100644 examples/widgets/mainwindows/mdi/images/cut.png create mode 100644 examples/widgets/mainwindows/mdi/images/new.png create mode 100644 examples/widgets/mainwindows/mdi/images/open.png create mode 100644 examples/widgets/mainwindows/mdi/images/paste.png create mode 100644 examples/widgets/mainwindows/mdi/images/save.png create mode 100644 examples/widgets/mainwindows/mdi/main.cpp create mode 100644 examples/widgets/mainwindows/mdi/mainwindow.cpp create mode 100644 examples/widgets/mainwindows/mdi/mainwindow.h create mode 100644 examples/widgets/mainwindows/mdi/mdi.desktop create mode 100644 examples/widgets/mainwindows/mdi/mdi.pro create mode 100644 examples/widgets/mainwindows/mdi/mdi.qrc create mode 100644 examples/widgets/mainwindows/mdi/mdichild.cpp create mode 100644 examples/widgets/mainwindows/mdi/mdichild.h create mode 100644 examples/widgets/mainwindows/menus/main.cpp create mode 100644 examples/widgets/mainwindows/menus/mainwindow.cpp create mode 100644 examples/widgets/mainwindows/menus/mainwindow.h create mode 100644 examples/widgets/mainwindows/menus/menus.desktop create mode 100644 examples/widgets/mainwindows/menus/menus.pro create mode 100644 examples/widgets/mainwindows/recentfiles/main.cpp create mode 100644 examples/widgets/mainwindows/recentfiles/mainwindow.cpp create mode 100644 examples/widgets/mainwindows/recentfiles/mainwindow.h create mode 100644 examples/widgets/mainwindows/recentfiles/recentfiles.desktop create mode 100644 examples/widgets/mainwindows/recentfiles/recentfiles.pro create mode 100644 examples/widgets/mainwindows/sdi/images/copy.png create mode 100644 examples/widgets/mainwindows/sdi/images/cut.png create mode 100644 examples/widgets/mainwindows/sdi/images/new.png create mode 100644 examples/widgets/mainwindows/sdi/images/open.png create mode 100644 examples/widgets/mainwindows/sdi/images/paste.png create mode 100644 examples/widgets/mainwindows/sdi/images/save.png create mode 100644 examples/widgets/mainwindows/sdi/main.cpp create mode 100644 examples/widgets/mainwindows/sdi/mainwindow.cpp create mode 100644 examples/widgets/mainwindows/sdi/mainwindow.h create mode 100644 examples/widgets/mainwindows/sdi/sdi.desktop create mode 100644 examples/widgets/mainwindows/sdi/sdi.pro create mode 100644 examples/widgets/mainwindows/sdi/sdi.qrc delete mode 100644 examples/widgets/mousebuttons/buttontester.cpp delete mode 100644 examples/widgets/mousebuttons/buttontester.h delete mode 100644 examples/widgets/mousebuttons/main.cpp delete mode 100644 examples/widgets/mousebuttons/mousebuttons.pro delete mode 100644 examples/widgets/movie/animation.gif delete mode 100644 examples/widgets/movie/main.cpp delete mode 100644 examples/widgets/movie/movie.desktop delete mode 100644 examples/widgets/movie/movie.pro delete mode 100644 examples/widgets/movie/movieplayer.cpp delete mode 100644 examples/widgets/movie/movieplayer.h delete mode 100644 examples/widgets/orientation/image_a.png delete mode 100644 examples/widgets/orientation/image_b.png delete mode 100644 examples/widgets/orientation/image_c.png delete mode 100644 examples/widgets/orientation/images.qrc delete mode 100644 examples/widgets/orientation/landscape.ui delete mode 100644 examples/widgets/orientation/main.cpp delete mode 100644 examples/widgets/orientation/mainwindow.cpp delete mode 100644 examples/widgets/orientation/mainwindow.h delete mode 100644 examples/widgets/orientation/orientation.desktop delete mode 100644 examples/widgets/orientation/orientation.pro delete mode 100644 examples/widgets/orientation/portrait.ui create mode 100644 examples/widgets/painting/README create mode 100644 examples/widgets/painting/affine/affine.pro create mode 100644 examples/widgets/painting/affine/affine.qrc create mode 100644 examples/widgets/painting/affine/bg1.jpg create mode 100644 examples/widgets/painting/affine/main.cpp create mode 100644 examples/widgets/painting/affine/xform.cpp create mode 100644 examples/widgets/painting/affine/xform.h create mode 100644 examples/widgets/painting/affine/xform.html create mode 100644 examples/widgets/painting/basicdrawing/basicdrawing.desktop create mode 100644 examples/widgets/painting/basicdrawing/basicdrawing.pro create mode 100644 examples/widgets/painting/basicdrawing/basicdrawing.qrc create mode 100644 examples/widgets/painting/basicdrawing/images/brick.png create mode 100644 examples/widgets/painting/basicdrawing/images/qt-logo.png create mode 100644 examples/widgets/painting/basicdrawing/main.cpp create mode 100644 examples/widgets/painting/basicdrawing/renderarea.cpp create mode 100644 examples/widgets/painting/basicdrawing/renderarea.h create mode 100644 examples/widgets/painting/basicdrawing/window.cpp create mode 100644 examples/widgets/painting/basicdrawing/window.h create mode 100644 examples/widgets/painting/composition/composition.cpp create mode 100644 examples/widgets/painting/composition/composition.h create mode 100644 examples/widgets/painting/composition/composition.html create mode 100644 examples/widgets/painting/composition/composition.pro create mode 100644 examples/widgets/painting/composition/composition.qrc create mode 100644 examples/widgets/painting/composition/flower.jpg create mode 100644 examples/widgets/painting/composition/flower_alpha.jpg create mode 100644 examples/widgets/painting/composition/main.cpp create mode 100644 examples/widgets/painting/concentriccircles/circlewidget.cpp create mode 100644 examples/widgets/painting/concentriccircles/circlewidget.h create mode 100644 examples/widgets/painting/concentriccircles/concentriccircles.desktop create mode 100644 examples/widgets/painting/concentriccircles/concentriccircles.pro create mode 100644 examples/widgets/painting/concentriccircles/main.cpp create mode 100644 examples/widgets/painting/concentriccircles/window.cpp create mode 100644 examples/widgets/painting/concentriccircles/window.h create mode 100644 examples/widgets/painting/deform/deform.pro create mode 100644 examples/widgets/painting/deform/deform.qrc create mode 100644 examples/widgets/painting/deform/main.cpp create mode 100644 examples/widgets/painting/deform/pathdeform.cpp create mode 100644 examples/widgets/painting/deform/pathdeform.h create mode 100644 examples/widgets/painting/deform/pathdeform.html create mode 100644 examples/widgets/painting/fontsampler/fontsampler.desktop create mode 100644 examples/widgets/painting/fontsampler/fontsampler.pro create mode 100644 examples/widgets/painting/fontsampler/main.cpp create mode 100644 examples/widgets/painting/fontsampler/mainwindow.cpp create mode 100644 examples/widgets/painting/fontsampler/mainwindow.h create mode 100644 examples/widgets/painting/fontsampler/mainwindowbase.ui create mode 100644 examples/widgets/painting/gradients/gradients.cpp create mode 100644 examples/widgets/painting/gradients/gradients.h create mode 100644 examples/widgets/painting/gradients/gradients.html create mode 100644 examples/widgets/painting/gradients/gradients.pro create mode 100644 examples/widgets/painting/gradients/gradients.qrc create mode 100644 examples/widgets/painting/gradients/main.cpp create mode 100644 examples/widgets/painting/imagecomposition/imagecomposer.cpp create mode 100644 examples/widgets/painting/imagecomposition/imagecomposer.h create mode 100644 examples/widgets/painting/imagecomposition/imagecomposition.desktop create mode 100644 examples/widgets/painting/imagecomposition/imagecomposition.pro create mode 100644 examples/widgets/painting/imagecomposition/imagecomposition.qrc create mode 100644 examples/widgets/painting/imagecomposition/images/background.png create mode 100644 examples/widgets/painting/imagecomposition/images/blackrectangle.png create mode 100644 examples/widgets/painting/imagecomposition/images/butterfly.png create mode 100644 examples/widgets/painting/imagecomposition/images/checker.png create mode 100644 examples/widgets/painting/imagecomposition/main.cpp create mode 100644 examples/widgets/painting/painterpaths/main.cpp create mode 100644 examples/widgets/painting/painterpaths/painterpaths.desktop create mode 100644 examples/widgets/painting/painterpaths/painterpaths.pro create mode 100644 examples/widgets/painting/painterpaths/renderarea.cpp create mode 100644 examples/widgets/painting/painterpaths/renderarea.h create mode 100644 examples/widgets/painting/painterpaths/window.cpp create mode 100644 examples/widgets/painting/painterpaths/window.h create mode 100644 examples/widgets/painting/painting.pro create mode 100644 examples/widgets/painting/pathstroke/main.cpp create mode 100644 examples/widgets/painting/pathstroke/pathstroke.cpp create mode 100644 examples/widgets/painting/pathstroke/pathstroke.h create mode 100644 examples/widgets/painting/pathstroke/pathstroke.html create mode 100644 examples/widgets/painting/pathstroke/pathstroke.pro create mode 100644 examples/widgets/painting/pathstroke/pathstroke.qrc create mode 100644 examples/widgets/painting/shared/arthurstyle.cpp create mode 100644 examples/widgets/painting/shared/arthurstyle.h create mode 100644 examples/widgets/painting/shared/arthurwidgets.cpp create mode 100644 examples/widgets/painting/shared/arthurwidgets.h create mode 100644 examples/widgets/painting/shared/hoverpoints.cpp create mode 100644 examples/widgets/painting/shared/hoverpoints.h create mode 100644 examples/widgets/painting/shared/images/bg_pattern.png create mode 100644 examples/widgets/painting/shared/images/button_normal_cap_left.png create mode 100644 examples/widgets/painting/shared/images/button_normal_cap_right.png create mode 100644 examples/widgets/painting/shared/images/button_normal_stretch.png create mode 100644 examples/widgets/painting/shared/images/button_pressed_cap_left.png create mode 100644 examples/widgets/painting/shared/images/button_pressed_cap_right.png create mode 100644 examples/widgets/painting/shared/images/button_pressed_stretch.png create mode 100644 examples/widgets/painting/shared/images/curve_thing_edit-6.png create mode 100644 examples/widgets/painting/shared/images/frame_bottom.png create mode 100644 examples/widgets/painting/shared/images/frame_bottomleft.png create mode 100644 examples/widgets/painting/shared/images/frame_bottomright.png create mode 100644 examples/widgets/painting/shared/images/frame_left.png create mode 100644 examples/widgets/painting/shared/images/frame_right.png create mode 100644 examples/widgets/painting/shared/images/frame_top.png create mode 100644 examples/widgets/painting/shared/images/frame_topleft.png create mode 100644 examples/widgets/painting/shared/images/frame_topright.png create mode 100644 examples/widgets/painting/shared/images/groupframe_bottom_left.png create mode 100644 examples/widgets/painting/shared/images/groupframe_bottom_right.png create mode 100644 examples/widgets/painting/shared/images/groupframe_bottom_stretch.png create mode 100644 examples/widgets/painting/shared/images/groupframe_left_stretch.png create mode 100644 examples/widgets/painting/shared/images/groupframe_right_stretch.png create mode 100644 examples/widgets/painting/shared/images/groupframe_top_stretch.png create mode 100644 examples/widgets/painting/shared/images/groupframe_topleft.png create mode 100644 examples/widgets/painting/shared/images/groupframe_topright.png create mode 100644 examples/widgets/painting/shared/images/line_dash_dot.png create mode 100644 examples/widgets/painting/shared/images/line_dash_dot_dot.png create mode 100644 examples/widgets/painting/shared/images/line_dashed.png create mode 100644 examples/widgets/painting/shared/images/line_dotted.png create mode 100644 examples/widgets/painting/shared/images/line_solid.png create mode 100644 examples/widgets/painting/shared/images/radiobutton-off.png create mode 100644 examples/widgets/painting/shared/images/radiobutton-on.png create mode 100644 examples/widgets/painting/shared/images/radiobutton_off.png create mode 100644 examples/widgets/painting/shared/images/radiobutton_on.png create mode 100644 examples/widgets/painting/shared/images/slider_bar.png create mode 100644 examples/widgets/painting/shared/images/slider_thumb_off.png create mode 100644 examples/widgets/painting/shared/images/slider_thumb_on.png create mode 100644 examples/widgets/painting/shared/images/title_cap_left.png create mode 100644 examples/widgets/painting/shared/images/title_cap_right.png create mode 100644 examples/widgets/painting/shared/images/title_stretch.png create mode 100644 examples/widgets/painting/shared/shared.pri create mode 100644 examples/widgets/painting/shared/shared.pro create mode 100644 examples/widgets/painting/shared/shared.qrc create mode 100644 examples/widgets/painting/svggenerator/svggenerator.desktop create mode 100644 examples/widgets/painting/svgviewer/svgviewer.desktop create mode 100644 examples/widgets/painting/transformations/main.cpp create mode 100644 examples/widgets/painting/transformations/renderarea.cpp create mode 100644 examples/widgets/painting/transformations/renderarea.h create mode 100644 examples/widgets/painting/transformations/transformations.desktop create mode 100644 examples/widgets/painting/transformations/transformations.pro create mode 100644 examples/widgets/painting/transformations/window.cpp create mode 100644 examples/widgets/painting/transformations/window.h create mode 100644 examples/widgets/richtext/README create mode 100644 examples/widgets/richtext/calendar/calendar.desktop create mode 100644 examples/widgets/richtext/calendar/calendar.pro create mode 100644 examples/widgets/richtext/calendar/main.cpp create mode 100644 examples/widgets/richtext/calendar/mainwindow.cpp create mode 100644 examples/widgets/richtext/calendar/mainwindow.h create mode 100644 examples/widgets/richtext/orderform/detailsdialog.cpp create mode 100644 examples/widgets/richtext/orderform/detailsdialog.h create mode 100644 examples/widgets/richtext/orderform/main.cpp create mode 100644 examples/widgets/richtext/orderform/mainwindow.cpp create mode 100644 examples/widgets/richtext/orderform/mainwindow.h create mode 100644 examples/widgets/richtext/orderform/orderform.desktop create mode 100644 examples/widgets/richtext/orderform/orderform.pro create mode 100644 examples/widgets/richtext/richtext.pro create mode 100644 examples/widgets/richtext/syntaxhighlighter/highlighter.cpp create mode 100644 examples/widgets/richtext/syntaxhighlighter/highlighter.h create mode 100644 examples/widgets/richtext/syntaxhighlighter/main.cpp create mode 100644 examples/widgets/richtext/syntaxhighlighter/mainwindow.cpp create mode 100644 examples/widgets/richtext/syntaxhighlighter/mainwindow.h create mode 100644 examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.desktop create mode 100644 examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pro create mode 100644 examples/widgets/richtext/textedit/example.html create mode 100644 examples/widgets/richtext/textedit/images/logo32.png create mode 100644 examples/widgets/richtext/textedit/images/mac/editcopy.png create mode 100644 examples/widgets/richtext/textedit/images/mac/editcut.png create mode 100644 examples/widgets/richtext/textedit/images/mac/editpaste.png create mode 100644 examples/widgets/richtext/textedit/images/mac/editredo.png create mode 100644 examples/widgets/richtext/textedit/images/mac/editundo.png create mode 100644 examples/widgets/richtext/textedit/images/mac/exportpdf.png create mode 100644 examples/widgets/richtext/textedit/images/mac/filenew.png create mode 100644 examples/widgets/richtext/textedit/images/mac/fileopen.png create mode 100644 examples/widgets/richtext/textedit/images/mac/fileprint.png create mode 100644 examples/widgets/richtext/textedit/images/mac/filesave.png create mode 100644 examples/widgets/richtext/textedit/images/mac/textbold.png create mode 100644 examples/widgets/richtext/textedit/images/mac/textcenter.png create mode 100644 examples/widgets/richtext/textedit/images/mac/textitalic.png create mode 100644 examples/widgets/richtext/textedit/images/mac/textjustify.png create mode 100644 examples/widgets/richtext/textedit/images/mac/textleft.png create mode 100644 examples/widgets/richtext/textedit/images/mac/textright.png create mode 100644 examples/widgets/richtext/textedit/images/mac/textunder.png create mode 100644 examples/widgets/richtext/textedit/images/mac/zoomin.png create mode 100644 examples/widgets/richtext/textedit/images/mac/zoomout.png create mode 100644 examples/widgets/richtext/textedit/images/win/editcopy.png create mode 100644 examples/widgets/richtext/textedit/images/win/editcut.png create mode 100644 examples/widgets/richtext/textedit/images/win/editpaste.png create mode 100644 examples/widgets/richtext/textedit/images/win/editredo.png create mode 100644 examples/widgets/richtext/textedit/images/win/editundo.png create mode 100644 examples/widgets/richtext/textedit/images/win/exportpdf.png create mode 100644 examples/widgets/richtext/textedit/images/win/filenew.png create mode 100644 examples/widgets/richtext/textedit/images/win/fileopen.png create mode 100644 examples/widgets/richtext/textedit/images/win/fileprint.png create mode 100644 examples/widgets/richtext/textedit/images/win/filesave.png create mode 100644 examples/widgets/richtext/textedit/images/win/textbold.png create mode 100644 examples/widgets/richtext/textedit/images/win/textcenter.png create mode 100644 examples/widgets/richtext/textedit/images/win/textitalic.png create mode 100644 examples/widgets/richtext/textedit/images/win/textjustify.png create mode 100644 examples/widgets/richtext/textedit/images/win/textleft.png create mode 100644 examples/widgets/richtext/textedit/images/win/textright.png create mode 100644 examples/widgets/richtext/textedit/images/win/textunder.png create mode 100644 examples/widgets/richtext/textedit/images/win/zoomin.png create mode 100644 examples/widgets/richtext/textedit/images/win/zoomout.png create mode 100644 examples/widgets/richtext/textedit/main.cpp create mode 100644 examples/widgets/richtext/textedit/textedit.cpp create mode 100644 examples/widgets/richtext/textedit/textedit.h create mode 100644 examples/widgets/richtext/textedit/textedit.pro create mode 100644 examples/widgets/richtext/textedit/textedit.qdoc create mode 100644 examples/widgets/richtext/textedit/textedit.qrc delete mode 100644 examples/widgets/scribble/main.cpp delete mode 100644 examples/widgets/scribble/mainwindow.cpp delete mode 100644 examples/widgets/scribble/mainwindow.h delete mode 100644 examples/widgets/scribble/scribble.desktop delete mode 100644 examples/widgets/scribble/scribble.pro delete mode 100644 examples/widgets/scribble/scribblearea.cpp delete mode 100644 examples/widgets/scribble/scribblearea.h create mode 100644 examples/widgets/scroller/graphicsview/graphicsview.pro create mode 100644 examples/widgets/scroller/graphicsview/main.cpp create mode 100644 examples/widgets/scroller/scroller.pro delete mode 100644 examples/widgets/shapedclock/main.cpp delete mode 100644 examples/widgets/shapedclock/shapedclock.cpp delete mode 100644 examples/widgets/shapedclock/shapedclock.desktop delete mode 100644 examples/widgets/shapedclock/shapedclock.h delete mode 100644 examples/widgets/shapedclock/shapedclock.pro delete mode 100644 examples/widgets/sliders/main.cpp delete mode 100644 examples/widgets/sliders/sliders.desktop delete mode 100644 examples/widgets/sliders/sliders.pro delete mode 100644 examples/widgets/sliders/slidersgroup.cpp delete mode 100644 examples/widgets/sliders/slidersgroup.h delete mode 100644 examples/widgets/sliders/window.cpp delete mode 100644 examples/widgets/sliders/window.h delete mode 100644 examples/widgets/softkeys/main.cpp delete mode 100644 examples/widgets/softkeys/softkeys.cpp delete mode 100644 examples/widgets/softkeys/softkeys.desktop delete mode 100644 examples/widgets/softkeys/softkeys.h delete mode 100644 examples/widgets/softkeys/softkeys.pro delete mode 100644 examples/widgets/spinboxes/main.cpp delete mode 100644 examples/widgets/spinboxes/spinboxes.desktop delete mode 100644 examples/widgets/spinboxes/spinboxes.pro delete mode 100644 examples/widgets/spinboxes/window.cpp delete mode 100644 examples/widgets/spinboxes/window.h create mode 100644 examples/widgets/statemachine/README create mode 100644 examples/widgets/statemachine/eventtransitions/eventtransitions.desktop create mode 100644 examples/widgets/statemachine/eventtransitions/eventtransitions.pro create mode 100644 examples/widgets/statemachine/eventtransitions/main.cpp create mode 100644 examples/widgets/statemachine/factorial/factorial.desktop create mode 100644 examples/widgets/statemachine/factorial/factorial.pro create mode 100644 examples/widgets/statemachine/factorial/main.cpp create mode 100644 examples/widgets/statemachine/pingpong/main.cpp create mode 100644 examples/widgets/statemachine/pingpong/pingpong.desktop create mode 100644 examples/widgets/statemachine/pingpong/pingpong.pro create mode 100644 examples/widgets/statemachine/rogue/main.cpp create mode 100644 examples/widgets/statemachine/rogue/movementtransition.h create mode 100644 examples/widgets/statemachine/rogue/rogue.desktop create mode 100644 examples/widgets/statemachine/rogue/rogue.pro create mode 100644 examples/widgets/statemachine/rogue/window.cpp create mode 100644 examples/widgets/statemachine/rogue/window.h create mode 100644 examples/widgets/statemachine/statemachine.pro create mode 100644 examples/widgets/statemachine/trafficlight/main.cpp create mode 100644 examples/widgets/statemachine/trafficlight/trafficlight.desktop create mode 100644 examples/widgets/statemachine/trafficlight/trafficlight.pro create mode 100644 examples/widgets/statemachine/twowaybutton/main.cpp create mode 100644 examples/widgets/statemachine/twowaybutton/twowaybutton.desktop create mode 100644 examples/widgets/statemachine/twowaybutton/twowaybutton.pro delete mode 100644 examples/widgets/styles/images/woodbackground.png delete mode 100644 examples/widgets/styles/images/woodbutton.png delete mode 100644 examples/widgets/styles/main.cpp delete mode 100644 examples/widgets/styles/norwegianwoodstyle.cpp delete mode 100644 examples/widgets/styles/norwegianwoodstyle.h delete mode 100644 examples/widgets/styles/styles.desktop delete mode 100644 examples/widgets/styles/styles.pro delete mode 100644 examples/widgets/styles/styles.qrc delete mode 100644 examples/widgets/styles/widgetgallery.cpp delete mode 100644 examples/widgets/styles/widgetgallery.h delete mode 100644 examples/widgets/stylesheet/images/checkbox_checked.png delete mode 100644 examples/widgets/stylesheet/images/checkbox_checked_hover.png delete mode 100644 examples/widgets/stylesheet/images/checkbox_checked_pressed.png delete mode 100644 examples/widgets/stylesheet/images/checkbox_unchecked.png delete mode 100644 examples/widgets/stylesheet/images/checkbox_unchecked_hover.png delete mode 100644 examples/widgets/stylesheet/images/checkbox_unchecked_pressed.png delete mode 100644 examples/widgets/stylesheet/images/down_arrow.png delete mode 100644 examples/widgets/stylesheet/images/down_arrow_disabled.png delete mode 100644 examples/widgets/stylesheet/images/frame.png delete mode 100644 examples/widgets/stylesheet/images/pagefold.png delete mode 100644 examples/widgets/stylesheet/images/pushbutton.png delete mode 100644 examples/widgets/stylesheet/images/pushbutton_hover.png delete mode 100644 examples/widgets/stylesheet/images/pushbutton_pressed.png delete mode 100644 examples/widgets/stylesheet/images/radiobutton_checked.png delete mode 100644 examples/widgets/stylesheet/images/radiobutton_checked_hover.png delete mode 100644 examples/widgets/stylesheet/images/radiobutton_checked_pressed.png delete mode 100644 examples/widgets/stylesheet/images/radiobutton_unchecked.png delete mode 100644 examples/widgets/stylesheet/images/radiobutton_unchecked_hover.png delete mode 100644 examples/widgets/stylesheet/images/radiobutton_unchecked_pressed.png delete mode 100644 examples/widgets/stylesheet/images/sizegrip.png delete mode 100644 examples/widgets/stylesheet/images/spindown.png delete mode 100644 examples/widgets/stylesheet/images/spindown_hover.png delete mode 100644 examples/widgets/stylesheet/images/spindown_off.png delete mode 100644 examples/widgets/stylesheet/images/spindown_pressed.png delete mode 100644 examples/widgets/stylesheet/images/spinup.png delete mode 100644 examples/widgets/stylesheet/images/spinup_hover.png delete mode 100644 examples/widgets/stylesheet/images/spinup_off.png delete mode 100644 examples/widgets/stylesheet/images/spinup_pressed.png delete mode 100644 examples/widgets/stylesheet/images/up_arrow.png delete mode 100644 examples/widgets/stylesheet/images/up_arrow_disabled.png delete mode 100644 examples/widgets/stylesheet/layouts/default.ui delete mode 100644 examples/widgets/stylesheet/layouts/pagefold.ui delete mode 100644 examples/widgets/stylesheet/main.cpp delete mode 100644 examples/widgets/stylesheet/mainwindow.cpp delete mode 100644 examples/widgets/stylesheet/mainwindow.h delete mode 100644 examples/widgets/stylesheet/mainwindow.ui delete mode 100644 examples/widgets/stylesheet/qss/coffee.qss delete mode 100644 examples/widgets/stylesheet/qss/default.qss delete mode 100644 examples/widgets/stylesheet/qss/pagefold.qss delete mode 100644 examples/widgets/stylesheet/stylesheet.desktop delete mode 100644 examples/widgets/stylesheet/stylesheet.pro delete mode 100644 examples/widgets/stylesheet/stylesheet.qrc delete mode 100644 examples/widgets/stylesheet/stylesheeteditor.cpp delete mode 100644 examples/widgets/stylesheet/stylesheeteditor.h delete mode 100644 examples/widgets/stylesheet/stylesheeteditor.ui delete mode 100644 examples/widgets/tablet/main.cpp delete mode 100644 examples/widgets/tablet/mainwindow.cpp delete mode 100644 examples/widgets/tablet/mainwindow.h delete mode 100644 examples/widgets/tablet/tablet.desktop delete mode 100644 examples/widgets/tablet/tablet.pro delete mode 100644 examples/widgets/tablet/tabletapplication.cpp delete mode 100644 examples/widgets/tablet/tabletapplication.h delete mode 100644 examples/widgets/tablet/tabletcanvas.cpp delete mode 100644 examples/widgets/tablet/tabletcanvas.h delete mode 100644 examples/widgets/tetrix/main.cpp delete mode 100644 examples/widgets/tetrix/tetrix.desktop delete mode 100644 examples/widgets/tetrix/tetrix.pro delete mode 100644 examples/widgets/tetrix/tetrixboard.cpp delete mode 100644 examples/widgets/tetrix/tetrixboard.h delete mode 100644 examples/widgets/tetrix/tetrixpiece.cpp delete mode 100644 examples/widgets/tetrix/tetrixpiece.h delete mode 100644 examples/widgets/tetrix/tetrixwindow.cpp delete mode 100644 examples/widgets/tetrix/tetrixwindow.h delete mode 100644 examples/widgets/tooltips/images/circle.png delete mode 100644 examples/widgets/tooltips/images/square.png delete mode 100644 examples/widgets/tooltips/images/triangle.png delete mode 100644 examples/widgets/tooltips/main.cpp delete mode 100644 examples/widgets/tooltips/shapeitem.cpp delete mode 100644 examples/widgets/tooltips/shapeitem.h delete mode 100644 examples/widgets/tooltips/sortingbox.cpp delete mode 100644 examples/widgets/tooltips/sortingbox.h delete mode 100644 examples/widgets/tooltips/tooltips.desktop delete mode 100644 examples/widgets/tooltips/tooltips.pro delete mode 100644 examples/widgets/tooltips/tooltips.qrc delete mode 100644 examples/widgets/validators/ledoff.png delete mode 100644 examples/widgets/validators/ledon.png delete mode 100644 examples/widgets/validators/ledwidget.cpp delete mode 100644 examples/widgets/validators/ledwidget.h delete mode 100644 examples/widgets/validators/localeselector.cpp delete mode 100644 examples/widgets/validators/localeselector.h delete mode 100644 examples/widgets/validators/main.cpp delete mode 100644 examples/widgets/validators/validators.desktop delete mode 100644 examples/widgets/validators/validators.pro delete mode 100644 examples/widgets/validators/validators.qrc delete mode 100644 examples/widgets/validators/validators.ui create mode 100644 examples/widgets/widgets/README create mode 100644 examples/widgets/widgets/analogclock/analogclock.cpp create mode 100644 examples/widgets/widgets/analogclock/analogclock.desktop create mode 100644 examples/widgets/widgets/analogclock/analogclock.h create mode 100644 examples/widgets/widgets/analogclock/analogclock.pro create mode 100644 examples/widgets/widgets/analogclock/main.cpp create mode 100644 examples/widgets/widgets/applicationicon/applicationicon.desktop create mode 100644 examples/widgets/widgets/applicationicon/applicationicon.png create mode 100644 examples/widgets/widgets/applicationicon/applicationicon.pro create mode 100644 examples/widgets/widgets/applicationicon/applicationicon.svg create mode 100644 examples/widgets/widgets/applicationicon/main.cpp create mode 100644 examples/widgets/widgets/calculator/button.cpp create mode 100644 examples/widgets/widgets/calculator/button.h create mode 100644 examples/widgets/widgets/calculator/calculator.cpp create mode 100644 examples/widgets/widgets/calculator/calculator.desktop create mode 100644 examples/widgets/widgets/calculator/calculator.h create mode 100644 examples/widgets/widgets/calculator/calculator.pro create mode 100644 examples/widgets/widgets/calculator/main.cpp create mode 100644 examples/widgets/widgets/calculator/releasenotes.txt create mode 100644 examples/widgets/widgets/calendarwidget/calendarwidget.desktop create mode 100644 examples/widgets/widgets/calendarwidget/calendarwidget.pro create mode 100644 examples/widgets/widgets/calendarwidget/main.cpp create mode 100644 examples/widgets/widgets/calendarwidget/window.cpp create mode 100644 examples/widgets/widgets/calendarwidget/window.h create mode 100644 examples/widgets/widgets/charactermap/charactermap.desktop create mode 100644 examples/widgets/widgets/charactermap/charactermap.pro create mode 100644 examples/widgets/widgets/charactermap/characterwidget.cpp create mode 100644 examples/widgets/widgets/charactermap/characterwidget.h create mode 100644 examples/widgets/widgets/charactermap/main.cpp create mode 100644 examples/widgets/widgets/charactermap/mainwindow.cpp create mode 100644 examples/widgets/widgets/charactermap/mainwindow.h create mode 100644 examples/widgets/widgets/codeeditor/codeeditor.cpp create mode 100644 examples/widgets/widgets/codeeditor/codeeditor.desktop create mode 100644 examples/widgets/widgets/codeeditor/codeeditor.h create mode 100644 examples/widgets/widgets/codeeditor/codeeditor.pro create mode 100644 examples/widgets/widgets/codeeditor/main.cpp create mode 100644 examples/widgets/widgets/digitalclock/digitalclock.cpp create mode 100644 examples/widgets/widgets/digitalclock/digitalclock.desktop create mode 100644 examples/widgets/widgets/digitalclock/digitalclock.h create mode 100644 examples/widgets/widgets/digitalclock/digitalclock.pro create mode 100644 examples/widgets/widgets/digitalclock/main.cpp create mode 100644 examples/widgets/widgets/elidedlabel/elidedlabel.cpp create mode 100644 examples/widgets/widgets/elidedlabel/elidedlabel.desktop create mode 100644 examples/widgets/widgets/elidedlabel/elidedlabel.h create mode 100644 examples/widgets/widgets/elidedlabel/elidedlabel.pro create mode 100644 examples/widgets/widgets/elidedlabel/main.cpp create mode 100644 examples/widgets/widgets/elidedlabel/testwidget.cpp create mode 100644 examples/widgets/widgets/elidedlabel/testwidget.h create mode 100644 examples/widgets/widgets/groupbox/groupbox.desktop create mode 100644 examples/widgets/widgets/groupbox/groupbox.pro create mode 100644 examples/widgets/widgets/groupbox/main.cpp create mode 100644 examples/widgets/widgets/groupbox/window.cpp create mode 100644 examples/widgets/widgets/groupbox/window.h create mode 100644 examples/widgets/widgets/icons/iconpreviewarea.cpp create mode 100644 examples/widgets/widgets/icons/iconpreviewarea.h create mode 100644 examples/widgets/widgets/icons/icons.desktop create mode 100644 examples/widgets/widgets/icons/icons.pro create mode 100644 examples/widgets/widgets/icons/iconsizespinbox.cpp create mode 100644 examples/widgets/widgets/icons/iconsizespinbox.h create mode 100644 examples/widgets/widgets/icons/imagedelegate.cpp create mode 100644 examples/widgets/widgets/icons/imagedelegate.h create mode 100644 examples/widgets/widgets/icons/images/designer.png create mode 100644 examples/widgets/widgets/icons/images/find_disabled.png create mode 100644 examples/widgets/widgets/icons/images/find_normal.png create mode 100644 examples/widgets/widgets/icons/images/monkey_off_128x128.png create mode 100644 examples/widgets/widgets/icons/images/monkey_off_16x16.png create mode 100644 examples/widgets/widgets/icons/images/monkey_off_32x32.png create mode 100644 examples/widgets/widgets/icons/images/monkey_off_64x64.png create mode 100644 examples/widgets/widgets/icons/images/monkey_on_128x128.png create mode 100644 examples/widgets/widgets/icons/images/monkey_on_16x16.png create mode 100644 examples/widgets/widgets/icons/images/monkey_on_32x32.png create mode 100644 examples/widgets/widgets/icons/images/monkey_on_64x64.png create mode 100644 examples/widgets/widgets/icons/images/qt_extended_16x16.png create mode 100644 examples/widgets/widgets/icons/images/qt_extended_32x32.png create mode 100644 examples/widgets/widgets/icons/images/qt_extended_48x48.png create mode 100644 examples/widgets/widgets/icons/main.cpp create mode 100644 examples/widgets/widgets/icons/mainwindow.cpp create mode 100644 examples/widgets/widgets/icons/mainwindow.h create mode 100644 examples/widgets/widgets/imageviewer/imageviewer.cpp create mode 100644 examples/widgets/widgets/imageviewer/imageviewer.desktop create mode 100644 examples/widgets/widgets/imageviewer/imageviewer.h create mode 100644 examples/widgets/widgets/imageviewer/imageviewer.pro create mode 100644 examples/widgets/widgets/imageviewer/main.cpp create mode 100644 examples/widgets/widgets/lineedits/lineedits.desktop create mode 100644 examples/widgets/widgets/lineedits/lineedits.pro create mode 100644 examples/widgets/widgets/lineedits/main.cpp create mode 100644 examples/widgets/widgets/lineedits/window.cpp create mode 100644 examples/widgets/widgets/lineedits/window.h create mode 100644 examples/widgets/widgets/mousebuttons/buttontester.cpp create mode 100644 examples/widgets/widgets/mousebuttons/buttontester.h create mode 100644 examples/widgets/widgets/mousebuttons/main.cpp create mode 100644 examples/widgets/widgets/mousebuttons/mousebuttons.pro create mode 100644 examples/widgets/widgets/movie/animation.gif create mode 100644 examples/widgets/widgets/movie/main.cpp create mode 100644 examples/widgets/widgets/movie/movie.desktop create mode 100644 examples/widgets/widgets/movie/movie.pro create mode 100644 examples/widgets/widgets/movie/movieplayer.cpp create mode 100644 examples/widgets/widgets/movie/movieplayer.h create mode 100644 examples/widgets/widgets/orientation/image_a.png create mode 100644 examples/widgets/widgets/orientation/image_b.png create mode 100644 examples/widgets/widgets/orientation/image_c.png create mode 100644 examples/widgets/widgets/orientation/images.qrc create mode 100644 examples/widgets/widgets/orientation/landscape.ui create mode 100644 examples/widgets/widgets/orientation/main.cpp create mode 100644 examples/widgets/widgets/orientation/mainwindow.cpp create mode 100644 examples/widgets/widgets/orientation/mainwindow.h create mode 100644 examples/widgets/widgets/orientation/orientation.desktop create mode 100644 examples/widgets/widgets/orientation/orientation.pro create mode 100644 examples/widgets/widgets/orientation/portrait.ui create mode 100644 examples/widgets/widgets/scribble/main.cpp create mode 100644 examples/widgets/widgets/scribble/mainwindow.cpp create mode 100644 examples/widgets/widgets/scribble/mainwindow.h create mode 100644 examples/widgets/widgets/scribble/scribble.desktop create mode 100644 examples/widgets/widgets/scribble/scribble.pro create mode 100644 examples/widgets/widgets/scribble/scribblearea.cpp create mode 100644 examples/widgets/widgets/scribble/scribblearea.h create mode 100644 examples/widgets/widgets/shapedclock/main.cpp create mode 100644 examples/widgets/widgets/shapedclock/shapedclock.cpp create mode 100644 examples/widgets/widgets/shapedclock/shapedclock.desktop create mode 100644 examples/widgets/widgets/shapedclock/shapedclock.h create mode 100644 examples/widgets/widgets/shapedclock/shapedclock.pro create mode 100644 examples/widgets/widgets/sliders/main.cpp create mode 100644 examples/widgets/widgets/sliders/sliders.desktop create mode 100644 examples/widgets/widgets/sliders/sliders.pro create mode 100644 examples/widgets/widgets/sliders/slidersgroup.cpp create mode 100644 examples/widgets/widgets/sliders/slidersgroup.h create mode 100644 examples/widgets/widgets/sliders/window.cpp create mode 100644 examples/widgets/widgets/sliders/window.h create mode 100644 examples/widgets/widgets/softkeys/main.cpp create mode 100644 examples/widgets/widgets/softkeys/softkeys.cpp create mode 100644 examples/widgets/widgets/softkeys/softkeys.desktop create mode 100644 examples/widgets/widgets/softkeys/softkeys.h create mode 100644 examples/widgets/widgets/softkeys/softkeys.pro create mode 100644 examples/widgets/widgets/spinboxes/main.cpp create mode 100644 examples/widgets/widgets/spinboxes/spinboxes.desktop create mode 100644 examples/widgets/widgets/spinboxes/spinboxes.pro create mode 100644 examples/widgets/widgets/spinboxes/window.cpp create mode 100644 examples/widgets/widgets/spinboxes/window.h create mode 100644 examples/widgets/widgets/styles/images/woodbackground.png create mode 100644 examples/widgets/widgets/styles/images/woodbutton.png create mode 100644 examples/widgets/widgets/styles/main.cpp create mode 100644 examples/widgets/widgets/styles/norwegianwoodstyle.cpp create mode 100644 examples/widgets/widgets/styles/norwegianwoodstyle.h create mode 100644 examples/widgets/widgets/styles/styles.desktop create mode 100644 examples/widgets/widgets/styles/styles.pro create mode 100644 examples/widgets/widgets/styles/styles.qrc create mode 100644 examples/widgets/widgets/styles/widgetgallery.cpp create mode 100644 examples/widgets/widgets/styles/widgetgallery.h create mode 100644 examples/widgets/widgets/stylesheet/images/checkbox_checked.png create mode 100644 examples/widgets/widgets/stylesheet/images/checkbox_checked_hover.png create mode 100644 examples/widgets/widgets/stylesheet/images/checkbox_checked_pressed.png create mode 100644 examples/widgets/widgets/stylesheet/images/checkbox_unchecked.png create mode 100644 examples/widgets/widgets/stylesheet/images/checkbox_unchecked_hover.png create mode 100644 examples/widgets/widgets/stylesheet/images/checkbox_unchecked_pressed.png create mode 100644 examples/widgets/widgets/stylesheet/images/down_arrow.png create mode 100644 examples/widgets/widgets/stylesheet/images/down_arrow_disabled.png create mode 100644 examples/widgets/widgets/stylesheet/images/frame.png create mode 100644 examples/widgets/widgets/stylesheet/images/pagefold.png create mode 100644 examples/widgets/widgets/stylesheet/images/pushbutton.png create mode 100644 examples/widgets/widgets/stylesheet/images/pushbutton_hover.png create mode 100644 examples/widgets/widgets/stylesheet/images/pushbutton_pressed.png create mode 100644 examples/widgets/widgets/stylesheet/images/radiobutton_checked.png create mode 100644 examples/widgets/widgets/stylesheet/images/radiobutton_checked_hover.png create mode 100644 examples/widgets/widgets/stylesheet/images/radiobutton_checked_pressed.png create mode 100644 examples/widgets/widgets/stylesheet/images/radiobutton_unchecked.png create mode 100644 examples/widgets/widgets/stylesheet/images/radiobutton_unchecked_hover.png create mode 100644 examples/widgets/widgets/stylesheet/images/radiobutton_unchecked_pressed.png create mode 100644 examples/widgets/widgets/stylesheet/images/sizegrip.png create mode 100644 examples/widgets/widgets/stylesheet/images/spindown.png create mode 100644 examples/widgets/widgets/stylesheet/images/spindown_hover.png create mode 100644 examples/widgets/widgets/stylesheet/images/spindown_off.png create mode 100644 examples/widgets/widgets/stylesheet/images/spindown_pressed.png create mode 100644 examples/widgets/widgets/stylesheet/images/spinup.png create mode 100644 examples/widgets/widgets/stylesheet/images/spinup_hover.png create mode 100644 examples/widgets/widgets/stylesheet/images/spinup_off.png create mode 100644 examples/widgets/widgets/stylesheet/images/spinup_pressed.png create mode 100644 examples/widgets/widgets/stylesheet/images/up_arrow.png create mode 100644 examples/widgets/widgets/stylesheet/images/up_arrow_disabled.png create mode 100644 examples/widgets/widgets/stylesheet/layouts/default.ui create mode 100644 examples/widgets/widgets/stylesheet/layouts/pagefold.ui create mode 100644 examples/widgets/widgets/stylesheet/main.cpp create mode 100644 examples/widgets/widgets/stylesheet/mainwindow.cpp create mode 100644 examples/widgets/widgets/stylesheet/mainwindow.h create mode 100644 examples/widgets/widgets/stylesheet/mainwindow.ui create mode 100644 examples/widgets/widgets/stylesheet/qss/coffee.qss create mode 100644 examples/widgets/widgets/stylesheet/qss/default.qss create mode 100644 examples/widgets/widgets/stylesheet/qss/pagefold.qss create mode 100644 examples/widgets/widgets/stylesheet/stylesheet.desktop create mode 100644 examples/widgets/widgets/stylesheet/stylesheet.pro create mode 100644 examples/widgets/widgets/stylesheet/stylesheet.qrc create mode 100644 examples/widgets/widgets/stylesheet/stylesheeteditor.cpp create mode 100644 examples/widgets/widgets/stylesheet/stylesheeteditor.h create mode 100644 examples/widgets/widgets/stylesheet/stylesheeteditor.ui create mode 100644 examples/widgets/widgets/tablet/main.cpp create mode 100644 examples/widgets/widgets/tablet/mainwindow.cpp create mode 100644 examples/widgets/widgets/tablet/mainwindow.h create mode 100644 examples/widgets/widgets/tablet/tablet.desktop create mode 100644 examples/widgets/widgets/tablet/tablet.pro create mode 100644 examples/widgets/widgets/tablet/tabletapplication.cpp create mode 100644 examples/widgets/widgets/tablet/tabletapplication.h create mode 100644 examples/widgets/widgets/tablet/tabletcanvas.cpp create mode 100644 examples/widgets/widgets/tablet/tabletcanvas.h create mode 100644 examples/widgets/widgets/tetrix/main.cpp create mode 100644 examples/widgets/widgets/tetrix/tetrix.desktop create mode 100644 examples/widgets/widgets/tetrix/tetrix.pro create mode 100644 examples/widgets/widgets/tetrix/tetrixboard.cpp create mode 100644 examples/widgets/widgets/tetrix/tetrixboard.h create mode 100644 examples/widgets/widgets/tetrix/tetrixpiece.cpp create mode 100644 examples/widgets/widgets/tetrix/tetrixpiece.h create mode 100644 examples/widgets/widgets/tetrix/tetrixwindow.cpp create mode 100644 examples/widgets/widgets/tetrix/tetrixwindow.h create mode 100644 examples/widgets/widgets/tooltips/images/circle.png create mode 100644 examples/widgets/widgets/tooltips/images/square.png create mode 100644 examples/widgets/widgets/tooltips/images/triangle.png create mode 100644 examples/widgets/widgets/tooltips/main.cpp create mode 100644 examples/widgets/widgets/tooltips/shapeitem.cpp create mode 100644 examples/widgets/widgets/tooltips/shapeitem.h create mode 100644 examples/widgets/widgets/tooltips/sortingbox.cpp create mode 100644 examples/widgets/widgets/tooltips/sortingbox.h create mode 100644 examples/widgets/widgets/tooltips/tooltips.desktop create mode 100644 examples/widgets/widgets/tooltips/tooltips.pro create mode 100644 examples/widgets/widgets/tooltips/tooltips.qrc create mode 100644 examples/widgets/widgets/validators/ledoff.png create mode 100644 examples/widgets/widgets/validators/ledon.png create mode 100644 examples/widgets/widgets/validators/ledwidget.cpp create mode 100644 examples/widgets/widgets/validators/ledwidget.h create mode 100644 examples/widgets/widgets/validators/localeselector.cpp create mode 100644 examples/widgets/widgets/validators/localeselector.h create mode 100644 examples/widgets/widgets/validators/main.cpp create mode 100644 examples/widgets/widgets/validators/validators.desktop create mode 100644 examples/widgets/widgets/validators/validators.pro create mode 100644 examples/widgets/widgets/validators/validators.qrc create mode 100644 examples/widgets/widgets/validators/validators.ui create mode 100644 examples/widgets/widgets/widgets.pro create mode 100644 examples/widgets/widgets/wiggly/dialog.cpp create mode 100644 examples/widgets/widgets/wiggly/dialog.h create mode 100644 examples/widgets/widgets/wiggly/main.cpp create mode 100644 examples/widgets/widgets/wiggly/wiggly.desktop create mode 100644 examples/widgets/widgets/wiggly/wiggly.pro create mode 100644 examples/widgets/widgets/wiggly/wigglywidget.cpp create mode 100644 examples/widgets/widgets/wiggly/wigglywidget.h create mode 100644 examples/widgets/widgets/windowflags/controllerwindow.cpp create mode 100644 examples/widgets/widgets/windowflags/controllerwindow.h create mode 100644 examples/widgets/widgets/windowflags/main.cpp create mode 100644 examples/widgets/widgets/windowflags/previewwindow.cpp create mode 100644 examples/widgets/widgets/windowflags/previewwindow.h create mode 100644 examples/widgets/widgets/windowflags/windowflags.desktop create mode 100644 examples/widgets/widgets/windowflags/windowflags.pro delete mode 100644 examples/widgets/wiggly/dialog.cpp delete mode 100644 examples/widgets/wiggly/dialog.h delete mode 100644 examples/widgets/wiggly/main.cpp delete mode 100644 examples/widgets/wiggly/wiggly.desktop delete mode 100644 examples/widgets/wiggly/wiggly.pro delete mode 100644 examples/widgets/wiggly/wigglywidget.cpp delete mode 100644 examples/widgets/wiggly/wigglywidget.h delete mode 100644 examples/widgets/windowflags/controllerwindow.cpp delete mode 100644 examples/widgets/windowflags/controllerwindow.h delete mode 100644 examples/widgets/windowflags/main.cpp delete mode 100644 examples/widgets/windowflags/previewwindow.cpp delete mode 100644 examples/widgets/windowflags/previewwindow.h delete mode 100644 examples/widgets/windowflags/windowflags.desktop delete mode 100644 examples/widgets/windowflags/windowflags.pro (limited to 'examples/widgets') diff --git a/examples/widgets/README b/examples/widgets/README deleted file mode 100644 index e862f07b71..0000000000 --- a/examples/widgets/README +++ /dev/null @@ -1,13 +0,0 @@ -Qt comes with a large range of standard widgets that users of modern -applications have come to expect. - -You can also develop your own custom widgets and controls, and use them -alongside standard widgets. - -It is even possible to provide custom styles and themes for widgets that can -be used to change the appearance of standard widgets and appropriately -written custom widgets. - - -Documentation for these examples can be found via the Examples -link in the main Qt documentation. diff --git a/examples/widgets/analogclock/analogclock.cpp b/examples/widgets/analogclock/analogclock.cpp deleted file mode 100644 index 029ca1031a..0000000000 --- a/examples/widgets/analogclock/analogclock.cpp +++ /dev/null @@ -1,145 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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 - -#include "analogclock.h" - -//! [0] //! [1] -AnalogClock::AnalogClock(QWidget *parent) -//! [0] //! [2] - : QWidget(parent) -//! [2] //! [3] -{ -//! [3] //! [4] - QTimer *timer = new QTimer(this); -//! [4] //! [5] - connect(timer, SIGNAL(timeout()), this, SLOT(update())); -//! [5] //! [6] - timer->start(1000); -//! [6] - - setWindowTitle(tr("Analog Clock")); - resize(200, 200); -//! [7] -} -//! [1] //! [7] - -//! [8] //! [9] -void AnalogClock::paintEvent(QPaintEvent *) -//! [8] //! [10] -{ - static const QPoint hourHand[3] = { - QPoint(7, 8), - QPoint(-7, 8), - QPoint(0, -40) - }; - static const QPoint minuteHand[3] = { - QPoint(7, 8), - QPoint(-7, 8), - QPoint(0, -70) - }; - - QColor hourColor(127, 0, 127); - QColor minuteColor(0, 127, 127, 191); - - int side = qMin(width(), height()); - QTime time = QTime::currentTime(); -//! [10] - -//! [11] - QPainter painter(this); -//! [11] //! [12] - painter.setRenderHint(QPainter::Antialiasing); -//! [12] //! [13] - painter.translate(width() / 2, height() / 2); -//! [13] //! [14] - painter.scale(side / 200.0, side / 200.0); -//! [9] //! [14] - -//! [15] - painter.setPen(Qt::NoPen); -//! [15] //! [16] - painter.setBrush(hourColor); -//! [16] - -//! [17] //! [18] - painter.save(); -//! [17] //! [19] - painter.rotate(30.0 * ((time.hour() + time.minute() / 60.0))); - painter.drawConvexPolygon(hourHand, 3); - painter.restore(); -//! [18] //! [19] - -//! [20] - painter.setPen(hourColor); -//! [20] //! [21] - - for (int i = 0; i < 12; ++i) { - painter.drawLine(88, 0, 96, 0); - painter.rotate(30.0); - } -//! [21] - -//! [22] - painter.setPen(Qt::NoPen); -//! [22] //! [23] - painter.setBrush(minuteColor); - -//! [24] - painter.save(); - painter.rotate(6.0 * (time.minute() + time.second() / 60.0)); - painter.drawConvexPolygon(minuteHand, 3); - painter.restore(); -//! [23] //! [24] - -//! [25] - painter.setPen(minuteColor); -//! [25] //! [26] - -//! [27] - for (int j = 0; j < 60; ++j) { - if ((j % 5) != 0) - painter.drawLine(92, 0, 96, 0); - painter.rotate(6.0); - } -//! [27] -} -//! [26] diff --git a/examples/widgets/analogclock/analogclock.desktop b/examples/widgets/analogclock/analogclock.desktop deleted file mode 100644 index b177a62d35..0000000000 --- a/examples/widgets/analogclock/analogclock.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Type=Application -Terminal=false -Name=Analog Clock -Exec=/opt/usr/bin/analogclock -Icon=analogclock -X-Window-Icon= -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable diff --git a/examples/widgets/analogclock/analogclock.h b/examples/widgets/analogclock/analogclock.h deleted file mode 100644 index f95a095712..0000000000 --- a/examples/widgets/analogclock/analogclock.h +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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 ANALOGCLOCK_H -#define ANALOGCLOCK_H - -#include - -//! [0] -class AnalogClock : public QWidget -{ - Q_OBJECT - -public: - AnalogClock(QWidget *parent = 0); - -protected: - void paintEvent(QPaintEvent *event); -}; -//! [0] - -#endif diff --git a/examples/widgets/analogclock/analogclock.pro b/examples/widgets/analogclock/analogclock.pro deleted file mode 100644 index a2641150e2..0000000000 --- a/examples/widgets/analogclock/analogclock.pro +++ /dev/null @@ -1,12 +0,0 @@ -HEADERS = analogclock.h -SOURCES = analogclock.cpp \ - main.cpp - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/widgets/analogclock -sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS analogclock.pro -sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/widgets/analogclock -INSTALLS += target sources - -QT += widgets - diff --git a/examples/widgets/analogclock/main.cpp b/examples/widgets/analogclock/main.cpp deleted file mode 100644 index 0efedc7acf..0000000000 --- a/examples/widgets/analogclock/main.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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 - -#include "analogclock.h" - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - AnalogClock clock; - clock.show(); - return app.exec(); -} diff --git a/examples/widgets/animation/README b/examples/widgets/animation/README new file mode 100644 index 0000000000..e723a28722 --- /dev/null +++ b/examples/widgets/animation/README @@ -0,0 +1,8 @@ +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. + + +Documentation for these examples can be found via the Examples +link in the main Qt documentation. diff --git a/examples/widgets/animation/animatedtiles/animatedtiles.desktop b/examples/widgets/animation/animatedtiles/animatedtiles.desktop new file mode 100644 index 0000000000..97e646fdf8 --- /dev/null +++ b/examples/widgets/animation/animatedtiles/animatedtiles.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Animated Tiles +Exec=/opt/usr/bin/animatedtiles +Icon=animatedtiles +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/widgets/animation/animatedtiles/animatedtiles.pro b/examples/widgets/animation/animatedtiles/animatedtiles.pro new file mode 100644 index 0000000000..1bba99449c --- /dev/null +++ b/examples/widgets/animation/animatedtiles/animatedtiles.pro @@ -0,0 +1,10 @@ +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 + +QT += widgets diff --git a/examples/widgets/animation/animatedtiles/animatedtiles.qrc b/examples/widgets/animation/animatedtiles/animatedtiles.qrc new file mode 100644 index 0000000000..c43a979723 --- /dev/null +++ b/examples/widgets/animation/animatedtiles/animatedtiles.qrc @@ -0,0 +1,11 @@ + + + images/Time-For-Lunch-2.jpg + images/centered.png + images/ellipse.png + images/figure8.png + images/kinetic.png + images/random.png + images/tile.png + + diff --git a/examples/widgets/animation/animatedtiles/images/Time-For-Lunch-2.jpg b/examples/widgets/animation/animatedtiles/images/Time-For-Lunch-2.jpg new file mode 100644 index 0000000000..c57a555490 Binary files /dev/null and b/examples/widgets/animation/animatedtiles/images/Time-For-Lunch-2.jpg differ diff --git a/examples/widgets/animation/animatedtiles/images/centered.png b/examples/widgets/animation/animatedtiles/images/centered.png new file mode 100644 index 0000000000..e416156a0e Binary files /dev/null and b/examples/widgets/animation/animatedtiles/images/centered.png differ diff --git a/examples/widgets/animation/animatedtiles/images/ellipse.png b/examples/widgets/animation/animatedtiles/images/ellipse.png new file mode 100644 index 0000000000..2c3ba881c5 Binary files /dev/null and b/examples/widgets/animation/animatedtiles/images/ellipse.png differ diff --git a/examples/widgets/animation/animatedtiles/images/figure8.png b/examples/widgets/animation/animatedtiles/images/figure8.png new file mode 100644 index 0000000000..6b058041c4 Binary files /dev/null and b/examples/widgets/animation/animatedtiles/images/figure8.png differ diff --git a/examples/widgets/animation/animatedtiles/images/kinetic.png b/examples/widgets/animation/animatedtiles/images/kinetic.png new file mode 100644 index 0000000000..55cfa5515f Binary files /dev/null and b/examples/widgets/animation/animatedtiles/images/kinetic.png differ diff --git a/examples/widgets/animation/animatedtiles/images/random.png b/examples/widgets/animation/animatedtiles/images/random.png new file mode 100644 index 0000000000..415d96f856 Binary files /dev/null and b/examples/widgets/animation/animatedtiles/images/random.png differ diff --git a/examples/widgets/animation/animatedtiles/images/tile.png b/examples/widgets/animation/animatedtiles/images/tile.png new file mode 100644 index 0000000000..c8f39d8d40 Binary files /dev/null and b/examples/widgets/animation/animatedtiles/images/tile.png differ diff --git a/examples/widgets/animation/animatedtiles/main.cpp b/examples/widgets/animation/animatedtiles/main.cpp new file mode 100644 index 0000000000..50bd33860e --- /dev/null +++ b/examples/widgets/animation/animatedtiles/main.cpp @@ -0,0 +1,256 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** 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 +#include + +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 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->setTransform(QTransform::fromScale(0.75, 0.75), true); + 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/widgets/animation/animation.pro b/examples/widgets/animation/animation.pro new file mode 100644 index 0000000000..b17aa0e0fe --- /dev/null +++ b/examples/widgets/animation/animation.pro @@ -0,0 +1,17 @@ +TEMPLATE = \ + subdirs +SUBDIRS += \ + animatedtiles \ + appchooser \ + easing \ + moveblocks \ + states \ + stickman \ + sub-attaq \ + +# 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 +QT += widgets diff --git a/examples/widgets/animation/appchooser/accessories-dictionary.png b/examples/widgets/animation/appchooser/accessories-dictionary.png new file mode 100644 index 0000000000..e9bd55d918 Binary files /dev/null and b/examples/widgets/animation/appchooser/accessories-dictionary.png differ diff --git a/examples/widgets/animation/appchooser/akregator.png b/examples/widgets/animation/appchooser/akregator.png new file mode 100644 index 0000000000..a086f45ab6 Binary files /dev/null and b/examples/widgets/animation/appchooser/akregator.png differ diff --git a/examples/widgets/animation/appchooser/appchooser.desktop b/examples/widgets/animation/appchooser/appchooser.desktop new file mode 100644 index 0000000000..8e413e96c2 --- /dev/null +++ b/examples/widgets/animation/appchooser/appchooser.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Application Chooser +Exec=/opt/usr/bin/appchooser +Icon=appchooser +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/widgets/animation/appchooser/appchooser.pro b/examples/widgets/animation/appchooser/appchooser.pro new file mode 100644 index 0000000000..158a0eca9f --- /dev/null +++ b/examples/widgets/animation/appchooser/appchooser.pro @@ -0,0 +1,10 @@ +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 + +QT += widgets diff --git a/examples/widgets/animation/appchooser/appchooser.qrc b/examples/widgets/animation/appchooser/appchooser.qrc new file mode 100644 index 0000000000..28a3e1c4c1 --- /dev/null +++ b/examples/widgets/animation/appchooser/appchooser.qrc @@ -0,0 +1,8 @@ + + + accessories-dictionary.png + akregator.png + digikam.png + k3b.png + + diff --git a/examples/widgets/animation/appchooser/digikam.png b/examples/widgets/animation/appchooser/digikam.png new file mode 100644 index 0000000000..9de9fb2f80 Binary files /dev/null and b/examples/widgets/animation/appchooser/digikam.png differ diff --git a/examples/widgets/animation/appchooser/k3b.png b/examples/widgets/animation/appchooser/k3b.png new file mode 100644 index 0000000000..bbcafcfba1 Binary files /dev/null and b/examples/widgets/animation/appchooser/k3b.png differ diff --git a/examples/widgets/animation/appchooser/main.cpp b/examples/widgets/animation/appchooser/main.cpp new file mode 100644 index 0000000000..c8e60c0641 --- /dev/null +++ b/examples/widgets/animation/appchooser/main.cpp @@ -0,0 +1,173 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** 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 +#include + + +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; +}; + +class GraphicsView : public QGraphicsView +{ + Q_OBJECT +public: + GraphicsView(QGraphicsScene *scene, QWidget *parent = 0) : QGraphicsView(scene, parent) + { + } + + virtual void resizeEvent(QResizeEvent *) + { + fitInView(sceneRect(), Qt::KeepAspectRatio); + } +}; + + +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; iaddDefaultAnimation(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); + + GraphicsView window(&scene); + window.setFrameStyle(0); + window.setAlignment(Qt::AlignLeft | Qt::AlignTop); + window.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + window.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + + QStateMachine machine; + machine.setGlobalRestorePolicy(QState::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/widgets/animation/easing/animation.h b/examples/widgets/animation/easing/animation.h new file mode 100644 index 0000000000..35cbed4555 --- /dev/null +++ b/examples/widgets/animation/easing/animation.h @@ -0,0 +1,100 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** 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 + +#include + +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/widgets/animation/easing/easing.desktop b/examples/widgets/animation/easing/easing.desktop new file mode 100644 index 0000000000..56d122217a --- /dev/null +++ b/examples/widgets/animation/easing/easing.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Easing Curves +Exec=/opt/usr/bin/easing +Icon=easing +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/widgets/animation/easing/easing.pro b/examples/widgets/animation/easing/easing.pro new file mode 100644 index 0000000000..155d17d9b9 --- /dev/null +++ b/examples/widgets/animation/easing/easing.pro @@ -0,0 +1,17 @@ +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 + +QT += widgets + diff --git a/examples/widgets/animation/easing/easing.qrc b/examples/widgets/animation/easing/easing.qrc new file mode 100644 index 0000000000..7e112d3a9d --- /dev/null +++ b/examples/widgets/animation/easing/easing.qrc @@ -0,0 +1,5 @@ + + + images/qt-logo.png + + \ No newline at end of file diff --git a/examples/widgets/animation/easing/form.ui b/examples/widgets/animation/easing/form.ui new file mode 100644 index 0000000000..364aebeda6 --- /dev/null +++ b/examples/widgets/animation/easing/form.ui @@ -0,0 +1,270 @@ + + + Form + + + + 0 + 0 + 545 + 471 + + + + Easing curves + + + + + + + 0 + 0 + + + + + 16777215 + 120 + + + + Qt::ScrollBarAlwaysOff + + + QListView::Static + + + false + + + QListView::IconMode + + + false + + + + + + + + + + 16777215 + 16777215 + + + + Path type + + + + + + + 16777215 + 40 + + + + Qt::LeftToRight + + + Line + + + true + + + buttonGroup + + + + + + + + 16777215 + 40 + + + + Circle + + + buttonGroup + + + + + + + + + + + 0 + 0 + + + + Properties + + + + QFormLayout::AllNonFixedFieldsGrow + + + + + + 0 + 0 + + + + + 0 + 30 + + + + Period + + + + + + + false + + + + 0 + 0 + + + + + 0 + 30 + + + + -1.000000000000000 + + + 0.100000000000000 + + + -1.000000000000000 + + + + + + + false + + + + 0 + 30 + + + + -1.000000000000000 + + + 0.100000000000000 + + + -1.000000000000000 + + + + + + + + 0 + 30 + + + + Overshoot + + + + + + + false + + + + 0 + 30 + + + + -1.000000000000000 + + + 0.100000000000000 + + + -1.000000000000000 + + + + + + + + 0 + 30 + + + + Amplitude + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + 0 + 0 + + + + + + + + + + + + diff --git a/examples/widgets/animation/easing/images/qt-logo.png b/examples/widgets/animation/easing/images/qt-logo.png new file mode 100644 index 0000000000..14ddf2a028 Binary files /dev/null and b/examples/widgets/animation/easing/images/qt-logo.png differ diff --git a/examples/widgets/animation/easing/main.cpp b/examples/widgets/animation/easing/main.cpp new file mode 100644 index 0000000000..05d4014fc2 --- /dev/null +++ b/examples/widgets/animation/easing/main.cpp @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** 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 +#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/widgets/animation/easing/window.cpp b/examples/widgets/animation/easing/window.cpp new file mode 100644 index 0000000000..33468db59c --- /dev/null +++ b/examples/widgets/animation/easing/window.cpp @@ -0,0 +1,177 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** 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(); // ### 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/widgets/animation/easing/window.h b/examples/widgets/animation/easing/window.h new file mode 100644 index 0000000000..bf5014c0cc --- /dev/null +++ b/examples/widgets/animation/easing/window.h @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** 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 + +#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/widgets/animation/moveblocks/main.cpp b/examples/widgets/animation/moveblocks/main.cpp new file mode 100644 index 0000000000..d807bb63d9 --- /dev/null +++ b/examples/widgets/animation/moveblocks/main.cpp @@ -0,0 +1,321 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** 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 +#include + +//![15] +class StateSwitchEvent: public QEvent +{ +public: + StateSwitchEvent() + : QEvent(Type(StateSwitchType)) + { + } + + explicit 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(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] + + +class GraphicsView : public QGraphicsView +{ + Q_OBJECT +public: + GraphicsView(QGraphicsScene *scene, QWidget *parent = NULL) : QGraphicsView(scene, parent) + { + } + +protected: + virtual void resizeEvent(QResizeEvent *event) + { + fitInView(scene()->sceneRect()); + QGraphicsView::resizeEvent(event); + } +}; + + +int main(int argc, char **argv) +{ + QApplication app(argc, argv); + +//![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] + GraphicsView window(&scene); + window.setFrameStyle(0); + window.setAlignment(Qt::AlignLeft | Qt::AlignTop); + window.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + window.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); +//![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/widgets/animation/moveblocks/moveblocks.desktop b/examples/widgets/animation/moveblocks/moveblocks.desktop new file mode 100644 index 0000000000..4100f448df --- /dev/null +++ b/examples/widgets/animation/moveblocks/moveblocks.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Move Blocks +Exec=/opt/usr/bin/moveblocks +Icon=moveblocks +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/widgets/animation/moveblocks/moveblocks.pro b/examples/widgets/animation/moveblocks/moveblocks.pro new file mode 100644 index 0000000000..7c242e31e6 --- /dev/null +++ b/examples/widgets/animation/moveblocks/moveblocks.pro @@ -0,0 +1,9 @@ +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 + +QT += widgets diff --git a/examples/widgets/animation/states/accessories-dictionary.png b/examples/widgets/animation/states/accessories-dictionary.png new file mode 100644 index 0000000000..e9bd55d918 Binary files /dev/null and b/examples/widgets/animation/states/accessories-dictionary.png differ diff --git a/examples/widgets/animation/states/akregator.png b/examples/widgets/animation/states/akregator.png new file mode 100644 index 0000000000..a086f45ab6 Binary files /dev/null and b/examples/widgets/animation/states/akregator.png differ diff --git a/examples/widgets/animation/states/digikam.png b/examples/widgets/animation/states/digikam.png new file mode 100644 index 0000000000..9de9fb2f80 Binary files /dev/null and b/examples/widgets/animation/states/digikam.png differ diff --git a/examples/widgets/animation/states/help-browser.png b/examples/widgets/animation/states/help-browser.png new file mode 100644 index 0000000000..db92faa4e7 Binary files /dev/null and b/examples/widgets/animation/states/help-browser.png differ diff --git a/examples/widgets/animation/states/k3b.png b/examples/widgets/animation/states/k3b.png new file mode 100644 index 0000000000..bbcafcfba1 Binary files /dev/null and b/examples/widgets/animation/states/k3b.png differ diff --git a/examples/widgets/animation/states/kchart.png b/examples/widgets/animation/states/kchart.png new file mode 100644 index 0000000000..1dd115be87 Binary files /dev/null and b/examples/widgets/animation/states/kchart.png differ diff --git a/examples/widgets/animation/states/main.cpp b/examples/widgets/animation/states/main.cpp new file mode 100644 index 0000000000..faa97ccbd0 --- /dev/null +++ b/examples/widgets/animation/states/main.cpp @@ -0,0 +1,285 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** 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 + +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; +}; + +class GraphicsView : public QGraphicsView +{ +public: + GraphicsView(QGraphicsScene *scene) : QGraphicsView(scene) + { + } + + virtual void resizeEvent(QResizeEvent *) + { + fitInView(sceneRect(), Qt::KeepAspectRatio); + } +}; + +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, 200)); // 185)); + state1->assignProperty(p2, "pos", QPointF(168, 200)); // 185)); + state1->assignProperty(p3, "pos", QPointF(268, 200)); // 185)); + state1->assignProperty(p4, "pos", QPointF(68 - 150, 48 - 150)); + state1->assignProperty(p5, "pos", QPointF(168, 48 - 150)); + state1->assignProperty(p6, "pos", QPointF(268 + 150, 48 - 150)); + state1->assignProperty(p1, "rotation", qreal(0)); + state1->assignProperty(p2, "rotation", qreal(0)); + state1->assignProperty(p3, "rotation", qreal(0)); + 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(); + + GraphicsView view(&scene); + + view.show(); + + return app.exec(); +} + +#include "main.moc" diff --git a/examples/widgets/animation/states/states.desktop b/examples/widgets/animation/states/states.desktop new file mode 100644 index 0000000000..8429979f23 --- /dev/null +++ b/examples/widgets/animation/states/states.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=States +Exec=/opt/usr/bin/states +Icon=states +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/widgets/animation/states/states.pro b/examples/widgets/animation/states/states.pro new file mode 100644 index 0000000000..adf0e8d58c --- /dev/null +++ b/examples/widgets/animation/states/states.pro @@ -0,0 +1,10 @@ +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 + +QT += widgets diff --git a/examples/widgets/animation/states/states.qrc b/examples/widgets/animation/states/states.qrc new file mode 100644 index 0000000000..60ab3f7a60 --- /dev/null +++ b/examples/widgets/animation/states/states.qrc @@ -0,0 +1,10 @@ + + + accessories-dictionary.png + akregator.png + digikam.png + help-browser.png + k3b.png + kchart.png + + diff --git a/examples/widgets/animation/stickman/animation.cpp b/examples/widgets/animation/stickman/animation.cpp new file mode 100644 index 0000000000..afdfae6eca --- /dev/null +++ b/examples/widgets/animation/stickman/animation.cpp @@ -0,0 +1,189 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** 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 +#include +#include +#include + +class Frame +{ +public: + Frame() { + } + + int nodeCount() const + { + return m_nodePositions.size(); + } + + void setNodeCount(int nodeCount) + { + m_nodePositions.resize(nodeCount); + } + + QPointF nodePos(int idx) const + { + return m_nodePositions.at(idx); + } + + void setNodePos(int idx, const QPointF &pos) + { + m_nodePositions[idx] = pos; + } + +private: + QVector 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; inodeCount(); ++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> nodeCount; + + Frame *frame = new Frame; + frame->setNodeCount(nodeCount); + + for (int j=0; j> pos; + + frame->setNodePos(j, pos); + } + + m_frames.append(frame); + } +} diff --git a/examples/widgets/animation/stickman/animation.h b/examples/widgets/animation/stickman/animation.h new file mode 100644 index 0000000000..d5dab530e6 --- /dev/null +++ b/examples/widgets/animation/stickman/animation.h @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** 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 +#include +#include + +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 m_frames; + int m_currentFrame; +}; + +#endif diff --git a/examples/widgets/animation/stickman/animations/chilling.bin b/examples/widgets/animation/stickman/animations/chilling.bin new file mode 100644 index 0000000000..a81fc7a18c Binary files /dev/null and b/examples/widgets/animation/stickman/animations/chilling.bin differ diff --git a/examples/widgets/animation/stickman/animations/dancing.bin b/examples/widgets/animation/stickman/animations/dancing.bin new file mode 100644 index 0000000000..462f66f89b Binary files /dev/null and b/examples/widgets/animation/stickman/animations/dancing.bin differ diff --git a/examples/widgets/animation/stickman/animations/dead.bin b/examples/widgets/animation/stickman/animations/dead.bin new file mode 100644 index 0000000000..9859b4b4cd Binary files /dev/null and b/examples/widgets/animation/stickman/animations/dead.bin differ diff --git a/examples/widgets/animation/stickman/animations/jumping.bin b/examples/widgets/animation/stickman/animations/jumping.bin new file mode 100644 index 0000000000..12661a15f8 Binary files /dev/null and b/examples/widgets/animation/stickman/animations/jumping.bin differ diff --git a/examples/widgets/animation/stickman/graphicsview.cpp b/examples/widgets/animation/stickman/graphicsview.cpp new file mode 100644 index 0000000000..134fb8acf1 --- /dev/null +++ b/examples/widgets/animation/stickman/graphicsview.cpp @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** 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 +#include +#include + +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())); +} + +void GraphicsView::resizeEvent(QResizeEvent *) +{ + fitInView(scene()->sceneRect()); +} diff --git a/examples/widgets/animation/stickman/graphicsview.h b/examples/widgets/animation/stickman/graphicsview.h new file mode 100644 index 0000000000..38bf6e1eb6 --- /dev/null +++ b/examples/widgets/animation/stickman/graphicsview.h @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** 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 + +class MainWindow; +class GraphicsView: public QGraphicsView +{ + Q_OBJECT +public: + GraphicsView(QWidget *parent = 0); + +protected: + virtual void resizeEvent(QResizeEvent *event); + void keyPressEvent(QKeyEvent *); + +signals: + void keyPressed(int key); + +private: + MainWindow *m_editor; +}; + +#endif diff --git a/examples/widgets/animation/stickman/lifecycle.cpp b/examples/widgets/animation/stickman/lifecycle.cpp new file mode 100644 index 0000000000..53249ccd6f --- /dev/null +++ b/examples/widgets/animation/stickman/lifecycle.cpp @@ -0,0 +1,217 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** 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 +#include + +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(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; inode(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, QObject *sender, const char *signal) +{ + QState *state = makeState(m_alive, fileName); + m_alive->addTransition(new KeyPressTransition(m_keyReceiver, key, state)); + + if((sender != NULL) || (signal != NULL)) { + m_alive->addTransition(sender, signal, state); + } +} + +QState *LifeCycle::makeState(QState *parentState, const QString &animationFileName) +{ + 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; iassignProperty(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/widgets/animation/stickman/lifecycle.h b/examples/widgets/animation/stickman/lifecycle.h new file mode 100644 index 0000000000..8e8bb50659 --- /dev/null +++ b/examples/widgets/animation/stickman/lifecycle.h @@ -0,0 +1,80 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** 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 + +class StickMan; +QT_BEGIN_NAMESPACE +class QStateMachine; +class QAnimationGroup; +class QState; +class QAbstractState; +class QAbstractTransition; +class QObject; +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, QObject *sender = NULL, const char *signal = NULL); + + 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/widgets/animation/stickman/main.cpp b/examples/widgets/animation/stickman/main.cpp new file mode 100644 index 0000000000..3e49da8de3 --- /dev/null +++ b/examples/widgets/animation/stickman/main.cpp @@ -0,0 +1,106 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** 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 "rectbutton.h" + +#include +#include + +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("Stickman" + "

" + "Tell the stickman what to do!" + "

" + "

" + "

  • Press J to make the stickman jump.
  • " + "
  • Press D to make the stickman dance.
  • " + "
  • Press C to make him chill out.
  • " + "
  • When you are done, press Escape.
  • " + "

    " + "

    If he is unlucky, the stickman will get struck by lightning, and never jump, dance or chill out again." + "

    "); + 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); + + 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); + + view.show(); + view.setFocus(); + + LifeCycle cycle(stickMan, &view); + cycle.setDeathAnimation(":/animations/dead.bin"); + + cycle.addActivity(":/animations/jumping.bin", Qt::Key_J); + cycle.addActivity(":/animations/dancing.bin", Qt::Key_D); + cycle.addActivity(":/animations/chilling.bin", Qt::Key_C); + + cycle.start(); + + + return app.exec(); +} diff --git a/examples/widgets/animation/stickman/node.cpp b/examples/widgets/animation/stickman/node.cpp new file mode 100644 index 0000000000..2de34b379c --- /dev/null +++ b/examples/widgets/animation/stickman/node.cpp @@ -0,0 +1,92 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** 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 +#include +#include + +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/widgets/animation/stickman/node.h b/examples/widgets/animation/stickman/node.h new file mode 100644 index 0000000000..ae6e2a3ed0 --- /dev/null +++ b/examples/widgets/animation/stickman/node.h @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** 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 + +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/widgets/animation/stickman/rectbutton.cpp b/examples/widgets/animation/stickman/rectbutton.cpp new file mode 100644 index 0000000000..8b17600ef5 --- /dev/null +++ b/examples/widgets/animation/stickman/rectbutton.cpp @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** 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 "rectbutton.h" +#include + +RectButton::RectButton(QString buttonText) : m_ButtonText(buttonText) +{ +} + + +RectButton::~RectButton() +{ +} + + +void RectButton::mousePressEvent (QGraphicsSceneMouseEvent *) +{ + emit clicked(); +} + + +QRectF RectButton::boundingRect() const +{ + return QRectF(0.0, 0.0, 90.0, 40.0); +} + + +void RectButton::paint(QPainter *painter, const QStyleOptionGraphicsItem * /* option */, QWidget * /* widget */) +{ + painter->setBrush(Qt::gray); + painter->drawRoundedRect(boundingRect(), 5, 5); + + painter->setPen(Qt::white); + painter->drawText(20, 25, m_ButtonText); +} diff --git a/examples/widgets/animation/stickman/rectbutton.h b/examples/widgets/animation/stickman/rectbutton.h new file mode 100644 index 0000000000..ead8f21420 --- /dev/null +++ b/examples/widgets/animation/stickman/rectbutton.h @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** 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 RECTBUTTON_H +#define RECTBUTTON_H + +#include + +class RectButton : public QGraphicsObject +{ + Q_OBJECT +public: + RectButton(QString buttonText); + ~RectButton(); + + virtual QRectF boundingRect() const; + virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); + +protected: + QString m_ButtonText; + + virtual void mousePressEvent (QGraphicsSceneMouseEvent *event); + +signals: + void clicked(); +}; + +#endif // RECTBUTTON_H diff --git a/examples/widgets/animation/stickman/stickman.cpp b/examples/widgets/animation/stickman/stickman.cpp new file mode 100644 index 0000000000..667ed7d141 --- /dev/null +++ b/examples/widgets/animation/stickman/stickman.cpp @@ -0,0 +1,337 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** 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 +#include + +#define _USE_MATH_DEFINES +#include + +#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; ipos() - 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;isetVisible(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; ipos(); + 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 +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; idrawLine(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/widgets/animation/stickman/stickman.desktop b/examples/widgets/animation/stickman/stickman.desktop new file mode 100644 index 0000000000..1722d4db3e --- /dev/null +++ b/examples/widgets/animation/stickman/stickman.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Stickman +Exec=/opt/usr/bin/stickman +Icon=stickman +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/widgets/animation/stickman/stickman.h b/examples/widgets/animation/stickman/stickman.h new file mode 100644 index 0000000000..f50ed1a6c2 --- /dev/null +++ b/examples/widgets/animation/stickman/stickman.h @@ -0,0 +1,103 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** 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 + +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/widgets/animation/stickman/stickman.pro b/examples/widgets/animation/stickman/stickman.pro new file mode 100644 index 0000000000..43aaec113d --- /dev/null +++ b/examples/widgets/animation/stickman/stickman.pro @@ -0,0 +1,23 @@ +HEADERS += stickman.h \ + animation.h \ + node.h \ + lifecycle.h \ + graphicsview.h \ + rectbutton.h +SOURCES += main.cpp \ + stickman.cpp \ + animation.cpp \ + node.cpp \ + lifecycle.cpp \ + graphicsview.cpp \ + rectbutton.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 + +QT += widgets diff --git a/examples/widgets/animation/stickman/stickman.qrc b/examples/widgets/animation/stickman/stickman.qrc new file mode 100644 index 0000000000..4cf3ba3828 --- /dev/null +++ b/examples/widgets/animation/stickman/stickman.qrc @@ -0,0 +1,8 @@ + + + animations/chilling.bin + animations/dancing.bin + animations/dead.bin + animations/jumping.bin + + diff --git a/examples/widgets/animation/sub-attaq/animationmanager.cpp b/examples/widgets/animation/sub-attaq/animationmanager.cpp new file mode 100644 index 0000000000..7dcb9dfb50 --- /dev/null +++ b/examples/widgets/animation/sub-attaq/animationmanager.cpp @@ -0,0 +1,98 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//Own +#include "animationmanager.h" + +//Qt +#include +#include + +// the universe's only animation manager +AnimationManager *AnimationManager::instance = 0; + +AnimationManager::AnimationManager() +{ +} + +AnimationManager *AnimationManager::self() +{ + if (!instance) + instance = new AnimationManager; + return instance; +} + +void AnimationManager::registerAnimation(QAbstractAnimation *anim) +{ + QObject::connect(anim, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterAnimation_helper(QObject*))); + animations.append(anim); +} + +void AnimationManager::unregisterAnimation_helper(QObject *obj) +{ + unregisterAnimation(static_cast(obj)); +} + +void AnimationManager::unregisterAnimation(QAbstractAnimation *anim) +{ + QObject::disconnect(anim, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterAnimation_helper(QObject*))); + animations.removeAll(anim); +} + +void AnimationManager::unregisterAllAnimations() +{ + animations.clear(); +} + +void AnimationManager::pauseAll() +{ + foreach (QAbstractAnimation* animation, animations) { + if (animation->state() == QAbstractAnimation::Running) + animation->pause(); + } +} +void AnimationManager::resumeAll() +{ + foreach (QAbstractAnimation* animation, animations) { + if (animation->state() == QAbstractAnimation::Paused) + animation->resume(); + } +} diff --git a/examples/widgets/animation/sub-attaq/animationmanager.h b/examples/widgets/animation/sub-attaq/animationmanager.h new file mode 100644 index 0000000000..6587e39b14 --- /dev/null +++ b/examples/widgets/animation/sub-attaq/animationmanager.h @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef ANIMATIONMANAGER_H +#define ANIMATIONMANAGER_H + +#include + +QT_BEGIN_NAMESPACE +class QAbstractAnimation; +QT_END_NAMESPACE + +class AnimationManager : public QObject +{ +Q_OBJECT +public: + AnimationManager(); + void registerAnimation(QAbstractAnimation *anim); + void unregisterAnimation(QAbstractAnimation *anim); + void unregisterAllAnimations(); + static AnimationManager *self(); + +public slots: + void pauseAll(); + void resumeAll(); + +private slots: + void unregisterAnimation_helper(QObject *obj); + +private: + static AnimationManager *instance; + QList animations; +}; + +#endif // ANIMATIONMANAGER_H diff --git a/examples/widgets/animation/sub-attaq/boat.cpp b/examples/widgets/animation/sub-attaq/boat.cpp new file mode 100644 index 0000000000..88332dbfe7 --- /dev/null +++ b/examples/widgets/animation/sub-attaq/boat.cpp @@ -0,0 +1,272 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//Own +#include "boat.h" +#include "boat_p.h" +#include "bomb.h" +#include "pixmapitem.h" +#include "graphicsscene.h" +#include "animationmanager.h" +#include "qanimationstate.h" + +//Qt +#include +#include +#include +#include +#include +#include + +static QAbstractAnimation *setupDestroyAnimation(Boat *boat) +{ + QSequentialAnimationGroup *group = new QSequentialAnimationGroup(boat); + for (int i = 1; i <= 4; i++) { + PixmapItem *step = new PixmapItem(QString("explosion/boat/step%1").arg(i),GraphicsScene::Big, boat); + step->setZValue(6); + step->setOpacity(0); + + //fade-in + QPropertyAnimation *anim = new QPropertyAnimation(step, "opacity"); + anim->setEndValue(1); + anim->setDuration(100); + group->insertAnimation(i-1, anim); + + //and then fade-out + QPropertyAnimation *anim2 = new QPropertyAnimation(step, "opacity"); + anim2->setEndValue(0); + anim2->setDuration(100); + group->addAnimation(anim2); + } + + AnimationManager::self()->registerAnimation(group); + return group; +} + + + +Boat::Boat() : PixmapItem(QString("boat"), GraphicsScene::Big), + speed(0), bombsAlreadyLaunched(0), direction(Boat::None), movementAnimation(0) +{ + setZValue(4); + setFlags(QGraphicsItem::ItemIsFocusable); + + //The movement animation used to animate the boat + movementAnimation = new QPropertyAnimation(this, "pos"); + + //The destroy animation used to explode the boat + destroyAnimation = setupDestroyAnimation(this); + + //We setup the state machine of the boat + machine = new QStateMachine(this); + QState *moving = new QState(machine); + StopState *stopState = new StopState(this, moving); + machine->setInitialState(moving); + moving->setInitialState(stopState); + MoveStateRight *moveStateRight = new MoveStateRight(this, moving); + MoveStateLeft *moveStateLeft = new MoveStateLeft(this, moving); + LaunchStateRight *launchStateRight = new LaunchStateRight(this, machine); + LaunchStateLeft *launchStateLeft = new LaunchStateLeft(this, machine); + + //then setup the transitions for the rightMove state + KeyStopTransition *leftStopRight = new KeyStopTransition(this, QEvent::KeyPress, Qt::Key_Left); + leftStopRight->setTargetState(stopState); + KeyMoveTransition *leftMoveRight = new KeyMoveTransition(this, QEvent::KeyPress, Qt::Key_Left); + leftMoveRight->setTargetState(moveStateRight); + KeyMoveTransition *rightMoveRight = new KeyMoveTransition(this, QEvent::KeyPress, Qt::Key_Right); + rightMoveRight->setTargetState(moveStateRight); + KeyMoveTransition *rightMoveStop = new KeyMoveTransition(this, QEvent::KeyPress, Qt::Key_Right); + rightMoveStop->setTargetState(moveStateRight); + + //then setup the transitions for the leftMove state + KeyStopTransition *rightStopLeft = new KeyStopTransition(this, QEvent::KeyPress, Qt::Key_Right); + rightStopLeft->setTargetState(stopState); + KeyMoveTransition *rightMoveLeft = new KeyMoveTransition(this, QEvent::KeyPress, Qt::Key_Right); + rightMoveLeft->setTargetState(moveStateLeft); + KeyMoveTransition *leftMoveLeft = new KeyMoveTransition(this, QEvent::KeyPress,Qt::Key_Left); + leftMoveLeft->setTargetState(moveStateLeft); + KeyMoveTransition *leftMoveStop = new KeyMoveTransition(this, QEvent::KeyPress,Qt::Key_Left); + leftMoveStop->setTargetState(moveStateLeft); + + //We set up the right move state + moveStateRight->addTransition(leftStopRight); + moveStateRight->addTransition(leftMoveRight); + moveStateRight->addTransition(rightMoveRight); + stopState->addTransition(rightMoveStop); + + //We set up the left move state + moveStateLeft->addTransition(rightStopLeft); + moveStateLeft->addTransition(leftMoveLeft); + moveStateLeft->addTransition(rightMoveLeft); + stopState->addTransition(leftMoveStop); + + //The animation is finished, it means we reached the border of the screen, the boat is stopped so we move to the stop state + moveStateLeft->addTransition(movementAnimation, SIGNAL(finished()), stopState); + moveStateRight->addTransition(movementAnimation, SIGNAL(finished()), stopState); + + //We set up the keys for dropping bombs + KeyLaunchTransition *upFireLeft = new KeyLaunchTransition(this, QEvent::KeyPress, Qt::Key_Up); + upFireLeft->setTargetState(launchStateRight); + KeyLaunchTransition *upFireRight = new KeyLaunchTransition(this, QEvent::KeyPress, Qt::Key_Up); + upFireRight->setTargetState(launchStateRight); + KeyLaunchTransition *upFireStop = new KeyLaunchTransition(this, QEvent::KeyPress, Qt::Key_Up); + upFireStop->setTargetState(launchStateRight); + KeyLaunchTransition *downFireLeft = new KeyLaunchTransition(this, QEvent::KeyPress, Qt::Key_Down); + downFireLeft->setTargetState(launchStateLeft); + KeyLaunchTransition *downFireRight = new KeyLaunchTransition(this, QEvent::KeyPress, Qt::Key_Down); + downFireRight->setTargetState(launchStateLeft); + KeyLaunchTransition *downFireMove = new KeyLaunchTransition(this, QEvent::KeyPress, Qt::Key_Down); + downFireMove->setTargetState(launchStateLeft); + + //We set up transitions for fire up + moveStateRight->addTransition(upFireRight); + moveStateLeft->addTransition(upFireLeft); + stopState->addTransition(upFireStop); + + //We set up transitions for fire down + moveStateRight->addTransition(downFireRight); + moveStateLeft->addTransition(downFireLeft); + stopState->addTransition(downFireMove); + + //Finally the launch state should come back to its original state + QHistoryState *historyState = new QHistoryState(moving); + launchStateLeft->addTransition(historyState); + launchStateRight->addTransition(historyState); + + QFinalState *final = new QFinalState(machine); + + //This state play the destroyed animation + QAnimationState *destroyedState = new QAnimationState(machine); + destroyedState->setAnimation(destroyAnimation); + + //Play a nice animation when the boat is destroyed + moving->addTransition(this, SIGNAL(boatDestroyed()), destroyedState); + + //Transition to final state when the destroyed animation is finished + destroyedState->addTransition(destroyedState, SIGNAL(animationFinished()), final); + + //The machine has finished to be executed, then the boat is dead + connect(machine,SIGNAL(finished()), this, SIGNAL(boatExecutionFinished())); + +} + +void Boat::run() +{ + //We register animations + AnimationManager::self()->registerAnimation(movementAnimation); + AnimationManager::self()->registerAnimation(destroyAnimation); + machine->start(); +} + +void Boat::stop() +{ + movementAnimation->stop(); + machine->stop(); +} + +void Boat::updateBoatMovement() +{ + if (speed == 0 || direction == Boat::None) { + movementAnimation->stop(); + return; + } + + movementAnimation->stop(); + + if (direction == Boat::Left) { + movementAnimation->setEndValue(QPointF(0,y())); + movementAnimation->setDuration(x()/speed*15); + } + else /*if (direction == Boat::Right)*/ { + movementAnimation->setEndValue(QPointF(scene()->width()-size().width(),y())); + movementAnimation->setDuration((scene()->width()-size().width()-x())/speed*15); + } + movementAnimation->start(); +} + +void Boat::destroy() +{ + movementAnimation->stop(); + emit boatDestroyed(); +} + +int Boat::bombsLaunched() const +{ + return bombsAlreadyLaunched; +} + +void Boat::setBombsLaunched(int number) +{ + if (number > MAX_BOMB) { + qWarning("Boat::setBombsLaunched : It impossible to launch that number of bombs"); + return; + } + bombsAlreadyLaunched = number; +} + +int Boat::currentSpeed() const +{ + return speed; +} + +void Boat::setCurrentSpeed(int speed) +{ + if (speed > 3 || speed < 0) { + qWarning("Boat::setCurrentSpeed: The boat can't run on that speed"); + return; + } + this->speed = speed; +} + +enum Boat::Movement Boat::currentDirection() const +{ + return direction; +} + +void Boat::setCurrentDirection(Movement direction) +{ + this->direction = direction; +} + +int Boat::type() const +{ + return Type; +} diff --git a/examples/widgets/animation/sub-attaq/boat.h b/examples/widgets/animation/sub-attaq/boat.h new file mode 100644 index 0000000000..0b2fe5c8eb --- /dev/null +++ b/examples/widgets/animation/sub-attaq/boat.h @@ -0,0 +1,95 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef __BOAT__H__ +#define __BOAT__H__ + +#include "pixmapitem.h" + +class Bomb; +QT_BEGIN_NAMESPACE +class QVariantAnimation; +class QAbstractAnimation; +class QStateMachine; +QT_END_NAMESPACE + +class Boat : public PixmapItem +{ +Q_OBJECT +public: + enum Movement { + None = 0, + Left, + Right + }; + enum { Type = UserType + 2 }; + Boat(); + void destroy(); + void run(); + void stop(); + + int bombsLaunched() const; + void setBombsLaunched(int number); + + int currentSpeed() const; + void setCurrentSpeed(int speed); + + enum Movement currentDirection() const; + void setCurrentDirection(Movement direction); + + void updateBoatMovement(); + + virtual int type() const; + +signals: + void boatDestroyed(); + void boatExecutionFinished(); + +private: + int speed; + int bombsAlreadyLaunched; + Movement direction; + QVariantAnimation *movementAnimation; + QAbstractAnimation *destroyAnimation; + QStateMachine *machine; +}; + +#endif //__BOAT__H__ diff --git a/examples/widgets/animation/sub-attaq/boat_p.h b/examples/widgets/animation/sub-attaq/boat_p.h new file mode 100644 index 0000000000..38be985777 --- /dev/null +++ b/examples/widgets/animation/sub-attaq/boat_p.h @@ -0,0 +1,232 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef BOAT_P_H +#define BOAT_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +//Own +#include "bomb.h" +#include "graphicsscene.h" + +// Qt +#include + +static const int MAX_BOMB = 5; + + +//These transtion test if we have to stop the boat (i.e current speed is 1) +class KeyStopTransition : public QKeyEventTransition +{ +public: + KeyStopTransition(Boat *b, QEvent::Type t, int k) + : QKeyEventTransition(b, t, k), boat(b), key(k) + { + } +protected: + virtual bool eventTest(QEvent *event) + { + if (!QKeyEventTransition::eventTest(event)) + return false; + return (boat->currentSpeed() == 1); + } +private: + Boat * boat; + int key; +}; + +//These transtion test if we have to move the boat (i.e current speed was 0 or another value) + class KeyMoveTransition : public QKeyEventTransition +{ +public: + KeyMoveTransition(Boat *b, QEvent::Type t, int k) + : QKeyEventTransition(b, t, k), boat(b), key(k) + { + } +protected: + virtual bool eventTest(QEvent *event) + { + if (!QKeyEventTransition::eventTest(event)) + return false; + return (boat->currentSpeed() >= 0); + } + void onTransition(QEvent *) + { + //We decrease the speed if needed + if (key == Qt::Key_Left && boat->currentDirection() == Boat::Right) + boat->setCurrentSpeed(boat->currentSpeed() - 1); + else if (key == Qt::Key_Right && boat->currentDirection() == Boat::Left) + boat->setCurrentSpeed(boat->currentSpeed() - 1); + else if (boat->currentSpeed() < 3) + boat->setCurrentSpeed(boat->currentSpeed() + 1); + boat->updateBoatMovement(); + } +private: + Boat * boat; + int key; +}; + +//This transition trigger the bombs launch + class KeyLaunchTransition : public QKeyEventTransition +{ +public: + KeyLaunchTransition(Boat *boat, QEvent::Type type, int key) + : QKeyEventTransition(boat, type, key), boat(boat), key(key) + { + } +protected: + virtual bool eventTest(QEvent *event) + { + if (!QKeyEventTransition::eventTest(event)) + return false; + //We have enough bomb? + return (boat->bombsLaunched() < MAX_BOMB); + } +private: + Boat * boat; + int key; +}; + +//This state is describing when the boat is moving right +class MoveStateRight : public QState +{ +public: + MoveStateRight(Boat *boat,QState *parent = 0) : QState(parent), boat(boat) + { + } +protected: + void onEntry(QEvent *) + { + boat->setCurrentDirection(Boat::Right); + boat->updateBoatMovement(); + } +private: + Boat * boat; +}; + + //This state is describing when the boat is moving left +class MoveStateLeft : public QState +{ +public: + MoveStateLeft(Boat *boat,QState *parent = 0) : QState(parent), boat(boat) + { + } +protected: + void onEntry(QEvent *) + { + boat->setCurrentDirection(Boat::Left); + boat->updateBoatMovement(); + } +private: + Boat * boat; +}; + +//This state is describing when the boat is in a stand by position +class StopState : public QState +{ +public: + StopState(Boat *boat,QState *parent = 0) : QState(parent), boat(boat) + { + } +protected: + void onEntry(QEvent *) + { + boat->setCurrentSpeed(0); + boat->setCurrentDirection(Boat::None); + boat->updateBoatMovement(); + } +private: + Boat * boat; +}; + +//This state is describing the launch of the torpedo on the right +class LaunchStateRight : public QState +{ +public: + LaunchStateRight(Boat *boat,QState *parent = 0) : QState(parent), boat(boat) + { + } +protected: + void onEntry(QEvent *) + { + Bomb *b = new Bomb(); + b->setPos(boat->x()+boat->size().width(),boat->y()); + GraphicsScene *scene = static_cast(boat->scene()); + scene->addItem(b); + b->launch(Bomb::Right); + boat->setBombsLaunched(boat->bombsLaunched() + 1); + } +private: + Boat * boat; +}; + +//This state is describing the launch of the torpedo on the left +class LaunchStateLeft : public QState +{ +public: + LaunchStateLeft(Boat *boat,QState *parent = 0) : QState(parent), boat(boat) + { + } +protected: + void onEntry(QEvent *) + { + Bomb *b = new Bomb(); + b->setPos(boat->x() - b->size().width(), boat->y()); + GraphicsScene *scene = static_cast(boat->scene()); + scene->addItem(b); + b->launch(Bomb::Left); + boat->setBombsLaunched(boat->bombsLaunched() + 1); + } +private: + Boat * boat; +}; + +#endif // BOAT_P_H diff --git a/examples/widgets/animation/sub-attaq/bomb.cpp b/examples/widgets/animation/sub-attaq/bomb.cpp new file mode 100644 index 0000000000..e47e9423a9 --- /dev/null +++ b/examples/widgets/animation/sub-attaq/bomb.cpp @@ -0,0 +1,118 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//Own +#include "bomb.h" +#include "submarine.h" +#include "pixmapitem.h" +#include "animationmanager.h" +#include "qanimationstate.h" + +//Qt +#include +#include +#include +#include + +Bomb::Bomb() : PixmapItem(QString("bomb"), GraphicsScene::Big) +{ + setZValue(2); +} + +void Bomb::launch(Bomb::Direction direction) +{ + QSequentialAnimationGroup *launchAnimation = new QSequentialAnimationGroup; + AnimationManager::self()->registerAnimation(launchAnimation); + qreal delta = direction == Right ? 20 : - 20; + QPropertyAnimation *anim = new QPropertyAnimation(this, "pos"); + anim->setEndValue(QPointF(x() + delta,y() - 20)); + anim->setDuration(150); + launchAnimation->addAnimation(anim); + anim = new QPropertyAnimation(this, "pos"); + anim->setEndValue(QPointF(x() + delta*2, y() )); + anim->setDuration(150); + launchAnimation->addAnimation(anim); + anim = new QPropertyAnimation(this, "pos"); + anim->setEndValue(QPointF(x() + delta*2,scene()->height())); + anim->setDuration(y()/2*60); + launchAnimation->addAnimation(anim); + connect(anim,SIGNAL(valueChanged(QVariant)),this,SLOT(onAnimationLaunchValueChanged(QVariant))); + connect(this, SIGNAL(bombExploded()), launchAnimation, SLOT(stop())); + //We setup the state machine of the bomb + QStateMachine *machine = new QStateMachine(this); + + //This state is when the launch animation is playing + QAnimationState *launched = new QAnimationState(machine); + launched->setAnimation(launchAnimation); + + //End + QFinalState *final = new QFinalState(machine); + + machine->setInitialState(launched); + + //### Add a nice animation when the bomb is destroyed + launched->addTransition(this, SIGNAL(bombExploded()),final); + + //If the animation is finished, then we move to the final state + launched->addTransition(launched, SIGNAL(animationFinished()), final); + + //The machine has finished to be executed, then the boat is dead + connect(machine,SIGNAL(finished()),this, SIGNAL(bombExecutionFinished())); + + machine->start(); + +} + +void Bomb::onAnimationLaunchValueChanged(const QVariant &) +{ + foreach (QGraphicsItem * item , collidingItems(Qt::IntersectsItemBoundingRect)) { + if (item->type() == SubMarine::Type) { + SubMarine *s = static_cast(item); + destroy(); + s->destroy(); + } + } +} + +void Bomb::destroy() +{ + emit bombExploded(); +} diff --git a/examples/widgets/animation/sub-attaq/bomb.h b/examples/widgets/animation/sub-attaq/bomb.h new file mode 100644 index 0000000000..74ed734caf --- /dev/null +++ b/examples/widgets/animation/sub-attaq/bomb.h @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef __BOMB__H__ +#define __BOMB__H__ + +#include "pixmapitem.h" + +class Bomb : public PixmapItem +{ +Q_OBJECT +public: + enum Direction { + Left = 0, + Right + }; + Bomb(); + void launch(Direction direction); + void destroy(); + +signals: + void bombExploded(); + void bombExecutionFinished(); + +private slots: + void onAnimationLaunchValueChanged(const QVariant &); +}; + +#endif //__BOMB__H__ diff --git a/examples/widgets/animation/sub-attaq/data.xml b/examples/widgets/animation/sub-attaq/data.xml new file mode 100644 index 0000000000..0f30515ddf --- /dev/null +++ b/examples/widgets/animation/sub-attaq/data.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/widgets/animation/sub-attaq/graphicsscene.cpp b/examples/widgets/animation/sub-attaq/graphicsscene.cpp new file mode 100644 index 0000000000..a2b3e2f101 --- /dev/null +++ b/examples/widgets/animation/sub-attaq/graphicsscene.cpp @@ -0,0 +1,282 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//Own +#include "graphicsscene.h" +#include "states.h" +#include "boat.h" +#include "submarine.h" +#include "torpedo.h" +#include "bomb.h" +#include "pixmapitem.h" +#include "animationmanager.h" +#include "qanimationstate.h" +#include "progressitem.h" +#include "textinformationitem.h" + +//Qt +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +GraphicsScene::GraphicsScene(int x, int y, int width, int height, Mode mode) + : QGraphicsScene(x , y, width, height), mode(mode), boat(new Boat) +{ + PixmapItem *backgroundItem = new PixmapItem(QString("background"),mode); + backgroundItem->setZValue(1); + backgroundItem->setPos(0,0); + addItem(backgroundItem); + + PixmapItem *surfaceItem = new PixmapItem(QString("surface"),mode); + surfaceItem->setZValue(3); + surfaceItem->setPos(0,sealLevel() - surfaceItem->boundingRect().height()/2); + addItem(surfaceItem); + + //The item that display score and level + progressItem = new ProgressItem(backgroundItem); + + textInformationItem = new TextInformationItem(backgroundItem); + textInformationItem->hide(); + //We create the boat + addItem(boat); + boat->setPos(this->width()/2, sealLevel() - boat->size().height()); + boat->hide(); + + //parse the xml that contain all data of the game + QXmlStreamReader reader; + QFile file(":data.xml"); + file.open(QIODevice::ReadOnly); + reader.setDevice(&file); + LevelDescription currentLevel; + while (!reader.atEnd()) { + reader.readNext(); + if (reader.tokenType() == QXmlStreamReader::StartElement) { + if (reader.name() == "submarine") { + SubmarineDescription desc; + desc.name = reader.attributes().value("name").toString(); + desc.points = reader.attributes().value("points").toString().toInt(); + desc.type = reader.attributes().value("type").toString().toInt(); + submarinesData.append(desc); + } else if (reader.name() == "level") { + currentLevel.id = reader.attributes().value("id").toString().toInt(); + currentLevel.name = reader.attributes().value("name").toString(); + } else if (reader.name() == "subinstance") { + currentLevel.submarines.append(qMakePair(reader.attributes().value("type").toString().toInt(), reader.attributes().value("nb").toString().toInt())); + } + } else if (reader.tokenType() == QXmlStreamReader::EndElement) { + if (reader.name() == "level") { + levelsData.insert(currentLevel.id, currentLevel); + currentLevel.submarines.clear(); + } + } + } +} + +qreal GraphicsScene::sealLevel() const +{ + return (mode == Big) ? 220 : 160; +} + +void GraphicsScene::setupScene(QAction *newAction, QAction *quitAction) +{ + static const int nLetters = 10; + static struct { + char const *pix; + qreal initX, initY; + qreal destX, destY; + } logoData[nLetters] = { + {"s", -1000, -1000, 300, 150 }, + {"u", -800, -1000, 350, 150 }, + {"b", -600, -1000, 400, 120 }, + {"dash", -400, -1000, 460, 150 }, + {"a", 1000, 2000, 350, 250 }, + {"t", 800, 2000, 400, 250 }, + {"t2", 600, 2000, 430, 250 }, + {"a2", 400, 2000, 465, 250 }, + {"q", 200, 2000, 510, 250 }, + {"excl", 0, 2000, 570, 220 } }; + + QSequentialAnimationGroup * lettersGroupMoving = new QSequentialAnimationGroup(this); + QParallelAnimationGroup * lettersGroupFading = new QParallelAnimationGroup(this); + + for (int i = 0; i < nLetters; ++i) { + PixmapItem *logo = new PixmapItem(QLatin1String(":/logo-") + logoData[i].pix, this); + logo->setPos(logoData[i].initX, logoData[i].initY); + logo->setZValue(i + 3); + //creation of the animations for moving letters + QPropertyAnimation *moveAnim = new QPropertyAnimation(logo, "pos", lettersGroupMoving); + moveAnim->setEndValue(QPointF(logoData[i].destX, logoData[i].destY)); + moveAnim->setDuration(200); + moveAnim->setEasingCurve(QEasingCurve::OutElastic); + lettersGroupMoving->addPause(50); + //creation of the animations for fading out the letters + QPropertyAnimation *fadeAnim = new QPropertyAnimation(logo, "opacity", lettersGroupFading); + fadeAnim->setDuration(800); + fadeAnim->setEndValue(0); + fadeAnim->setEasingCurve(QEasingCurve::OutQuad); + } + + QStateMachine *machine = new QStateMachine(this); + + //This state is when the player is playing + PlayState *gameState = new PlayState(this, machine); + + //Final state + QFinalState *final = new QFinalState(machine); + + //Animation when the player enter in the game + QAnimationState *lettersMovingState = new QAnimationState(machine); + lettersMovingState->setAnimation(lettersGroupMoving); + + //Animation when the welcome screen disappear + QAnimationState *lettersFadingState = new QAnimationState(machine); + lettersFadingState->setAnimation(lettersGroupFading); + + //if new game then we fade out the welcome screen and start playing + lettersMovingState->addTransition(newAction, SIGNAL(triggered()), lettersFadingState); + lettersFadingState->addTransition(lettersFadingState, SIGNAL(animationFinished()), gameState); + + //New Game is triggered then player start playing + gameState->addTransition(newAction, SIGNAL(triggered()), gameState); + + //Wanna quit, then connect to CTRL+Q + gameState->addTransition(quitAction, SIGNAL(triggered()), final); + lettersMovingState->addTransition(quitAction, SIGNAL(triggered()), final); + + //Welcome screen is the initial state + machine->setInitialState(lettersMovingState); + + machine->start(); + + //We reach the final state, then we quit + connect(machine, SIGNAL(finished()), qApp, SLOT(quit())); +} + +void GraphicsScene::addItem(Bomb *bomb) +{ + bombs.insert(bomb); + connect(bomb,SIGNAL(bombExecutionFinished()),this, SLOT(onBombExecutionFinished())); + QGraphicsScene::addItem(bomb); +} + +void GraphicsScene::addItem(Torpedo *torpedo) +{ + torpedos.insert(torpedo); + connect(torpedo,SIGNAL(torpedoExecutionFinished()),this, SLOT(onTorpedoExecutionFinished())); + QGraphicsScene::addItem(torpedo); +} + +void GraphicsScene::addItem(SubMarine *submarine) +{ + submarines.insert(submarine); + connect(submarine,SIGNAL(subMarineExecutionFinished()),this, SLOT(onSubMarineExecutionFinished())); + QGraphicsScene::addItem(submarine); +} + +void GraphicsScene::addItem(QGraphicsItem *item) +{ + QGraphicsScene::addItem(item); +} + +void GraphicsScene::onBombExecutionFinished() +{ + Bomb *bomb = qobject_cast(sender()); + bombs.remove(bomb); + bomb->deleteLater(); + if (boat) + boat->setBombsLaunched(boat->bombsLaunched() - 1); +} + +void GraphicsScene::onTorpedoExecutionFinished() +{ + Torpedo *torpedo = qobject_cast(sender()); + torpedos.remove(torpedo); + torpedo->deleteLater(); +} + +void GraphicsScene::onSubMarineExecutionFinished() +{ + SubMarine *submarine = qobject_cast(sender()); + submarines.remove(submarine); + if (submarines.count() == 0) + emit allSubMarineDestroyed(submarine->points()); + else + emit subMarineDestroyed(submarine->points()); + submarine->deleteLater(); +} + +void GraphicsScene::clearScene() +{ + foreach (SubMarine *sub, submarines) { + sub->destroy(); + sub->deleteLater(); + } + + foreach (Torpedo *torpedo, torpedos) { + torpedo->destroy(); + torpedo->deleteLater(); + } + + foreach (Bomb *bomb, bombs) { + bomb->destroy(); + bomb->deleteLater(); + } + + submarines.clear(); + bombs.clear(); + torpedos.clear(); + + AnimationManager::self()->unregisterAllAnimations(); + + boat->stop(); + boat->hide(); + boat->setEnabled(true); +} diff --git a/examples/widgets/animation/sub-attaq/graphicsscene.h b/examples/widgets/animation/sub-attaq/graphicsscene.h new file mode 100644 index 0000000000..3e571a878c --- /dev/null +++ b/examples/widgets/animation/sub-attaq/graphicsscene.h @@ -0,0 +1,122 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef __GRAPHICSSCENE__H__ +#define __GRAPHICSSCENE__H__ + +//Qt +#include +#include +#include + + +class Boat; +class SubMarine; +class Torpedo; +class Bomb; +class PixmapItem; +class ProgressItem; +class TextInformationItem; +QT_BEGIN_NAMESPACE +class QAction; +QT_END_NAMESPACE + +class GraphicsScene : public QGraphicsScene +{ +Q_OBJECT +public: + enum Mode { + Big = 0, + Small + }; + + struct SubmarineDescription { + int type; + int points; + QString name; + }; + + struct LevelDescription { + int id; + QString name; + QList > submarines; + }; + + GraphicsScene(int x, int y, int width, int height, Mode mode = Big); + qreal sealLevel() const; + void setupScene(QAction *newAction, QAction *quitAction); + void addItem(Bomb *bomb); + void addItem(Torpedo *torpedo); + void addItem(SubMarine *submarine); + void addItem(QGraphicsItem *item); + void clearScene(); + +signals: + void subMarineDestroyed(int); + void allSubMarineDestroyed(int); + +private slots: + void onBombExecutionFinished(); + void onTorpedoExecutionFinished(); + void onSubMarineExecutionFinished(); + +private: + Mode mode; + ProgressItem *progressItem; + TextInformationItem *textInformationItem; + Boat *boat; + QSet submarines; + QSet bombs; + QSet torpedos; + QVector submarinesData; + QHash levelsData; + + friend class PauseState; + friend class PlayState; + friend class LevelState; + friend class LostState; + friend class WinState; + friend class WinTransition; + friend class UpdateScoreTransition; +}; + +#endif //__GRAPHICSSCENE__H__ + diff --git a/examples/widgets/animation/sub-attaq/main.cpp b/examples/widgets/animation/sub-attaq/main.cpp new file mode 100644 index 0000000000..df18c83435 --- /dev/null +++ b/examples/widgets/animation/sub-attaq/main.cpp @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include "mainwindow.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + Q_INIT_RESOURCE(subattaq); + + qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); + + MainWindow w; + w.show(); + + return app.exec(); +} diff --git a/examples/widgets/animation/sub-attaq/mainwindow.cpp b/examples/widgets/animation/sub-attaq/mainwindow.cpp new file mode 100644 index 0000000000..70f0303177 --- /dev/null +++ b/examples/widgets/animation/sub-attaq/mainwindow.cpp @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//Own +#include "mainwindow.h" +#include "graphicsscene.h" + +//Qt +#include +#include +#include +#include +#include + +#ifndef QT_NO_OPENGL +# include +#endif + +MainWindow::MainWindow() : QMainWindow(0) +{ + QMenu *file = menuBar()->addMenu(tr("&File")); + + QAction *newAction = file->addAction(tr("New Game")); + newAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_N)); + QAction *quitAction = file->addAction(tr("Quit")); + quitAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q)); + + if (QApplication::arguments().contains("-fullscreen")) { + scene = new GraphicsScene(0, 0, 750, 400, GraphicsScene::Small); + setWindowState(Qt::WindowFullScreen); + } else { + scene = new GraphicsScene(0, 0, 880, 630); + layout()->setSizeConstraint(QLayout::SetFixedSize); + } + + view = new QGraphicsView(scene, this); + view->setAlignment(Qt::AlignLeft | Qt::AlignTop); + scene->setupScene(newAction, quitAction); +#ifndef QT_NO_OPENGL + view->setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers))); +#endif + + setCentralWidget(view); +} diff --git a/examples/widgets/animation/sub-attaq/mainwindow.h b/examples/widgets/animation/sub-attaq/mainwindow.h new file mode 100644 index 0000000000..596157d38f --- /dev/null +++ b/examples/widgets/animation/sub-attaq/mainwindow.h @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef __MAINWINDOW__H__ +#define __MAINWINDOW__H__ + +//Qt +#include +class GraphicsScene; +QT_BEGIN_NAMESPACE +class QGraphicsView; +QT_END_NAMESPACE + +class MainWindow : public QMainWindow +{ +Q_OBJECT +public: + MainWindow(); + +private: + GraphicsScene *scene; + QGraphicsView *view; +}; + +#endif //__MAINWINDOW__H__ diff --git a/examples/widgets/animation/sub-attaq/pics/big/background.png b/examples/widgets/animation/sub-attaq/pics/big/background.png new file mode 100644 index 0000000000..9f581571fa Binary files /dev/null and b/examples/widgets/animation/sub-attaq/pics/big/background.png differ diff --git a/examples/widgets/animation/sub-attaq/pics/big/boat.png b/examples/widgets/animation/sub-attaq/pics/big/boat.png new file mode 100644 index 0000000000..be82dff62a Binary files /dev/null and b/examples/widgets/animation/sub-attaq/pics/big/boat.png differ diff --git a/examples/widgets/animation/sub-attaq/pics/big/bomb.png b/examples/widgets/animation/sub-attaq/pics/big/bomb.png new file mode 100644 index 0000000000..3af5f2f29c Binary files /dev/null and b/examples/widgets/animation/sub-attaq/pics/big/bomb.png differ diff --git a/examples/widgets/animation/sub-attaq/pics/big/explosion/boat/step1.png b/examples/widgets/animation/sub-attaq/pics/big/explosion/boat/step1.png new file mode 100644 index 0000000000..c9fd8b0984 Binary files /dev/null and b/examples/widgets/animation/sub-attaq/pics/big/explosion/boat/step1.png differ diff --git a/examples/widgets/animation/sub-attaq/pics/big/explosion/boat/step2.png b/examples/widgets/animation/sub-attaq/pics/big/explosion/boat/step2.png new file mode 100644 index 0000000000..7528f2d2da Binary files /dev/null and b/examples/widgets/animation/sub-attaq/pics/big/explosion/boat/step2.png differ diff --git a/examples/widgets/animation/sub-attaq/pics/big/explosion/boat/step3.png b/examples/widgets/animation/sub-attaq/pics/big/explosion/boat/step3.png new file mode 100644 index 0000000000..aae9c9c184 Binary files /dev/null and b/examples/widgets/animation/sub-attaq/pics/big/explosion/boat/step3.png differ diff --git a/examples/widgets/animation/sub-attaq/pics/big/explosion/boat/step4.png b/examples/widgets/animation/sub-attaq/pics/big/explosion/boat/step4.png new file mode 100644 index 0000000000..d697c1bae8 Binary files /dev/null and b/examples/widgets/animation/sub-attaq/pics/big/explosion/boat/step4.png differ diff --git a/examples/widgets/animation/sub-attaq/pics/big/explosion/submarine/step1.png b/examples/widgets/animation/sub-attaq/pics/big/explosion/submarine/step1.png new file mode 100644 index 0000000000..88ca5144b7 Binary files /dev/null and b/examples/widgets/animation/sub-attaq/pics/big/explosion/submarine/step1.png differ diff --git a/examples/widgets/animation/sub-attaq/pics/big/explosion/submarine/step2.png b/examples/widgets/animation/sub-attaq/pics/big/explosion/submarine/step2.png new file mode 100644 index 0000000000..524f5890ee Binary files /dev/null and b/examples/widgets/animation/sub-attaq/pics/big/explosion/submarine/step2.png differ diff --git a/examples/widgets/animation/sub-attaq/pics/big/explosion/submarine/step3.png b/examples/widgets/animation/sub-attaq/pics/big/explosion/submarine/step3.png new file mode 100644 index 0000000000..2cca1e80fe Binary files /dev/null and b/examples/widgets/animation/sub-attaq/pics/big/explosion/submarine/step3.png differ diff --git a/examples/widgets/animation/sub-attaq/pics/big/explosion/submarine/step4.png b/examples/widgets/animation/sub-attaq/pics/big/explosion/submarine/step4.png new file mode 100644 index 0000000000..82100a8260 Binary files /dev/null and b/examples/widgets/animation/sub-attaq/pics/big/explosion/submarine/step4.png differ diff --git a/examples/widgets/animation/sub-attaq/pics/big/submarine.png b/examples/widgets/animation/sub-attaq/pics/big/submarine.png new file mode 100644 index 0000000000..df435dc47d Binary files /dev/null and b/examples/widgets/animation/sub-attaq/pics/big/submarine.png differ diff --git a/examples/widgets/animation/sub-attaq/pics/big/surface.png b/examples/widgets/animation/sub-attaq/pics/big/surface.png new file mode 100644 index 0000000000..4eba29e9cd Binary files /dev/null and b/examples/widgets/animation/sub-attaq/pics/big/surface.png differ diff --git a/examples/widgets/animation/sub-attaq/pics/big/torpedo.png b/examples/widgets/animation/sub-attaq/pics/big/torpedo.png new file mode 100644 index 0000000000..f9c26873f1 Binary files /dev/null and b/examples/widgets/animation/sub-attaq/pics/big/torpedo.png differ diff --git a/examples/widgets/animation/sub-attaq/pics/scalable/background-n810.svg b/examples/widgets/animation/sub-attaq/pics/scalable/background-n810.svg new file mode 100644 index 0000000000..ece9f7aaf1 --- /dev/null +++ b/examples/widgets/animation/sub-attaq/pics/scalable/background-n810.svg @@ -0,0 +1,171 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/widgets/animation/sub-attaq/pics/scalable/background.svg b/examples/widgets/animation/sub-attaq/pics/scalable/background.svg new file mode 100644 index 0000000000..0be268010e --- /dev/null +++ b/examples/widgets/animation/sub-attaq/pics/scalable/background.svg @@ -0,0 +1,171 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/widgets/animation/sub-attaq/pics/scalable/boat.svg b/examples/widgets/animation/sub-attaq/pics/scalable/boat.svg new file mode 100644 index 0000000000..5298821ba8 --- /dev/null +++ b/examples/widgets/animation/sub-attaq/pics/scalable/boat.svg @@ -0,0 +1,279 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/widgets/animation/sub-attaq/pics/scalable/bomb.svg b/examples/widgets/animation/sub-attaq/pics/scalable/bomb.svg new file mode 100644 index 0000000000..294771a6dd --- /dev/null +++ b/examples/widgets/animation/sub-attaq/pics/scalable/bomb.svg @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/widgets/animation/sub-attaq/pics/scalable/sand.svg b/examples/widgets/animation/sub-attaq/pics/scalable/sand.svg new file mode 100644 index 0000000000..8af11b7a66 --- /dev/null +++ b/examples/widgets/animation/sub-attaq/pics/scalable/sand.svg @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/widgets/animation/sub-attaq/pics/scalable/see.svg b/examples/widgets/animation/sub-attaq/pics/scalable/see.svg new file mode 100644 index 0000000000..0666691215 --- /dev/null +++ b/examples/widgets/animation/sub-attaq/pics/scalable/see.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + diff --git a/examples/widgets/animation/sub-attaq/pics/scalable/sky.svg b/examples/widgets/animation/sub-attaq/pics/scalable/sky.svg new file mode 100644 index 0000000000..1546c087a7 --- /dev/null +++ b/examples/widgets/animation/sub-attaq/pics/scalable/sky.svg @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + diff --git a/examples/widgets/animation/sub-attaq/pics/scalable/sub-attaq.svg b/examples/widgets/animation/sub-attaq/pics/scalable/sub-attaq.svg new file mode 100644 index 0000000000..b075179b46 --- /dev/null +++ b/examples/widgets/animation/sub-attaq/pics/scalable/sub-attaq.svg @@ -0,0 +1,1473 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/widgets/animation/sub-attaq/pics/scalable/submarine.svg b/examples/widgets/animation/sub-attaq/pics/scalable/submarine.svg new file mode 100644 index 0000000000..8a0ffddbca --- /dev/null +++ b/examples/widgets/animation/sub-attaq/pics/scalable/submarine.svg @@ -0,0 +1,214 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/widgets/animation/sub-attaq/pics/scalable/surface.svg b/examples/widgets/animation/sub-attaq/pics/scalable/surface.svg new file mode 100644 index 0000000000..40ed239638 --- /dev/null +++ b/examples/widgets/animation/sub-attaq/pics/scalable/surface.svg @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + diff --git a/examples/widgets/animation/sub-attaq/pics/scalable/torpedo.svg b/examples/widgets/animation/sub-attaq/pics/scalable/torpedo.svg new file mode 100644 index 0000000000..48e429d2bf --- /dev/null +++ b/examples/widgets/animation/sub-attaq/pics/scalable/torpedo.svg @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/widgets/animation/sub-attaq/pics/small/background.png b/examples/widgets/animation/sub-attaq/pics/small/background.png new file mode 100644 index 0000000000..5ad3db660a Binary files /dev/null and b/examples/widgets/animation/sub-attaq/pics/small/background.png differ diff --git a/examples/widgets/animation/sub-attaq/pics/small/boat.png b/examples/widgets/animation/sub-attaq/pics/small/boat.png new file mode 100644 index 0000000000..114ccc310e Binary files /dev/null and b/examples/widgets/animation/sub-attaq/pics/small/boat.png differ diff --git a/examples/widgets/animation/sub-attaq/pics/small/bomb.png b/examples/widgets/animation/sub-attaq/pics/small/bomb.png new file mode 100644 index 0000000000..3af5f2f29c Binary files /dev/null and b/examples/widgets/animation/sub-attaq/pics/small/bomb.png differ diff --git a/examples/widgets/animation/sub-attaq/pics/small/submarine.png b/examples/widgets/animation/sub-attaq/pics/small/submarine.png new file mode 100644 index 0000000000..0c0c350600 Binary files /dev/null and b/examples/widgets/animation/sub-attaq/pics/small/submarine.png differ diff --git a/examples/widgets/animation/sub-attaq/pics/small/surface.png b/examples/widgets/animation/sub-attaq/pics/small/surface.png new file mode 100644 index 0000000000..06d0e47a5c Binary files /dev/null and b/examples/widgets/animation/sub-attaq/pics/small/surface.png differ diff --git a/examples/widgets/animation/sub-attaq/pics/small/torpedo.png b/examples/widgets/animation/sub-attaq/pics/small/torpedo.png new file mode 100644 index 0000000000..f9c26873f1 Binary files /dev/null and b/examples/widgets/animation/sub-attaq/pics/small/torpedo.png differ diff --git a/examples/widgets/animation/sub-attaq/pics/welcome/logo-a.png b/examples/widgets/animation/sub-attaq/pics/welcome/logo-a.png new file mode 100644 index 0000000000..67dd76dac0 Binary files /dev/null and b/examples/widgets/animation/sub-attaq/pics/welcome/logo-a.png differ diff --git a/examples/widgets/animation/sub-attaq/pics/welcome/logo-a2.png b/examples/widgets/animation/sub-attaq/pics/welcome/logo-a2.png new file mode 100644 index 0000000000..17668b07de Binary files /dev/null and b/examples/widgets/animation/sub-attaq/pics/welcome/logo-a2.png differ diff --git a/examples/widgets/animation/sub-attaq/pics/welcome/logo-b.png b/examples/widgets/animation/sub-attaq/pics/welcome/logo-b.png new file mode 100644 index 0000000000..cf6c04560b Binary files /dev/null and b/examples/widgets/animation/sub-attaq/pics/welcome/logo-b.png differ diff --git a/examples/widgets/animation/sub-attaq/pics/welcome/logo-dash.png b/examples/widgets/animation/sub-attaq/pics/welcome/logo-dash.png new file mode 100644 index 0000000000..219233ce6b Binary files /dev/null and b/examples/widgets/animation/sub-attaq/pics/welcome/logo-dash.png differ diff --git a/examples/widgets/animation/sub-attaq/pics/welcome/logo-excl.png b/examples/widgets/animation/sub-attaq/pics/welcome/logo-excl.png new file mode 100644 index 0000000000..8dd0a2eb86 Binary files /dev/null and b/examples/widgets/animation/sub-attaq/pics/welcome/logo-excl.png differ diff --git a/examples/widgets/animation/sub-attaq/pics/welcome/logo-q.png b/examples/widgets/animation/sub-attaq/pics/welcome/logo-q.png new file mode 100644 index 0000000000..86e588d4d8 Binary files /dev/null and b/examples/widgets/animation/sub-attaq/pics/welcome/logo-q.png differ diff --git a/examples/widgets/animation/sub-attaq/pics/welcome/logo-s.png b/examples/widgets/animation/sub-attaq/pics/welcome/logo-s.png new file mode 100644 index 0000000000..7b6a36e93a Binary files /dev/null and b/examples/widgets/animation/sub-attaq/pics/welcome/logo-s.png differ diff --git a/examples/widgets/animation/sub-attaq/pics/welcome/logo-t.png b/examples/widgets/animation/sub-attaq/pics/welcome/logo-t.png new file mode 100644 index 0000000000..b2e3526bea Binary files /dev/null and b/examples/widgets/animation/sub-attaq/pics/welcome/logo-t.png differ diff --git a/examples/widgets/animation/sub-attaq/pics/welcome/logo-t2.png b/examples/widgets/animation/sub-attaq/pics/welcome/logo-t2.png new file mode 100644 index 0000000000..b11a77886e Binary files /dev/null and b/examples/widgets/animation/sub-attaq/pics/welcome/logo-t2.png differ diff --git a/examples/widgets/animation/sub-attaq/pics/welcome/logo-u.png b/examples/widgets/animation/sub-attaq/pics/welcome/logo-u.png new file mode 100644 index 0000000000..24eede887a Binary files /dev/null and b/examples/widgets/animation/sub-attaq/pics/welcome/logo-u.png differ diff --git a/examples/widgets/animation/sub-attaq/pixmapitem.cpp b/examples/widgets/animation/sub-attaq/pixmapitem.cpp new file mode 100644 index 0000000000..077151d708 --- /dev/null +++ b/examples/widgets/animation/sub-attaq/pixmapitem.cpp @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//Own +#include "pixmapitem.h" + +//Qt +#include + +PixmapItem::PixmapItem(const QString &fileName,GraphicsScene::Mode mode, QGraphicsItem * parent) : QGraphicsObject(parent) +{ + if (mode == GraphicsScene::Big) + pix = QPixmap(QStringLiteral(":/big/") + fileName); + else + pix = QPixmap(QStringLiteral(":/small/") + fileName); +} + +PixmapItem::PixmapItem(const QString &fileName, QGraphicsScene *scene) : QGraphicsObject(), pix(fileName) +{ + scene->addItem(this); +} + +QSizeF PixmapItem::size() const +{ + return pix.size(); +} + +QRectF PixmapItem::boundingRect() const +{ + return QRectF(QPointF(0, 0), pix.size()); +} + +void PixmapItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) +{ + painter->drawPixmap(0, 0, pix); +} + + diff --git a/examples/widgets/animation/sub-attaq/pixmapitem.h b/examples/widgets/animation/sub-attaq/pixmapitem.h new file mode 100644 index 0000000000..0a3b1287c7 --- /dev/null +++ b/examples/widgets/animation/sub-attaq/pixmapitem.h @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef __PIXMAPITEM__H__ +#define __PIXMAPITEM__H__ + +//Own +#include "graphicsscene.h" + +//Qt +#include + +class PixmapItem : public QGraphicsObject +{ +public: + PixmapItem(const QString &fileName, GraphicsScene::Mode mode, QGraphicsItem * parent = 0); + PixmapItem(const QString &fileName, QGraphicsScene *scene); + QSizeF size() const; + QRectF boundingRect() const; + void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); +private: + QPixmap pix; +}; + +#endif //__PIXMAPITEM__H__ diff --git a/examples/widgets/animation/sub-attaq/progressitem.cpp b/examples/widgets/animation/sub-attaq/progressitem.cpp new file mode 100644 index 0000000000..bad9ceb471 --- /dev/null +++ b/examples/widgets/animation/sub-attaq/progressitem.cpp @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "progressitem.h" +#include "pixmapitem.h" + +ProgressItem::ProgressItem (QGraphicsItem * parent) + : QGraphicsTextItem(parent), currentLevel(1), currentScore(0) +{ + setFont(QFont("Comic Sans MS")); + setPos(parentItem()->boundingRect().topRight() - QPointF(180, -5)); +} + +void ProgressItem::setLevel(int level) +{ + currentLevel = level; + updateProgress(); +} + +void ProgressItem::setScore(int score) +{ + currentScore = score; + updateProgress(); +} + +void ProgressItem::updateProgress() +{ + setHtml(QString("Level : %1 Score : %2").arg(currentLevel).arg(currentScore)); +} diff --git a/examples/widgets/animation/sub-attaq/progressitem.h b/examples/widgets/animation/sub-attaq/progressitem.h new file mode 100644 index 0000000000..dc6d7ba6bc --- /dev/null +++ b/examples/widgets/animation/sub-attaq/progressitem.h @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef PROGRESSITEM_H +#define PROGRESSITEM_H + +//Qt +#include + +class ProgressItem : public QGraphicsTextItem +{ +public: + ProgressItem(QGraphicsItem * parent = 0); + void setLevel(int level); + void setScore(int score); + +private: + void updateProgress(); + int currentLevel; + int currentScore; +}; + +#endif // PROGRESSITEM_H diff --git a/examples/widgets/animation/sub-attaq/qanimationstate.cpp b/examples/widgets/animation/sub-attaq/qanimationstate.cpp new file mode 100644 index 0000000000..b122acc858 --- /dev/null +++ b/examples/widgets/animation/sub-attaq/qanimationstate.cpp @@ -0,0 +1,150 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qanimationstate.h" + +#include + +QT_BEGIN_NAMESPACE + +/*! +\class QAnimationState + +\brief The QAnimationState class provides state that handle an animation and emit +a signal when this animation is finished. + +\ingroup statemachine + +QAnimationState provides a state that handle an animation. It will start this animation +when the state is entered and stop it when it is leaved. When the animation has finished the +state emit animationFinished signal. +QAnimationState is part of \l{The State Machine Framework}. + +\code +QStateMachine machine; +QAnimationState *s = new QAnimationState(machine->rootState()); +QPropertyAnimation *animation = new QPropertyAnimation(obj, "pos"); +s->setAnimation(animation); +QState *s2 = new QState(machine->rootState()); +s->addTransition(s, SIGNAL(animationFinished()), s2); +machine.start(); +\endcode + +\sa QState, {The Animation Framework} +*/ + + +#ifndef QT_NO_ANIMATION + +/*! + Constructs a new state with the given \a parent state. +*/ +QAnimationState::QAnimationState(QState *parent) + : QState(parent), m_animation(0) +{ +} + +/*! + Destroys the animation state. +*/ +QAnimationState::~QAnimationState() +{ +} + +/*! + Set an \a animation for this QAnimationState. If an animation was previously handle by this + state then it won't emit animationFinished for the old animation. The QAnimationState doesn't + take the ownership of the animation. +*/ +void QAnimationState::setAnimation(QAbstractAnimation *animation) +{ + if (animation == m_animation) + return; + + //Disconnect from the previous animation if exist + if(m_animation) + disconnect(m_animation, SIGNAL(finished()), this, SIGNAL(animationFinished())); + + m_animation = animation; + + if (m_animation) { + //connect the new animation + connect(m_animation, SIGNAL(finished()), this, SIGNAL(animationFinished())); + } +} + +/*! + Returns the animation handle by this animation state, or 0 if there is no animation. +*/ +QAbstractAnimation* QAnimationState::animation() const +{ + return m_animation; +} + +/*! + \reimp +*/ +void QAnimationState::onEntry(QEvent *) +{ + if (m_animation) + m_animation->start(); +} + +/*! + \reimp +*/ +void QAnimationState::onExit(QEvent *) +{ + if (m_animation) + m_animation->stop(); +} + +/*! + \reimp +*/ +bool QAnimationState::event(QEvent *e) +{ + return QState::event(e); +} + +QT_END_NAMESPACE + +#endif diff --git a/examples/widgets/animation/sub-attaq/qanimationstate.h b/examples/widgets/animation/sub-attaq/qanimationstate.h new file mode 100644 index 0000000000..2672f640e4 --- /dev/null +++ b/examples/widgets/animation/sub-attaq/qanimationstate.h @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QANIMATIONSTATE_H +#define QANIMATIONSTATE_H + +#ifndef QT_STATEMACHINE_SOLUTION +# include +# include +#else +# include "qstate.h" +# include "qabstractanimation.h" +#endif + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + + +#ifndef QT_NO_ANIMATION + +class QAbstractAnimation; + +class QAnimationState : public QState +{ + Q_OBJECT +public: + QAnimationState(QState *parent = 0); + ~QAnimationState(); + + void setAnimation(QAbstractAnimation *animation); + QAbstractAnimation* animation() const; + +signals: + void animationFinished(); + +protected: + void onEntry(QEvent *); + void onExit(QEvent *); + bool event(QEvent *e); + +private: + Q_DISABLE_COPY(QAnimationState) + QAbstractAnimation *m_animation; +}; + +#endif + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QANIMATIONSTATE_H diff --git a/examples/widgets/animation/sub-attaq/states.cpp b/examples/widgets/animation/sub-attaq/states.cpp new file mode 100644 index 0000000000..32ad218693 --- /dev/null +++ b/examples/widgets/animation/sub-attaq/states.cpp @@ -0,0 +1,330 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//Own +#include "states.h" +#include "graphicsscene.h" +#include "boat.h" +#include "submarine.h" +#include "torpedo.h" +#include "animationmanager.h" +#include "progressitem.h" +#include "textinformationitem.h" + +//Qt +#include +#include +#include +#include +#include + +PlayState::PlayState(GraphicsScene *scene, QState *parent) + : QState(parent), + scene(scene), + machine(0), + currentLevel(0), + score(0) +{ +} + +PlayState::~PlayState() +{ + delete machine; +} + +void PlayState::onEntry(QEvent *) +{ + //We are now playing? + if (machine) { + machine->stop(); + //we hide the information + scene->textInformationItem->hide(); + scene->clearScene(); + currentLevel = 0; + score = 0; + delete machine; + } + + machine = new QStateMachine; + + //This state is when player is playing + LevelState *levelState = new LevelState(scene, this, machine); + + //This state is when the player is actually playing but the game is not paused + QState *playingState = new QState(levelState); + levelState->setInitialState(playingState); + + //This state is when the game is paused + PauseState *pauseState = new PauseState(scene, levelState); + + //We have one view, it receive the key press event + QKeyEventTransition *pressPplay = new QKeyEventTransition(scene->views().at(0), QEvent::KeyPress, Qt::Key_P); + pressPplay->setTargetState(pauseState); + QKeyEventTransition *pressPpause = new QKeyEventTransition(scene->views().at(0), QEvent::KeyPress, Qt::Key_P); + pressPpause->setTargetState(playingState); + + //Pause "P" is triggered, the player pause the game + playingState->addTransition(pressPplay); + + //To get back playing when the game has been paused + pauseState->addTransition(pressPpause); + + //This state is when player have lost + LostState *lostState = new LostState(scene, this, machine); + + //This state is when player have won + WinState *winState = new WinState(scene, this, machine); + + //The boat has been destroyed then the game is finished + levelState->addTransition(scene->boat, SIGNAL(boatExecutionFinished()),lostState); + + //This transition check if we won or not + WinTransition *winTransition = new WinTransition(scene, this, winState); + + //The boat has been destroyed then the game is finished + levelState->addTransition(winTransition); + + //This state is an animation when the score changed + UpdateScoreState *scoreState = new UpdateScoreState(this, levelState); + + //This transition update the score when a submarine die + UpdateScoreTransition *scoreTransition = new UpdateScoreTransition(scene, this, levelState); + scoreTransition->setTargetState(scoreState); + + //The boat has been destroyed then the game is finished + playingState->addTransition(scoreTransition); + + //We go back to play state + scoreState->addTransition(playingState); + + //We start playing!!! + machine->setInitialState(levelState); + + //Final state + QFinalState *final = new QFinalState(machine); + + //This transition is triggered when the player press space after completing a level + CustomSpaceTransition *spaceTransition = new CustomSpaceTransition(scene->views().at(0), this, QEvent::KeyPress, Qt::Key_Space); + spaceTransition->setTargetState(levelState); + winState->addTransition(spaceTransition); + + //We lost we should reach the final state + lostState->addTransition(lostState, SIGNAL(finished()), final); + + machine->start(); +} + +LevelState::LevelState(GraphicsScene *scene, PlayState *game, QState *parent) : QState(parent), scene(scene), game(game) +{ +} +void LevelState::onEntry(QEvent *) +{ + initializeLevel(); +} + +void LevelState::initializeLevel() +{ + //we re-init the boat + scene->boat->setPos(scene->width()/2, scene->sealLevel() - scene->boat->size().height()); + scene->boat->setCurrentSpeed(0); + scene->boat->setCurrentDirection(Boat::None); + scene->boat->setBombsLaunched(0); + scene->boat->show(); + scene->setFocusItem(scene->boat, Qt::OtherFocusReason); + scene->boat->run(); + + scene->progressItem->setScore(game->score); + scene->progressItem->setLevel(game->currentLevel + 1); + + GraphicsScene::LevelDescription currentLevelDescription = scene->levelsData.value(game->currentLevel); + + for (int i = 0; i < currentLevelDescription.submarines.size(); ++i ) { + + QPair subContent = currentLevelDescription.submarines.at(i); + GraphicsScene::SubmarineDescription submarineDesc = scene->submarinesData.at(subContent.first); + + for (int j = 0; j < subContent.second; ++j ) { + SubMarine *sub = new SubMarine(submarineDesc.type, submarineDesc.name, submarineDesc.points); + scene->addItem(sub); + int random = (qrand() % 15 + 1); + qreal x = random == 13 || random == 5 ? 0 : scene->width() - sub->size().width(); + qreal y = scene->height() -(qrand() % 150 + 1) - sub->size().height(); + sub->setPos(x,y); + sub->setCurrentDirection(x == 0 ? SubMarine::Right : SubMarine::Left); + sub->setCurrentSpeed(qrand() % 3 + 1); + } + } +} + +/** Pause State */ +PauseState::PauseState(GraphicsScene *scene, QState *parent) : QState(parent),scene(scene) +{ +} +void PauseState::onEntry(QEvent *) +{ + AnimationManager::self()->pauseAll(); + scene->boat->setEnabled(false); +} +void PauseState::onExit(QEvent *) +{ + AnimationManager::self()->resumeAll(); + scene->boat->setEnabled(true); + scene->boat->setFocus(); +} + +/** Lost State */ +LostState::LostState(GraphicsScene *scene, PlayState *game, QState *parent) : QState(parent), scene(scene), game(game) +{ +} + +void LostState::onEntry(QEvent *) +{ + //The message to display + QString message = QString("You lose on level %1. Your score is %2.").arg(game->currentLevel+1).arg(game->score); + + //We set the level back to 0 + game->currentLevel = 0; + + //We set the score back to 0 + game->score = 0; + + //We clear the scene + scene->clearScene(); + + //We inform the player + scene->textInformationItem->setMessage(message); + scene->textInformationItem->show(); +} + +void LostState::onExit(QEvent *) +{ + //we hide the information + scene->textInformationItem->hide(); +} + +/** Win State */ +WinState::WinState(GraphicsScene *scene, PlayState *game, QState *parent) : QState(parent), scene(scene), game(game) +{ +} + +void WinState::onEntry(QEvent *) +{ + //We clear the scene + scene->clearScene(); + + QString message; + if (scene->levelsData.size() - 1 != game->currentLevel) { + message = QString("You win the level %1. Your score is %2.\nPress Space to continue.").arg(game->currentLevel+1).arg(game->score); + //We increment the level number + game->currentLevel++; + } else { + message = QString("You finish the game on level %1. Your score is %2.").arg(game->currentLevel+1).arg(game->score); + //We set the level back to 0 + game->currentLevel = 0; + //We set the score back to 0 + game->score = 0; + } + + //We inform the player + scene->textInformationItem->setMessage(message); + scene->textInformationItem->show(); +} + +void WinState::onExit(QEvent *) +{ + //we hide the information + scene->textInformationItem->hide(); +} + +/** UpdateScore State */ +UpdateScoreState::UpdateScoreState(PlayState *g, QState *parent) : QState(parent), game(g) +{ +} + +/** Win transition */ +UpdateScoreTransition::UpdateScoreTransition(GraphicsScene *scene, PlayState *game, QAbstractState *target) + : QSignalTransition(scene,SIGNAL(subMarineDestroyed(int))), + game(game), scene(scene) +{ + setTargetState(target); +} + +bool UpdateScoreTransition::eventTest(QEvent *event) +{ + if (!QSignalTransition::eventTest(event)) + return false; + QStateMachine::SignalEvent *se = static_cast(event); + game->score += se->arguments().at(0).toInt(); + scene->progressItem->setScore(game->score); + return true; +} + +/** Win transition */ +WinTransition::WinTransition(GraphicsScene *scene, PlayState *game, QAbstractState *target) + : QSignalTransition(scene,SIGNAL(allSubMarineDestroyed(int))), + game(game), scene(scene) +{ + setTargetState(target); +} + +bool WinTransition::eventTest(QEvent *event) +{ + if (!QSignalTransition::eventTest(event)) + return false; + QStateMachine::SignalEvent *se = static_cast(event); + game->score += se->arguments().at(0).toInt(); + scene->progressItem->setScore(game->score); + return true; +} + +/** Space transition */ +CustomSpaceTransition::CustomSpaceTransition(QWidget *widget, PlayState *game, QEvent::Type type, int key) + : QKeyEventTransition(widget, type, key), + game(game) +{ +} + +bool CustomSpaceTransition::eventTest(QEvent *event) +{ + if (!QKeyEventTransition::eventTest(event)) + return false; + return (game->currentLevel != 0); +} diff --git a/examples/widgets/animation/sub-attaq/states.h b/examples/widgets/animation/sub-attaq/states.h new file mode 100644 index 0000000000..e43370302c --- /dev/null +++ b/examples/widgets/animation/sub-attaq/states.h @@ -0,0 +1,180 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef STATES_H +#define STATES_H + +//Qt +#include +#include +#include +#include +#include + +class GraphicsScene; +class Boat; +class SubMarine; +QT_BEGIN_NAMESPACE +class QStateMachine; +QT_END_NAMESPACE + +class PlayState : public QState +{ +public: + PlayState(GraphicsScene *scene, QState *parent = 0); + ~PlayState(); + + protected: + void onEntry(QEvent *); + +private : + GraphicsScene *scene; + QStateMachine *machine; + int currentLevel; + int score; + QState *parallelChild; + + friend class UpdateScoreState; + friend class UpdateScoreTransition; + friend class WinTransition; + friend class CustomSpaceTransition; + friend class WinState; + friend class LostState; + friend class LevelState; +}; + +class LevelState : public QState +{ +public: + LevelState(GraphicsScene *scene, PlayState *game, QState *parent = 0); +protected: + void onEntry(QEvent *); +private : + void initializeLevel(); + GraphicsScene *scene; + PlayState *game; +}; + +class PauseState : public QState +{ +public: + PauseState(GraphicsScene *scene, QState *parent = 0); + +protected: + void onEntry(QEvent *); + void onExit(QEvent *); +private : + GraphicsScene *scene; + Boat *boat; +}; + +class LostState : public QState +{ +public: + LostState(GraphicsScene *scene, PlayState *game, QState *parent = 0); + +protected: + void onEntry(QEvent *); + void onExit(QEvent *); +private : + GraphicsScene *scene; + PlayState *game; +}; + +class WinState : public QState +{ +public: + WinState(GraphicsScene *scene, PlayState *game, QState *parent = 0); + +protected: + void onEntry(QEvent *); + void onExit(QEvent *); +private : + GraphicsScene *scene; + PlayState *game; +}; + +class UpdateScoreState : public QState +{ +public: + UpdateScoreState(PlayState *game, QState *parent); +private: + QPropertyAnimation *scoreAnimation; + PlayState *game; +}; + +//These transtion is used to update the score +class UpdateScoreTransition : public QSignalTransition +{ +public: + UpdateScoreTransition(GraphicsScene *scene, PlayState *game, QAbstractState *target); +protected: + virtual bool eventTest(QEvent *event); +private: + PlayState * game; + GraphicsScene *scene; +}; + +//These transtion test if we have won the game +class WinTransition : public QSignalTransition +{ +public: + WinTransition(GraphicsScene *scene, PlayState *game, QAbstractState *target); +protected: + virtual bool eventTest(QEvent *event); +private: + PlayState * game; + GraphicsScene *scene; +}; + +//These transtion is true if one level has been completed and the player want to continue + class CustomSpaceTransition : public QKeyEventTransition +{ +public: + CustomSpaceTransition(QWidget *widget, PlayState *game, QEvent::Type type, int key); +protected: + virtual bool eventTest(QEvent *event); +private: + PlayState *game; + int key; +}; + +#endif // STATES_H diff --git a/examples/widgets/animation/sub-attaq/sub-attaq.pro b/examples/widgets/animation/sub-attaq/sub-attaq.pro new file mode 100644 index 0000000000..6d9b3195ac --- /dev/null +++ b/examples/widgets/animation/sub-attaq/sub-attaq.pro @@ -0,0 +1,42 @@ +QT += widgets +contains(QT_CONFIG, opengl):QT += opengl +HEADERS += boat.h \ + bomb.h \ + mainwindow.h \ + submarine.h \ + torpedo.h \ + pixmapitem.h \ + graphicsscene.h \ + animationmanager.h \ + states.h \ + boat_p.h \ + submarine_p.h \ + qanimationstate.h \ + progressitem.h \ + textinformationitem.h +SOURCES += boat.cpp \ + bomb.cpp \ + main.cpp \ + mainwindow.cpp \ + submarine.cpp \ + torpedo.cpp \ + pixmapitem.cpp \ + graphicsscene.cpp \ + animationmanager.cpp \ + states.cpp \ + qanimationstate.cpp \ + progressitem.cpp \ + textinformationitem.cpp +RESOURCES += subattaq.qrc + +# install +target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/animation/sub-attaq +sources.files = $$SOURCES \ + $$HEADERS \ + $$RESOURCES \ + $$FORMS \ + sub-attaq.pro \ + pics +sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/animation/sub-attaq +INSTALLS += target \ + sources diff --git a/examples/widgets/animation/sub-attaq/subattaq.qrc b/examples/widgets/animation/sub-attaq/subattaq.qrc new file mode 100644 index 0000000000..80a3af11cc --- /dev/null +++ b/examples/widgets/animation/sub-attaq/subattaq.qrc @@ -0,0 +1,39 @@ + + + pics/scalable/sub-attaq.svg + pics/scalable/submarine.svg + pics/scalable/boat.svg + pics/scalable/torpedo.svg + pics/welcome/logo-s.png + pics/welcome/logo-u.png + pics/welcome/logo-b.png + pics/welcome/logo-dash.png + pics/welcome/logo-a.png + pics/welcome/logo-t.png + pics/welcome/logo-t2.png + pics/welcome/logo-a2.png + pics/welcome/logo-q.png + pics/welcome/logo-excl.png + pics/big/background.png + pics/big/boat.png + pics/big/bomb.png + pics/big/submarine.png + pics/big/surface.png + pics/big/torpedo.png + pics/small/background.png + pics/small/boat.png + pics/small/bomb.png + pics/small/submarine.png + pics/small/surface.png + pics/small/torpedo.png + pics/big/explosion/boat/step1.png + pics/big/explosion/boat/step2.png + pics/big/explosion/boat/step3.png + pics/big/explosion/boat/step4.png + pics/big/explosion/submarine/step1.png + pics/big/explosion/submarine/step2.png + pics/big/explosion/submarine/step3.png + pics/big/explosion/submarine/step4.png + data.xml + + diff --git a/examples/widgets/animation/sub-attaq/submarine.cpp b/examples/widgets/animation/sub-attaq/submarine.cpp new file mode 100644 index 0000000000..68eaf7ef38 --- /dev/null +++ b/examples/widgets/animation/sub-attaq/submarine.cpp @@ -0,0 +1,182 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//Own +#include "submarine.h" +#include "submarine_p.h" +#include "torpedo.h" +#include "pixmapitem.h" +#include "graphicsscene.h" +#include "animationmanager.h" +#include "qanimationstate.h" + +#include +#include +#include +#include + +static QAbstractAnimation *setupDestroyAnimation(SubMarine *sub) +{ + QSequentialAnimationGroup *group = new QSequentialAnimationGroup(sub); + for (int i = 1; i <= 4; ++i) { + PixmapItem *step = new PixmapItem(QString::fromLatin1("explosion/submarine/step%1").arg(i), GraphicsScene::Big, sub); + step->setZValue(6); + step->setOpacity(0); + QPropertyAnimation *anim = new QPropertyAnimation(step, "opacity", group); + anim->setDuration(100); + anim->setEndValue(1); + } + AnimationManager::self()->registerAnimation(group); + return group; +} + + +SubMarine::SubMarine(int type, const QString &name, int points) : PixmapItem(QString("submarine"), GraphicsScene::Big), + subType(type), subName(name), subPoints(points), speed(0), direction(SubMarine::None) +{ + setZValue(5); + setTransformOriginPoint(boundingRect().center()); + + graphicsRotation = new QGraphicsRotation(this); + graphicsRotation->setAxis(Qt::YAxis); + graphicsRotation->setOrigin(QVector3D(size().width()/2, size().height()/2, 0)); + QList r; + r.append(graphicsRotation); + setTransformations(r); + + //We setup the state machine of the submarine + QStateMachine *machine = new QStateMachine(this); + + //This state is when the boat is moving/rotating + QState *moving = new QState(machine); + + //This state is when the boat is moving from left to right + MovementState *movement = new MovementState(this, moving); + + //This state is when the boat is moving from left to right + ReturnState *rotation = new ReturnState(this, moving); + + //This is the initial state of the moving root state + moving->setInitialState(movement); + + movement->addTransition(this, SIGNAL(subMarineStateChanged()), moving); + + //This is the initial state of the machine + machine->setInitialState(moving); + + //End + QFinalState *final = new QFinalState(machine); + + //If the moving animation is finished we move to the return state + movement->addTransition(movement, SIGNAL(animationFinished()), rotation); + + //If the return animation is finished we move to the moving state + rotation->addTransition(rotation, SIGNAL(animationFinished()), movement); + + //This state play the destroyed animation + QAnimationState *destroyedState = new QAnimationState(machine); + destroyedState->setAnimation(setupDestroyAnimation(this)); + + //Play a nice animation when the submarine is destroyed + moving->addTransition(this, SIGNAL(subMarineDestroyed()), destroyedState); + + //Transition to final state when the destroyed animation is finished + destroyedState->addTransition(destroyedState, SIGNAL(animationFinished()), final); + + //The machine has finished to be executed, then the submarine is dead + connect(machine,SIGNAL(finished()),this, SIGNAL(subMarineExecutionFinished())); + + machine->start(); +} + +int SubMarine::points() const +{ + return subPoints; +} + +void SubMarine::setCurrentDirection(SubMarine::Movement direction) +{ + if (this->direction == direction) + return; + if (direction == SubMarine::Right && this->direction == SubMarine::None) { + graphicsRotation->setAngle(180); + } + this->direction = direction; +} + +enum SubMarine::Movement SubMarine::currentDirection() const +{ + return direction; +} + +void SubMarine::setCurrentSpeed(int speed) +{ + if (speed < 0 || speed > 3) { + qWarning("SubMarine::setCurrentSpeed : The speed is invalid"); + } + this->speed = speed; + emit subMarineStateChanged(); +} + +int SubMarine::currentSpeed() const +{ + return speed; +} + +void SubMarine::launchTorpedo(int speed) +{ + Torpedo * torp = new Torpedo(); + GraphicsScene *scene = static_cast(this->scene()); + scene->addItem(torp); + torp->setPos(pos()); + torp->setCurrentSpeed(speed); + torp->launch(); +} + +void SubMarine::destroy() +{ + emit subMarineDestroyed(); +} + +int SubMarine::type() const +{ + return Type; +} diff --git a/examples/widgets/animation/sub-attaq/submarine.h b/examples/widgets/animation/sub-attaq/submarine.h new file mode 100644 index 0000000000..b113bc8797 --- /dev/null +++ b/examples/widgets/animation/sub-attaq/submarine.h @@ -0,0 +1,93 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef __SUBMARINE__H__ +#define __SUBMARINE__H__ + +//Qt +#include + +#include "pixmapitem.h" + +class Torpedo; + +class SubMarine : public PixmapItem +{ +Q_OBJECT +public: + enum Movement { + None = 0, + Left, + Right + }; + enum { Type = UserType + 1 }; + SubMarine(int type, const QString &name, int points); + + int points() const; + + void setCurrentDirection(Movement direction); + enum Movement currentDirection() const; + + void setCurrentSpeed(int speed); + int currentSpeed() const; + + void launchTorpedo(int speed); + void destroy(); + + virtual int type() const; + + QGraphicsRotation *rotation() const { return graphicsRotation; } + +signals: + void subMarineDestroyed(); + void subMarineExecutionFinished(); + void subMarineStateChanged(); + +private: + int subType; + QString subName; + int subPoints; + int speed; + Movement direction; + QGraphicsRotation *graphicsRotation; +}; + +#endif //__SUBMARINE__H__ diff --git a/examples/widgets/animation/sub-attaq/submarine_p.h b/examples/widgets/animation/sub-attaq/submarine_p.h new file mode 100644 index 0000000000..f24487aa17 --- /dev/null +++ b/examples/widgets/animation/sub-attaq/submarine_p.h @@ -0,0 +1,137 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef SUBMARINE_P_H +#define SUBMARINE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +//Own +#include "animationmanager.h" +#include "submarine.h" +#include "qanimationstate.h" + +//Qt +#include +#include + +//This state is describing when the boat is moving right +class MovementState : public QAnimationState +{ +Q_OBJECT +public: + MovementState(SubMarine *submarine, QState *parent = 0) : QAnimationState(parent) + { + movementAnimation = new QPropertyAnimation(submarine, "pos"); + connect(movementAnimation,SIGNAL(valueChanged(const QVariant &)),this,SLOT(onAnimationMovementValueChanged(const QVariant &))); + setAnimation(movementAnimation); + AnimationManager::self()->registerAnimation(movementAnimation); + this->submarine = submarine; + } + +protected slots: + void onAnimationMovementValueChanged(const QVariant &) + { + if (qrand() % 200 + 1 == 3) + submarine->launchTorpedo(qrand() % 3 + 1); + } + +protected: + void onEntry(QEvent *e) + { + if (submarine->currentDirection() == SubMarine::Left) { + movementAnimation->setEndValue(QPointF(0,submarine->y())); + movementAnimation->setDuration(submarine->x()/submarine->currentSpeed()*12); + } + else /*if (submarine->currentDirection() == SubMarine::Right)*/ { + movementAnimation->setEndValue(QPointF(submarine->scene()->width()-submarine->size().width(),submarine->y())); + movementAnimation->setDuration((submarine->scene()->width()-submarine->size().width()-submarine->x())/submarine->currentSpeed()*12); + } + QAnimationState::onEntry(e); + } + +private: + SubMarine *submarine; + QPropertyAnimation *movementAnimation; +}; + +//This state is describing when the boat is moving right +class ReturnState : public QAnimationState +{ +public: + ReturnState(SubMarine *submarine, QState *parent = 0) : QAnimationState(parent) + { + returnAnimation = new QPropertyAnimation(submarine->rotation(), "angle"); + returnAnimation->setDuration(500); + AnimationManager::self()->registerAnimation(returnAnimation); + setAnimation(returnAnimation); + this->submarine = submarine; + } + +protected: + void onEntry(QEvent *e) + { + returnAnimation->stop(); + returnAnimation->setEndValue(submarine->currentDirection() == SubMarine::Right ? 360. : 180.); + QAnimationState::onEntry(e); + } + + void onExit(QEvent *e) + { + submarine->currentDirection() == SubMarine::Right ? submarine->setCurrentDirection(SubMarine::Left) : submarine->setCurrentDirection(SubMarine::Right); + QAnimationState::onExit(e); + } + +private: + SubMarine *submarine; + QPropertyAnimation *returnAnimation; +}; + +#endif // SUBMARINE_P_H diff --git a/examples/widgets/animation/sub-attaq/textinformationitem.cpp b/examples/widgets/animation/sub-attaq/textinformationitem.cpp new file mode 100644 index 0000000000..ce2e297287 --- /dev/null +++ b/examples/widgets/animation/sub-attaq/textinformationitem.cpp @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "textinformationitem.h" +#include "pixmapitem.h" + +TextInformationItem::TextInformationItem (QGraphicsItem * parent) + : QGraphicsTextItem(parent) +{ + setFont(QFont("Comic Sans MS", 15)); +} +#include +void TextInformationItem::setMessage(const QString& text) +{ + setHtml(text); + setPos(parentItem()->boundingRect().center().x() - boundingRect().size().width()/2 , parentItem()->boundingRect().center().y()); +} diff --git a/examples/widgets/animation/sub-attaq/textinformationitem.h b/examples/widgets/animation/sub-attaq/textinformationitem.h new file mode 100644 index 0000000000..adad8be90b --- /dev/null +++ b/examples/widgets/animation/sub-attaq/textinformationitem.h @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef TEXTINFORMATIONITEM_H +#define TEXTINFORMATIONITEM_H + +//Qt +#include + +class TextInformationItem : public QGraphicsTextItem +{ +public: + TextInformationItem(QGraphicsItem * parent = 0); + void setMessage(const QString& text); +}; + +#endif // TEXTINFORMATIONITEM_H diff --git a/examples/widgets/animation/sub-attaq/torpedo.cpp b/examples/widgets/animation/sub-attaq/torpedo.cpp new file mode 100644 index 0000000000..34c32fe059 --- /dev/null +++ b/examples/widgets/animation/sub-attaq/torpedo.cpp @@ -0,0 +1,114 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//Own +#include "torpedo.h" +#include "pixmapitem.h" +#include "boat.h" +#include "graphicsscene.h" +#include "animationmanager.h" +#include "qanimationstate.h" + +#include +#include +#include + +Torpedo::Torpedo() : PixmapItem(QString::fromLatin1("torpedo"),GraphicsScene::Big), + currentSpeed(0) +{ + setZValue(2); +} + +void Torpedo::launch() +{ + QPropertyAnimation *launchAnimation = new QPropertyAnimation(this, "pos"); + AnimationManager::self()->registerAnimation(launchAnimation); + launchAnimation->setEndValue(QPointF(x(),qobject_cast(scene())->sealLevel() - 15)); + launchAnimation->setEasingCurve(QEasingCurve::InQuad); + launchAnimation->setDuration(y()/currentSpeed*10); + connect(launchAnimation,SIGNAL(valueChanged(QVariant)),this,SLOT(onAnimationLaunchValueChanged(QVariant))); + connect(this,SIGNAL(torpedoExploded()), launchAnimation, SLOT(stop())); + + //We setup the state machine of the torpedo + QStateMachine *machine = new QStateMachine(this); + + //This state is when the launch animation is playing + QAnimationState *launched = new QAnimationState(machine); + launched->setAnimation(launchAnimation); + + //End + QFinalState *final = new QFinalState(machine); + + machine->setInitialState(launched); + + //### Add a nice animation when the torpedo is destroyed + launched->addTransition(this, SIGNAL(torpedoExploded()),final); + + //If the animation is finished, then we move to the final state + launched->addTransition(launched, SIGNAL(animationFinished()), final); + + //The machine has finished to be executed, then the boat is dead + connect(machine,SIGNAL(finished()),this, SIGNAL(torpedoExecutionFinished())); + + machine->start(); +} + +void Torpedo::setCurrentSpeed(int speed) +{ + if (speed < 0) { + qWarning("Torpedo::setCurrentSpeed : The speed is invalid"); + return; + } + currentSpeed = speed; +} + +void Torpedo::onAnimationLaunchValueChanged(const QVariant &) +{ + foreach (QGraphicsItem *item , collidingItems(Qt::IntersectsItemBoundingRect)) { + if (Boat *b = qgraphicsitem_cast(item)) + b->destroy(); + } +} + +void Torpedo::destroy() +{ + emit torpedoExploded(); +} diff --git a/examples/widgets/animation/sub-attaq/torpedo.h b/examples/widgets/animation/sub-attaq/torpedo.h new file mode 100644 index 0000000000..59209e3d75 --- /dev/null +++ b/examples/widgets/animation/sub-attaq/torpedo.h @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef __TORPEDO__H__ +#define __TORPEDO__H__ + +#include "pixmapitem.h" + +class Torpedo : public PixmapItem +{ +Q_OBJECT +public: + Torpedo(); + void launch(); + void setCurrentSpeed(int speed); + void destroy(); + +signals: + void torpedoExploded(); + void torpedoExecutionFinished(); + +private slots: + void onAnimationLaunchValueChanged(const QVariant &); + +private: + int currentSpeed; +}; + +#endif //__TORPEDO__H__ diff --git a/examples/widgets/applicationicon/applicationicon.desktop b/examples/widgets/applicationicon/applicationicon.desktop deleted file mode 100644 index 9645802195..0000000000 --- a/examples/widgets/applicationicon/applicationicon.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Type=Application -Terminal=false -Name=Application Icon -Exec=/opt/usr/bin/applicationicon -Icon=applicationicon -X-Window-Icon= -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable diff --git a/examples/widgets/applicationicon/applicationicon.png b/examples/widgets/applicationicon/applicationicon.png deleted file mode 100644 index 83a186ee56..0000000000 Binary files a/examples/widgets/applicationicon/applicationicon.png and /dev/null differ diff --git a/examples/widgets/applicationicon/applicationicon.pro b/examples/widgets/applicationicon/applicationicon.pro deleted file mode 100644 index 0a3ba8bbdd..0000000000 --- a/examples/widgets/applicationicon/applicationicon.pro +++ /dev/null @@ -1,17 +0,0 @@ - -QT += core gui widgets - -TARGET = applicationicon -TEMPLATE = app - -SOURCES += main.cpp - -OTHER_FILES += applicationicon.svg \ - applicationicon.png \ - applicationicon.desktop - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/widgets/applicationicon -sources.files = $$SOURCES $$HEADERS applicationicon.svg applicationicon.png *.pro -sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/widgets/applicationicon -INSTALLS += target sources diff --git a/examples/widgets/applicationicon/applicationicon.svg b/examples/widgets/applicationicon/applicationicon.svg deleted file mode 100644 index aa2835b08f..0000000000 --- a/examples/widgets/applicationicon/applicationicon.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/examples/widgets/applicationicon/main.cpp b/examples/widgets/applicationicon/main.cpp deleted file mode 100644 index 1314de1cbf..0000000000 --- a/examples/widgets/applicationicon/main.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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 -#include - -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - QLabel label(QObject::tr("Hello, world!")); - label.show(); - return a.exec(); -} diff --git a/examples/widgets/calculator/button.cpp b/examples/widgets/calculator/button.cpp deleted file mode 100644 index 14c3ebe20d..0000000000 --- a/examples/widgets/calculator/button.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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 - -#include "button.h" - -//! [0] -Button::Button(const QString &text, QWidget *parent) - : QToolButton(parent) -{ - setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); - setText(text); -} -//! [0] - -//! [1] -QSize Button::sizeHint() const -//! [1] //! [2] -{ - QSize size = QToolButton::sizeHint(); - size.rheight() += 20; - size.rwidth() = qMax(size.width(), size.height()); - return size; -} -//! [2] diff --git a/examples/widgets/calculator/button.h b/examples/widgets/calculator/button.h deleted file mode 100644 index 50874ea574..0000000000 --- a/examples/widgets/calculator/button.h +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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 BUTTON_H -#define BUTTON_H - -#include - -//! [0] -class Button : public QToolButton -{ - Q_OBJECT - -public: - Button(const QString &text, QWidget *parent = 0); - - QSize sizeHint() const; -}; -//! [0] - -#endif diff --git a/examples/widgets/calculator/calculator.cpp b/examples/widgets/calculator/calculator.cpp deleted file mode 100644 index 29503befc5..0000000000 --- a/examples/widgets/calculator/calculator.cpp +++ /dev/null @@ -1,396 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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 - -#include - -#include "button.h" -#include "calculator.h" - -//! [0] -Calculator::Calculator(QWidget *parent) - : QWidget(parent) -{ - sumInMemory = 0.0; - sumSoFar = 0.0; - factorSoFar = 0.0; - waitingForOperand = true; -//! [0] - -//! [1] - display = new QLineEdit("0"); -//! [1] //! [2] - display->setReadOnly(true); - display->setAlignment(Qt::AlignRight); - display->setMaxLength(15); - - QFont font = display->font(); - font.setPointSize(font.pointSize() + 8); - display->setFont(font); -//! [2] - -//! [4] - for (int i = 0; i < NumDigitButtons; ++i) { - digitButtons[i] = createButton(QString::number(i), SLOT(digitClicked())); - } - - Button *pointButton = createButton(tr("."), SLOT(pointClicked())); - Button *changeSignButton = createButton(tr("\302\261"), SLOT(changeSignClicked())); - - Button *backspaceButton = createButton(tr("Backspace"), SLOT(backspaceClicked())); - Button *clearButton = createButton(tr("Clear"), SLOT(clear())); - Button *clearAllButton = createButton(tr("Clear All"), SLOT(clearAll())); - - Button *clearMemoryButton = createButton(tr("MC"), SLOT(clearMemory())); - Button *readMemoryButton = createButton(tr("MR"), SLOT(readMemory())); - Button *setMemoryButton = createButton(tr("MS"), SLOT(setMemory())); - Button *addToMemoryButton = createButton(tr("M+"), SLOT(addToMemory())); - - Button *divisionButton = createButton(tr("\303\267"), SLOT(multiplicativeOperatorClicked())); - Button *timesButton = createButton(tr("\303\227"), SLOT(multiplicativeOperatorClicked())); - Button *minusButton = createButton(tr("-"), SLOT(additiveOperatorClicked())); - Button *plusButton = createButton(tr("+"), SLOT(additiveOperatorClicked())); - - Button *squareRootButton = createButton(tr("Sqrt"), SLOT(unaryOperatorClicked())); - Button *powerButton = createButton(tr("x\302\262"), SLOT(unaryOperatorClicked())); - Button *reciprocalButton = createButton(tr("1/x"), SLOT(unaryOperatorClicked())); - Button *equalButton = createButton(tr("="), SLOT(equalClicked())); -//! [4] - -//! [5] - QGridLayout *mainLayout = new QGridLayout; -//! [5] //! [6] - mainLayout->setSizeConstraint(QLayout::SetFixedSize); - mainLayout->addWidget(display, 0, 0, 1, 6); - mainLayout->addWidget(backspaceButton, 1, 0, 1, 2); - mainLayout->addWidget(clearButton, 1, 2, 1, 2); - mainLayout->addWidget(clearAllButton, 1, 4, 1, 2); - - mainLayout->addWidget(clearMemoryButton, 2, 0); - mainLayout->addWidget(readMemoryButton, 3, 0); - mainLayout->addWidget(setMemoryButton, 4, 0); - mainLayout->addWidget(addToMemoryButton, 5, 0); - - for (int i = 1; i < NumDigitButtons; ++i) { - int row = ((9 - i) / 3) + 2; - int column = ((i - 1) % 3) + 1; - mainLayout->addWidget(digitButtons[i], row, column); - } - - mainLayout->addWidget(digitButtons[0], 5, 1); - mainLayout->addWidget(pointButton, 5, 2); - mainLayout->addWidget(changeSignButton, 5, 3); - - mainLayout->addWidget(divisionButton, 2, 4); - mainLayout->addWidget(timesButton, 3, 4); - mainLayout->addWidget(minusButton, 4, 4); - mainLayout->addWidget(plusButton, 5, 4); - - mainLayout->addWidget(squareRootButton, 2, 5); - mainLayout->addWidget(powerButton, 3, 5); - mainLayout->addWidget(reciprocalButton, 4, 5); - mainLayout->addWidget(equalButton, 5, 5); - setLayout(mainLayout); - - setWindowTitle(tr("Calculator")); -} -//! [6] - -//! [7] -void Calculator::digitClicked() -{ - Button *clickedButton = qobject_cast