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/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 + 248 files changed, 17031 insertions(+) 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 (limited to 'examples/widgets/widgets') diff --git a/examples/widgets/widgets/README b/examples/widgets/widgets/README new file mode 100644 index 0000000000..e862f07b71 --- /dev/null +++ b/examples/widgets/widgets/README @@ -0,0 +1,13 @@ +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/widgets/analogclock/analogclock.cpp b/examples/widgets/widgets/analogclock/analogclock.cpp new file mode 100644 index 0000000000..029ca1031a --- /dev/null +++ b/examples/widgets/widgets/analogclock/analogclock.cpp @@ -0,0 +1,145 @@ +/**************************************************************************** +** +** 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/widgets/analogclock/analogclock.desktop b/examples/widgets/widgets/analogclock/analogclock.desktop new file mode 100644 index 0000000000..b177a62d35 --- /dev/null +++ b/examples/widgets/widgets/analogclock/analogclock.desktop @@ -0,0 +1,11 @@ +[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/widgets/analogclock/analogclock.h b/examples/widgets/widgets/analogclock/analogclock.h new file mode 100644 index 0000000000..f95a095712 --- /dev/null +++ b/examples/widgets/widgets/analogclock/analogclock.h @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** 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/widgets/analogclock/analogclock.pro b/examples/widgets/widgets/analogclock/analogclock.pro new file mode 100644 index 0000000000..a2641150e2 --- /dev/null +++ b/examples/widgets/widgets/analogclock/analogclock.pro @@ -0,0 +1,12 @@ +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/widgets/analogclock/main.cpp b/examples/widgets/widgets/analogclock/main.cpp new file mode 100644 index 0000000000..0efedc7acf --- /dev/null +++ b/examples/widgets/widgets/analogclock/main.cpp @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** 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/widgets/applicationicon/applicationicon.desktop b/examples/widgets/widgets/applicationicon/applicationicon.desktop new file mode 100644 index 0000000000..9645802195 --- /dev/null +++ b/examples/widgets/widgets/applicationicon/applicationicon.desktop @@ -0,0 +1,11 @@ +[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/widgets/applicationicon/applicationicon.png b/examples/widgets/widgets/applicationicon/applicationicon.png new file mode 100644 index 0000000000..83a186ee56 Binary files /dev/null and b/examples/widgets/widgets/applicationicon/applicationicon.png differ diff --git a/examples/widgets/widgets/applicationicon/applicationicon.pro b/examples/widgets/widgets/applicationicon/applicationicon.pro new file mode 100644 index 0000000000..0a3ba8bbdd --- /dev/null +++ b/examples/widgets/widgets/applicationicon/applicationicon.pro @@ -0,0 +1,17 @@ + +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/widgets/applicationicon/applicationicon.svg b/examples/widgets/widgets/applicationicon/applicationicon.svg new file mode 100644 index 0000000000..aa2835b08f --- /dev/null +++ b/examples/widgets/widgets/applicationicon/applicationicon.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/widgets/widgets/applicationicon/main.cpp b/examples/widgets/widgets/applicationicon/main.cpp new file mode 100644 index 0000000000..1314de1cbf --- /dev/null +++ b/examples/widgets/widgets/applicationicon/main.cpp @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** 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/widgets/calculator/button.cpp b/examples/widgets/widgets/calculator/button.cpp new file mode 100644 index 0000000000..14c3ebe20d --- /dev/null +++ b/examples/widgets/widgets/calculator/button.cpp @@ -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 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/widgets/calculator/button.h b/examples/widgets/widgets/calculator/button.h new file mode 100644 index 0000000000..50874ea574 --- /dev/null +++ b/examples/widgets/widgets/calculator/button.h @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** 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/widgets/calculator/calculator.cpp b/examples/widgets/widgets/calculator/calculator.cpp new file mode 100644 index 0000000000..29503befc5 --- /dev/null +++ b/examples/widgets/widgets/calculator/calculator.cpp @@ -0,0 +1,396 @@ +/**************************************************************************** +** +** 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