summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/widgets/dialogs/qcolordialog.cpp8
-rw-r--r--src/widgets/dialogs/qdialog.cpp14
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp28
-rw-r--r--src/widgets/dialogs/qfilesystemmodel.cpp6
-rw-r--r--src/widgets/dialogs/qfontdialog.cpp30
-rw-r--r--src/widgets/dialogs/qinputdialog.cpp32
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp24
-rw-r--r--src/widgets/dialogs/qprogressdialog.cpp8
-rw-r--r--src/widgets/dialogs/qwizard.cpp208
-rw-r--r--src/widgets/doc/images/assistant-toolbar.pngbin0 -> 6532 bytes
-rw-r--r--src/widgets/doc/images/buttonbox-gnomelayout-horizontal.pngbin0 -> 4188 bytes
-rw-r--r--src/widgets/doc/images/buttonbox-gnomelayout-vertical.pngbin0 -> 5027 bytes
-rw-r--r--src/widgets/doc/images/buttonbox-kdelayout-horizontal.pngbin0 -> 2862 bytes
-rw-r--r--src/widgets/doc/images/buttonbox-kdelayout-vertical.pngbin0 -> 3298 bytes
-rw-r--r--src/widgets/doc/images/buttonbox-mac-modeless-horizontal.pngbin0 -> 4123 bytes
-rw-r--r--src/widgets/doc/images/buttonbox-mac-modeless-vertical.pngbin0 -> 5177 bytes
-rw-r--r--src/widgets/doc/images/buttonbox-maclayout-horizontal.pngbin0 -> 5409 bytes
-rw-r--r--src/widgets/doc/images/buttonbox-maclayout-vertical.pngbin0 -> 7340 bytes
-rw-r--r--src/widgets/doc/images/buttonbox-winlayout-horizontal.pngbin0 -> 2780 bytes
-rw-r--r--src/widgets/doc/images/buttonbox-winlayout-vertical.pngbin0 -> 3184 bytes
-rw-r--r--src/widgets/doc/images/cde-calendarwidget.pngbin0 -> 10187 bytes
-rw-r--r--src/widgets/doc/images/cde-checkbox.pngbin0 -> 1331 bytes
-rw-r--r--src/widgets/doc/images/cde-combobox.pngbin0 -> 1269 bytes
-rw-r--r--src/widgets/doc/images/cde-dateedit.pngbin0 -> 1183 bytes
-rw-r--r--src/widgets/doc/images/cde-datetimeedit.pngbin0 -> 1701 bytes
-rw-r--r--src/widgets/doc/images/cde-dial.pngbin0 -> 4481 bytes
-rw-r--r--src/widgets/doc/images/cde-doublespinbox.pngbin0 -> 1007 bytes
-rw-r--r--src/widgets/doc/images/cde-fontcombobox.pngbin0 -> 1603 bytes
-rw-r--r--src/widgets/doc/images/cde-frame.pngbin0 -> 2976 bytes
-rw-r--r--src/widgets/doc/images/cde-groupbox.pngbin0 -> 2592 bytes
-rw-r--r--src/widgets/doc/images/cde-horizontalscrollbar.pngbin0 -> 569 bytes
-rw-r--r--src/widgets/doc/images/cde-label.pngbin0 -> 1043 bytes
-rw-r--r--src/widgets/doc/images/cde-lcdnumber.pngbin0 -> 538 bytes
-rw-r--r--src/widgets/doc/images/cde-lineedit.pngbin0 -> 1355 bytes
-rw-r--r--src/widgets/doc/images/cde-listview.pngbin0 -> 5166 bytes
-rw-r--r--src/widgets/doc/images/cde-progressbar.pngbin0 -> 934 bytes
-rw-r--r--src/widgets/doc/images/cde-pushbutton.pngbin0 -> 1099 bytes
-rw-r--r--src/widgets/doc/images/cde-radiobutton.pngbin0 -> 1562 bytes
-rw-r--r--src/widgets/doc/images/cde-slider.pngbin0 -> 526 bytes
-rw-r--r--src/widgets/doc/images/cde-spinbox.pngbin0 -> 863 bytes
-rw-r--r--src/widgets/doc/images/cde-tableview.pngbin0 -> 2467 bytes
-rw-r--r--src/widgets/doc/images/cde-tabwidget.pngbin0 -> 2483 bytes
-rw-r--r--src/widgets/doc/images/cde-textedit.pngbin0 -> 7374 bytes
-rw-r--r--src/widgets/doc/images/cde-timeedit.pngbin0 -> 1248 bytes
-rw-r--r--src/widgets/doc/images/cde-toolbox.pngbin0 -> 1813 bytes
-rw-r--r--src/widgets/doc/images/cde-toolbutton.pngbin0 -> 1169 bytes
-rw-r--r--src/widgets/doc/images/cde-treeview.pngbin0 -> 6703 bytes
-rw-r--r--src/widgets/doc/images/checkboxes-exclusive.pngbin0 -> 5079 bytes
-rw-r--r--src/widgets/doc/images/checkboxes-non-exclusive.pngbin0 -> 5614 bytes
-rw-r--r--src/widgets/doc/images/cleanlooks-calendarwidget.pngbin0 -> 9748 bytes
-rw-r--r--src/widgets/doc/images/cleanlooks-checkbox.pngbin0 -> 1416 bytes
-rw-r--r--src/widgets/doc/images/cleanlooks-combobox.pngbin0 -> 2348 bytes
-rw-r--r--src/widgets/doc/images/cleanlooks-dateedit.pngbin0 -> 1369 bytes
-rw-r--r--src/widgets/doc/images/cleanlooks-datetimeedit.pngbin0 -> 1892 bytes
-rw-r--r--src/widgets/doc/images/cleanlooks-dial.pngbin0 -> 4297 bytes
-rw-r--r--src/widgets/doc/images/cleanlooks-doublespinbox.pngbin0 -> 1141 bytes
-rw-r--r--src/widgets/doc/images/cleanlooks-fontcombobox.pngbin0 -> 1835 bytes
-rw-r--r--src/widgets/doc/images/cleanlooks-frame.pngbin0 -> 2989 bytes
-rw-r--r--src/widgets/doc/images/cleanlooks-groupbox.pngbin0 -> 2630 bytes
-rw-r--r--src/widgets/doc/images/cleanlooks-horizontalscrollbar.pngbin0 -> 837 bytes
-rw-r--r--src/widgets/doc/images/cleanlooks-label.pngbin0 -> 1043 bytes
-rw-r--r--src/widgets/doc/images/cleanlooks-lcdnumber.pngbin0 -> 538 bytes
-rw-r--r--src/widgets/doc/images/cleanlooks-lineedit.pngbin0 -> 1406 bytes
-rw-r--r--src/widgets/doc/images/cleanlooks-listview.pngbin0 -> 5559 bytes
-rw-r--r--src/widgets/doc/images/cleanlooks-progressbar.pngbin0 -> 1292 bytes
-rw-r--r--src/widgets/doc/images/cleanlooks-pushbutton-menu.pngbin0 -> 3177 bytes
-rw-r--r--src/widgets/doc/images/cleanlooks-pushbutton.pngbin0 -> 1332 bytes
-rw-r--r--src/widgets/doc/images/cleanlooks-radiobutton.pngbin0 -> 1782 bytes
-rw-r--r--src/widgets/doc/images/cleanlooks-slider.pngbin0 -> 671 bytes
-rw-r--r--src/widgets/doc/images/cleanlooks-spinbox.pngbin0 -> 983 bytes
-rw-r--r--src/widgets/doc/images/cleanlooks-tableview.pngbin0 -> 2465 bytes
-rw-r--r--src/widgets/doc/images/cleanlooks-tabwidget.pngbin0 -> 5007 bytes
-rw-r--r--src/widgets/doc/images/cleanlooks-textedit.pngbin0 -> 7560 bytes
-rw-r--r--src/widgets/doc/images/cleanlooks-timeedit.pngbin0 -> 1388 bytes
-rw-r--r--src/widgets/doc/images/cleanlooks-toolbox.pngbin0 -> 1445 bytes
-rw-r--r--src/widgets/doc/images/cleanlooks-toolbutton.pngbin0 -> 1469 bytes
-rw-r--r--src/widgets/doc/images/cleanlooks-treeview.pngbin0 -> 6981 bytes
-rw-r--r--src/widgets/doc/images/designer-stylesheet-options.pngbin0 -> 18914 bytes
-rw-r--r--src/widgets/doc/images/designer-stylesheet-usage.pngbin0 -> 8128 bytes
-rw-r--r--src/widgets/doc/images/designer-validator-highlighter.pngbin0 -> 27153 bytes
-rw-r--r--src/widgets/doc/images/filedialogurls.pngbin0 -> 29132 bytes
-rw-r--r--src/widgets/doc/images/frames.pngbin0 -> 25735 bytes
-rw-r--r--src/widgets/doc/images/graphicsview-ellipseitem-pie.pngbin0 -> 6683 bytes
-rw-r--r--src/widgets/doc/images/graphicsview-ellipseitem.pngbin0 -> 5801 bytes
-rw-r--r--src/widgets/doc/images/graphicsview-items.pngbin0 -> 62593 bytes
-rw-r--r--src/widgets/doc/images/graphicsview-pathitem.pngbin0 -> 5710 bytes
-rw-r--r--src/widgets/doc/images/graphicsview-pixmapitem.pngbin0 -> 10764 bytes
-rw-r--r--src/widgets/doc/images/graphicsview-polygonitem.pngbin0 -> 5829 bytes
-rw-r--r--src/widgets/doc/images/graphicsview-rectitem.pngbin0 -> 3305 bytes
-rw-r--r--src/widgets/doc/images/graphicsview-zorder.pngbin0 -> 6724 bytes
-rw-r--r--src/widgets/doc/images/gridlayout.pngbin0 -> 1445 bytes
-rw-r--r--src/widgets/doc/images/gtk-calendarwidget.pngbin0 -> 16761 bytes
-rw-r--r--src/widgets/doc/images/gtk-checkbox.pngbin0 -> 2323 bytes
-rw-r--r--src/widgets/doc/images/gtk-combobox.pngbin0 -> 2730 bytes
-rw-r--r--src/widgets/doc/images/gtk-dateedit.pngbin0 -> 2163 bytes
-rw-r--r--src/widgets/doc/images/gtk-datetimeedit.pngbin0 -> 2923 bytes
-rw-r--r--src/widgets/doc/images/gtk-dial.pngbin0 -> 7221 bytes
-rw-r--r--src/widgets/doc/images/gtk-doublespinbox.pngbin0 -> 2325 bytes
-rw-r--r--src/widgets/doc/images/gtk-fontcombobox.pngbin0 -> 3022 bytes
-rw-r--r--src/widgets/doc/images/gtk-frame.pngbin0 -> 2340 bytes
-rw-r--r--src/widgets/doc/images/gtk-groupbox.pngbin0 -> 6650 bytes
-rw-r--r--src/widgets/doc/images/gtk-horizontalscrollbar.pngbin0 -> 1701 bytes
-rw-r--r--src/widgets/doc/images/gtk-label.pngbin0 -> 1582 bytes
-rw-r--r--src/widgets/doc/images/gtk-lcdnumber.pngbin0 -> 1193 bytes
-rw-r--r--src/widgets/doc/images/gtk-lineedit.pngbin0 -> 2528 bytes
-rw-r--r--src/widgets/doc/images/gtk-listview.pngbin0 -> 8493 bytes
-rw-r--r--src/widgets/doc/images/gtk-progressbar.pngbin0 -> 2228 bytes
-rw-r--r--src/widgets/doc/images/gtk-pushbutton.pngbin0 -> 2153 bytes
-rw-r--r--src/widgets/doc/images/gtk-radiobutton.pngbin0 -> 3142 bytes
-rw-r--r--src/widgets/doc/images/gtk-slider.pngbin0 -> 1359 bytes
-rw-r--r--src/widgets/doc/images/gtk-spinbox.pngbin0 -> 2078 bytes
-rw-r--r--src/widgets/doc/images/gtk-tableview.pngbin0 -> 8364 bytes
-rw-r--r--src/widgets/doc/images/gtk-tabwidget.pngbin0 -> 8179 bytes
-rw-r--r--src/widgets/doc/images/gtk-textedit.pngbin0 -> 12641 bytes
-rw-r--r--src/widgets/doc/images/gtk-timeedit.pngbin0 -> 2621 bytes
-rw-r--r--src/widgets/doc/images/gtk-toolbox.pngbin0 -> 4240 bytes
-rw-r--r--src/widgets/doc/images/gtk-toolbutton.pngbin0 -> 2260 bytes
-rw-r--r--src/widgets/doc/images/gtk-treeview.pngbin0 -> 9722 bytes
-rw-r--r--src/widgets/doc/images/javastyle/branchindicatorimage.pngbin0 -> 18867 bytes
-rw-r--r--src/widgets/doc/images/javastyle/button.pngbin0 -> 5475 bytes
-rw-r--r--src/widgets/doc/images/javastyle/checkbox.pngbin0 -> 3634 bytes
-rw-r--r--src/widgets/doc/images/javastyle/checkboxexample.pngbin0 -> 911 bytes
-rw-r--r--src/widgets/doc/images/javastyle/combobox.pngbin0 -> 3537 bytes
-rw-r--r--src/widgets/doc/images/javastyle/comboboximage.pngbin0 -> 6527 bytes
-rw-r--r--src/widgets/doc/images/javastyle/conceptualpushbuttontree.pngbin0 -> 3590 bytes
-rw-r--r--src/widgets/doc/images/javastyle/dockwidget.pngbin0 -> 7181 bytes
-rw-r--r--src/widgets/doc/images/javastyle/dockwidgetimage.pngbin0 -> 21774 bytes
-rw-r--r--src/widgets/doc/images/javastyle/groupbox.pngbin0 -> 2010 bytes
-rw-r--r--src/widgets/doc/images/javastyle/groupboximage.pngbin0 -> 7067 bytes
-rw-r--r--src/widgets/doc/images/javastyle/header.pngbin0 -> 4399 bytes
-rw-r--r--src/widgets/doc/images/javastyle/headerimage.pngbin0 -> 6474 bytes
-rw-r--r--src/widgets/doc/images/javastyle/menu.pngbin0 -> 6508 bytes
-rw-r--r--src/widgets/doc/images/javastyle/menubar.pngbin0 -> 4315 bytes
-rw-r--r--src/widgets/doc/images/javastyle/menubarimage.pngbin0 -> 4487 bytes
-rw-r--r--src/widgets/doc/images/javastyle/menuimage.pngbin0 -> 5584 bytes
-rw-r--r--src/widgets/doc/images/javastyle/progressbar.pngbin0 -> 4493 bytes
-rw-r--r--src/widgets/doc/images/javastyle/progressbarimage.pngbin0 -> 6921 bytes
-rw-r--r--src/widgets/doc/images/javastyle/pushbutton.pngbin0 -> 6820 bytes
-rw-r--r--src/widgets/doc/images/javastyle/rubberband.pngbin0 -> 765 bytes
-rw-r--r--src/widgets/doc/images/javastyle/rubberbandimage.pngbin0 -> 6452 bytes
-rw-r--r--src/widgets/doc/images/javastyle/scrollbar.pngbin0 -> 7199 bytes
-rw-r--r--src/widgets/doc/images/javastyle/scrollbarimage.pngbin0 -> 6196 bytes
-rw-r--r--src/widgets/doc/images/javastyle/sizegrip.pngbin0 -> 708 bytes
-rw-r--r--src/widgets/doc/images/javastyle/sizegripimage.pngbin0 -> 1793 bytes
-rw-r--r--src/widgets/doc/images/javastyle/slider.pngbin0 -> 2844 bytes
-rw-r--r--src/widgets/doc/images/javastyle/sliderimage.pngbin0 -> 3442 bytes
-rw-r--r--src/widgets/doc/images/javastyle/spinbox.pngbin0 -> 2864 bytes
-rw-r--r--src/widgets/doc/images/javastyle/spinboximage.pngbin0 -> 4544 bytes
-rw-r--r--src/widgets/doc/images/javastyle/tab.pngbin0 -> 12176 bytes
-rw-r--r--src/widgets/doc/images/javastyle/tabwidget.pngbin0 -> 4725 bytes
-rw-r--r--src/widgets/doc/images/javastyle/titlebar.pngbin0 -> 2609 bytes
-rw-r--r--src/widgets/doc/images/javastyle/titlebarimage.pngbin0 -> 6882 bytes
-rw-r--r--src/widgets/doc/images/javastyle/toolbar.pngbin0 -> 6303 bytes
-rw-r--r--src/widgets/doc/images/javastyle/toolbarimage.pngbin0 -> 8245 bytes
-rw-r--r--src/widgets/doc/images/javastyle/toolbox.pngbin0 -> 3211 bytes
-rw-r--r--src/widgets/doc/images/javastyle/toolboximage.pngbin0 -> 5580 bytes
-rw-r--r--src/widgets/doc/images/javastyle/toolbutton.pngbin0 -> 4487 bytes
-rw-r--r--src/widgets/doc/images/javastyle/toolbuttonimage.pngbin0 -> 5124 bytes
-rw-r--r--src/widgets/doc/images/javastyle/windowstabimage.pngbin0 -> 6898 bytes
-rw-r--r--src/widgets/doc/images/licensewizard-flow.pngbin0 -> 15306 bytes
-rw-r--r--src/widgets/doc/images/macintosh-calendarwidget.pngbin0 -> 13560 bytes
-rw-r--r--src/widgets/doc/images/macintosh-checkbox.pngbin0 -> 2473 bytes
-rw-r--r--src/widgets/doc/images/macintosh-combobox.pngbin0 -> 3273 bytes
-rw-r--r--src/widgets/doc/images/macintosh-dateedit.pngbin0 -> 1703 bytes
-rw-r--r--src/widgets/doc/images/macintosh-datetimeedit.pngbin0 -> 2633 bytes
-rw-r--r--src/widgets/doc/images/macintosh-dial.pngbin0 -> 2563 bytes
-rw-r--r--src/widgets/doc/images/macintosh-doublespinbox.pngbin0 -> 2306 bytes
-rw-r--r--src/widgets/doc/images/macintosh-fontcombobox.pngbin0 -> 2967 bytes
-rw-r--r--src/widgets/doc/images/macintosh-frame.pngbin0 -> 6187 bytes
-rw-r--r--src/widgets/doc/images/macintosh-groupbox.pngbin0 -> 6469 bytes
-rw-r--r--src/widgets/doc/images/macintosh-horizontalscrollbar.pngbin0 -> 2242 bytes
-rw-r--r--src/widgets/doc/images/macintosh-label.pngbin0 -> 1450 bytes
-rw-r--r--src/widgets/doc/images/macintosh-lcdnumber.pngbin0 -> 492 bytes
-rw-r--r--src/widgets/doc/images/macintosh-lineedit.pngbin0 -> 1854 bytes
-rw-r--r--src/widgets/doc/images/macintosh-listview.pngbin0 -> 9987 bytes
-rw-r--r--src/widgets/doc/images/macintosh-menu.pngbin0 -> 6891 bytes
-rw-r--r--src/widgets/doc/images/macintosh-progressbar.pngbin0 -> 1127 bytes
-rw-r--r--src/widgets/doc/images/macintosh-pushbutton.pngbin0 -> 2966 bytes
-rw-r--r--src/widgets/doc/images/macintosh-radiobutton.pngbin0 -> 2914 bytes
-rw-r--r--src/widgets/doc/images/macintosh-slider.pngbin0 -> 1694 bytes
-rw-r--r--src/widgets/doc/images/macintosh-spinbox.pngbin0 -> 1964 bytes
-rw-r--r--src/widgets/doc/images/macintosh-tableview.pngbin0 -> 10024 bytes
-rw-r--r--src/widgets/doc/images/macintosh-tabwidget.pngbin0 -> 9562 bytes
-rw-r--r--src/widgets/doc/images/macintosh-textedit.pngbin0 -> 7845 bytes
-rw-r--r--src/widgets/doc/images/macintosh-timeedit.pngbin0 -> 2244 bytes
-rw-r--r--src/widgets/doc/images/macintosh-toolbox.pngbin0 -> 2576 bytes
-rw-r--r--src/widgets/doc/images/macintosh-toolbutton.pngbin0 -> 2003 bytes
-rw-r--r--src/widgets/doc/images/macintosh-treeview.pngbin0 -> 11728 bytes
-rw-r--r--src/widgets/doc/images/mainwindow-docks.pngbin0 -> 37240 bytes
-rw-r--r--src/widgets/doc/images/mainwindowlayout.pngbin0 -> 6782 bytes
-rw-r--r--src/widgets/doc/images/mdi-cascade.pngbin0 -> 14590 bytes
-rw-r--r--src/widgets/doc/images/mdi-tile.pngbin0 -> 31624 bytes
-rw-r--r--src/widgets/doc/images/motif-calendarwidget.pngbin0 -> 9989 bytes
-rw-r--r--src/widgets/doc/images/motif-checkbox.pngbin0 -> 1284 bytes
-rw-r--r--src/widgets/doc/images/motif-combobox.pngbin0 -> 1276 bytes
-rw-r--r--src/widgets/doc/images/motif-dateedit.pngbin0 -> 1214 bytes
-rw-r--r--src/widgets/doc/images/motif-datetimeedit.pngbin0 -> 1730 bytes
-rw-r--r--src/widgets/doc/images/motif-dial.pngbin0 -> 2017 bytes
-rw-r--r--src/widgets/doc/images/motif-doublespinbox.pngbin0 -> 1019 bytes
-rw-r--r--src/widgets/doc/images/motif-fontcombobox.pngbin0 -> 1633 bytes
-rw-r--r--src/widgets/doc/images/motif-frame.pngbin0 -> 5631 bytes
-rw-r--r--src/widgets/doc/images/motif-groupbox.pngbin0 -> 2514 bytes
-rw-r--r--src/widgets/doc/images/motif-horizontalscrollbar.pngbin0 -> 628 bytes
-rw-r--r--src/widgets/doc/images/motif-label.pngbin0 -> 699 bytes
-rw-r--r--src/widgets/doc/images/motif-lcdnumber.pngbin0 -> 538 bytes
-rw-r--r--src/widgets/doc/images/motif-lineedit.pngbin0 -> 1360 bytes
-rw-r--r--src/widgets/doc/images/motif-listview.pngbin0 -> 5189 bytes
-rw-r--r--src/widgets/doc/images/motif-menubar.pngbin0 -> 1350 bytes
-rw-r--r--src/widgets/doc/images/motif-progressbar.pngbin0 -> 927 bytes
-rw-r--r--src/widgets/doc/images/motif-pushbutton.pngbin0 -> 1045 bytes
-rw-r--r--src/widgets/doc/images/motif-radiobutton.pngbin0 -> 1545 bytes
-rw-r--r--src/widgets/doc/images/motif-slider.pngbin0 -> 543 bytes
-rw-r--r--src/widgets/doc/images/motif-spinbox.pngbin0 -> 875 bytes
-rw-r--r--src/widgets/doc/images/motif-tableview.pngbin0 -> 3102 bytes
-rw-r--r--src/widgets/doc/images/motif-tabwidget.pngbin0 -> 2490 bytes
-rw-r--r--src/widgets/doc/images/motif-textedit.pngbin0 -> 7378 bytes
-rw-r--r--src/widgets/doc/images/motif-timeedit.pngbin0 -> 1280 bytes
-rw-r--r--src/widgets/doc/images/motif-toolbox.pngbin0 -> 1667 bytes
-rw-r--r--src/widgets/doc/images/motif-toolbutton.pngbin0 -> 1152 bytes
-rw-r--r--src/widgets/doc/images/motif-treeview.pngbin0 -> 6386 bytes
-rw-r--r--src/widgets/doc/images/msgbox1.pngbin0 -> 4529 bytes
-rw-r--r--src/widgets/doc/images/msgbox2.pngbin0 -> 9175 bytes
-rw-r--r--src/widgets/doc/images/msgbox3.pngbin0 -> 9589 bytes
-rw-r--r--src/widgets/doc/images/msgbox4.pngbin0 -> 17520 bytes
-rw-r--r--src/widgets/doc/images/pangesture.pngbin0 -> 7153 bytes
-rw-r--r--src/widgets/doc/images/parent-child-widgets.pngbin0 -> 47824 bytes
-rw-r--r--src/widgets/doc/images/pinchgesture.pngbin0 -> 10094 bytes
-rw-r--r--src/widgets/doc/images/plastique-calendarwidget.pngbin0 -> 9629 bytes
-rw-r--r--src/widgets/doc/images/plastique-checkbox.pngbin0 -> 1069 bytes
-rw-r--r--src/widgets/doc/images/plastique-colordialog.pngbin0 -> 22595 bytes
-rw-r--r--src/widgets/doc/images/plastique-combobox.pngbin0 -> 1714 bytes
-rw-r--r--src/widgets/doc/images/plastique-dateedit.pngbin0 -> 1271 bytes
-rw-r--r--src/widgets/doc/images/plastique-datetimeedit.pngbin0 -> 1771 bytes
-rw-r--r--src/widgets/doc/images/plastique-dial.pngbin0 -> 2995 bytes
-rw-r--r--src/widgets/doc/images/plastique-doublespinbox.pngbin0 -> 1102 bytes
-rw-r--r--src/widgets/doc/images/plastique-fontcombobox.pngbin0 -> 1904 bytes
-rw-r--r--src/widgets/doc/images/plastique-fontdialog.pngbin0 -> 23835 bytes
-rw-r--r--src/widgets/doc/images/plastique-frame.pngbin0 -> 5616 bytes
-rw-r--r--src/widgets/doc/images/plastique-groupbox.pngbin0 -> 2704 bytes
-rw-r--r--src/widgets/doc/images/plastique-horizontalscrollbar.pngbin0 -> 868 bytes
-rw-r--r--src/widgets/doc/images/plastique-label.pngbin0 -> 696 bytes
-rw-r--r--src/widgets/doc/images/plastique-lcdnumber.pngbin0 -> 470 bytes
-rw-r--r--src/widgets/doc/images/plastique-lineedit.pngbin0 -> 1015 bytes
-rw-r--r--src/widgets/doc/images/plastique-listview.pngbin0 -> 4895 bytes
-rw-r--r--src/widgets/doc/images/plastique-menu.pngbin0 -> 3867 bytes
-rw-r--r--src/widgets/doc/images/plastique-menubar.pngbin0 -> 1030 bytes
-rw-r--r--src/widgets/doc/images/plastique-progressbar.pngbin0 -> 1044 bytes
-rw-r--r--src/widgets/doc/images/plastique-progressdialog.pngbin0 -> 6311 bytes
-rw-r--r--src/widgets/doc/images/plastique-pushbutton-menu.pngbin0 -> 3354 bytes
-rw-r--r--src/widgets/doc/images/plastique-pushbutton.pngbin0 -> 1409 bytes
-rw-r--r--src/widgets/doc/images/plastique-radiobutton.pngbin0 -> 1667 bytes
-rw-r--r--src/widgets/doc/images/plastique-sizegrip.pngbin0 -> 8168 bytes
-rw-r--r--src/widgets/doc/images/plastique-slider.pngbin0 -> 632 bytes
-rw-r--r--src/widgets/doc/images/plastique-spinbox.pngbin0 -> 968 bytes
-rw-r--r--src/widgets/doc/images/plastique-statusbar.pngbin0 -> 878 bytes
-rw-r--r--src/widgets/doc/images/plastique-tabbar-truncated.pngbin0 -> 2986 bytes
-rw-r--r--src/widgets/doc/images/plastique-tabbar.pngbin0 -> 2721 bytes
-rw-r--r--src/widgets/doc/images/plastique-tableview.pngbin0 -> 6052 bytes
-rw-r--r--src/widgets/doc/images/plastique-tabwidget.pngbin0 -> 4705 bytes
-rw-r--r--src/widgets/doc/images/plastique-textedit.pngbin0 -> 5141 bytes
-rw-r--r--src/widgets/doc/images/plastique-timeedit.pngbin0 -> 1336 bytes
-rw-r--r--src/widgets/doc/images/plastique-toolbox.pngbin0 -> 1858 bytes
-rw-r--r--src/widgets/doc/images/plastique-toolbutton.pngbin0 -> 1254 bytes
-rw-r--r--src/widgets/doc/images/plastique-treeview.pngbin0 -> 8453 bytes
-rw-r--r--src/widgets/doc/images/progressBar-stylesheet.pngbin0 -> 455 bytes
-rw-r--r--src/widgets/doc/images/progressBar2-stylesheet.pngbin0 -> 494 bytes
-rw-r--r--src/widgets/doc/images/propagation-custom.pngbin0 -> 163413 bytes
-rw-r--r--src/widgets/doc/images/propagation-standard.pngbin0 -> 83382 bytes
-rw-r--r--src/widgets/doc/images/qcalendarwidget-grid.pngbin0 -> 9601 bytes
-rw-r--r--src/widgets/doc/images/qcalendarwidget-maximum.pngbin0 -> 9709 bytes
-rw-r--r--src/widgets/doc/images/qcalendarwidget-minimum.pngbin0 -> 9770 bytes
-rw-r--r--src/widgets/doc/images/qcolumnview.pngbin0 -> 3075 bytes
-rw-r--r--src/widgets/doc/images/qdesktopwidget.pngbin0 -> 42328 bytes
-rw-r--r--src/widgets/doc/images/qformlayout-kde.pngbin0 -> 1703 bytes
-rw-r--r--src/widgets/doc/images/qformlayout-mac.pngbin0 -> 1706 bytes
-rw-r--r--src/widgets/doc/images/qformlayout-qpe.pngbin0 -> 1764 bytes
-rw-r--r--src/widgets/doc/images/qformlayout-win.pngbin0 -> 1743 bytes
-rw-r--r--src/widgets/doc/images/qformlayout-with-6-children.pngbin0 -> 3264 bytes
-rw-r--r--src/widgets/doc/images/qgraphicsproxywidget-embed.pngbin0 -> 2199 bytes
-rw-r--r--src/widgets/doc/images/qgridlayout-with-5-children.pngbin0 -> 3201 bytes
-rw-r--r--src/widgets/doc/images/qhboxlayout-with-5-children.pngbin0 -> 2652 bytes
-rw-r--r--src/widgets/doc/images/qmdisubwindowlayout.pngbin0 -> 3153 bytes
-rw-r--r--src/widgets/doc/images/qscrollarea-noscrollbars.pngbin0 -> 54671 bytes
-rw-r--r--src/widgets/doc/images/qscrollarea-onescrollbar.pngbin0 -> 77476 bytes
-rw-r--r--src/widgets/doc/images/qscrollarea-twoscrollbars.pngbin0 -> 78046 bytes
-rw-r--r--src/widgets/doc/images/qscrollbar-picture.pngbin0 -> 6568 bytes
-rw-r--r--src/widgets/doc/images/qscrollbar-values.pngbin0 -> 15902 bytes
-rw-r--r--src/widgets/doc/images/qspinbox-plusminus.pngbin0 -> 375 bytes
-rw-r--r--src/widgets/doc/images/qspinbox-updown.pngbin0 -> 402 bytes
-rw-r--r--src/widgets/doc/images/qstyle-comboboxes.pngbin0 -> 19437 bytes
-rw-r--r--src/widgets/doc/images/qstyleoptiontoolbar-position.pngbin0 -> 13707 bytes
-rw-r--r--src/widgets/doc/images/qtableview-resized.pngbin0 -> 42232 bytes
-rw-r--r--src/widgets/doc/images/qtwizard-aero1.pngbin0 -> 11749 bytes
-rw-r--r--src/widgets/doc/images/qtwizard-aero2.pngbin0 -> 16560 bytes
-rw-r--r--src/widgets/doc/images/qtwizard-classic1.pngbin0 -> 39640 bytes
-rw-r--r--src/widgets/doc/images/qtwizard-classic2.pngbin0 -> 8616 bytes
-rw-r--r--src/widgets/doc/images/qtwizard-mac1.pngbin0 -> 25478 bytes
-rw-r--r--src/widgets/doc/images/qtwizard-mac2.pngbin0 -> 29591 bytes
-rw-r--r--src/widgets/doc/images/qtwizard-macpage.pngbin0 -> 23095 bytes
-rw-r--r--src/widgets/doc/images/qtwizard-modern1.pngbin0 -> 45093 bytes
-rw-r--r--src/widgets/doc/images/qtwizard-modern2.pngbin0 -> 15081 bytes
-rw-r--r--src/widgets/doc/images/qtwizard-nonmacpage.pngbin0 -> 26557 bytes
-rw-r--r--src/widgets/doc/images/qundoview.pngbin0 -> 5993 bytes
-rw-r--r--src/widgets/doc/images/qvboxlayout-with-5-children.pngbin0 -> 2974 bytes
-rw-r--r--src/widgets/doc/images/simpleanchorlayout-example.pngbin0 -> 13463 bytes
-rw-r--r--src/widgets/doc/images/stylesheet-border-image-normal.pngbin0 -> 5769 bytes
-rw-r--r--src/widgets/doc/images/stylesheet-border-image-stretched.pngbin0 -> 12170 bytes
-rw-r--r--src/widgets/doc/images/stylesheet-border-image-wrong.pngbin0 -> 12887 bytes
-rw-r--r--src/widgets/doc/images/stylesheet-boxmodel.pngbin0 -> 18144 bytes
-rw-r--r--src/widgets/doc/images/stylesheet-branch-closed.pngbin0 -> 334 bytes
-rw-r--r--src/widgets/doc/images/stylesheet-branch-end.pngbin0 -> 182 bytes
-rw-r--r--src/widgets/doc/images/stylesheet-branch-more.pngbin0 -> 136 bytes
-rw-r--r--src/widgets/doc/images/stylesheet-branch-open.pngbin0 -> 346 bytes
-rw-r--r--src/widgets/doc/images/stylesheet-coffee-cleanlooks.pngbin0 -> 14820 bytes
-rw-r--r--src/widgets/doc/images/stylesheet-coffee-xp.pngbin0 -> 14200 bytes
-rw-r--r--src/widgets/doc/images/stylesheet-pagefold-mac.pngbin0 -> 20618 bytes
-rw-r--r--src/widgets/doc/images/stylesheet-pagefold.pngbin0 -> 15989 bytes
-rw-r--r--src/widgets/doc/images/stylesheet-redbutton1.pngbin0 -> 378 bytes
-rw-r--r--src/widgets/doc/images/stylesheet-redbutton2.pngbin0 -> 410 bytes
-rw-r--r--src/widgets/doc/images/stylesheet-redbutton3.pngbin0 -> 664 bytes
-rw-r--r--src/widgets/doc/images/stylesheet-scrollbar1.pngbin0 -> 150 bytes
-rw-r--r--src/widgets/doc/images/stylesheet-scrollbar2.pngbin0 -> 169 bytes
-rw-r--r--src/widgets/doc/images/stylesheet-treeview.pngbin0 -> 2412 bytes
-rw-r--r--src/widgets/doc/images/stylesheet-vline.pngbin0 -> 124 bytes
-rw-r--r--src/widgets/doc/images/swipegesture.pngbin0 -> 6864 bytes
-rw-r--r--src/widgets/doc/images/system-tray.pngbin0 -> 6326 bytes
-rw-r--r--src/widgets/doc/images/tabWidget-stylesheet1.pngbin0 -> 1321 bytes
-rw-r--r--src/widgets/doc/images/tabWidget-stylesheet2.pngbin0 -> 1434 bytes
-rw-r--r--src/widgets/doc/images/tabWidget-stylesheet3.pngbin0 -> 1206 bytes
-rw-r--r--src/widgets/doc/images/tableWidget-stylesheet.pngbin0 -> 3478 bytes
-rw-r--r--src/widgets/doc/images/widgetdelegate.pngbin0 -> 7449 bytes
-rw-r--r--src/widgets/doc/images/windows-calendarwidget.pngbin0 -> 5055 bytes
-rw-r--r--src/widgets/doc/images/windows-checkbox.pngbin0 -> 929 bytes
-rw-r--r--src/widgets/doc/images/windows-combobox.pngbin0 -> 1002 bytes
-rw-r--r--src/widgets/doc/images/windows-dateedit.pngbin0 -> 817 bytes
-rw-r--r--src/widgets/doc/images/windows-datetimeedit.pngbin0 -> 1026 bytes
-rw-r--r--src/widgets/doc/images/windows-dial.pngbin0 -> 4598 bytes
-rw-r--r--src/widgets/doc/images/windows-doublespinbox.pngbin0 -> 762 bytes
-rw-r--r--src/widgets/doc/images/windows-fontcombobox.pngbin0 -> 1022 bytes
-rw-r--r--src/widgets/doc/images/windows-frame.pngbin0 -> 1837 bytes
-rw-r--r--src/widgets/doc/images/windows-groupbox.pngbin0 -> 1617 bytes
-rw-r--r--src/widgets/doc/images/windows-horizontalscrollbar.pngbin0 -> 566 bytes
-rw-r--r--src/widgets/doc/images/windows-label.pngbin0 -> 696 bytes
-rw-r--r--src/widgets/doc/images/windows-lcdnumber.pngbin0 -> 491 bytes
-rw-r--r--src/widgets/doc/images/windows-lineedit.pngbin0 -> 884 bytes
-rw-r--r--src/widgets/doc/images/windows-listview.pngbin0 -> 2781 bytes
-rw-r--r--src/widgets/doc/images/windows-progressbar.pngbin0 -> 674 bytes
-rw-r--r--src/widgets/doc/images/windows-pushbutton.pngbin0 -> 722 bytes
-rw-r--r--src/widgets/doc/images/windows-radiobutton.pngbin0 -> 1005 bytes
-rw-r--r--src/widgets/doc/images/windows-slider.pngbin0 -> 485 bytes
-rw-r--r--src/widgets/doc/images/windows-spinbox.pngbin0 -> 667 bytes
-rw-r--r--src/widgets/doc/images/windows-tableview.pngbin0 -> 1738 bytes
-rw-r--r--src/widgets/doc/images/windows-tabwidget.pngbin0 -> 1707 bytes
-rw-r--r--src/widgets/doc/images/windows-textedit.pngbin0 -> 3192 bytes
-rw-r--r--src/widgets/doc/images/windows-timeedit.pngbin0 -> 873 bytes
-rw-r--r--src/widgets/doc/images/windows-toolbox.pngbin0 -> 925 bytes
-rw-r--r--src/widgets/doc/images/windows-toolbutton.pngbin0 -> 771 bytes
-rw-r--r--src/widgets/doc/images/windows-treeview.pngbin0 -> 2723 bytes
-rw-r--r--src/widgets/doc/images/windowsvista-calendarwidget.pngbin0 -> 5144 bytes
-rw-r--r--src/widgets/doc/images/windowsvista-checkbox.pngbin0 -> 1115 bytes
-rw-r--r--src/widgets/doc/images/windowsvista-combobox.pngbin0 -> 1457 bytes
-rw-r--r--src/widgets/doc/images/windowsvista-dateedit.pngbin0 -> 855 bytes
-rw-r--r--src/widgets/doc/images/windowsvista-datetimeedit.pngbin0 -> 1034 bytes
-rw-r--r--src/widgets/doc/images/windowsvista-dial.pngbin0 -> 2431 bytes
-rw-r--r--src/widgets/doc/images/windowsvista-doublespinbox.pngbin0 -> 852 bytes
-rw-r--r--src/widgets/doc/images/windowsvista-fontcombobox.pngbin0 -> 919 bytes
-rw-r--r--src/widgets/doc/images/windowsvista-frame.pngbin0 -> 1800 bytes
-rw-r--r--src/widgets/doc/images/windowsvista-groupbox.pngbin0 -> 1991 bytes
-rw-r--r--src/widgets/doc/images/windowsvista-horizontalscrollbar.pngbin0 -> 1049 bytes
-rw-r--r--src/widgets/doc/images/windowsvista-label.pngbin0 -> 599 bytes
-rw-r--r--src/widgets/doc/images/windowsvista-lcdnumber.pngbin0 -> 491 bytes
-rw-r--r--src/widgets/doc/images/windowsvista-lineedit.pngbin0 -> 873 bytes
-rw-r--r--src/widgets/doc/images/windowsvista-listview.pngbin0 -> 6872 bytes
-rw-r--r--src/widgets/doc/images/windowsvista-progressbar.pngbin0 -> 1437 bytes
-rw-r--r--src/widgets/doc/images/windowsvista-pushbutton.pngbin0 -> 1085 bytes
-rw-r--r--src/widgets/doc/images/windowsvista-radiobutton.pngbin0 -> 1266 bytes
-rw-r--r--src/widgets/doc/images/windowsvista-slider.pngbin0 -> 624 bytes
-rw-r--r--src/widgets/doc/images/windowsvista-spinbox.pngbin0 -> 767 bytes
-rw-r--r--src/widgets/doc/images/windowsvista-tableview.pngbin0 -> 3941 bytes
-rw-r--r--src/widgets/doc/images/windowsvista-tabwidget.pngbin0 -> 3286 bytes
-rw-r--r--src/widgets/doc/images/windowsvista-textedit.pngbin0 -> 3122 bytes
-rw-r--r--src/widgets/doc/images/windowsvista-timeedit.pngbin0 -> 764 bytes
-rw-r--r--src/widgets/doc/images/windowsvista-toolbox.pngbin0 -> 891 bytes
-rw-r--r--src/widgets/doc/images/windowsvista-toolbutton.pngbin0 -> 981 bytes
-rw-r--r--src/widgets/doc/images/windowsvista-treeview.pngbin0 -> 5760 bytes
-rw-r--r--src/widgets/doc/images/windowsxp-calendarwidget.pngbin0 -> 5009 bytes
-rw-r--r--src/widgets/doc/images/windowsxp-checkbox.pngbin0 -> 1006 bytes
-rw-r--r--src/widgets/doc/images/windowsxp-combobox.pngbin0 -> 1450 bytes
-rw-r--r--src/widgets/doc/images/windowsxp-dateedit.pngbin0 -> 1107 bytes
-rw-r--r--src/widgets/doc/images/windowsxp-datetimeedit.pngbin0 -> 1321 bytes
-rw-r--r--src/widgets/doc/images/windowsxp-dial.pngbin0 -> 4598 bytes
-rw-r--r--src/widgets/doc/images/windowsxp-doublespinbox.pngbin0 -> 1065 bytes
-rw-r--r--src/widgets/doc/images/windowsxp-fontcombobox.pngbin0 -> 1408 bytes
-rw-r--r--src/widgets/doc/images/windowsxp-frame.pngbin0 -> 1837 bytes
-rw-r--r--src/widgets/doc/images/windowsxp-groupbox.pngbin0 -> 2016 bytes
-rw-r--r--src/widgets/doc/images/windowsxp-horizontalscrollbar.pngbin0 -> 1498 bytes
-rw-r--r--src/widgets/doc/images/windowsxp-label.pngbin0 -> 696 bytes
-rw-r--r--src/widgets/doc/images/windowsxp-lcdnumber.pngbin0 -> 493 bytes
-rw-r--r--src/widgets/doc/images/windowsxp-lineedit.pngbin0 -> 861 bytes
-rw-r--r--src/widgets/doc/images/windowsxp-listview.pngbin0 -> 5391 bytes
-rw-r--r--src/widgets/doc/images/windowsxp-menu.pngbin0 -> 1442 bytes
-rw-r--r--src/widgets/doc/images/windowsxp-progressbar.pngbin0 -> 1007 bytes
-rw-r--r--src/widgets/doc/images/windowsxp-pushbutton.pngbin0 -> 1462 bytes
-rw-r--r--src/widgets/doc/images/windowsxp-radiobutton.pngbin0 -> 1270 bytes
-rw-r--r--src/widgets/doc/images/windowsxp-slider.pngbin0 -> 732 bytes
-rw-r--r--src/widgets/doc/images/windowsxp-spinbox.pngbin0 -> 974 bytes
-rw-r--r--src/widgets/doc/images/windowsxp-tableview.pngbin0 -> 3204 bytes
-rw-r--r--src/widgets/doc/images/windowsxp-tabwidget.pngbin0 -> 5220 bytes
-rw-r--r--src/widgets/doc/images/windowsxp-textedit.pngbin0 -> 3159 bytes
-rw-r--r--src/widgets/doc/images/windowsxp-timeedit.pngbin0 -> 1172 bytes
-rw-r--r--src/widgets/doc/images/windowsxp-toolbox.pngbin0 -> 925 bytes
-rw-r--r--src/widgets/doc/images/windowsxp-toolbutton.pngbin0 -> 1549 bytes
-rw-r--r--src/widgets/doc/images/windowsxp-treeview.pngbin0 -> 5795 bytes
-rw-r--r--src/widgets/doc/qtwidgets.qdocconf92
-rw-r--r--src/widgets/doc/snippets/code/doc_src_layout.cpp166
-rw-r--r--src/widgets/doc/snippets/code/doc_src_qt4-styles.cpp82
-rw-r--r--src/widgets/doc/snippets/code/doc_src_qtwidgets.cpp43
-rw-r--r--src/widgets/doc/snippets/code/doc_src_qtwidgets.pro43
-rw-r--r--src/widgets/doc/snippets/code/doc_src_styles.cpp134
-rw-r--r--src/widgets/doc/snippets/code/doc_src_stylesheet.cpp140
-rw-r--r--src/widgets/doc/snippets/code/doc_src_stylesheet.qdoc1866
-rw-r--r--src/widgets/doc/snippets/code/src_gui_dialogs_qfiledialog.cpp131
-rw-r--r--src/widgets/doc/snippets/code/src_gui_dialogs_qfontdialog.cpp85
-rw-r--r--src/widgets/doc/snippets/code/src_gui_dialogs_qmessagebox.cpp148
-rw-r--r--src/widgets/doc/snippets/code/src_gui_dialogs_qwizard.cpp80
-rw-r--r--src/widgets/doc/snippets/code/src_gui_effects_qgraphicseffect.cpp83
-rw-r--r--src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicsgridlayout.cpp53
-rw-r--r--src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp278
-rw-r--r--src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicslinearlayout.cpp53
-rw-r--r--src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicsproxywidget.cpp87
-rw-r--r--src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicsscene.cpp122
-rw-r--r--src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicssceneevent.cpp45
-rw-r--r--src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicsview.cpp132
-rw-r--r--src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicswidget.cpp66
-rw-r--r--src/widgets/doc/snippets/code/src_gui_image_qicon.cpp71
-rw-r--r--src/widgets/doc/snippets/code/src_gui_image_qpixmapfilter.cpp62
-rw-r--r--src/widgets/doc/snippets/code/src_gui_itemviews_qabstractitemview.cpp58
-rw-r--r--src/widgets/doc/snippets/code/src_gui_itemviews_qdatawidgetmapper.cpp63
-rw-r--r--src/widgets/doc/snippets/code/src_gui_itemviews_qitemeditorfactory.cpp63
-rw-r--r--src/widgets/doc/snippets/code/src_gui_itemviews_qstandarditemmodel.cpp82
-rw-r--r--src/widgets/doc/snippets/code/src_gui_itemviews_qtablewidget.cpp45
-rw-r--r--src/widgets/doc/snippets/code/src_gui_itemviews_qtreewidget.cpp48
-rw-r--r--src/widgets/doc/snippets/code/src_gui_kernel_qaction.cpp49
-rw-r--r--src/widgets/doc/snippets/code/src_gui_kernel_qapplication.cpp183
-rw-r--r--src/widgets/doc/snippets/code/src_gui_kernel_qformlayout.cpp76
-rw-r--r--src/widgets/doc/snippets/code/src_gui_kernel_qlayout.cpp67
-rw-r--r--src/widgets/doc/snippets/code/src_gui_kernel_qlayoutitem.cpp53
-rw-r--r--src/widgets/doc/snippets/code/src_gui_kernel_qshortcut.cpp55
-rw-r--r--src/widgets/doc/snippets/code/src_gui_kernel_qwidget.cpp137
-rw-r--r--src/widgets/doc/snippets/code/src_gui_painting_qdrawutil.cpp98
-rw-r--r--src/widgets/doc/snippets/code/src_gui_qproxystyle.cpp85
-rw-r--r--src/widgets/doc/snippets/code/src_gui_styles_qstyle.cpp48
-rw-r--r--src/widgets/doc/snippets/code/src_gui_styles_qstyleoption.cpp54
-rw-r--r--src/widgets/doc/snippets/code/src_gui_util_qcompleter.cpp63
-rw-r--r--src/widgets/doc/snippets/code/src_gui_util_qundostack.cpp109
-rw-r--r--src/widgets/doc/snippets/code/src_gui_widgets_qabstractbutton.cpp60
-rw-r--r--src/widgets/doc/snippets/code/src_gui_widgets_qabstractspinbox.cpp48
-rw-r--r--src/widgets/doc/snippets/code/src_gui_widgets_qcalendarwidget.cpp79
-rw-r--r--src/widgets/doc/snippets/code/src_gui_widgets_qcheckbox.cpp43
-rw-r--r--src/widgets/doc/snippets/code/src_gui_widgets_qdatetimeedit.cpp79
-rw-r--r--src/widgets/doc/snippets/code/src_gui_widgets_qdockwidget.cpp48
-rw-r--r--src/widgets/doc/snippets/code/src_gui_widgets_qframe.cpp48
-rw-r--r--src/widgets/doc/snippets/code/src_gui_widgets_qgroupbox.cpp43
-rw-r--r--src/widgets/doc/snippets/code/src_gui_widgets_qlabel.cpp64
-rw-r--r--src/widgets/doc/snippets/code/src_gui_widgets_qlineedit.cpp50
-rw-r--r--src/widgets/doc/snippets/code/src_gui_widgets_qmainwindow.cpp59
-rw-r--r--src/widgets/doc/snippets/code/src_gui_widgets_qmenu.cpp77
-rw-r--r--src/widgets/doc/snippets/code/src_gui_widgets_qmenubar.cpp48
-rw-r--r--src/widgets/doc/snippets/code/src_gui_widgets_qplaintextedit.cpp55
-rw-r--r--src/widgets/doc/snippets/code/src_gui_widgets_qpushbutton.cpp43
-rw-r--r--src/widgets/doc/snippets/code/src_gui_widgets_qradiobutton.cpp43
-rw-r--r--src/widgets/doc/snippets/code/src_gui_widgets_qrubberband.cpp62
-rw-r--r--src/widgets/doc/snippets/code/src_gui_widgets_qscrollarea.cpp49
-rw-r--r--src/widgets/doc/snippets/code/src_gui_widgets_qspinbox.cpp80
-rw-r--r--src/widgets/doc/snippets/code/src_gui_widgets_qsplashscreen.cpp55
-rw-r--r--src/widgets/doc/snippets/code/src_gui_widgets_qsplitter.cpp47
-rw-r--r--src/widgets/doc/snippets/code/src_gui_widgets_qstatusbar.cpp43
-rw-r--r--src/widgets/doc/snippets/code/src_gui_widgets_qtextbrowser.cpp44
-rw-r--r--src/widgets/doc/snippets/code/src_gui_widgets_qtextedit.cpp60
-rw-r--r--src/widgets/doc/snippets/customstyle/customstyle.cpp92
-rw-r--r--src/widgets/doc/snippets/customstyle/customstyle.h60
-rw-r--r--src/widgets/doc/snippets/customstyle/customstyle.pro2
-rw-r--r--src/widgets/doc/snippets/customstyle/main.cpp54
-rw-r--r--src/widgets/doc/snippets/customviewstyle.cpp69
-rw-r--r--src/widgets/doc/snippets/dialogs/dialogs.cpp268
-rw-r--r--src/widgets/doc/snippets/filedialogurls.cpp61
-rw-r--r--src/widgets/doc/snippets/graphicssceneadditemsnippet.cpp80
-rw-r--r--src/widgets/doc/snippets/javastyle.cpp2745
-rw-r--r--src/widgets/doc/snippets/layouts/layouts.cpp165
-rw-r--r--src/widgets/doc/snippets/mainwindowsnippet.cpp92
-rw-r--r--src/widgets/doc/snippets/mdiareasnippets.cpp97
-rw-r--r--src/widgets/doc/snippets/myscrollarea.cpp128
-rw-r--r--src/widgets/doc/snippets/qlistwidget-using/mainwindow.cpp158
-rw-r--r--src/widgets/doc/snippets/qmacnativewidget/main.mm84
-rw-r--r--src/widgets/doc/snippets/qsplashscreen/main.cpp63
-rw-r--r--src/widgets/doc/snippets/qstackedlayout/main.cpp89
-rw-r--r--src/widgets/doc/snippets/qstackedwidget/main.cpp87
-rw-r--r--src/widgets/doc/snippets/qstyleoption/main.cpp139
-rw-r--r--src/widgets/doc/snippets/qstyleplugin/main.cpp97
-rw-r--r--src/widgets/doc/snippets/qtablewidget-resizing/mainwindow.cpp115
-rw-r--r--src/widgets/doc/snippets/qtablewidget-using/mainwindow.cpp150
-rw-r--r--src/widgets/doc/snippets/qtreewidget-using/mainwindow.cpp230
-rw-r--r--src/widgets/doc/snippets/qtreewidgetitemiterator-using/mainwindow.cpp197
-rw-r--r--src/widgets/doc/snippets/shareddirmodel/main.cpp81
-rw-r--r--src/widgets/doc/snippets/splitter/splitter.cpp84
-rw-r--r--src/widgets/doc/snippets/splitterhandle/splitter.cpp78
-rw-r--r--src/widgets/doc/snippets/splitterhandle/splitter.h73
-rw-r--r--src/widgets/doc/snippets/styles/styles.cpp91
-rw-r--r--src/widgets/doc/snippets/stylesheet/common-mistakes.cpp52
-rw-r--r--src/widgets/doc/snippets/textdocument-imagedrop/textedit.cpp71
-rw-r--r--src/widgets/doc/snippets/timeline/main.cpp72
-rw-r--r--src/widgets/doc/snippets/whatsthis/whatsthis.cpp64
-rw-r--r--src/widgets/doc/snippets/widget-mask/main.cpp54
-rw-r--r--src/widgets/doc/snippets/widgetdelegate.cpp66
-rw-r--r--src/widgets/doc/src/qtwidgets.qdoc45
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/focus.qdoc186
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/gallery-cde.qdoc133
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/gallery-cleanlooks.qdoc138
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/gallery-gtk.qdoc141
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/gallery-macintosh.qdoc138
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/gallery-motif.qdoc138
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/gallery-plastique.qdoc138
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/gallery-windows.qdoc138
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/gallery-windowsvista.qdoc138
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/gallery-windowsxp.qdoc138
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/gallery.qdoc84
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/layout.qdoc396
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/styles.qdoc2102
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc3963
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/widgets.qdoc162
-rw-r--r--src/widgets/effects/qgraphicseffect.cpp6
-rw-r--r--src/widgets/effects/qpixmapfilter.cpp6
-rw-r--r--src/widgets/graphicsview/qgraphicsanchorlayout.cpp12
-rw-r--r--src/widgets/graphicsview/qgraphicsgridlayout.cpp2
-rw-r--r--src/widgets/graphicsview/qgraphicsitem.cpp48
-rw-r--r--src/widgets/graphicsview/qgraphicsitemanimation.cpp2
-rw-r--r--src/widgets/graphicsview/qgraphicslinearlayout.cpp2
-rw-r--r--src/widgets/graphicsview/qgraphicsproxywidget.cpp6
-rw-r--r--src/widgets/graphicsview/qgraphicsscene.cpp14
-rw-r--r--src/widgets/graphicsview/qgraphicssceneevent.cpp2
-rw-r--r--src/widgets/graphicsview/qgraphicsview.cpp16
-rw-r--r--src/widgets/graphicsview/qgraphicswidget.cpp6
-rw-r--r--src/widgets/itemviews/qabstractitemdelegate.cpp2
-rw-r--r--src/widgets/itemviews/qabstractitemview.cpp6
-rw-r--r--src/widgets/itemviews/qdatawidgetmapper.cpp6
-rw-r--r--src/widgets/itemviews/qitemdelegate.cpp20
-rw-r--r--src/widgets/itemviews/qitemeditorfactory.cpp8
-rw-r--r--src/widgets/itemviews/qlistwidget.cpp12
-rw-r--r--src/widgets/itemviews/qstandarditemmodel.cpp10
-rw-r--r--src/widgets/itemviews/qstyleditemdelegate.cpp18
-rw-r--r--src/widgets/itemviews/qtablewidget.cpp14
-rw-r--r--src/widgets/itemviews/qtreeview.cpp4
-rw-r--r--src/widgets/itemviews/qtreewidget.cpp6
-rw-r--r--src/widgets/itemviews/qtreewidgetitemiterator.cpp2
-rw-r--r--src/widgets/kernel/qaction.cpp10
-rw-r--r--src/widgets/kernel/qactiongroup.cpp6
-rw-r--r--src/widgets/kernel/qapplication.cpp36
-rw-r--r--src/widgets/kernel/qboxlayout.cpp24
-rw-r--r--src/widgets/kernel/qformlayout.cpp6
-rw-r--r--src/widgets/kernel/qicon.cpp10
-rw-r--r--src/widgets/kernel/qlayout.cpp4
-rw-r--r--src/widgets/kernel/qlayoutitem.cpp2
-rw-r--r--src/widgets/kernel/qshortcut.cpp10
-rw-r--r--src/widgets/kernel/qstackedlayout.cpp8
-rw-r--r--src/widgets/kernel/qwhatsthis.cpp2
-rw-r--r--src/widgets/kernel/qwidget.cpp30
-rw-r--r--src/widgets/styles/qdrawutil.cpp20
-rw-r--r--src/widgets/styles/qproxystyle.cpp2
-rw-r--r--src/widgets/styles/qstyle.cpp30
-rw-r--r--src/widgets/styles/qstyleoption.cpp8
-rw-r--r--src/widgets/styles/qstylepainter.cpp8
-rw-r--r--src/widgets/styles/qstyleplugin.cpp6
-rw-r--r--src/widgets/util/qcompleter.cpp6
-rw-r--r--src/widgets/util/qundostack.cpp12
-rw-r--r--src/widgets/widgets/qabstractbutton.cpp6
-rw-r--r--src/widgets/widgets/qabstractscrollarea.cpp4
-rw-r--r--src/widgets/widgets/qabstractspinbox.cpp4
-rw-r--r--src/widgets/widgets/qcalendarwidget.cpp12
-rw-r--r--src/widgets/widgets/qcheckbox.cpp2
-rw-r--r--src/widgets/widgets/qdatetimeedit.cpp14
-rw-r--r--src/widgets/widgets/qdialogbuttonbox.cpp8
-rw-r--r--src/widgets/widgets/qdockwidget.cpp2
-rw-r--r--src/widgets/widgets/qframe.cpp2
-rw-r--r--src/widgets/widgets/qgroupbox.cpp4
-rw-r--r--src/widgets/widgets/qlabel.cpp6
-rw-r--r--src/widgets/widgets/qlineedit.cpp2
-rw-r--r--src/widgets/widgets/qmaccocoaviewcontainer_mac.mm2
-rw-r--r--src/widgets/widgets/qmacnativewidget_mac.mm4
-rw-r--r--src/widgets/widgets/qmainwindow.cpp12
-rw-r--r--src/widgets/widgets/qmdiarea.cpp4
-rw-r--r--src/widgets/widgets/qmenu.cpp14
-rw-r--r--src/widgets/widgets/qmenubar.cpp12
-rw-r--r--src/widgets/widgets/qplaintextedit.cpp8
-rw-r--r--src/widgets/widgets/qpushbutton.cpp2
-rw-r--r--src/widgets/widgets/qradiobutton.cpp2
-rw-r--r--src/widgets/widgets/qrubberband.cpp2
-rw-r--r--src/widgets/widgets/qscrollarea.cpp2
-rw-r--r--src/widgets/widgets/qspinbox.cpp20
-rw-r--r--src/widgets/widgets/qsplashscreen.cpp6
-rw-r--r--src/widgets/widgets/qsplitter.cpp14
-rw-r--r--src/widgets/widgets/qstackedwidget.cpp8
-rw-r--r--src/widgets/widgets/qstatusbar.cpp6
-rw-r--r--src/widgets/widgets/qtextbrowser.cpp2
-rw-r--r--src/widgets/widgets/qtextedit.cpp14
604 files changed, 21626 insertions, 513 deletions
diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp
index d7a8f5dc21..f034590ccb 100644
--- a/src/widgets/dialogs/qcolordialog.cpp
+++ b/src/widgets/dialogs/qcolordialog.cpp
@@ -1717,7 +1717,7 @@ QColor QColorDialog::currentColor() const
}
/*!
- Returns the color that the user selected by clicking the \gui{OK}
+ Returns the color that the user selected by clicking the \uicontrol{OK}
or equivalent button.
\note This color is not always the same as the color held by the
@@ -1795,7 +1795,7 @@ QColorDialog::ColorDialogOptions QColorDialog::options() const
of a color dialog.
\value ShowAlphaChannel Allow the user to select the alpha component of a color.
- \value NoButtons Don't display \gui{OK} and \gui{Cancel} buttons. (Useful for "live dialogs".)
+ \value NoButtons Don't display \uicontrol{OK} and \uicontrol{Cancel} buttons. (Useful for "live dialogs".)
\value DontUseNativeDialog Use Qt's standard color dialog on the Mac instead of Apple's
native color panel.
@@ -1819,7 +1819,7 @@ bool QColorDialogPrivate::sharedColorPanelAvailable = true;
/*!
\fn void QColorDialog::colorSelected(const QColor &color);
- This signal is emitted just after the user has clicked \gui{OK} to
+ This signal is emitted just after the user has clicked \uicontrol{OK} to
select a color to use. The chosen color is specified by \a color.
\sa color, currentColorChanged()
@@ -1933,7 +1933,7 @@ QColor QColorDialog::getColor(const QColor &initial, QWidget *parent, const QStr
initially set to \a initial. The dialog is a child of \a parent.
If \a ok is non-null, \e *\a ok is set to true if the user clicked
- \gui{OK}, and to false if the user clicked Cancel.
+ \uicontrol{OK}, and to false if the user clicked Cancel.
If the user clicks Cancel, the \a initial value is returned.
diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp
index 718d64bd27..9410a9b62b 100644
--- a/src/widgets/dialogs/qdialog.cpp
+++ b/src/widgets/dialogs/qdialog.cpp
@@ -181,8 +181,8 @@ QVariant QDialogPrivate::styleHint(QPlatformDialogHelper::StyleHint hint) const
exec() function. When the user closes the dialog, exec() will
provide a useful \link #return return value\endlink. Typically,
to get the dialog to close and return the appropriate value, we
- connect a default button, e.g. \gui OK, to the accept() slot and a
- \gui Cancel button to the reject() slot.
+ connect a default button, e.g. \uicontrol OK, to the accept() slot and a
+ \uicontrol Cancel button to the reject() slot.
Alternatively you can call the done() slot with \c Accepted or
\c Rejected.
@@ -239,7 +239,7 @@ QVariant QDialogPrivate::styleHint(QPlatformDialogHelper::StyleHint hint) const
partial dialog that shows the most commonly used options, and a
full dialog that shows all the options. Typically an extensible
dialog will initially appear as a partial dialog, but with a
- \gui More toggle button. If the user presses the \gui More button down,
+ \uicontrol More toggle button. If the user presses the \uicontrol More button down,
the dialog is expanded. The \l{Extension Example} shows how to achieve
extensible dialogs using Qt.
@@ -247,8 +247,8 @@ QVariant QDialogPrivate::styleHint(QPlatformDialogHelper::StyleHint hint) const
\section1 Return Value (Modal Dialogs)
Modal dialogs are often used in situations where a return value is
- required, e.g. to indicate whether the user pressed \gui OK or
- \gui Cancel. A dialog can be closed by calling the accept() or the
+ required, e.g. to indicate whether the user pressed \uicontrol OK or
+ \uicontrol Cancel. A dialog can be closed by calling the accept() or the
reject() slots, and exec() will return \c Accepted or \c Rejected
as appropriate. The exec() call returns the result of the dialog.
The result is also available from result() if the dialog has not
@@ -265,11 +265,11 @@ QVariant QDialogPrivate::styleHint(QPlatformDialogHelper::StyleHint hint) const
A modal dialog:
- \snippet doc/src/snippets/dialogs/dialogs.cpp 1
+ \snippet dialogs/dialogs.cpp 1
A modeless dialog:
- \snippet doc/src/snippets/dialogs/dialogs.cpp 0
+ \snippet dialogs/dialogs.cpp 0
\sa QDialogButtonBox, QTabWidget, QWidget, QProgressDialog,
{fowler}{GUI Design Handbook: Dialogs, Standard}, {Extension Example},
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index 3908daec9c..43bb164366 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -108,7 +108,7 @@ Q_WIDGETS_EXPORT _qt_filedialog_save_filename_hook qt_filedialog_save_filename_h
functions. On Windows, Mac OS X, KDE and GNOME, these static functions will
call the native file dialog when possible.
- \snippet doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp 0
+ \snippet code/src_gui_dialogs_qfiledialog.cpp 0
In the above example, a modal QFileDialog is created using a static
function. The dialog initially displays the contents of the "/home/jana"
@@ -119,13 +119,13 @@ Q_WIDGETS_EXPORT _qt_filedialog_save_filename_hook qt_filedialog_save_filename_h
If you want to use multiple filters, separate each one with
\e two semicolons. For example:
- \snippet doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp 1
+ \snippet code/src_gui_dialogs_qfiledialog.cpp 1
You can create your own QFileDialog without using the static
functions. By calling setFileMode(), you can specify what the user must
select in the dialog:
- \snippet doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp 2
+ \snippet code/src_gui_dialogs_qfiledialog.cpp 2
In the above example, the mode of the file dialog is set to
AnyFile, meaning that the user can select any file, or even specify a
@@ -138,7 +138,7 @@ Q_WIDGETS_EXPORT _qt_filedialog_save_filename_hook qt_filedialog_save_filename_h
this indicates what types of objects the user is expected to select.
Use setNameFilter() to set the dialog's file filter. For example:
- \snippet doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp 3
+ \snippet code/src_gui_dialogs_qfiledialog.cpp 3
In the above example, the filter is set to \c{"Images (*.png *.xpm *.jpg)"},
this means that only files with the extension \c png, \c xpm,
@@ -154,12 +154,12 @@ Q_WIDGETS_EXPORT _qt_filedialog_save_filename_hook qt_filedialog_save_filename_h
information alongside each name, such as the file size and modification
date. Set the mode with setViewMode():
- \snippet doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp 4
+ \snippet code/src_gui_dialogs_qfiledialog.cpp 4
The last important function you will need to use when creating your
own file dialog is selectedFiles().
- \snippet doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp 5
+ \snippet code/src_gui_dialogs_qfiledialog.cpp 5
In the above example, a modal file dialog is created and shown. If
the user clicked OK, the file they selected is put in \c fileName.
@@ -377,7 +377,7 @@ QFileDialog::~QFileDialog()
For instance:
- \snippet doc/src/snippets/filedialogurls.cpp 0
+ \snippet filedialogurls.cpp 0
The file dialog will then look like this:
@@ -1100,7 +1100,7 @@ QStringList qt_make_filter_list(const QString &filter)
text contained in the parentheses is used as the filter. This means
that these calls are all equivalent:
- \snippet doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp 6
+ \snippet code/src_gui_dialogs_qfiledialog.cpp 6
\sa setNameFilters()
*/
@@ -1156,7 +1156,7 @@ QStringList qt_strip_filters(const QStringList &filters)
Sets the \a filters used in the file dialog.
- \snippet doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp 7
+ \snippet code/src_gui_dialogs_qfiledialog.cpp 7
*/
void QFileDialog::setNameFilters(const QStringList &filters)
{
@@ -1707,7 +1707,7 @@ extern QString qt_win_get_existing_directory(const QFileDialogArgs &args);
This is a convenience static function that returns an existing file
selected by the user. If the user presses Cancel, it returns a null string.
- \snippet doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp 8
+ \snippet code/src_gui_dialogs_qfiledialog.cpp 8
The function creates a modal file dialog with the given \a parent widget.
If \a parent is not 0, the dialog will be shown centered over the parent
@@ -1789,7 +1789,7 @@ QString QFileDialog::getOpenFileName(QWidget *parent,
This is a convenience static function that will return one or more existing
files selected by the user.
- \snippet doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp 9
+ \snippet code/src_gui_dialogs_qfiledialog.cpp 9
This function creates a modal file dialog with the given \a parent widget.
If \a parent is not 0, the dialog will be shown centered over the parent
@@ -1826,7 +1826,7 @@ QString QFileDialog::getOpenFileName(QWidget *parent,
\note If you want to iterate over the list of files, you should iterate
over a copy. For example:
- \snippet doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp 10
+ \snippet code/src_gui_dialogs_qfiledialog.cpp 10
\warning Do not delete \a parent during the execution of the dialog. If you
want to do this, you should create the dialog yourself using one of the
@@ -1878,7 +1878,7 @@ QStringList QFileDialog::getOpenFileNames(QWidget *parent,
\a parent is not 0, the dialog will be shown centered over the parent
widget.
- \snippet doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp 11
+ \snippet code/src_gui_dialogs_qfiledialog.cpp 11
The file dialog's working directory will be set to \a dir. If \a dir
includes a file name, the file will be selected. Only files that match the
@@ -1962,7 +1962,7 @@ QString QFileDialog::getSaveFileName(QWidget *parent,
This is a convenience static function that will return an existing
directory selected by the user.
- \snippet doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp 12
+ \snippet code/src_gui_dialogs_qfiledialog.cpp 12
This function creates a modal file dialog with the given \a parent widget.
If \a parent is not 0, the dialog will be shown centered over the parent
diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp
index 40cc100c53..06733a8932 100644
--- a/src/widgets/dialogs/qfilesystemmodel.cpp
+++ b/src/widgets/dialogs/qfilesystemmodel.cpp
@@ -95,16 +95,16 @@ QT_BEGIN_NAMESPACE
A directory model that displays the contents of a default directory
is usually constructed with a parent object:
- \snippet doc/src/snippets/shareddirmodel/main.cpp 2
+ \snippet shareddirmodel/main.cpp 2
A tree view can be used to display the contents of the model
- \snippet doc/src/snippets/shareddirmodel/main.cpp 4
+ \snippet shareddirmodel/main.cpp 4
and the contents of a particular directory can be displayed by
setting the tree view's root index:
- \snippet doc/src/snippets/shareddirmodel/main.cpp 7
+ \snippet shareddirmodel/main.cpp 7
The view's root index can be used to control how much of a
hierarchical model is displayed. QDirModel provides a convenience
diff --git a/src/widgets/dialogs/qfontdialog.cpp b/src/widgets/dialogs/qfontdialog.cpp
index b267f67422..23fac31822 100644
--- a/src/widgets/dialogs/qfontdialog.cpp
+++ b/src/widgets/dialogs/qfontdialog.cpp
@@ -122,10 +122,10 @@ static const Qt::WindowFlags DefaultWindowFlags =
Examples:
- \snippet doc/src/snippets/code/src_gui_dialogs_qfontdialog.cpp 0
+ \snippet code/src_gui_dialogs_qfontdialog.cpp 0
The dialog can also be used to set a widget's font directly:
- \snippet doc/src/snippets/code/src_gui_dialogs_qfontdialog.cpp 1
+ \snippet code/src_gui_dialogs_qfontdialog.cpp 1
If the user clicks OK the font they chose will be used for myWidget,
and if they click Cancel the original font is used.
@@ -345,20 +345,20 @@ QFontDialog::~QFontDialog()
/*!
Executes a modal font dialog and returns a font.
- If the user clicks \gui OK, the selected font is returned. If the user
- clicks \gui Cancel, the \a initial font is returned.
+ If the user clicks \uicontrol OK, the selected font is returned. If the user
+ clicks \uicontrol Cancel, the \a initial font is returned.
The dialog is constructed with the given \a parent and the options specified
in \a options. \a title is shown as the window title of the dialog and \a
initial is the initially selected font. If the \a ok parameter is not-null,
- the value it refers to is set to true if the user clicks \gui OK, and set to
- false if the user clicks \gui Cancel.
+ the value it refers to is set to true if the user clicks \uicontrol OK, and set to
+ false if the user clicks \uicontrol Cancel.
Examples:
- \snippet doc/src/snippets/code/src_gui_dialogs_qfontdialog.cpp 2
+ \snippet code/src_gui_dialogs_qfontdialog.cpp 2
The dialog can also be used to set a widget's font directly:
- \snippet doc/src/snippets/code/src_gui_dialogs_qfontdialog.cpp 3
+ \snippet code/src_gui_dialogs_qfontdialog.cpp 3
In this example, if the user clicks OK the font they chose will be
used, and if they click Cancel the original font is used.
@@ -377,16 +377,16 @@ QFont QFontDialog::getFont(bool *ok, const QFont &initial, QWidget *parent, cons
Executes a modal font dialog and returns a font.
- If the user clicks \gui OK, the selected font is returned. If the user
- clicks \gui Cancel, the Qt default font is returned.
+ If the user clicks \uicontrol OK, the selected font is returned. If the user
+ clicks \uicontrol Cancel, the Qt default font is returned.
The dialog is constructed with the given \a parent.
If the \a ok parameter is not-null, the value it refers to is set
- to true if the user clicks \gui OK, and false if the user clicks
- \gui Cancel.
+ to true if the user clicks \uicontrol OK, and false if the user clicks
+ \uicontrol Cancel.
Example:
- \snippet doc/src/snippets/code/src_gui_dialogs_qfontdialog.cpp 4
+ \snippet code/src_gui_dialogs_qfontdialog.cpp 4
\warning Do not delete \a parent during the execution of the dialog.
If you want to do this, you should create the dialog
@@ -829,7 +829,7 @@ QFont QFontDialog::currentFont() const
}
/*!
- Returns the font that the user selected by clicking the \gui{OK}
+ Returns the font that the user selected by clicking the \uicontrol{OK}
or equivalent button.
\note This font is not always the same as the font held by the
@@ -849,7 +849,7 @@ QFont QFontDialog::selectedFont() const
This enum specifies various options that affect the look and feel
of a font dialog.
- \value NoButtons Don't display \gui{OK} and \gui{Cancel} buttons. (Useful for "live dialogs".)
+ \value NoButtons Don't display \uicontrol{OK} and \uicontrol{Cancel} buttons. (Useful for "live dialogs".)
\value DontUseNativeDialog Use Qt's standard font dialog on the Mac instead of Apple's
native font panel. (Currently, the native dialog is never used,
but this is likely to change in future Qt releases.)
diff --git a/src/widgets/dialogs/qinputdialog.cpp b/src/widgets/dialogs/qinputdialog.cpp
index 737d6bb467..13be3fcbe4 100644
--- a/src/widgets/dialogs/qinputdialog.cpp
+++ b/src/widgets/dialogs/qinputdialog.cpp
@@ -442,9 +442,9 @@ void QInputDialogPrivate::_q_currentRowChanged(const QModelIndex &newIndex,
getDouble(), and getItem(). All the functions can be used in a similar way,
for example:
- \snippet examples/dialogs/standarddialogs/dialog.cpp 3
+ \snippet dialogs/standarddialogs/dialog.cpp 3
- The \c ok variable is set to true if the user clicks \gui OK; otherwise it
+ The \c ok variable is set to true if the user clicks \uicontrol OK; otherwise it
is set to false.
\img inputdialogs.png Input Dialogs
@@ -576,7 +576,7 @@ QString QInputDialog::labelText() const
This enum specifies various options that affect the look and feel
of an input dialog.
- \value NoButtons Don't display \gui{OK} and \gui{Cancel} buttons. (Useful for "live dialogs".)
+ \value NoButtons Don't display \uicontrol{OK} and \uicontrol{Cancel} buttons. (Useful for "live dialogs".)
\value UseListViewForComboBoxItems Use a QListView rather than a non-editable QComboBox for
displaying the items set with setComboBoxItems().
@@ -1133,7 +1133,7 @@ void QInputDialog::done(int result)
edit widget if an input method is active.
If \a ok is nonnull \e *\a ok will be set to true if the user pressed
- \gui OK and to false if the user pressed \gui Cancel. The dialog's parent
+ \uicontrol OK and to false if the user pressed \uicontrol Cancel. The dialog's parent
is \a parent. The dialog will be modal and uses the specified widget
\a flags.
@@ -1142,7 +1142,7 @@ void QInputDialog::done(int result)
Use this static function like this:
- \snippet examples/dialogs/standarddialogs/dialog.cpp 3
+ \snippet dialogs/standarddialogs/dialog.cpp 3
\warning Do not delete \a parent during the execution of the dialog. If you
want to do this, you should create the dialog yourself using one of the
@@ -1185,8 +1185,8 @@ QString QInputDialog::getText(QWidget *parent, const QString &title, const QStri
\a step is the amount by which the values change as the user presses the
arrow buttons to increment or decrement the value.
- If \a ok is nonnull *\a ok will be set to true if the user pressed \gui OK
- and to false if the user pressed \gui Cancel. The dialog's parent is
+ If \a ok is nonnull *\a ok will be set to true if the user pressed \uicontrol OK
+ and to false if the user pressed \uicontrol Cancel. The dialog's parent is
\a parent. The dialog will be modal and uses the widget \a flags.
On success, this function returns the integer which has been entered by the
@@ -1194,7 +1194,7 @@ QString QInputDialog::getText(QWidget *parent, const QString &title, const QStri
Use this static function like this:
- \snippet examples/dialogs/standarddialogs/dialog.cpp 0
+ \snippet dialogs/standarddialogs/dialog.cpp 0
\warning Do not delete \a parent during the execution of the dialog. If you
want to do this, you should create the dialog yourself using one of the
@@ -1234,8 +1234,8 @@ int QInputDialog::getInt(QWidget *parent, const QString &title, const QString &l
\a min and \a max are the minimum and maximum values the user may choose.
\a decimals is the maximum number of decimal places the number may have.
- If \a ok is nonnull, *\a ok will be set to true if the user pressed \gui OK
- and to false if the user pressed \gui Cancel. The dialog's parent is
+ If \a ok is nonnull, *\a ok will be set to true if the user pressed \uicontrol OK
+ and to false if the user pressed \uicontrol Cancel. The dialog's parent is
\a parent. The dialog will be modal and uses the widget \a flags.
This function returns the floating point number which has been entered by
@@ -1243,7 +1243,7 @@ int QInputDialog::getInt(QWidget *parent, const QString &title, const QString &l
Use this static function like this:
- \snippet examples/dialogs/standarddialogs/dialog.cpp 1
+ \snippet dialogs/standarddialogs/dialog.cpp 1
\warning Do not delete \a parent during the execution of the dialog. If you
want to do this, you should create the dialog yourself using one of the
@@ -1289,7 +1289,7 @@ double QInputDialog::getDouble(QWidget *parent, const QString &title, const QStr
user may only select one of the existing items.
If \a ok is nonnull \e *\a ok will be set to true if the user pressed
- \gui OK and to false if the user pressed \gui Cancel. The dialog's parent
+ \uicontrol OK and to false if the user pressed \uicontrol Cancel. The dialog's parent
is \a parent. The dialog will be modal and uses the widget \a flags.
This function returns the text of the current item, or if \a editable is
@@ -1297,7 +1297,7 @@ double QInputDialog::getDouble(QWidget *parent, const QString &title, const QStr
Use this static function like this:
- \snippet examples/dialogs/standarddialogs/dialog.cpp 2
+ \snippet dialogs/standarddialogs/dialog.cpp 2
\warning Do not delete \a parent during the execution of the dialog. If you
want to do this, you should create the dialog yourself using one of the
@@ -1379,7 +1379,7 @@ QString QInputDialog::getItem(QWidget *parent, const QString &title, const QStri
\fn void QInputDialog::doubleValueSelected(double value)
This signal is emitted whenever the user selects a double value by
- accepting the dialog; for example, by clicking the \gui{OK} button.
+ accepting the dialog; for example, by clicking the \uicontrol{OK} button.
The selected value is specified by \a value.
This signal is only relevant when the input dialog is used in
@@ -1400,7 +1400,7 @@ QString QInputDialog::getItem(QWidget *parent, const QString &title, const QStri
\fn void QInputDialog::intValueSelected(int value)
This signal is emitted whenever the user selects a integer value by
- accepting the dialog; for example, by clicking the \gui{OK} button.
+ accepting the dialog; for example, by clicking the \uicontrol{OK} button.
The selected value is specified by \a value.
This signal is only relevant when the input dialog is used in
@@ -1421,7 +1421,7 @@ QString QInputDialog::getItem(QWidget *parent, const QString &title, const QStri
\fn void QInputDialog::textValueSelected(const QString &text)
This signal is emitted whenever the user selects a text string by
- accepting the dialog; for example, by clicking the \gui{OK} button.
+ accepting the dialog; for example, by clicking the \uicontrol{OK} button.
The selected string is specified by \a text.
This signal is only relevant when the input dialog is used in
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp
index 92915b1bb1..5c1a2a4a64 100644
--- a/src/widgets/dialogs/qmessagebox.cpp
+++ b/src/widgets/dialogs/qmessagebox.cpp
@@ -498,9 +498,9 @@ void QMessageBoxPrivate::_q_buttonClicked(QAbstractButton *button)
the message. The simplest configuration is to set only the
\l{QMessageBox::text} {message text} property.
- \snippet doc/src/snippets/code/src_gui_dialogs_qmessagebox.cpp 5
+ \snippet code/src_gui_dialogs_qmessagebox.cpp 5
- The user must click the \gui{OK} button to dismiss the message
+ The user must click the \uicontrol{OK} button to dismiss the message
box. The rest of the GUI is blocked until the message box is
dismissed.
@@ -514,13 +514,13 @@ void QMessageBoxPrivate::_q_buttonClicked(QAbstractButton *button)
responses. The buttons are specified by combining values from
StandardButtons using the bitwise OR operator. The display order
for the buttons is platform-dependent. For example, on Windows,
- \gui{Save} is displayed to the left of \gui{Cancel}, whereas on
+ \uicontrol{Save} is displayed to the left of \uicontrol{Cancel}, whereas on
Mac OS, the order is reversed.
Mark one of your standard buttons to be your
\l{QMessageBox::defaultButton()} {default button}.
- \snippet doc/src/snippets/code/src_gui_dialogs_qmessagebox.cpp 6
+ \snippet code/src_gui_dialogs_qmessagebox.cpp 6
This is the approach recommended in the
\l{http://developer.apple.com/library/mac/documentation/UserExperience/Conceptual/AppleHIGuidelines/Windows/Windows.html#//apple_ref/doc/uid/20000961-BABCAJID}
@@ -534,16 +534,16 @@ void QMessageBoxPrivate::_q_buttonClicked(QAbstractButton *button)
The exec() slot returns the StandardButtons value of the button
that was clicked.
- \snippet doc/src/snippets/code/src_gui_dialogs_qmessagebox.cpp 7
+ \snippet code/src_gui_dialogs_qmessagebox.cpp 7
To give the user more information to help him answer the question,
set the \l{QMessageBox::detailedText} {detailed text} property. If
the \l{QMessageBox::detailedText} {detailed text} property is set,
- the \gui{Show Details...} button will be shown.
+ the \uicontrol{Show Details...} button will be shown.
\image msgbox3.png
- Clicking the \gui{Show Details...} button displays the detailed text.
+ Clicking the \uicontrol{Show Details...} button displays the detailed text.
\image msgbox4.png
@@ -632,7 +632,7 @@ void QMessageBoxPrivate::_q_buttonClicked(QAbstractButton *button)
Static functions are available for creating information(),
question(), warning(), and critical() message boxes.
- \snippet doc/src/snippets/code/src_gui_dialogs_qmessagebox.cpp 0
+ \snippet code/src_gui_dialogs_qmessagebox.cpp 0
The \l{dialogs/standarddialogs}{Standard Dialogs} example shows
how to use QMessageBox and the other built-in Qt dialogs.
@@ -647,7 +647,7 @@ void QMessageBoxPrivate::_q_buttonClicked(QAbstractButton *button)
platform). You can test the value of clickedButton() after calling
exec(). For example,
- \snippet doc/src/snippets/code/src_gui_dialogs_qmessagebox.cpp 2
+ \snippet code/src_gui_dialogs_qmessagebox.cpp 2
\section1 Default and Escape Keys
@@ -1028,7 +1028,7 @@ void QMessageBoxPrivate::detectEscapeButton()
Example:
- \snippet doc/src/snippets/code/src_gui_dialogs_qmessagebox.cpp 3
+ \snippet code/src_gui_dialogs_qmessagebox.cpp 3
\sa standardButton(), button()
*/
@@ -1707,7 +1707,7 @@ void QMessageBox::about(QWidget *parent, const QString &title, const QString &te
and centered over \a parent (if \a parent is not 0). The message
includes the version number of Qt being used by the application.
- This is useful for inclusion in the \gui Help menu of an application,
+ This is useful for inclusion in the \uicontrol Help menu of an application,
as shown in the \l{mainwindows/menus}{Menus} example.
QApplication provides this functionality as a slot.
@@ -1964,7 +1964,7 @@ void QMessageBoxPrivate::retranslateStrings()
to make it the cancel or close button (clicked when \key Esc is
pressed).
- \snippet doc/src/snippets/dialogs/dialogs.cpp 2
+ \snippet dialogs/dialogs.cpp 2
The message box is an \l{Qt::ApplicationModal} {application modal}
dialog box.
diff --git a/src/widgets/dialogs/qprogressdialog.cpp b/src/widgets/dialogs/qprogressdialog.cpp
index 350fb57e20..97e628e96b 100644
--- a/src/widgets/dialogs/qprogressdialog.cpp
+++ b/src/widgets/dialogs/qprogressdialog.cpp
@@ -244,7 +244,7 @@ void QProgressDialogPrivate::_q_disconnectOnClose()
to use for the programmer. Do the operation in a loop, call \l setValue() at
intervals, and check for cancellation with wasCanceled(). For example:
- \snippet doc/src/snippets/dialogs/dialogs.cpp 3
+ \snippet dialogs/dialogs.cpp 3
A modeless progress dialog is suitable for operations that take
place in the background, where the user is able to interact with the
@@ -257,11 +257,11 @@ void QProgressDialogPrivate::_q_disconnectOnClose()
canceled() signal to a slot that stops the operation, and call \l
setValue() at intervals. For example:
- \snippet doc/src/snippets/dialogs/dialogs.cpp 4
+ \snippet dialogs/dialogs.cpp 4
\codeline
- \snippet doc/src/snippets/dialogs/dialogs.cpp 5
+ \snippet dialogs/dialogs.cpp 5
\codeline
- \snippet doc/src/snippets/dialogs/dialogs.cpp 6
+ \snippet dialogs/dialogs.cpp 6
In both modes the progress dialog may be customized by
replacing the child widgets with custom widgets by using setLabel(),
diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp
index ac19ec8d22..36327741c8 100644
--- a/src/widgets/dialogs/qwizard.cpp
+++ b/src/widgets/dialogs/qwizard.cpp
@@ -1809,17 +1809,17 @@ void QWizardAntiFlickerWidget::paintEvent(QPaintEvent *)
\l{dialogs/classwizard}{Class Wizard} and \l{dialogs/licensewizard}{License
Wizard}.
- \snippet examples/dialogs/trivialwizard/trivialwizard.cpp 1
- \snippet examples/dialogs/trivialwizard/trivialwizard.cpp 3
+ \snippet dialogs/trivialwizard/trivialwizard.cpp 1
+ \snippet dialogs/trivialwizard/trivialwizard.cpp 3
\dots
- \snippet examples/dialogs/trivialwizard/trivialwizard.cpp 4
+ \snippet dialogs/trivialwizard/trivialwizard.cpp 4
\codeline
- \snippet examples/dialogs/trivialwizard/trivialwizard.cpp 5
- \snippet examples/dialogs/trivialwizard/trivialwizard.cpp 7
+ \snippet dialogs/trivialwizard/trivialwizard.cpp 5
+ \snippet dialogs/trivialwizard/trivialwizard.cpp 7
\dots
- \snippet examples/dialogs/trivialwizard/trivialwizard.cpp 8
+ \snippet dialogs/trivialwizard/trivialwizard.cpp 8
\codeline
- \snippet examples/dialogs/trivialwizard/trivialwizard.cpp 10
+ \snippet dialogs/trivialwizard/trivialwizard.cpp 10
\section1 Wizard Look and Feel
@@ -1856,19 +1856,19 @@ void QWizardAntiFlickerWidget::paintEvent(QPaintEvent *)
In addition to the wizard style, there are several options that
control the look and feel of the wizard. These can be set using
setOption() or setOptions(). For example, HaveHelpButton makes
- QWizard show a \gui Help button along with the other wizard
+ QWizard show a \uicontrol Help button along with the other wizard
buttons.
You can even change the order of the wizard buttons to any
arbitrary order using setButtonLayout(), and you can add up to
- three custom buttons (e.g., a \gui Print button) to the button
+ three custom buttons (e.g., a \uicontrol Print button) to the button
row. This is achieved by calling setButton() or setButtonText()
with CustomButton1, CustomButton2, or CustomButton3 to set up the
button, and by enabling the HaveCustomButton1, HaveCustomButton2,
or HaveCustomButton3 options. Whenever the user clicks a custom
button, customButtonClicked() is emitted. For example:
- \snippet examples/dialogs/licensewizard/licensewizard.cpp 29
+ \snippet dialogs/licensewizard/licensewizard.cpp 29
\section1 Elements of a Wizard Page
@@ -1936,12 +1936,12 @@ void QWizardAntiFlickerWidget::paintEvent(QPaintEvent *)
To register a field, call QWizardPage::registerField() field.
For example:
- \snippet examples/dialogs/classwizard/classwizard.cpp 8
+ \snippet dialogs/classwizard/classwizard.cpp 8
\dots
- \snippet examples/dialogs/classwizard/classwizard.cpp 10
- \snippet examples/dialogs/classwizard/classwizard.cpp 11
+ \snippet dialogs/classwizard/classwizard.cpp 10
+ \snippet dialogs/classwizard/classwizard.cpp 11
\dots
- \snippet examples/dialogs/classwizard/classwizard.cpp 13
+ \snippet dialogs/classwizard/classwizard.cpp 13
The above code registers three fields, \c className, \c
baseClass, and \c qobjectMacro, which are associated with three
@@ -1952,7 +1952,7 @@ void QWizardAntiFlickerWidget::paintEvent(QPaintEvent *)
The fields of any page are accessible from any other page. For
example:
- \snippet examples/dialogs/classwizard/classwizard.cpp 17
+ \snippet dialogs/classwizard/classwizard.cpp 17
Here, we call QWizardPage::field() to access the contents of the
\c className field (which was defined in the \c ClassInfoPage)
@@ -1971,7 +1971,7 @@ void QWizardAntiFlickerWidget::paintEvent(QPaintEvent *)
If an asterisk (\c *) is appended to the name when the property
is registered, the field is a \e{mandatory field}. When a page has
- mandatory fields, the \gui Next and/or \gui Finish buttons are
+ mandatory fields, the \uicontrol Next and/or \uicontrol Finish buttons are
enabled only when all mandatory fields are filled.
To consider a field "filled", QWizard simply checks that the
@@ -1987,7 +1987,7 @@ void QWizardAntiFlickerWidget::paintEvent(QPaintEvent *)
QWizardPage::completeChanged() signal whenever the page becomes
complete or incomplete.
- The enabled/disabled state of the \gui Next and/or \gui Finish
+ The enabled/disabled state of the \uicontrol Next and/or \uicontrol Finish
buttons is one way to perform validation on the user input.
Another way is to reimplement validateCurrentPage() (or
QWizardPage::validatePage()) to perform some last-minute
@@ -2005,9 +2005,9 @@ void QWizardAntiFlickerWidget::paintEvent(QPaintEvent *)
them using addPage(). By default, the pages are shown in the
order in which they were added. For example:
- \snippet examples/dialogs/classwizard/classwizard.cpp 0
+ \snippet dialogs/classwizard/classwizard.cpp 0
\dots
- \snippet examples/dialogs/classwizard/classwizard.cpp 2
+ \snippet dialogs/classwizard/classwizard.cpp 2
When a page is about to be shown, QWizard calls initializePage()
(which in turn calls QWizardPage::initializePage()) to fill the
@@ -2016,11 +2016,11 @@ void QWizardAntiFlickerWidget::paintEvent(QPaintEvent *)
based on other pages' fields (see the \l{initialize page}{example
above}).
- If the user presses \gui Back, cleanupPage() is called (which in
+ If the user presses \uicontrol Back, cleanupPage() is called (which in
turn calls QWizardPage::cleanupPage()). The default
implementation resets the page's fields to their original values
(the values they had before initializePage() was called). If you
- want the \gui Back button to be non-destructive and keep the
+ want the \uicontrol Back button to be non-destructive and keep the
values entered by the user, simply enable the IndependentPages
option.
@@ -2037,37 +2037,37 @@ void QWizardAntiFlickerWidget::paintEvent(QPaintEvent *)
In complex wizards, pages are identified by IDs. These IDs are
typically defined using an enum. For example:
- \snippet examples/dialogs/licensewizard/licensewizard.h 0
+ \snippet dialogs/licensewizard/licensewizard.h 0
\dots
- \snippet examples/dialogs/licensewizard/licensewizard.h 2
+ \snippet dialogs/licensewizard/licensewizard.h 2
\dots
- \snippet examples/dialogs/licensewizard/licensewizard.h 3
+ \snippet dialogs/licensewizard/licensewizard.h 3
The pages are inserted using setPage(), which takes an ID and an
instance of QWizardPage (or of a subclass):
- \snippet examples/dialogs/licensewizard/licensewizard.cpp 1
+ \snippet dialogs/licensewizard/licensewizard.cpp 1
\dots
- \snippet examples/dialogs/licensewizard/licensewizard.cpp 8
+ \snippet dialogs/licensewizard/licensewizard.cpp 8
By default, the pages are shown in increasing ID order. To
provide a dynamic order that depends on the options chosen by the
user, we must reimplement QWizardPage::nextId(). For example:
- \snippet examples/dialogs/licensewizard/licensewizard.cpp 18
+ \snippet dialogs/licensewizard/licensewizard.cpp 18
\codeline
- \snippet examples/dialogs/licensewizard/licensewizard.cpp 23
+ \snippet dialogs/licensewizard/licensewizard.cpp 23
\codeline
- \snippet examples/dialogs/licensewizard/licensewizard.cpp 24
+ \snippet dialogs/licensewizard/licensewizard.cpp 24
\codeline
- \snippet examples/dialogs/licensewizard/licensewizard.cpp 25
+ \snippet dialogs/licensewizard/licensewizard.cpp 25
\codeline
- \snippet examples/dialogs/licensewizard/licensewizard.cpp 26
+ \snippet dialogs/licensewizard/licensewizard.cpp 26
It would also be possible to put all the logic in one place, in a
QWizard::nextId() reimplementation. For example:
- \snippet doc/src/snippets/code/src_gui_dialogs_qwizard.cpp 0
+ \snippet code/src_gui_dialogs_qwizard.cpp 0
To start at another page than the page with the lowest ID, call
setStartId().
@@ -2075,7 +2075,7 @@ void QWizardAntiFlickerWidget::paintEvent(QPaintEvent *)
To test whether a page has been visited or not, call
hasVisitedPage(). For example:
- \snippet examples/dialogs/licensewizard/licensewizard.cpp 27
+ \snippet dialogs/licensewizard/licensewizard.cpp 27
\sa QWizardPage, {Class Wizard Example}, {License Wizard Example}
*/
@@ -2085,12 +2085,12 @@ void QWizardAntiFlickerWidget::paintEvent(QPaintEvent *)
This enum specifies the buttons in a wizard.
- \value BackButton The \gui Back button (\gui {Go Back} on Mac OS X)
- \value NextButton The \gui Next button (\gui Continue on Mac OS X)
- \value CommitButton The \gui Commit button
- \value FinishButton The \gui Finish button (\gui Done on Mac OS X)
- \value CancelButton The \gui Cancel button (see also NoCancelButton)
- \value HelpButton The \gui Help button (see also HaveHelpButton)
+ \value BackButton The \uicontrol Back button (\uicontrol {Go Back} on Mac OS X)
+ \value NextButton The \uicontrol Next button (\uicontrol Continue on Mac OS X)
+ \value CommitButton The \uicontrol Commit button
+ \value FinishButton The \uicontrol Finish button (\uicontrol Done on Mac OS X)
+ \value CancelButton The \uicontrol Cancel button (see also NoCancelButton)
+ \value HelpButton The \uicontrol Help button (see also HaveHelpButton)
\value CustomButton1 The first user-defined button (see also HaveCustomButton1)
\value CustomButton2 The second user-defined button (see also HaveCustomButton2)
\value CustomButton3 The third user-defined button (see also HaveCustomButton3)
@@ -2148,18 +2148,18 @@ void QWizardAntiFlickerWidget::paintEvent(QPaintEvent *)
\value IgnoreSubTitles Don't show any subtitles, even if they are set.
\value ExtendedWatermarkPixmap Extend any WatermarkPixmap all the
way down to the window's edge.
- \value NoDefaultButton Don't make the \gui Next or \gui Finish button the
+ \value NoDefaultButton Don't make the \uicontrol Next or \uicontrol Finish button the
dialog's \l{QPushButton::setDefault()}{default button}.
- \value NoBackButtonOnStartPage Don't show the \gui Back button on the start page.
- \value NoBackButtonOnLastPage Don't show the \gui Back button on the last page.
- \value DisabledBackButtonOnLastPage Disable the \gui Back button on the last page.
- \value HaveNextButtonOnLastPage Show the (disabled) \gui Next button on the last page.
- \value HaveFinishButtonOnEarlyPages Show the (disabled) \gui Finish button on non-final pages.
- \value NoCancelButton Don't show the \gui Cancel button.
- \value CancelButtonOnLeft Put the \gui Cancel button on the left of \gui Back (rather than on
- the right of \gui Finish or \gui Next).
- \value HaveHelpButton Show the \gui Help button.
- \value HelpButtonOnRight Put the \gui Help button on the far right of the button layout
+ \value NoBackButtonOnStartPage Don't show the \uicontrol Back button on the start page.
+ \value NoBackButtonOnLastPage Don't show the \uicontrol Back button on the last page.
+ \value DisabledBackButtonOnLastPage Disable the \uicontrol Back button on the last page.
+ \value HaveNextButtonOnLastPage Show the (disabled) \uicontrol Next button on the last page.
+ \value HaveFinishButtonOnEarlyPages Show the (disabled) \uicontrol Finish button on non-final pages.
+ \value NoCancelButton Don't show the \uicontrol Cancel button.
+ \value CancelButtonOnLeft Put the \uicontrol Cancel button on the left of \uicontrol Back (rather than on
+ the right of \uicontrol Finish or \uicontrol Next).
+ \value HaveHelpButton Show the \uicontrol Help button.
+ \value HelpButtonOnRight Put the \uicontrol Help button on the far right of the button layout
(rather than on the far left).
\value HaveCustomButton1 Show the first user-defined button (CustomButton1).
\value HaveCustomButton2 Show the second user-defined button (CustomButton2).
@@ -2363,7 +2363,7 @@ QWizardPage *QWizard::page(int theid) const
Returns true if the page history contains page \a id; otherwise,
returns false.
- Pressing \gui Back marks the current page as "unvisited" again.
+ Pressing \uicontrol Back marks the current page as "unvisited" again.
\sa visitedPages()
*/
@@ -2377,7 +2377,7 @@ bool QWizard::hasVisitedPage(int theid) const
Returns the list of IDs of visited pages, in the order in which the pages
were visited.
- Pressing \gui Back marks the current page as "unvisited" again.
+ Pressing \uicontrol Back marks the current page as "unvisited" again.
\sa hasVisitedPage()
*/
@@ -2635,10 +2635,10 @@ QWizard::WizardOptions QWizard::options() const
Sets the text on button \a which to be \a text.
By default, the text on buttons depends on the wizardStyle. For
- example, on Mac OS X, the \gui Next button is called \gui
+ example, on Mac OS X, the \uicontrol Next button is called \uicontrol
Continue.
- To add extra buttons to the wizard (e.g., a \gui Print button),
+ To add extra buttons to the wizard (e.g., a \uicontrol Print button),
one way is to call setButtonText() with CustomButton1,
CustomButton2, or CustomButton3 to set their text, and make the
buttons visible using the HaveCustomButton1, HaveCustomButton2,
@@ -2667,7 +2667,7 @@ void QWizard::setButtonText(WizardButton which, const QString &text)
If a text has ben set using setButtonText(), this text is returned.
By default, the text on buttons depends on the wizardStyle. For
- example, on Mac OS X, the \gui Next button is called \gui
+ example, on Mac OS X, the \uicontrol Next button is called \uicontrol
Continue.
\sa button(), setButton(), setButtonText(), QWizardPage::buttonText(),
@@ -2704,7 +2704,7 @@ QString QWizard::buttonText(WizardButton which) const
Example:
- \snippet doc/src/snippets/code/src_gui_dialogs_qwizard.cpp 1
+ \snippet code/src_gui_dialogs_qwizard.cpp 1
\sa setButton(), setButtonText(), setOptions()
*/
@@ -2738,7 +2738,7 @@ void QWizard::setButtonLayout(const QList<WizardButton> &layout)
/*!
Sets the button corresponding to role \a which to \a button.
- To add extra buttons to the wizard (e.g., a \gui Print button),
+ To add extra buttons to the wizard (e.g., a \uicontrol Print button),
one way is to call setButton() with CustomButton1 to
CustomButton3, and make the buttons visible using the
HaveCustomButton1 to HaveCustomButton3 options.
@@ -3029,27 +3029,27 @@ QSize QWizard::sizeHint() const
/*!
\fn void QWizard::helpRequested()
- This signal is emitted when the user clicks the \gui Help button.
+ This signal is emitted when the user clicks the \uicontrol Help button.
- By default, no \gui Help button is shown. Call
+ By default, no \uicontrol Help button is shown. Call
setOption(HaveHelpButton, true) to have one.
Example:
- \snippet examples/dialogs/licensewizard/licensewizard.cpp 0
+ \snippet dialogs/licensewizard/licensewizard.cpp 0
\dots
- \snippet examples/dialogs/licensewizard/licensewizard.cpp 5
- \snippet examples/dialogs/licensewizard/licensewizard.cpp 7
+ \snippet dialogs/licensewizard/licensewizard.cpp 5
+ \snippet dialogs/licensewizard/licensewizard.cpp 7
\dots
- \snippet examples/dialogs/licensewizard/licensewizard.cpp 8
+ \snippet dialogs/licensewizard/licensewizard.cpp 8
\codeline
- \snippet examples/dialogs/licensewizard/licensewizard.cpp 10
+ \snippet dialogs/licensewizard/licensewizard.cpp 10
\dots
- \snippet examples/dialogs/licensewizard/licensewizard.cpp 12
+ \snippet dialogs/licensewizard/licensewizard.cpp 12
\codeline
- \snippet examples/dialogs/licensewizard/licensewizard.cpp 14
+ \snippet dialogs/licensewizard/licensewizard.cpp 14
\codeline
- \snippet examples/dialogs/licensewizard/licensewizard.cpp 15
+ \snippet dialogs/licensewizard/licensewizard.cpp 15
\sa customButtonClicked()
*/
@@ -3070,7 +3070,7 @@ QSize QWizard::sizeHint() const
/*!
Goes back to the previous page.
- This is equivalent to pressing the \gui Back button.
+ This is equivalent to pressing the \uicontrol Back button.
\sa next(), accept(), reject(), restart()
*/
@@ -3086,7 +3086,7 @@ void QWizard::back()
/*!
Advances to the next page.
- This is equivalent to pressing the \gui Next or \gui Commit button.
+ This is equivalent to pressing the \uicontrol Next or \uicontrol Commit button.
\sa nextId(), back(), accept(), reject(), restart()
*/
@@ -3253,7 +3253,7 @@ void QWizard::done(int result)
This virtual function is called by QWizard to prepare page \a id
just before it is shown either as a result of QWizard::restart()
- being called, or as a result of the user clicking \gui Next. (However, if the \l
+ being called, or as a result of the user clicking \uicontrol Next. (However, if the \l
QWizard::IndependentPages option is set, this function is only
called the first time the page is shown.)
@@ -3277,7 +3277,7 @@ void QWizard::initializePage(int theid)
\fn void QWizard::cleanupPage(int id)
This virtual function is called by QWizard to clean up page \a id just before the
- user leaves it by clicking \gui Back (unless the \l QWizard::IndependentPages option is set).
+ user leaves it by clicking \uicontrol Back (unless the \l QWizard::IndependentPages option is set).
The default implementation calls QWizardPage::cleanupPage() on
page(\a id).
@@ -3293,15 +3293,15 @@ void QWizard::cleanupPage(int theid)
/*!
This virtual function is called by QWizard when the user clicks
- \gui Next or \gui Finish to perform some last-minute validation.
+ \uicontrol Next or \uicontrol Finish to perform some last-minute validation.
If it returns true, the next page is shown (or the wizard
finishes); otherwise, the current page stays up.
The default implementation calls QWizardPage::validatePage() on
the currentPage().
- When possible, it is usually better style to disable the \gui
- Next or \gui Finish button (by specifying \l{mandatory fields} or
+ When possible, it is usually better style to disable the \uicontrol
+ Next or \uicontrol Finish button (by specifying \l{mandatory fields} or
by reimplementing QWizardPage::isComplete()) than to reimplement
validateCurrentPage().
@@ -3318,7 +3318,7 @@ bool QWizard::validateCurrentPage()
/*!
This virtual function is called by QWizard to find out which page
- to show when the user clicks the \gui Next button.
+ to show when the user clicks the \uicontrol Next button.
The return value is the ID of the next page, or -1 if no page follows.
@@ -3362,29 +3362,29 @@ int QWizard::nextId() const
\list
\li initializePage() is called to initialize the page's contents
- when the user clicks the wizard's \gui Next button. If you
+ when the user clicks the wizard's \uicontrol Next button. If you
want to derive the page's default from what the user entered
on previous pages, this is the function to reimplement.
\li cleanupPage() is called to reset the page's contents when the
- user clicks the wizard's \gui Back button.
- \li validatePage() validates the page when the user clicks \gui
- Next or \gui Finish. It is often used to show an error message
+ user clicks the wizard's \uicontrol Back button.
+ \li validatePage() validates the page when the user clicks \uicontrol
+ Next or \uicontrol Finish. It is often used to show an error message
if the user has entered incomplete or invalid information.
\li nextId() returns the ID of the next page. It is useful when
\l{creating non-linear wizards}, which allow different
traversal paths based on the information provided by the user.
- \li isComplete() is called to determine whether the \gui Next
- and/or \gui Finish button should be enabled or disabled. If
+ \li isComplete() is called to determine whether the \uicontrol Next
+ and/or \uicontrol Finish button should be enabled or disabled. If
you reimplement isComplete(), also make sure that
completeChanged() is emitted whenever the complete state
changes.
\endlist
- Normally, the \gui Next button and the \gui Finish button of a
- wizard are mutually exclusive. If isFinalPage() returns true, \gui
- Finish is available; otherwise, \gui Next is available. By
+ Normally, the \uicontrol Next button and the \uicontrol Finish button of a
+ wizard are mutually exclusive. If isFinalPage() returns true, \uicontrol
+ Finish is available; otherwise, \uicontrol Next is available. By
default, isFinalPage() is true only when nextId() returns -1. If
- you want to show \gui Next and \gui Final simultaneously for a
+ you want to show \uicontrol Next and \uicontrol Final simultaneously for a
page (letting the user perform an "early finish"), call
setFinalPage(true) on that page. For wizards that support early
finishes, you might also want to set the
@@ -3532,7 +3532,7 @@ QPixmap QWizardPage::pixmap(QWizard::WizardPixmap which) const
/*!
This virtual function is called by QWizard::initializePage() to
prepare the page just before it is shown either as a result of QWizard::restart()
- being called, or as a result of the user clicking \gui Next.
+ being called, or as a result of the user clicking \uicontrol Next.
(However, if the \l QWizard::IndependentPages option is set, this function is only
called the first time the page is shown.)
@@ -3540,7 +3540,7 @@ QPixmap QWizardPage::pixmap(QWizard::WizardPixmap which) const
fields are properly initialized based on fields from previous
pages. For example:
- \snippet examples/dialogs/classwizard/classwizard.cpp 17
+ \snippet dialogs/classwizard/classwizard.cpp 17
The default implementation does nothing.
@@ -3552,7 +3552,7 @@ void QWizardPage::initializePage()
/*!
This virtual function is called by QWizard::cleanupPage() when
- the user leaves the page by clicking \gui Back (unless the \l QWizard::IndependentPages
+ the user leaves the page by clicking \uicontrol Back (unless the \l QWizard::IndependentPages
option is set).
The default implementation resets the page's fields to their
@@ -3576,14 +3576,14 @@ void QWizardPage::cleanupPage()
/*!
This virtual function is called by QWizard::validateCurrentPage()
- when the user clicks \gui Next or \gui Finish to perform some
+ when the user clicks \uicontrol Next or \uicontrol Finish to perform some
last-minute validation. If it returns true, the next page is shown
(or the wizard finishes); otherwise, the current page stays up.
The default implementation returns true.
- When possible, it is usually better style to disable the \gui
- Next or \gui Finish button (by specifying \l{mandatory fields} or
+ When possible, it is usually better style to disable the \uicontrol
+ Next or \uicontrol Finish button (by specifying \l{mandatory fields} or
reimplementing isComplete()) than to reimplement validatePage().
\sa QWizard::validateCurrentPage(), isComplete()
@@ -3595,7 +3595,7 @@ bool QWizardPage::validatePage()
/*!
This virtual function is called by QWizard to determine whether
- the \gui Next or \gui Finish button should be enabled or
+ the \uicontrol Next or \uicontrol Finish button should be enabled or
disabled.
The default implementation returns true if all \l{mandatory
@@ -3645,7 +3645,7 @@ bool QWizardPage::isComplete() const
/*!
Explicitly sets this page to be final if \a finalPage is true.
- After calling setFinalPage(true), isFinalPage() returns true and the \gui
+ After calling setFinalPage(true), isFinalPage() returns true and the \uicontrol
Finish button is visible (and enabled if isComplete() returns
true).
@@ -3664,7 +3664,7 @@ void QWizardPage::setFinalPage(bool finalPage)
}
/*!
- This function is called by QWizard to determine whether the \gui
+ This function is called by QWizard to determine whether the \uicontrol
Finish button should be shown for this page or not.
By default, it returns true if there is no next page
@@ -3695,12 +3695,12 @@ bool QWizardPage::isFinalPage() const
sets it to be a normal page.
A commit page is a page that represents an action which cannot be undone
- by clicking \gui Back or \gui Cancel.
+ by clicking \uicontrol Back or \uicontrol Cancel.
- A \gui Commit button replaces the \gui Next button on a commit page. Clicking this
- button simply calls QWizard::next() just like clicking \gui Next does.
+ A \uicontrol Commit button replaces the \uicontrol Next button on a commit page. Clicking this
+ button simply calls QWizard::next() just like clicking \uicontrol Next does.
- A page entered directly from a commit page has its \gui Back button disabled.
+ A page entered directly from a commit page has its \uicontrol Back button disabled.
\sa isCommitPage()
*/
@@ -3748,7 +3748,7 @@ void QWizardPage::setButtonText(QWizard::WizardButton which, const QString &text
this text is returned.
By default, the text on buttons depends on the QWizard::wizardStyle.
- For example, on Mac OS X, the \gui Next button is called \gui
+ For example, on Mac OS X, the \uicontrol Next button is called \uicontrol
Continue.
\sa setButtonText(), QWizard::buttonText(), QWizard::setButtonText()
@@ -3768,7 +3768,7 @@ QString QWizardPage::buttonText(QWizard::WizardButton which) const
/*!
This virtual function is called by QWizard::nextId() to find
- out which page to show when the user clicks the \gui Next button.
+ out which page to show when the user clicks the \uicontrol Next button.
The return value is the ID of the next page, or -1 if no page follows.
@@ -3778,7 +3778,7 @@ QString QWizardPage::buttonText(QWizard::WizardButton which) const
By reimplementing this function, you can specify a dynamic page
order. For example:
- \snippet examples/dialogs/licensewizard/licensewizard.cpp 18
+ \snippet dialogs/licensewizard/licensewizard.cpp 18
\sa QWizard::nextId()
*/
@@ -3845,7 +3845,7 @@ void QWizardPage::setField(const QString &name, const QVariant &value)
Example:
- \snippet examples/dialogs/classwizard/classwizard.cpp 17
+ \snippet dialogs/classwizard/classwizard.cpp 17
\sa QWizard::field(), setField(), registerField()
*/
@@ -3868,8 +3868,8 @@ QVariant QWizardPage::field(const QString &name) const
explicitly about each other.
If \a name ends with an asterisk (\c *), the field is a mandatory
- field. When a page has mandatory fields, the \gui Next and/or
- \gui Finish buttons are enabled only when all mandatory fields
+ field. When a page has mandatory fields, the \uicontrol Next and/or
+ \uicontrol Finish buttons are enabled only when all mandatory fields
are filled. This requires a \a changedSignal to be specified, to
tell QWizard to recheck the value stored by the mandatory field.
diff --git a/src/widgets/doc/images/assistant-toolbar.png b/src/widgets/doc/images/assistant-toolbar.png
new file mode 100644
index 0000000000..1b41825c64
--- /dev/null
+++ b/src/widgets/doc/images/assistant-toolbar.png
Binary files differ
diff --git a/src/widgets/doc/images/buttonbox-gnomelayout-horizontal.png b/src/widgets/doc/images/buttonbox-gnomelayout-horizontal.png
new file mode 100644
index 0000000000..b2f74bb6c6
--- /dev/null
+++ b/src/widgets/doc/images/buttonbox-gnomelayout-horizontal.png
Binary files differ
diff --git a/src/widgets/doc/images/buttonbox-gnomelayout-vertical.png b/src/widgets/doc/images/buttonbox-gnomelayout-vertical.png
new file mode 100644
index 0000000000..e7843dc22d
--- /dev/null
+++ b/src/widgets/doc/images/buttonbox-gnomelayout-vertical.png
Binary files differ
diff --git a/src/widgets/doc/images/buttonbox-kdelayout-horizontal.png b/src/widgets/doc/images/buttonbox-kdelayout-horizontal.png
new file mode 100644
index 0000000000..5da11f4d7a
--- /dev/null
+++ b/src/widgets/doc/images/buttonbox-kdelayout-horizontal.png
Binary files differ
diff --git a/src/widgets/doc/images/buttonbox-kdelayout-vertical.png b/src/widgets/doc/images/buttonbox-kdelayout-vertical.png
new file mode 100644
index 0000000000..6f5dfc6b65
--- /dev/null
+++ b/src/widgets/doc/images/buttonbox-kdelayout-vertical.png
Binary files differ
diff --git a/src/widgets/doc/images/buttonbox-mac-modeless-horizontal.png b/src/widgets/doc/images/buttonbox-mac-modeless-horizontal.png
new file mode 100644
index 0000000000..2e853d34fb
--- /dev/null
+++ b/src/widgets/doc/images/buttonbox-mac-modeless-horizontal.png
Binary files differ
diff --git a/src/widgets/doc/images/buttonbox-mac-modeless-vertical.png b/src/widgets/doc/images/buttonbox-mac-modeless-vertical.png
new file mode 100644
index 0000000000..f59bd8ddaf
--- /dev/null
+++ b/src/widgets/doc/images/buttonbox-mac-modeless-vertical.png
Binary files differ
diff --git a/src/widgets/doc/images/buttonbox-maclayout-horizontal.png b/src/widgets/doc/images/buttonbox-maclayout-horizontal.png
new file mode 100644
index 0000000000..89ae84dea0
--- /dev/null
+++ b/src/widgets/doc/images/buttonbox-maclayout-horizontal.png
Binary files differ
diff --git a/src/widgets/doc/images/buttonbox-maclayout-vertical.png b/src/widgets/doc/images/buttonbox-maclayout-vertical.png
new file mode 100644
index 0000000000..728760029f
--- /dev/null
+++ b/src/widgets/doc/images/buttonbox-maclayout-vertical.png
Binary files differ
diff --git a/src/widgets/doc/images/buttonbox-winlayout-horizontal.png b/src/widgets/doc/images/buttonbox-winlayout-horizontal.png
new file mode 100644
index 0000000000..dd4ce1c313
--- /dev/null
+++ b/src/widgets/doc/images/buttonbox-winlayout-horizontal.png
Binary files differ
diff --git a/src/widgets/doc/images/buttonbox-winlayout-vertical.png b/src/widgets/doc/images/buttonbox-winlayout-vertical.png
new file mode 100644
index 0000000000..539de1aa1a
--- /dev/null
+++ b/src/widgets/doc/images/buttonbox-winlayout-vertical.png
Binary files differ
diff --git a/src/widgets/doc/images/cde-calendarwidget.png b/src/widgets/doc/images/cde-calendarwidget.png
new file mode 100644
index 0000000000..9615eaeab8
--- /dev/null
+++ b/src/widgets/doc/images/cde-calendarwidget.png
Binary files differ
diff --git a/src/widgets/doc/images/cde-checkbox.png b/src/widgets/doc/images/cde-checkbox.png
new file mode 100644
index 0000000000..b2528dc5de
--- /dev/null
+++ b/src/widgets/doc/images/cde-checkbox.png
Binary files differ
diff --git a/src/widgets/doc/images/cde-combobox.png b/src/widgets/doc/images/cde-combobox.png
new file mode 100644
index 0000000000..74586433eb
--- /dev/null
+++ b/src/widgets/doc/images/cde-combobox.png
Binary files differ
diff --git a/src/widgets/doc/images/cde-dateedit.png b/src/widgets/doc/images/cde-dateedit.png
new file mode 100644
index 0000000000..ebb24d59cf
--- /dev/null
+++ b/src/widgets/doc/images/cde-dateedit.png
Binary files differ
diff --git a/src/widgets/doc/images/cde-datetimeedit.png b/src/widgets/doc/images/cde-datetimeedit.png
new file mode 100644
index 0000000000..9ac659a3f3
--- /dev/null
+++ b/src/widgets/doc/images/cde-datetimeedit.png
Binary files differ
diff --git a/src/widgets/doc/images/cde-dial.png b/src/widgets/doc/images/cde-dial.png
new file mode 100644
index 0000000000..956d19cb6c
--- /dev/null
+++ b/src/widgets/doc/images/cde-dial.png
Binary files differ
diff --git a/src/widgets/doc/images/cde-doublespinbox.png b/src/widgets/doc/images/cde-doublespinbox.png
new file mode 100644
index 0000000000..30a9af66fa
--- /dev/null
+++ b/src/widgets/doc/images/cde-doublespinbox.png
Binary files differ
diff --git a/src/widgets/doc/images/cde-fontcombobox.png b/src/widgets/doc/images/cde-fontcombobox.png
new file mode 100644
index 0000000000..043ca1d20f
--- /dev/null
+++ b/src/widgets/doc/images/cde-fontcombobox.png
Binary files differ
diff --git a/src/widgets/doc/images/cde-frame.png b/src/widgets/doc/images/cde-frame.png
new file mode 100644
index 0000000000..221576e849
--- /dev/null
+++ b/src/widgets/doc/images/cde-frame.png
Binary files differ
diff --git a/src/widgets/doc/images/cde-groupbox.png b/src/widgets/doc/images/cde-groupbox.png
new file mode 100644
index 0000000000..8bad69be4e
--- /dev/null
+++ b/src/widgets/doc/images/cde-groupbox.png
Binary files differ
diff --git a/src/widgets/doc/images/cde-horizontalscrollbar.png b/src/widgets/doc/images/cde-horizontalscrollbar.png
new file mode 100644
index 0000000000..6e7cde8da1
--- /dev/null
+++ b/src/widgets/doc/images/cde-horizontalscrollbar.png
Binary files differ
diff --git a/src/widgets/doc/images/cde-label.png b/src/widgets/doc/images/cde-label.png
new file mode 100644
index 0000000000..4e906eaa00
--- /dev/null
+++ b/src/widgets/doc/images/cde-label.png
Binary files differ
diff --git a/src/widgets/doc/images/cde-lcdnumber.png b/src/widgets/doc/images/cde-lcdnumber.png
new file mode 100644
index 0000000000..97324c1a6c
--- /dev/null
+++ b/src/widgets/doc/images/cde-lcdnumber.png
Binary files differ
diff --git a/src/widgets/doc/images/cde-lineedit.png b/src/widgets/doc/images/cde-lineedit.png
new file mode 100644
index 0000000000..6c1527ba19
--- /dev/null
+++ b/src/widgets/doc/images/cde-lineedit.png
Binary files differ
diff --git a/src/widgets/doc/images/cde-listview.png b/src/widgets/doc/images/cde-listview.png
new file mode 100644
index 0000000000..2e58140880
--- /dev/null
+++ b/src/widgets/doc/images/cde-listview.png
Binary files differ
diff --git a/src/widgets/doc/images/cde-progressbar.png b/src/widgets/doc/images/cde-progressbar.png
new file mode 100644
index 0000000000..41715deb48
--- /dev/null
+++ b/src/widgets/doc/images/cde-progressbar.png
Binary files differ
diff --git a/src/widgets/doc/images/cde-pushbutton.png b/src/widgets/doc/images/cde-pushbutton.png
new file mode 100644
index 0000000000..2d9bdd25a4
--- /dev/null
+++ b/src/widgets/doc/images/cde-pushbutton.png
Binary files differ
diff --git a/src/widgets/doc/images/cde-radiobutton.png b/src/widgets/doc/images/cde-radiobutton.png
new file mode 100644
index 0000000000..e053665f5a
--- /dev/null
+++ b/src/widgets/doc/images/cde-radiobutton.png
Binary files differ
diff --git a/src/widgets/doc/images/cde-slider.png b/src/widgets/doc/images/cde-slider.png
new file mode 100644
index 0000000000..bd84371898
--- /dev/null
+++ b/src/widgets/doc/images/cde-slider.png
Binary files differ
diff --git a/src/widgets/doc/images/cde-spinbox.png b/src/widgets/doc/images/cde-spinbox.png
new file mode 100644
index 0000000000..5f53c8e902
--- /dev/null
+++ b/src/widgets/doc/images/cde-spinbox.png
Binary files differ
diff --git a/src/widgets/doc/images/cde-tableview.png b/src/widgets/doc/images/cde-tableview.png
new file mode 100644
index 0000000000..7a99217560
--- /dev/null
+++ b/src/widgets/doc/images/cde-tableview.png
Binary files differ
diff --git a/src/widgets/doc/images/cde-tabwidget.png b/src/widgets/doc/images/cde-tabwidget.png
new file mode 100644
index 0000000000..8cf5473fc2
--- /dev/null
+++ b/src/widgets/doc/images/cde-tabwidget.png
Binary files differ
diff --git a/src/widgets/doc/images/cde-textedit.png b/src/widgets/doc/images/cde-textedit.png
new file mode 100644
index 0000000000..c65b8da8f4
--- /dev/null
+++ b/src/widgets/doc/images/cde-textedit.png
Binary files differ
diff --git a/src/widgets/doc/images/cde-timeedit.png b/src/widgets/doc/images/cde-timeedit.png
new file mode 100644
index 0000000000..6a5a4b953f
--- /dev/null
+++ b/src/widgets/doc/images/cde-timeedit.png
Binary files differ
diff --git a/src/widgets/doc/images/cde-toolbox.png b/src/widgets/doc/images/cde-toolbox.png
new file mode 100644
index 0000000000..c0dd4e9400
--- /dev/null
+++ b/src/widgets/doc/images/cde-toolbox.png
Binary files differ
diff --git a/src/widgets/doc/images/cde-toolbutton.png b/src/widgets/doc/images/cde-toolbutton.png
new file mode 100644
index 0000000000..baff25c25b
--- /dev/null
+++ b/src/widgets/doc/images/cde-toolbutton.png
Binary files differ
diff --git a/src/widgets/doc/images/cde-treeview.png b/src/widgets/doc/images/cde-treeview.png
new file mode 100644
index 0000000000..df3184b31b
--- /dev/null
+++ b/src/widgets/doc/images/cde-treeview.png
Binary files differ
diff --git a/src/widgets/doc/images/checkboxes-exclusive.png b/src/widgets/doc/images/checkboxes-exclusive.png
new file mode 100644
index 0000000000..0ada3a046a
--- /dev/null
+++ b/src/widgets/doc/images/checkboxes-exclusive.png
Binary files differ
diff --git a/src/widgets/doc/images/checkboxes-non-exclusive.png b/src/widgets/doc/images/checkboxes-non-exclusive.png
new file mode 100644
index 0000000000..4211aaedfb
--- /dev/null
+++ b/src/widgets/doc/images/checkboxes-non-exclusive.png
Binary files differ
diff --git a/src/widgets/doc/images/cleanlooks-calendarwidget.png b/src/widgets/doc/images/cleanlooks-calendarwidget.png
new file mode 100644
index 0000000000..99c57b61ee
--- /dev/null
+++ b/src/widgets/doc/images/cleanlooks-calendarwidget.png
Binary files differ
diff --git a/src/widgets/doc/images/cleanlooks-checkbox.png b/src/widgets/doc/images/cleanlooks-checkbox.png
new file mode 100644
index 0000000000..aaf2daae4e
--- /dev/null
+++ b/src/widgets/doc/images/cleanlooks-checkbox.png
Binary files differ
diff --git a/src/widgets/doc/images/cleanlooks-combobox.png b/src/widgets/doc/images/cleanlooks-combobox.png
new file mode 100644
index 0000000000..5fff4c87f6
--- /dev/null
+++ b/src/widgets/doc/images/cleanlooks-combobox.png
Binary files differ
diff --git a/src/widgets/doc/images/cleanlooks-dateedit.png b/src/widgets/doc/images/cleanlooks-dateedit.png
new file mode 100644
index 0000000000..384136a162
--- /dev/null
+++ b/src/widgets/doc/images/cleanlooks-dateedit.png
Binary files differ
diff --git a/src/widgets/doc/images/cleanlooks-datetimeedit.png b/src/widgets/doc/images/cleanlooks-datetimeedit.png
new file mode 100644
index 0000000000..7a62cebfb4
--- /dev/null
+++ b/src/widgets/doc/images/cleanlooks-datetimeedit.png
Binary files differ
diff --git a/src/widgets/doc/images/cleanlooks-dial.png b/src/widgets/doc/images/cleanlooks-dial.png
new file mode 100644
index 0000000000..259a0888b6
--- /dev/null
+++ b/src/widgets/doc/images/cleanlooks-dial.png
Binary files differ
diff --git a/src/widgets/doc/images/cleanlooks-doublespinbox.png b/src/widgets/doc/images/cleanlooks-doublespinbox.png
new file mode 100644
index 0000000000..93b11f919a
--- /dev/null
+++ b/src/widgets/doc/images/cleanlooks-doublespinbox.png
Binary files differ
diff --git a/src/widgets/doc/images/cleanlooks-fontcombobox.png b/src/widgets/doc/images/cleanlooks-fontcombobox.png
new file mode 100644
index 0000000000..47a5907f56
--- /dev/null
+++ b/src/widgets/doc/images/cleanlooks-fontcombobox.png
Binary files differ
diff --git a/src/widgets/doc/images/cleanlooks-frame.png b/src/widgets/doc/images/cleanlooks-frame.png
new file mode 100644
index 0000000000..2427b08d8f
--- /dev/null
+++ b/src/widgets/doc/images/cleanlooks-frame.png
Binary files differ
diff --git a/src/widgets/doc/images/cleanlooks-groupbox.png b/src/widgets/doc/images/cleanlooks-groupbox.png
new file mode 100644
index 0000000000..89c6eb2f39
--- /dev/null
+++ b/src/widgets/doc/images/cleanlooks-groupbox.png
Binary files differ
diff --git a/src/widgets/doc/images/cleanlooks-horizontalscrollbar.png b/src/widgets/doc/images/cleanlooks-horizontalscrollbar.png
new file mode 100644
index 0000000000..ca1c806c91
--- /dev/null
+++ b/src/widgets/doc/images/cleanlooks-horizontalscrollbar.png
Binary files differ
diff --git a/src/widgets/doc/images/cleanlooks-label.png b/src/widgets/doc/images/cleanlooks-label.png
new file mode 100644
index 0000000000..199758fd69
--- /dev/null
+++ b/src/widgets/doc/images/cleanlooks-label.png
Binary files differ
diff --git a/src/widgets/doc/images/cleanlooks-lcdnumber.png b/src/widgets/doc/images/cleanlooks-lcdnumber.png
new file mode 100644
index 0000000000..c6e34127cf
--- /dev/null
+++ b/src/widgets/doc/images/cleanlooks-lcdnumber.png
Binary files differ
diff --git a/src/widgets/doc/images/cleanlooks-lineedit.png b/src/widgets/doc/images/cleanlooks-lineedit.png
new file mode 100644
index 0000000000..3e9f1a4be3
--- /dev/null
+++ b/src/widgets/doc/images/cleanlooks-lineedit.png
Binary files differ
diff --git a/src/widgets/doc/images/cleanlooks-listview.png b/src/widgets/doc/images/cleanlooks-listview.png
new file mode 100644
index 0000000000..95f836c66b
--- /dev/null
+++ b/src/widgets/doc/images/cleanlooks-listview.png
Binary files differ
diff --git a/src/widgets/doc/images/cleanlooks-progressbar.png b/src/widgets/doc/images/cleanlooks-progressbar.png
new file mode 100644
index 0000000000..53fc6c1faa
--- /dev/null
+++ b/src/widgets/doc/images/cleanlooks-progressbar.png
Binary files differ
diff --git a/src/widgets/doc/images/cleanlooks-pushbutton-menu.png b/src/widgets/doc/images/cleanlooks-pushbutton-menu.png
new file mode 100644
index 0000000000..0d5cb59ec0
--- /dev/null
+++ b/src/widgets/doc/images/cleanlooks-pushbutton-menu.png
Binary files differ
diff --git a/src/widgets/doc/images/cleanlooks-pushbutton.png b/src/widgets/doc/images/cleanlooks-pushbutton.png
new file mode 100644
index 0000000000..7b3b3357c1
--- /dev/null
+++ b/src/widgets/doc/images/cleanlooks-pushbutton.png
Binary files differ
diff --git a/src/widgets/doc/images/cleanlooks-radiobutton.png b/src/widgets/doc/images/cleanlooks-radiobutton.png
new file mode 100644
index 0000000000..4e077688c2
--- /dev/null
+++ b/src/widgets/doc/images/cleanlooks-radiobutton.png
Binary files differ
diff --git a/src/widgets/doc/images/cleanlooks-slider.png b/src/widgets/doc/images/cleanlooks-slider.png
new file mode 100644
index 0000000000..8dfaa01092
--- /dev/null
+++ b/src/widgets/doc/images/cleanlooks-slider.png
Binary files differ
diff --git a/src/widgets/doc/images/cleanlooks-spinbox.png b/src/widgets/doc/images/cleanlooks-spinbox.png
new file mode 100644
index 0000000000..ad5b5a01b6
--- /dev/null
+++ b/src/widgets/doc/images/cleanlooks-spinbox.png
Binary files differ
diff --git a/src/widgets/doc/images/cleanlooks-tableview.png b/src/widgets/doc/images/cleanlooks-tableview.png
new file mode 100644
index 0000000000..d89fecc5ad
--- /dev/null
+++ b/src/widgets/doc/images/cleanlooks-tableview.png
Binary files differ
diff --git a/src/widgets/doc/images/cleanlooks-tabwidget.png b/src/widgets/doc/images/cleanlooks-tabwidget.png
new file mode 100644
index 0000000000..bcff2967aa
--- /dev/null
+++ b/src/widgets/doc/images/cleanlooks-tabwidget.png
Binary files differ
diff --git a/src/widgets/doc/images/cleanlooks-textedit.png b/src/widgets/doc/images/cleanlooks-textedit.png
new file mode 100644
index 0000000000..0c825a1e04
--- /dev/null
+++ b/src/widgets/doc/images/cleanlooks-textedit.png
Binary files differ
diff --git a/src/widgets/doc/images/cleanlooks-timeedit.png b/src/widgets/doc/images/cleanlooks-timeedit.png
new file mode 100644
index 0000000000..00420a2f18
--- /dev/null
+++ b/src/widgets/doc/images/cleanlooks-timeedit.png
Binary files differ
diff --git a/src/widgets/doc/images/cleanlooks-toolbox.png b/src/widgets/doc/images/cleanlooks-toolbox.png
new file mode 100644
index 0000000000..63366e5422
--- /dev/null
+++ b/src/widgets/doc/images/cleanlooks-toolbox.png
Binary files differ
diff --git a/src/widgets/doc/images/cleanlooks-toolbutton.png b/src/widgets/doc/images/cleanlooks-toolbutton.png
new file mode 100644
index 0000000000..bcf86ea26f
--- /dev/null
+++ b/src/widgets/doc/images/cleanlooks-toolbutton.png
Binary files differ
diff --git a/src/widgets/doc/images/cleanlooks-treeview.png b/src/widgets/doc/images/cleanlooks-treeview.png
new file mode 100644
index 0000000000..5bc4a06a3c
--- /dev/null
+++ b/src/widgets/doc/images/cleanlooks-treeview.png
Binary files differ
diff --git a/src/widgets/doc/images/designer-stylesheet-options.png b/src/widgets/doc/images/designer-stylesheet-options.png
new file mode 100644
index 0000000000..a6893e770b
--- /dev/null
+++ b/src/widgets/doc/images/designer-stylesheet-options.png
Binary files differ
diff --git a/src/widgets/doc/images/designer-stylesheet-usage.png b/src/widgets/doc/images/designer-stylesheet-usage.png
new file mode 100644
index 0000000000..f6875900de
--- /dev/null
+++ b/src/widgets/doc/images/designer-stylesheet-usage.png
Binary files differ
diff --git a/src/widgets/doc/images/designer-validator-highlighter.png b/src/widgets/doc/images/designer-validator-highlighter.png
new file mode 100644
index 0000000000..a6661d5c95
--- /dev/null
+++ b/src/widgets/doc/images/designer-validator-highlighter.png
Binary files differ
diff --git a/src/widgets/doc/images/filedialogurls.png b/src/widgets/doc/images/filedialogurls.png
new file mode 100644
index 0000000000..7d22ef33ae
--- /dev/null
+++ b/src/widgets/doc/images/filedialogurls.png
Binary files differ
diff --git a/src/widgets/doc/images/frames.png b/src/widgets/doc/images/frames.png
new file mode 100644
index 0000000000..13c08508a2
--- /dev/null
+++ b/src/widgets/doc/images/frames.png
Binary files differ
diff --git a/src/widgets/doc/images/graphicsview-ellipseitem-pie.png b/src/widgets/doc/images/graphicsview-ellipseitem-pie.png
new file mode 100644
index 0000000000..136175abc2
--- /dev/null
+++ b/src/widgets/doc/images/graphicsview-ellipseitem-pie.png
Binary files differ
diff --git a/src/widgets/doc/images/graphicsview-ellipseitem.png b/src/widgets/doc/images/graphicsview-ellipseitem.png
new file mode 100644
index 0000000000..7c7a8e58d0
--- /dev/null
+++ b/src/widgets/doc/images/graphicsview-ellipseitem.png
Binary files differ
diff --git a/src/widgets/doc/images/graphicsview-items.png b/src/widgets/doc/images/graphicsview-items.png
new file mode 100644
index 0000000000..73be2ddaee
--- /dev/null
+++ b/src/widgets/doc/images/graphicsview-items.png
Binary files differ
diff --git a/src/widgets/doc/images/graphicsview-pathitem.png b/src/widgets/doc/images/graphicsview-pathitem.png
new file mode 100644
index 0000000000..c1ddd5620a
--- /dev/null
+++ b/src/widgets/doc/images/graphicsview-pathitem.png
Binary files differ
diff --git a/src/widgets/doc/images/graphicsview-pixmapitem.png b/src/widgets/doc/images/graphicsview-pixmapitem.png
new file mode 100644
index 0000000000..d14fac55e0
--- /dev/null
+++ b/src/widgets/doc/images/graphicsview-pixmapitem.png
Binary files differ
diff --git a/src/widgets/doc/images/graphicsview-polygonitem.png b/src/widgets/doc/images/graphicsview-polygonitem.png
new file mode 100644
index 0000000000..3cd2232574
--- /dev/null
+++ b/src/widgets/doc/images/graphicsview-polygonitem.png
Binary files differ
diff --git a/src/widgets/doc/images/graphicsview-rectitem.png b/src/widgets/doc/images/graphicsview-rectitem.png
new file mode 100644
index 0000000000..a5917e55dd
--- /dev/null
+++ b/src/widgets/doc/images/graphicsview-rectitem.png
Binary files differ
diff --git a/src/widgets/doc/images/graphicsview-zorder.png b/src/widgets/doc/images/graphicsview-zorder.png
new file mode 100644
index 0000000000..a1cc3d0168
--- /dev/null
+++ b/src/widgets/doc/images/graphicsview-zorder.png
Binary files differ
diff --git a/src/widgets/doc/images/gridlayout.png b/src/widgets/doc/images/gridlayout.png
new file mode 100644
index 0000000000..ae76c0487b
--- /dev/null
+++ b/src/widgets/doc/images/gridlayout.png
Binary files differ
diff --git a/src/widgets/doc/images/gtk-calendarwidget.png b/src/widgets/doc/images/gtk-calendarwidget.png
new file mode 100644
index 0000000000..568cd1a5da
--- /dev/null
+++ b/src/widgets/doc/images/gtk-calendarwidget.png
Binary files differ
diff --git a/src/widgets/doc/images/gtk-checkbox.png b/src/widgets/doc/images/gtk-checkbox.png
new file mode 100644
index 0000000000..1fd5fc77bf
--- /dev/null
+++ b/src/widgets/doc/images/gtk-checkbox.png
Binary files differ
diff --git a/src/widgets/doc/images/gtk-combobox.png b/src/widgets/doc/images/gtk-combobox.png
new file mode 100644
index 0000000000..3b4544df13
--- /dev/null
+++ b/src/widgets/doc/images/gtk-combobox.png
Binary files differ
diff --git a/src/widgets/doc/images/gtk-dateedit.png b/src/widgets/doc/images/gtk-dateedit.png
new file mode 100644
index 0000000000..25229f0b3b
--- /dev/null
+++ b/src/widgets/doc/images/gtk-dateedit.png
Binary files differ
diff --git a/src/widgets/doc/images/gtk-datetimeedit.png b/src/widgets/doc/images/gtk-datetimeedit.png
new file mode 100644
index 0000000000..0c934a4d0d
--- /dev/null
+++ b/src/widgets/doc/images/gtk-datetimeedit.png
Binary files differ
diff --git a/src/widgets/doc/images/gtk-dial.png b/src/widgets/doc/images/gtk-dial.png
new file mode 100644
index 0000000000..18e14b3650
--- /dev/null
+++ b/src/widgets/doc/images/gtk-dial.png
Binary files differ
diff --git a/src/widgets/doc/images/gtk-doublespinbox.png b/src/widgets/doc/images/gtk-doublespinbox.png
new file mode 100644
index 0000000000..3a69043c0b
--- /dev/null
+++ b/src/widgets/doc/images/gtk-doublespinbox.png
Binary files differ
diff --git a/src/widgets/doc/images/gtk-fontcombobox.png b/src/widgets/doc/images/gtk-fontcombobox.png
new file mode 100644
index 0000000000..4cb1bc1343
--- /dev/null
+++ b/src/widgets/doc/images/gtk-fontcombobox.png
Binary files differ
diff --git a/src/widgets/doc/images/gtk-frame.png b/src/widgets/doc/images/gtk-frame.png
new file mode 100644
index 0000000000..c1bf52f6a6
--- /dev/null
+++ b/src/widgets/doc/images/gtk-frame.png
Binary files differ
diff --git a/src/widgets/doc/images/gtk-groupbox.png b/src/widgets/doc/images/gtk-groupbox.png
new file mode 100644
index 0000000000..6d217c89f9
--- /dev/null
+++ b/src/widgets/doc/images/gtk-groupbox.png
Binary files differ
diff --git a/src/widgets/doc/images/gtk-horizontalscrollbar.png b/src/widgets/doc/images/gtk-horizontalscrollbar.png
new file mode 100644
index 0000000000..2887730c13
--- /dev/null
+++ b/src/widgets/doc/images/gtk-horizontalscrollbar.png
Binary files differ
diff --git a/src/widgets/doc/images/gtk-label.png b/src/widgets/doc/images/gtk-label.png
new file mode 100644
index 0000000000..006d0133d8
--- /dev/null
+++ b/src/widgets/doc/images/gtk-label.png
Binary files differ
diff --git a/src/widgets/doc/images/gtk-lcdnumber.png b/src/widgets/doc/images/gtk-lcdnumber.png
new file mode 100644
index 0000000000..142d298ffc
--- /dev/null
+++ b/src/widgets/doc/images/gtk-lcdnumber.png
Binary files differ
diff --git a/src/widgets/doc/images/gtk-lineedit.png b/src/widgets/doc/images/gtk-lineedit.png
new file mode 100644
index 0000000000..8fb513c39f
--- /dev/null
+++ b/src/widgets/doc/images/gtk-lineedit.png
Binary files differ
diff --git a/src/widgets/doc/images/gtk-listview.png b/src/widgets/doc/images/gtk-listview.png
new file mode 100644
index 0000000000..d32f8e8aee
--- /dev/null
+++ b/src/widgets/doc/images/gtk-listview.png
Binary files differ
diff --git a/src/widgets/doc/images/gtk-progressbar.png b/src/widgets/doc/images/gtk-progressbar.png
new file mode 100644
index 0000000000..6162484bf3
--- /dev/null
+++ b/src/widgets/doc/images/gtk-progressbar.png
Binary files differ
diff --git a/src/widgets/doc/images/gtk-pushbutton.png b/src/widgets/doc/images/gtk-pushbutton.png
new file mode 100644
index 0000000000..f4f4d7c1e4
--- /dev/null
+++ b/src/widgets/doc/images/gtk-pushbutton.png
Binary files differ
diff --git a/src/widgets/doc/images/gtk-radiobutton.png b/src/widgets/doc/images/gtk-radiobutton.png
new file mode 100644
index 0000000000..b3620fa054
--- /dev/null
+++ b/src/widgets/doc/images/gtk-radiobutton.png
Binary files differ
diff --git a/src/widgets/doc/images/gtk-slider.png b/src/widgets/doc/images/gtk-slider.png
new file mode 100644
index 0000000000..3d8e0ee89e
--- /dev/null
+++ b/src/widgets/doc/images/gtk-slider.png
Binary files differ
diff --git a/src/widgets/doc/images/gtk-spinbox.png b/src/widgets/doc/images/gtk-spinbox.png
new file mode 100644
index 0000000000..a39eb3aa93
--- /dev/null
+++ b/src/widgets/doc/images/gtk-spinbox.png
Binary files differ
diff --git a/src/widgets/doc/images/gtk-tableview.png b/src/widgets/doc/images/gtk-tableview.png
new file mode 100644
index 0000000000..a025193188
--- /dev/null
+++ b/src/widgets/doc/images/gtk-tableview.png
Binary files differ
diff --git a/src/widgets/doc/images/gtk-tabwidget.png b/src/widgets/doc/images/gtk-tabwidget.png
new file mode 100644
index 0000000000..089c76dad2
--- /dev/null
+++ b/src/widgets/doc/images/gtk-tabwidget.png
Binary files differ
diff --git a/src/widgets/doc/images/gtk-textedit.png b/src/widgets/doc/images/gtk-textedit.png
new file mode 100644
index 0000000000..e4b91c01c9
--- /dev/null
+++ b/src/widgets/doc/images/gtk-textedit.png
Binary files differ
diff --git a/src/widgets/doc/images/gtk-timeedit.png b/src/widgets/doc/images/gtk-timeedit.png
new file mode 100644
index 0000000000..acf6730a86
--- /dev/null
+++ b/src/widgets/doc/images/gtk-timeedit.png
Binary files differ
diff --git a/src/widgets/doc/images/gtk-toolbox.png b/src/widgets/doc/images/gtk-toolbox.png
new file mode 100644
index 0000000000..25e6137699
--- /dev/null
+++ b/src/widgets/doc/images/gtk-toolbox.png
Binary files differ
diff --git a/src/widgets/doc/images/gtk-toolbutton.png b/src/widgets/doc/images/gtk-toolbutton.png
new file mode 100644
index 0000000000..f0eb86efc5
--- /dev/null
+++ b/src/widgets/doc/images/gtk-toolbutton.png
Binary files differ
diff --git a/src/widgets/doc/images/gtk-treeview.png b/src/widgets/doc/images/gtk-treeview.png
new file mode 100644
index 0000000000..7b4e3044be
--- /dev/null
+++ b/src/widgets/doc/images/gtk-treeview.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/branchindicatorimage.png b/src/widgets/doc/images/javastyle/branchindicatorimage.png
new file mode 100644
index 0000000000..f2cfc4b2e9
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/branchindicatorimage.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/button.png b/src/widgets/doc/images/javastyle/button.png
new file mode 100644
index 0000000000..c3a97425b1
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/button.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/checkbox.png b/src/widgets/doc/images/javastyle/checkbox.png
new file mode 100644
index 0000000000..bc841a6a6d
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/checkbox.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/checkboxexample.png b/src/widgets/doc/images/javastyle/checkboxexample.png
new file mode 100644
index 0000000000..69217fb2e5
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/checkboxexample.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/combobox.png b/src/widgets/doc/images/javastyle/combobox.png
new file mode 100644
index 0000000000..de9745a218
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/combobox.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/comboboximage.png b/src/widgets/doc/images/javastyle/comboboximage.png
new file mode 100644
index 0000000000..1f05e5fe86
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/comboboximage.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/conceptualpushbuttontree.png b/src/widgets/doc/images/javastyle/conceptualpushbuttontree.png
new file mode 100644
index 0000000000..910000a6e8
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/conceptualpushbuttontree.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/dockwidget.png b/src/widgets/doc/images/javastyle/dockwidget.png
new file mode 100644
index 0000000000..4bfec142bf
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/dockwidget.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/dockwidgetimage.png b/src/widgets/doc/images/javastyle/dockwidgetimage.png
new file mode 100644
index 0000000000..eefe171e3e
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/dockwidgetimage.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/groupbox.png b/src/widgets/doc/images/javastyle/groupbox.png
new file mode 100644
index 0000000000..a39cd42c9f
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/groupbox.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/groupboximage.png b/src/widgets/doc/images/javastyle/groupboximage.png
new file mode 100644
index 0000000000..5baf6092d4
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/groupboximage.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/header.png b/src/widgets/doc/images/javastyle/header.png
new file mode 100644
index 0000000000..b4546d840e
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/header.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/headerimage.png b/src/widgets/doc/images/javastyle/headerimage.png
new file mode 100644
index 0000000000..41171497d5
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/headerimage.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/menu.png b/src/widgets/doc/images/javastyle/menu.png
new file mode 100644
index 0000000000..8d44da4054
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/menu.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/menubar.png b/src/widgets/doc/images/javastyle/menubar.png
new file mode 100644
index 0000000000..e68e4a3a55
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/menubar.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/menubarimage.png b/src/widgets/doc/images/javastyle/menubarimage.png
new file mode 100644
index 0000000000..b0cf28edcc
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/menubarimage.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/menuimage.png b/src/widgets/doc/images/javastyle/menuimage.png
new file mode 100644
index 0000000000..282dde7159
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/menuimage.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/progressbar.png b/src/widgets/doc/images/javastyle/progressbar.png
new file mode 100644
index 0000000000..de3a838c38
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/progressbar.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/progressbarimage.png b/src/widgets/doc/images/javastyle/progressbarimage.png
new file mode 100644
index 0000000000..433b900ab5
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/progressbarimage.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/pushbutton.png b/src/widgets/doc/images/javastyle/pushbutton.png
new file mode 100644
index 0000000000..e5f92bea12
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/pushbutton.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/rubberband.png b/src/widgets/doc/images/javastyle/rubberband.png
new file mode 100644
index 0000000000..087424a3f0
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/rubberband.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/rubberbandimage.png b/src/widgets/doc/images/javastyle/rubberbandimage.png
new file mode 100644
index 0000000000..2794638dbc
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/rubberbandimage.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/scrollbar.png b/src/widgets/doc/images/javastyle/scrollbar.png
new file mode 100644
index 0000000000..c1ecb5d655
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/scrollbar.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/scrollbarimage.png b/src/widgets/doc/images/javastyle/scrollbarimage.png
new file mode 100644
index 0000000000..6d3e29d8dd
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/scrollbarimage.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/sizegrip.png b/src/widgets/doc/images/javastyle/sizegrip.png
new file mode 100644
index 0000000000..667e6fb465
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/sizegrip.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/sizegripimage.png b/src/widgets/doc/images/javastyle/sizegripimage.png
new file mode 100644
index 0000000000..ccbf5254d3
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/sizegripimage.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/slider.png b/src/widgets/doc/images/javastyle/slider.png
new file mode 100644
index 0000000000..a382233f58
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/slider.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/sliderimage.png b/src/widgets/doc/images/javastyle/sliderimage.png
new file mode 100644
index 0000000000..df700dd712
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/sliderimage.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/spinbox.png b/src/widgets/doc/images/javastyle/spinbox.png
new file mode 100644
index 0000000000..ec9d6e0d75
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/spinbox.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/spinboximage.png b/src/widgets/doc/images/javastyle/spinboximage.png
new file mode 100644
index 0000000000..d0d57c8ffb
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/spinboximage.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/tab.png b/src/widgets/doc/images/javastyle/tab.png
new file mode 100644
index 0000000000..616580c839
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/tab.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/tabwidget.png b/src/widgets/doc/images/javastyle/tabwidget.png
new file mode 100644
index 0000000000..737155ccb9
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/tabwidget.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/titlebar.png b/src/widgets/doc/images/javastyle/titlebar.png
new file mode 100644
index 0000000000..5d7ecc481d
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/titlebar.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/titlebarimage.png b/src/widgets/doc/images/javastyle/titlebarimage.png
new file mode 100644
index 0000000000..50287aeb1d
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/titlebarimage.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/toolbar.png b/src/widgets/doc/images/javastyle/toolbar.png
new file mode 100644
index 0000000000..e69e8df4c8
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/toolbar.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/toolbarimage.png b/src/widgets/doc/images/javastyle/toolbarimage.png
new file mode 100644
index 0000000000..b9025f582a
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/toolbarimage.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/toolbox.png b/src/widgets/doc/images/javastyle/toolbox.png
new file mode 100644
index 0000000000..c5f61ecec8
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/toolbox.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/toolboximage.png b/src/widgets/doc/images/javastyle/toolboximage.png
new file mode 100644
index 0000000000..7bcbd26432
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/toolboximage.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/toolbutton.png b/src/widgets/doc/images/javastyle/toolbutton.png
new file mode 100644
index 0000000000..9167e83f75
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/toolbutton.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/toolbuttonimage.png b/src/widgets/doc/images/javastyle/toolbuttonimage.png
new file mode 100644
index 0000000000..3217172fca
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/toolbuttonimage.png
Binary files differ
diff --git a/src/widgets/doc/images/javastyle/windowstabimage.png b/src/widgets/doc/images/javastyle/windowstabimage.png
new file mode 100644
index 0000000000..485e847844
--- /dev/null
+++ b/src/widgets/doc/images/javastyle/windowstabimage.png
Binary files differ
diff --git a/src/widgets/doc/images/licensewizard-flow.png b/src/widgets/doc/images/licensewizard-flow.png
new file mode 100644
index 0000000000..76df63a98f
--- /dev/null
+++ b/src/widgets/doc/images/licensewizard-flow.png
Binary files differ
diff --git a/src/widgets/doc/images/macintosh-calendarwidget.png b/src/widgets/doc/images/macintosh-calendarwidget.png
new file mode 100644
index 0000000000..2f743501a9
--- /dev/null
+++ b/src/widgets/doc/images/macintosh-calendarwidget.png
Binary files differ
diff --git a/src/widgets/doc/images/macintosh-checkbox.png b/src/widgets/doc/images/macintosh-checkbox.png
new file mode 100644
index 0000000000..d0130e3f22
--- /dev/null
+++ b/src/widgets/doc/images/macintosh-checkbox.png
Binary files differ
diff --git a/src/widgets/doc/images/macintosh-combobox.png b/src/widgets/doc/images/macintosh-combobox.png
new file mode 100644
index 0000000000..c1dc3c0c96
--- /dev/null
+++ b/src/widgets/doc/images/macintosh-combobox.png
Binary files differ
diff --git a/src/widgets/doc/images/macintosh-dateedit.png b/src/widgets/doc/images/macintosh-dateedit.png
new file mode 100644
index 0000000000..45aee90a9b
--- /dev/null
+++ b/src/widgets/doc/images/macintosh-dateedit.png
Binary files differ
diff --git a/src/widgets/doc/images/macintosh-datetimeedit.png b/src/widgets/doc/images/macintosh-datetimeedit.png
new file mode 100644
index 0000000000..62af02d64e
--- /dev/null
+++ b/src/widgets/doc/images/macintosh-datetimeedit.png
Binary files differ
diff --git a/src/widgets/doc/images/macintosh-dial.png b/src/widgets/doc/images/macintosh-dial.png
new file mode 100644
index 0000000000..df0ffe23a1
--- /dev/null
+++ b/src/widgets/doc/images/macintosh-dial.png
Binary files differ
diff --git a/src/widgets/doc/images/macintosh-doublespinbox.png b/src/widgets/doc/images/macintosh-doublespinbox.png
new file mode 100644
index 0000000000..a0695ff278
--- /dev/null
+++ b/src/widgets/doc/images/macintosh-doublespinbox.png
Binary files differ
diff --git a/src/widgets/doc/images/macintosh-fontcombobox.png b/src/widgets/doc/images/macintosh-fontcombobox.png
new file mode 100644
index 0000000000..8a5a3c78a3
--- /dev/null
+++ b/src/widgets/doc/images/macintosh-fontcombobox.png
Binary files differ
diff --git a/src/widgets/doc/images/macintosh-frame.png b/src/widgets/doc/images/macintosh-frame.png
new file mode 100644
index 0000000000..fee61a3643
--- /dev/null
+++ b/src/widgets/doc/images/macintosh-frame.png
Binary files differ
diff --git a/src/widgets/doc/images/macintosh-groupbox.png b/src/widgets/doc/images/macintosh-groupbox.png
new file mode 100644
index 0000000000..f6c7bce580
--- /dev/null
+++ b/src/widgets/doc/images/macintosh-groupbox.png
Binary files differ
diff --git a/src/widgets/doc/images/macintosh-horizontalscrollbar.png b/src/widgets/doc/images/macintosh-horizontalscrollbar.png
new file mode 100644
index 0000000000..8b63572a9e
--- /dev/null
+++ b/src/widgets/doc/images/macintosh-horizontalscrollbar.png
Binary files differ
diff --git a/src/widgets/doc/images/macintosh-label.png b/src/widgets/doc/images/macintosh-label.png
new file mode 100644
index 0000000000..753aa4d138
--- /dev/null
+++ b/src/widgets/doc/images/macintosh-label.png
Binary files differ
diff --git a/src/widgets/doc/images/macintosh-lcdnumber.png b/src/widgets/doc/images/macintosh-lcdnumber.png
new file mode 100644
index 0000000000..2ea9ea0713
--- /dev/null
+++ b/src/widgets/doc/images/macintosh-lcdnumber.png
Binary files differ
diff --git a/src/widgets/doc/images/macintosh-lineedit.png b/src/widgets/doc/images/macintosh-lineedit.png
new file mode 100644
index 0000000000..0e992c7ffe
--- /dev/null
+++ b/src/widgets/doc/images/macintosh-lineedit.png
Binary files differ
diff --git a/src/widgets/doc/images/macintosh-listview.png b/src/widgets/doc/images/macintosh-listview.png
new file mode 100644
index 0000000000..346e6427ff
--- /dev/null
+++ b/src/widgets/doc/images/macintosh-listview.png
Binary files differ
diff --git a/src/widgets/doc/images/macintosh-menu.png b/src/widgets/doc/images/macintosh-menu.png
new file mode 100644
index 0000000000..59bdceaab6
--- /dev/null
+++ b/src/widgets/doc/images/macintosh-menu.png
Binary files differ
diff --git a/src/widgets/doc/images/macintosh-progressbar.png b/src/widgets/doc/images/macintosh-progressbar.png
new file mode 100644
index 0000000000..2dfc8aba81
--- /dev/null
+++ b/src/widgets/doc/images/macintosh-progressbar.png
Binary files differ
diff --git a/src/widgets/doc/images/macintosh-pushbutton.png b/src/widgets/doc/images/macintosh-pushbutton.png
new file mode 100644
index 0000000000..7ec14910d8
--- /dev/null
+++ b/src/widgets/doc/images/macintosh-pushbutton.png
Binary files differ
diff --git a/src/widgets/doc/images/macintosh-radiobutton.png b/src/widgets/doc/images/macintosh-radiobutton.png
new file mode 100644
index 0000000000..8b02f509ff
--- /dev/null
+++ b/src/widgets/doc/images/macintosh-radiobutton.png
Binary files differ
diff --git a/src/widgets/doc/images/macintosh-slider.png b/src/widgets/doc/images/macintosh-slider.png
new file mode 100644
index 0000000000..bf0c5464e9
--- /dev/null
+++ b/src/widgets/doc/images/macintosh-slider.png
Binary files differ
diff --git a/src/widgets/doc/images/macintosh-spinbox.png b/src/widgets/doc/images/macintosh-spinbox.png
new file mode 100644
index 0000000000..4196c37246
--- /dev/null
+++ b/src/widgets/doc/images/macintosh-spinbox.png
Binary files differ
diff --git a/src/widgets/doc/images/macintosh-tableview.png b/src/widgets/doc/images/macintosh-tableview.png
new file mode 100644
index 0000000000..e6512494de
--- /dev/null
+++ b/src/widgets/doc/images/macintosh-tableview.png
Binary files differ
diff --git a/src/widgets/doc/images/macintosh-tabwidget.png b/src/widgets/doc/images/macintosh-tabwidget.png
new file mode 100644
index 0000000000..1d174a47e6
--- /dev/null
+++ b/src/widgets/doc/images/macintosh-tabwidget.png
Binary files differ
diff --git a/src/widgets/doc/images/macintosh-textedit.png b/src/widgets/doc/images/macintosh-textedit.png
new file mode 100644
index 0000000000..4f0ce36baf
--- /dev/null
+++ b/src/widgets/doc/images/macintosh-textedit.png
Binary files differ
diff --git a/src/widgets/doc/images/macintosh-timeedit.png b/src/widgets/doc/images/macintosh-timeedit.png
new file mode 100644
index 0000000000..4bcfce33f8
--- /dev/null
+++ b/src/widgets/doc/images/macintosh-timeedit.png
Binary files differ
diff --git a/src/widgets/doc/images/macintosh-toolbox.png b/src/widgets/doc/images/macintosh-toolbox.png
new file mode 100644
index 0000000000..18d41ea595
--- /dev/null
+++ b/src/widgets/doc/images/macintosh-toolbox.png
Binary files differ
diff --git a/src/widgets/doc/images/macintosh-toolbutton.png b/src/widgets/doc/images/macintosh-toolbutton.png
new file mode 100644
index 0000000000..f91331cc51
--- /dev/null
+++ b/src/widgets/doc/images/macintosh-toolbutton.png
Binary files differ
diff --git a/src/widgets/doc/images/macintosh-treeview.png b/src/widgets/doc/images/macintosh-treeview.png
new file mode 100644
index 0000000000..afda6d8372
--- /dev/null
+++ b/src/widgets/doc/images/macintosh-treeview.png
Binary files differ
diff --git a/src/widgets/doc/images/mainwindow-docks.png b/src/widgets/doc/images/mainwindow-docks.png
new file mode 100644
index 0000000000..24f42a28ea
--- /dev/null
+++ b/src/widgets/doc/images/mainwindow-docks.png
Binary files differ
diff --git a/src/widgets/doc/images/mainwindowlayout.png b/src/widgets/doc/images/mainwindowlayout.png
new file mode 100644
index 0000000000..4776ce4f1b
--- /dev/null
+++ b/src/widgets/doc/images/mainwindowlayout.png
Binary files differ
diff --git a/src/widgets/doc/images/mdi-cascade.png b/src/widgets/doc/images/mdi-cascade.png
new file mode 100644
index 0000000000..ca55a5b894
--- /dev/null
+++ b/src/widgets/doc/images/mdi-cascade.png
Binary files differ
diff --git a/src/widgets/doc/images/mdi-tile.png b/src/widgets/doc/images/mdi-tile.png
new file mode 100644
index 0000000000..1486d9654e
--- /dev/null
+++ b/src/widgets/doc/images/mdi-tile.png
Binary files differ
diff --git a/src/widgets/doc/images/motif-calendarwidget.png b/src/widgets/doc/images/motif-calendarwidget.png
new file mode 100644
index 0000000000..4ce6aebc21
--- /dev/null
+++ b/src/widgets/doc/images/motif-calendarwidget.png
Binary files differ
diff --git a/src/widgets/doc/images/motif-checkbox.png b/src/widgets/doc/images/motif-checkbox.png
new file mode 100644
index 0000000000..2a263273a6
--- /dev/null
+++ b/src/widgets/doc/images/motif-checkbox.png
Binary files differ
diff --git a/src/widgets/doc/images/motif-combobox.png b/src/widgets/doc/images/motif-combobox.png
new file mode 100644
index 0000000000..2a288d9f40
--- /dev/null
+++ b/src/widgets/doc/images/motif-combobox.png
Binary files differ
diff --git a/src/widgets/doc/images/motif-dateedit.png b/src/widgets/doc/images/motif-dateedit.png
new file mode 100644
index 0000000000..d00c45ff65
--- /dev/null
+++ b/src/widgets/doc/images/motif-dateedit.png
Binary files differ
diff --git a/src/widgets/doc/images/motif-datetimeedit.png b/src/widgets/doc/images/motif-datetimeedit.png
new file mode 100644
index 0000000000..cc43ef888d
--- /dev/null
+++ b/src/widgets/doc/images/motif-datetimeedit.png
Binary files differ
diff --git a/src/widgets/doc/images/motif-dial.png b/src/widgets/doc/images/motif-dial.png
new file mode 100644
index 0000000000..36b3ff7be0
--- /dev/null
+++ b/src/widgets/doc/images/motif-dial.png
Binary files differ
diff --git a/src/widgets/doc/images/motif-doublespinbox.png b/src/widgets/doc/images/motif-doublespinbox.png
new file mode 100644
index 0000000000..6092913ab0
--- /dev/null
+++ b/src/widgets/doc/images/motif-doublespinbox.png
Binary files differ
diff --git a/src/widgets/doc/images/motif-fontcombobox.png b/src/widgets/doc/images/motif-fontcombobox.png
new file mode 100644
index 0000000000..c07452d85e
--- /dev/null
+++ b/src/widgets/doc/images/motif-fontcombobox.png
Binary files differ
diff --git a/src/widgets/doc/images/motif-frame.png b/src/widgets/doc/images/motif-frame.png
new file mode 100644
index 0000000000..55dcc32227
--- /dev/null
+++ b/src/widgets/doc/images/motif-frame.png
Binary files differ
diff --git a/src/widgets/doc/images/motif-groupbox.png b/src/widgets/doc/images/motif-groupbox.png
new file mode 100644
index 0000000000..13742b116e
--- /dev/null
+++ b/src/widgets/doc/images/motif-groupbox.png
Binary files differ
diff --git a/src/widgets/doc/images/motif-horizontalscrollbar.png b/src/widgets/doc/images/motif-horizontalscrollbar.png
new file mode 100644
index 0000000000..dab1d3f6f6
--- /dev/null
+++ b/src/widgets/doc/images/motif-horizontalscrollbar.png
Binary files differ
diff --git a/src/widgets/doc/images/motif-label.png b/src/widgets/doc/images/motif-label.png
new file mode 100644
index 0000000000..7ae6674f50
--- /dev/null
+++ b/src/widgets/doc/images/motif-label.png
Binary files differ
diff --git a/src/widgets/doc/images/motif-lcdnumber.png b/src/widgets/doc/images/motif-lcdnumber.png
new file mode 100644
index 0000000000..e2cc9a8058
--- /dev/null
+++ b/src/widgets/doc/images/motif-lcdnumber.png
Binary files differ
diff --git a/src/widgets/doc/images/motif-lineedit.png b/src/widgets/doc/images/motif-lineedit.png
new file mode 100644
index 0000000000..a335c8c107
--- /dev/null
+++ b/src/widgets/doc/images/motif-lineedit.png
Binary files differ
diff --git a/src/widgets/doc/images/motif-listview.png b/src/widgets/doc/images/motif-listview.png
new file mode 100644
index 0000000000..47bd3eae6d
--- /dev/null
+++ b/src/widgets/doc/images/motif-listview.png
Binary files differ
diff --git a/src/widgets/doc/images/motif-menubar.png b/src/widgets/doc/images/motif-menubar.png
new file mode 100644
index 0000000000..f1d9f4bb3d
--- /dev/null
+++ b/src/widgets/doc/images/motif-menubar.png
Binary files differ
diff --git a/src/widgets/doc/images/motif-progressbar.png b/src/widgets/doc/images/motif-progressbar.png
new file mode 100644
index 0000000000..f6d6979b86
--- /dev/null
+++ b/src/widgets/doc/images/motif-progressbar.png
Binary files differ
diff --git a/src/widgets/doc/images/motif-pushbutton.png b/src/widgets/doc/images/motif-pushbutton.png
new file mode 100644
index 0000000000..9dc6a9db78
--- /dev/null
+++ b/src/widgets/doc/images/motif-pushbutton.png
Binary files differ
diff --git a/src/widgets/doc/images/motif-radiobutton.png b/src/widgets/doc/images/motif-radiobutton.png
new file mode 100644
index 0000000000..468e54cfcf
--- /dev/null
+++ b/src/widgets/doc/images/motif-radiobutton.png
Binary files differ
diff --git a/src/widgets/doc/images/motif-slider.png b/src/widgets/doc/images/motif-slider.png
new file mode 100644
index 0000000000..6301e2b26d
--- /dev/null
+++ b/src/widgets/doc/images/motif-slider.png
Binary files differ
diff --git a/src/widgets/doc/images/motif-spinbox.png b/src/widgets/doc/images/motif-spinbox.png
new file mode 100644
index 0000000000..9acc2821c8
--- /dev/null
+++ b/src/widgets/doc/images/motif-spinbox.png
Binary files differ
diff --git a/src/widgets/doc/images/motif-tableview.png b/src/widgets/doc/images/motif-tableview.png
new file mode 100644
index 0000000000..a1d205aaed
--- /dev/null
+++ b/src/widgets/doc/images/motif-tableview.png
Binary files differ
diff --git a/src/widgets/doc/images/motif-tabwidget.png b/src/widgets/doc/images/motif-tabwidget.png
new file mode 100644
index 0000000000..19da66a76c
--- /dev/null
+++ b/src/widgets/doc/images/motif-tabwidget.png
Binary files differ
diff --git a/src/widgets/doc/images/motif-textedit.png b/src/widgets/doc/images/motif-textedit.png
new file mode 100644
index 0000000000..205bc19cfa
--- /dev/null
+++ b/src/widgets/doc/images/motif-textedit.png
Binary files differ
diff --git a/src/widgets/doc/images/motif-timeedit.png b/src/widgets/doc/images/motif-timeedit.png
new file mode 100644
index 0000000000..1ad459b886
--- /dev/null
+++ b/src/widgets/doc/images/motif-timeedit.png
Binary files differ
diff --git a/src/widgets/doc/images/motif-toolbox.png b/src/widgets/doc/images/motif-toolbox.png
new file mode 100644
index 0000000000..4bc3c37bb2
--- /dev/null
+++ b/src/widgets/doc/images/motif-toolbox.png
Binary files differ
diff --git a/src/widgets/doc/images/motif-toolbutton.png b/src/widgets/doc/images/motif-toolbutton.png
new file mode 100644
index 0000000000..8ef51ddd8d
--- /dev/null
+++ b/src/widgets/doc/images/motif-toolbutton.png
Binary files differ
diff --git a/src/widgets/doc/images/motif-treeview.png b/src/widgets/doc/images/motif-treeview.png
new file mode 100644
index 0000000000..a7dd0f2466
--- /dev/null
+++ b/src/widgets/doc/images/motif-treeview.png
Binary files differ
diff --git a/src/widgets/doc/images/msgbox1.png b/src/widgets/doc/images/msgbox1.png
new file mode 100644
index 0000000000..1380e20a5f
--- /dev/null
+++ b/src/widgets/doc/images/msgbox1.png
Binary files differ
diff --git a/src/widgets/doc/images/msgbox2.png b/src/widgets/doc/images/msgbox2.png
new file mode 100644
index 0000000000..e7946996e4
--- /dev/null
+++ b/src/widgets/doc/images/msgbox2.png
Binary files differ
diff --git a/src/widgets/doc/images/msgbox3.png b/src/widgets/doc/images/msgbox3.png
new file mode 100644
index 0000000000..bd81f4d4da
--- /dev/null
+++ b/src/widgets/doc/images/msgbox3.png
Binary files differ
diff --git a/src/widgets/doc/images/msgbox4.png b/src/widgets/doc/images/msgbox4.png
new file mode 100644
index 0000000000..dbe6701cdd
--- /dev/null
+++ b/src/widgets/doc/images/msgbox4.png
Binary files differ
diff --git a/src/widgets/doc/images/pangesture.png b/src/widgets/doc/images/pangesture.png
new file mode 100644
index 0000000000..24caf91d3b
--- /dev/null
+++ b/src/widgets/doc/images/pangesture.png
Binary files differ
diff --git a/src/widgets/doc/images/parent-child-widgets.png b/src/widgets/doc/images/parent-child-widgets.png
new file mode 100644
index 0000000000..094e2e96b6
--- /dev/null
+++ b/src/widgets/doc/images/parent-child-widgets.png
Binary files differ
diff --git a/src/widgets/doc/images/pinchgesture.png b/src/widgets/doc/images/pinchgesture.png
new file mode 100644
index 0000000000..95614c4052
--- /dev/null
+++ b/src/widgets/doc/images/pinchgesture.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-calendarwidget.png b/src/widgets/doc/images/plastique-calendarwidget.png
new file mode 100644
index 0000000000..5e65945c72
--- /dev/null
+++ b/src/widgets/doc/images/plastique-calendarwidget.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-checkbox.png b/src/widgets/doc/images/plastique-checkbox.png
new file mode 100644
index 0000000000..91a5109d65
--- /dev/null
+++ b/src/widgets/doc/images/plastique-checkbox.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-colordialog.png b/src/widgets/doc/images/plastique-colordialog.png
new file mode 100644
index 0000000000..68bf4d0b4b
--- /dev/null
+++ b/src/widgets/doc/images/plastique-colordialog.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-combobox.png b/src/widgets/doc/images/plastique-combobox.png
new file mode 100644
index 0000000000..e3bf8a321f
--- /dev/null
+++ b/src/widgets/doc/images/plastique-combobox.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-dateedit.png b/src/widgets/doc/images/plastique-dateedit.png
new file mode 100644
index 0000000000..2e28a40f01
--- /dev/null
+++ b/src/widgets/doc/images/plastique-dateedit.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-datetimeedit.png b/src/widgets/doc/images/plastique-datetimeedit.png
new file mode 100644
index 0000000000..810bf1660a
--- /dev/null
+++ b/src/widgets/doc/images/plastique-datetimeedit.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-dial.png b/src/widgets/doc/images/plastique-dial.png
new file mode 100644
index 0000000000..b65e7c78cd
--- /dev/null
+++ b/src/widgets/doc/images/plastique-dial.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-doublespinbox.png b/src/widgets/doc/images/plastique-doublespinbox.png
new file mode 100644
index 0000000000..627c4a20fe
--- /dev/null
+++ b/src/widgets/doc/images/plastique-doublespinbox.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-fontcombobox.png b/src/widgets/doc/images/plastique-fontcombobox.png
new file mode 100644
index 0000000000..d3823081d8
--- /dev/null
+++ b/src/widgets/doc/images/plastique-fontcombobox.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-fontdialog.png b/src/widgets/doc/images/plastique-fontdialog.png
new file mode 100644
index 0000000000..7e799a8815
--- /dev/null
+++ b/src/widgets/doc/images/plastique-fontdialog.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-frame.png b/src/widgets/doc/images/plastique-frame.png
new file mode 100644
index 0000000000..9f81f6cba4
--- /dev/null
+++ b/src/widgets/doc/images/plastique-frame.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-groupbox.png b/src/widgets/doc/images/plastique-groupbox.png
new file mode 100644
index 0000000000..d353c40071
--- /dev/null
+++ b/src/widgets/doc/images/plastique-groupbox.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-horizontalscrollbar.png b/src/widgets/doc/images/plastique-horizontalscrollbar.png
new file mode 100644
index 0000000000..d20300c23f
--- /dev/null
+++ b/src/widgets/doc/images/plastique-horizontalscrollbar.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-label.png b/src/widgets/doc/images/plastique-label.png
new file mode 100644
index 0000000000..d2a55a862c
--- /dev/null
+++ b/src/widgets/doc/images/plastique-label.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-lcdnumber.png b/src/widgets/doc/images/plastique-lcdnumber.png
new file mode 100644
index 0000000000..74149ee158
--- /dev/null
+++ b/src/widgets/doc/images/plastique-lcdnumber.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-lineedit.png b/src/widgets/doc/images/plastique-lineedit.png
new file mode 100644
index 0000000000..f455383520
--- /dev/null
+++ b/src/widgets/doc/images/plastique-lineedit.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-listview.png b/src/widgets/doc/images/plastique-listview.png
new file mode 100644
index 0000000000..64bd00fe1f
--- /dev/null
+++ b/src/widgets/doc/images/plastique-listview.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-menu.png b/src/widgets/doc/images/plastique-menu.png
new file mode 100644
index 0000000000..88df2493af
--- /dev/null
+++ b/src/widgets/doc/images/plastique-menu.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-menubar.png b/src/widgets/doc/images/plastique-menubar.png
new file mode 100644
index 0000000000..642f95d6cf
--- /dev/null
+++ b/src/widgets/doc/images/plastique-menubar.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-progressbar.png b/src/widgets/doc/images/plastique-progressbar.png
new file mode 100644
index 0000000000..fe8dd90274
--- /dev/null
+++ b/src/widgets/doc/images/plastique-progressbar.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-progressdialog.png b/src/widgets/doc/images/plastique-progressdialog.png
new file mode 100644
index 0000000000..4373bcac16
--- /dev/null
+++ b/src/widgets/doc/images/plastique-progressdialog.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-pushbutton-menu.png b/src/widgets/doc/images/plastique-pushbutton-menu.png
new file mode 100644
index 0000000000..d090033aa7
--- /dev/null
+++ b/src/widgets/doc/images/plastique-pushbutton-menu.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-pushbutton.png b/src/widgets/doc/images/plastique-pushbutton.png
new file mode 100644
index 0000000000..83c44fd38d
--- /dev/null
+++ b/src/widgets/doc/images/plastique-pushbutton.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-radiobutton.png b/src/widgets/doc/images/plastique-radiobutton.png
new file mode 100644
index 0000000000..a2c820d7d1
--- /dev/null
+++ b/src/widgets/doc/images/plastique-radiobutton.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-sizegrip.png b/src/widgets/doc/images/plastique-sizegrip.png
new file mode 100644
index 0000000000..09a551efab
--- /dev/null
+++ b/src/widgets/doc/images/plastique-sizegrip.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-slider.png b/src/widgets/doc/images/plastique-slider.png
new file mode 100644
index 0000000000..492f0fdfbd
--- /dev/null
+++ b/src/widgets/doc/images/plastique-slider.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-spinbox.png b/src/widgets/doc/images/plastique-spinbox.png
new file mode 100644
index 0000000000..af15db3c23
--- /dev/null
+++ b/src/widgets/doc/images/plastique-spinbox.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-statusbar.png b/src/widgets/doc/images/plastique-statusbar.png
new file mode 100644
index 0000000000..c8f9792ab9
--- /dev/null
+++ b/src/widgets/doc/images/plastique-statusbar.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-tabbar-truncated.png b/src/widgets/doc/images/plastique-tabbar-truncated.png
new file mode 100644
index 0000000000..8e906d9928
--- /dev/null
+++ b/src/widgets/doc/images/plastique-tabbar-truncated.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-tabbar.png b/src/widgets/doc/images/plastique-tabbar.png
new file mode 100644
index 0000000000..3371dda1b6
--- /dev/null
+++ b/src/widgets/doc/images/plastique-tabbar.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-tableview.png b/src/widgets/doc/images/plastique-tableview.png
new file mode 100644
index 0000000000..b20c1cce7f
--- /dev/null
+++ b/src/widgets/doc/images/plastique-tableview.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-tabwidget.png b/src/widgets/doc/images/plastique-tabwidget.png
new file mode 100644
index 0000000000..92ae398844
--- /dev/null
+++ b/src/widgets/doc/images/plastique-tabwidget.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-textedit.png b/src/widgets/doc/images/plastique-textedit.png
new file mode 100644
index 0000000000..a802d75fcc
--- /dev/null
+++ b/src/widgets/doc/images/plastique-textedit.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-timeedit.png b/src/widgets/doc/images/plastique-timeedit.png
new file mode 100644
index 0000000000..2d70b84c4c
--- /dev/null
+++ b/src/widgets/doc/images/plastique-timeedit.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-toolbox.png b/src/widgets/doc/images/plastique-toolbox.png
new file mode 100644
index 0000000000..10bcd7af62
--- /dev/null
+++ b/src/widgets/doc/images/plastique-toolbox.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-toolbutton.png b/src/widgets/doc/images/plastique-toolbutton.png
new file mode 100644
index 0000000000..4e51831408
--- /dev/null
+++ b/src/widgets/doc/images/plastique-toolbutton.png
Binary files differ
diff --git a/src/widgets/doc/images/plastique-treeview.png b/src/widgets/doc/images/plastique-treeview.png
new file mode 100644
index 0000000000..db0bc01a25
--- /dev/null
+++ b/src/widgets/doc/images/plastique-treeview.png
Binary files differ
diff --git a/src/widgets/doc/images/progressBar-stylesheet.png b/src/widgets/doc/images/progressBar-stylesheet.png
new file mode 100644
index 0000000000..b4bf755b6c
--- /dev/null
+++ b/src/widgets/doc/images/progressBar-stylesheet.png
Binary files differ
diff --git a/src/widgets/doc/images/progressBar2-stylesheet.png b/src/widgets/doc/images/progressBar2-stylesheet.png
new file mode 100644
index 0000000000..8b5ecc0a66
--- /dev/null
+++ b/src/widgets/doc/images/progressBar2-stylesheet.png
Binary files differ
diff --git a/src/widgets/doc/images/propagation-custom.png b/src/widgets/doc/images/propagation-custom.png
new file mode 100644
index 0000000000..866b44d677
--- /dev/null
+++ b/src/widgets/doc/images/propagation-custom.png
Binary files differ
diff --git a/src/widgets/doc/images/propagation-standard.png b/src/widgets/doc/images/propagation-standard.png
new file mode 100644
index 0000000000..b010fccc95
--- /dev/null
+++ b/src/widgets/doc/images/propagation-standard.png
Binary files differ
diff --git a/src/widgets/doc/images/qcalendarwidget-grid.png b/src/widgets/doc/images/qcalendarwidget-grid.png
new file mode 100644
index 0000000000..3df4dd99e2
--- /dev/null
+++ b/src/widgets/doc/images/qcalendarwidget-grid.png
Binary files differ
diff --git a/src/widgets/doc/images/qcalendarwidget-maximum.png b/src/widgets/doc/images/qcalendarwidget-maximum.png
new file mode 100644
index 0000000000..1e78d20e85
--- /dev/null
+++ b/src/widgets/doc/images/qcalendarwidget-maximum.png
Binary files differ
diff --git a/src/widgets/doc/images/qcalendarwidget-minimum.png b/src/widgets/doc/images/qcalendarwidget-minimum.png
new file mode 100644
index 0000000000..f860429309
--- /dev/null
+++ b/src/widgets/doc/images/qcalendarwidget-minimum.png
Binary files differ
diff --git a/src/widgets/doc/images/qcolumnview.png b/src/widgets/doc/images/qcolumnview.png
new file mode 100644
index 0000000000..1d312bf953
--- /dev/null
+++ b/src/widgets/doc/images/qcolumnview.png
Binary files differ
diff --git a/src/widgets/doc/images/qdesktopwidget.png b/src/widgets/doc/images/qdesktopwidget.png
new file mode 100644
index 0000000000..02f8e8b5ad
--- /dev/null
+++ b/src/widgets/doc/images/qdesktopwidget.png
Binary files differ
diff --git a/src/widgets/doc/images/qformlayout-kde.png b/src/widgets/doc/images/qformlayout-kde.png
new file mode 100644
index 0000000000..c32bb12499
--- /dev/null
+++ b/src/widgets/doc/images/qformlayout-kde.png
Binary files differ
diff --git a/src/widgets/doc/images/qformlayout-mac.png b/src/widgets/doc/images/qformlayout-mac.png
new file mode 100644
index 0000000000..0a0824efb6
--- /dev/null
+++ b/src/widgets/doc/images/qformlayout-mac.png
Binary files differ
diff --git a/src/widgets/doc/images/qformlayout-qpe.png b/src/widgets/doc/images/qformlayout-qpe.png
new file mode 100644
index 0000000000..3abecc5716
--- /dev/null
+++ b/src/widgets/doc/images/qformlayout-qpe.png
Binary files differ
diff --git a/src/widgets/doc/images/qformlayout-win.png b/src/widgets/doc/images/qformlayout-win.png
new file mode 100644
index 0000000000..1ed44bdd3b
--- /dev/null
+++ b/src/widgets/doc/images/qformlayout-win.png
Binary files differ
diff --git a/src/widgets/doc/images/qformlayout-with-6-children.png b/src/widgets/doc/images/qformlayout-with-6-children.png
new file mode 100644
index 0000000000..f743599702
--- /dev/null
+++ b/src/widgets/doc/images/qformlayout-with-6-children.png
Binary files differ
diff --git a/src/widgets/doc/images/qgraphicsproxywidget-embed.png b/src/widgets/doc/images/qgraphicsproxywidget-embed.png
new file mode 100644
index 0000000000..10d8f6fddd
--- /dev/null
+++ b/src/widgets/doc/images/qgraphicsproxywidget-embed.png
Binary files differ
diff --git a/src/widgets/doc/images/qgridlayout-with-5-children.png b/src/widgets/doc/images/qgridlayout-with-5-children.png
new file mode 100644
index 0000000000..8d0c2962e4
--- /dev/null
+++ b/src/widgets/doc/images/qgridlayout-with-5-children.png
Binary files differ
diff --git a/src/widgets/doc/images/qhboxlayout-with-5-children.png b/src/widgets/doc/images/qhboxlayout-with-5-children.png
new file mode 100644
index 0000000000..9b48dc5c47
--- /dev/null
+++ b/src/widgets/doc/images/qhboxlayout-with-5-children.png
Binary files differ
diff --git a/src/widgets/doc/images/qmdisubwindowlayout.png b/src/widgets/doc/images/qmdisubwindowlayout.png
new file mode 100644
index 0000000000..ffe5cc3949
--- /dev/null
+++ b/src/widgets/doc/images/qmdisubwindowlayout.png
Binary files differ
diff --git a/src/widgets/doc/images/qscrollarea-noscrollbars.png b/src/widgets/doc/images/qscrollarea-noscrollbars.png
new file mode 100644
index 0000000000..a1520f3e21
--- /dev/null
+++ b/src/widgets/doc/images/qscrollarea-noscrollbars.png
Binary files differ
diff --git a/src/widgets/doc/images/qscrollarea-onescrollbar.png b/src/widgets/doc/images/qscrollarea-onescrollbar.png
new file mode 100644
index 0000000000..b4f7976bc4
--- /dev/null
+++ b/src/widgets/doc/images/qscrollarea-onescrollbar.png
Binary files differ
diff --git a/src/widgets/doc/images/qscrollarea-twoscrollbars.png b/src/widgets/doc/images/qscrollarea-twoscrollbars.png
new file mode 100644
index 0000000000..bf720e498c
--- /dev/null
+++ b/src/widgets/doc/images/qscrollarea-twoscrollbars.png
Binary files differ
diff --git a/src/widgets/doc/images/qscrollbar-picture.png b/src/widgets/doc/images/qscrollbar-picture.png
new file mode 100644
index 0000000000..898e014c40
--- /dev/null
+++ b/src/widgets/doc/images/qscrollbar-picture.png
Binary files differ
diff --git a/src/widgets/doc/images/qscrollbar-values.png b/src/widgets/doc/images/qscrollbar-values.png
new file mode 100644
index 0000000000..cea744b3be
--- /dev/null
+++ b/src/widgets/doc/images/qscrollbar-values.png
Binary files differ
diff --git a/src/widgets/doc/images/qspinbox-plusminus.png b/src/widgets/doc/images/qspinbox-plusminus.png
new file mode 100644
index 0000000000..3b35a408a0
--- /dev/null
+++ b/src/widgets/doc/images/qspinbox-plusminus.png
Binary files differ
diff --git a/src/widgets/doc/images/qspinbox-updown.png b/src/widgets/doc/images/qspinbox-updown.png
new file mode 100644
index 0000000000..a6caa4419b
--- /dev/null
+++ b/src/widgets/doc/images/qspinbox-updown.png
Binary files differ
diff --git a/src/widgets/doc/images/qstyle-comboboxes.png b/src/widgets/doc/images/qstyle-comboboxes.png
new file mode 100644
index 0000000000..aecec914a0
--- /dev/null
+++ b/src/widgets/doc/images/qstyle-comboboxes.png
Binary files differ
diff --git a/src/widgets/doc/images/qstyleoptiontoolbar-position.png b/src/widgets/doc/images/qstyleoptiontoolbar-position.png
new file mode 100644
index 0000000000..5eaae7e4cd
--- /dev/null
+++ b/src/widgets/doc/images/qstyleoptiontoolbar-position.png
Binary files differ
diff --git a/src/widgets/doc/images/qtableview-resized.png b/src/widgets/doc/images/qtableview-resized.png
new file mode 100644
index 0000000000..813256ee9e
--- /dev/null
+++ b/src/widgets/doc/images/qtableview-resized.png
Binary files differ
diff --git a/src/widgets/doc/images/qtwizard-aero1.png b/src/widgets/doc/images/qtwizard-aero1.png
new file mode 100644
index 0000000000..fe9e9bc21c
--- /dev/null
+++ b/src/widgets/doc/images/qtwizard-aero1.png
Binary files differ
diff --git a/src/widgets/doc/images/qtwizard-aero2.png b/src/widgets/doc/images/qtwizard-aero2.png
new file mode 100644
index 0000000000..261c0651fe
--- /dev/null
+++ b/src/widgets/doc/images/qtwizard-aero2.png
Binary files differ
diff --git a/src/widgets/doc/images/qtwizard-classic1.png b/src/widgets/doc/images/qtwizard-classic1.png
new file mode 100644
index 0000000000..be3edbecaf
--- /dev/null
+++ b/src/widgets/doc/images/qtwizard-classic1.png
Binary files differ
diff --git a/src/widgets/doc/images/qtwizard-classic2.png b/src/widgets/doc/images/qtwizard-classic2.png
new file mode 100644
index 0000000000..165f569d1d
--- /dev/null
+++ b/src/widgets/doc/images/qtwizard-classic2.png
Binary files differ
diff --git a/src/widgets/doc/images/qtwizard-mac1.png b/src/widgets/doc/images/qtwizard-mac1.png
new file mode 100644
index 0000000000..bc8cd9b715
--- /dev/null
+++ b/src/widgets/doc/images/qtwizard-mac1.png
Binary files differ
diff --git a/src/widgets/doc/images/qtwizard-mac2.png b/src/widgets/doc/images/qtwizard-mac2.png
new file mode 100644
index 0000000000..850f6b85a5
--- /dev/null
+++ b/src/widgets/doc/images/qtwizard-mac2.png
Binary files differ
diff --git a/src/widgets/doc/images/qtwizard-macpage.png b/src/widgets/doc/images/qtwizard-macpage.png
new file mode 100644
index 0000000000..1ba3122f91
--- /dev/null
+++ b/src/widgets/doc/images/qtwizard-macpage.png
Binary files differ
diff --git a/src/widgets/doc/images/qtwizard-modern1.png b/src/widgets/doc/images/qtwizard-modern1.png
new file mode 100644
index 0000000000..223e3ddec3
--- /dev/null
+++ b/src/widgets/doc/images/qtwizard-modern1.png
Binary files differ
diff --git a/src/widgets/doc/images/qtwizard-modern2.png b/src/widgets/doc/images/qtwizard-modern2.png
new file mode 100644
index 0000000000..d66c374a4c
--- /dev/null
+++ b/src/widgets/doc/images/qtwizard-modern2.png
Binary files differ
diff --git a/src/widgets/doc/images/qtwizard-nonmacpage.png b/src/widgets/doc/images/qtwizard-nonmacpage.png
new file mode 100644
index 0000000000..cbe464d57f
--- /dev/null
+++ b/src/widgets/doc/images/qtwizard-nonmacpage.png
Binary files differ
diff --git a/src/widgets/doc/images/qundoview.png b/src/widgets/doc/images/qundoview.png
new file mode 100644
index 0000000000..3bdb1cf2ed
--- /dev/null
+++ b/src/widgets/doc/images/qundoview.png
Binary files differ
diff --git a/src/widgets/doc/images/qvboxlayout-with-5-children.png b/src/widgets/doc/images/qvboxlayout-with-5-children.png
new file mode 100644
index 0000000000..57c37d7247
--- /dev/null
+++ b/src/widgets/doc/images/qvboxlayout-with-5-children.png
Binary files differ
diff --git a/src/widgets/doc/images/simpleanchorlayout-example.png b/src/widgets/doc/images/simpleanchorlayout-example.png
new file mode 100644
index 0000000000..1d5c8ac048
--- /dev/null
+++ b/src/widgets/doc/images/simpleanchorlayout-example.png
Binary files differ
diff --git a/src/widgets/doc/images/stylesheet-border-image-normal.png b/src/widgets/doc/images/stylesheet-border-image-normal.png
new file mode 100644
index 0000000000..8afe3c9a67
--- /dev/null
+++ b/src/widgets/doc/images/stylesheet-border-image-normal.png
Binary files differ
diff --git a/src/widgets/doc/images/stylesheet-border-image-stretched.png b/src/widgets/doc/images/stylesheet-border-image-stretched.png
new file mode 100644
index 0000000000..3f9ca92dd3
--- /dev/null
+++ b/src/widgets/doc/images/stylesheet-border-image-stretched.png
Binary files differ
diff --git a/src/widgets/doc/images/stylesheet-border-image-wrong.png b/src/widgets/doc/images/stylesheet-border-image-wrong.png
new file mode 100644
index 0000000000..19d6e449f4
--- /dev/null
+++ b/src/widgets/doc/images/stylesheet-border-image-wrong.png
Binary files differ
diff --git a/src/widgets/doc/images/stylesheet-boxmodel.png b/src/widgets/doc/images/stylesheet-boxmodel.png
new file mode 100644
index 0000000000..a0249d77b7
--- /dev/null
+++ b/src/widgets/doc/images/stylesheet-boxmodel.png
Binary files differ
diff --git a/src/widgets/doc/images/stylesheet-branch-closed.png b/src/widgets/doc/images/stylesheet-branch-closed.png
new file mode 100644
index 0000000000..213ffdd88f
--- /dev/null
+++ b/src/widgets/doc/images/stylesheet-branch-closed.png
Binary files differ
diff --git a/src/widgets/doc/images/stylesheet-branch-end.png b/src/widgets/doc/images/stylesheet-branch-end.png
new file mode 100644
index 0000000000..54915b3b01
--- /dev/null
+++ b/src/widgets/doc/images/stylesheet-branch-end.png
Binary files differ
diff --git a/src/widgets/doc/images/stylesheet-branch-more.png b/src/widgets/doc/images/stylesheet-branch-more.png
new file mode 100644
index 0000000000..664ad44740
--- /dev/null
+++ b/src/widgets/doc/images/stylesheet-branch-more.png
Binary files differ
diff --git a/src/widgets/doc/images/stylesheet-branch-open.png b/src/widgets/doc/images/stylesheet-branch-open.png
new file mode 100644
index 0000000000..e8cad95ccf
--- /dev/null
+++ b/src/widgets/doc/images/stylesheet-branch-open.png
Binary files differ
diff --git a/src/widgets/doc/images/stylesheet-coffee-cleanlooks.png b/src/widgets/doc/images/stylesheet-coffee-cleanlooks.png
new file mode 100644
index 0000000000..e75df0d80a
--- /dev/null
+++ b/src/widgets/doc/images/stylesheet-coffee-cleanlooks.png
Binary files differ
diff --git a/src/widgets/doc/images/stylesheet-coffee-xp.png b/src/widgets/doc/images/stylesheet-coffee-xp.png
new file mode 100644
index 0000000000..8bedd80ee9
--- /dev/null
+++ b/src/widgets/doc/images/stylesheet-coffee-xp.png
Binary files differ
diff --git a/src/widgets/doc/images/stylesheet-pagefold-mac.png b/src/widgets/doc/images/stylesheet-pagefold-mac.png
new file mode 100644
index 0000000000..5c061b9cfd
--- /dev/null
+++ b/src/widgets/doc/images/stylesheet-pagefold-mac.png
Binary files differ
diff --git a/src/widgets/doc/images/stylesheet-pagefold.png b/src/widgets/doc/images/stylesheet-pagefold.png
new file mode 100644
index 0000000000..5ccb4edbc9
--- /dev/null
+++ b/src/widgets/doc/images/stylesheet-pagefold.png
Binary files differ
diff --git a/src/widgets/doc/images/stylesheet-redbutton1.png b/src/widgets/doc/images/stylesheet-redbutton1.png
new file mode 100644
index 0000000000..cb03375e12
--- /dev/null
+++ b/src/widgets/doc/images/stylesheet-redbutton1.png
Binary files differ
diff --git a/src/widgets/doc/images/stylesheet-redbutton2.png b/src/widgets/doc/images/stylesheet-redbutton2.png
new file mode 100644
index 0000000000..5325708942
--- /dev/null
+++ b/src/widgets/doc/images/stylesheet-redbutton2.png
Binary files differ
diff --git a/src/widgets/doc/images/stylesheet-redbutton3.png b/src/widgets/doc/images/stylesheet-redbutton3.png
new file mode 100644
index 0000000000..dd976f0760
--- /dev/null
+++ b/src/widgets/doc/images/stylesheet-redbutton3.png
Binary files differ
diff --git a/src/widgets/doc/images/stylesheet-scrollbar1.png b/src/widgets/doc/images/stylesheet-scrollbar1.png
new file mode 100644
index 0000000000..666ff1119a
--- /dev/null
+++ b/src/widgets/doc/images/stylesheet-scrollbar1.png
Binary files differ
diff --git a/src/widgets/doc/images/stylesheet-scrollbar2.png b/src/widgets/doc/images/stylesheet-scrollbar2.png
new file mode 100644
index 0000000000..439cf8035d
--- /dev/null
+++ b/src/widgets/doc/images/stylesheet-scrollbar2.png
Binary files differ
diff --git a/src/widgets/doc/images/stylesheet-treeview.png b/src/widgets/doc/images/stylesheet-treeview.png
new file mode 100644
index 0000000000..883d190f36
--- /dev/null
+++ b/src/widgets/doc/images/stylesheet-treeview.png
Binary files differ
diff --git a/src/widgets/doc/images/stylesheet-vline.png b/src/widgets/doc/images/stylesheet-vline.png
new file mode 100644
index 0000000000..8f0c336fd8
--- /dev/null
+++ b/src/widgets/doc/images/stylesheet-vline.png
Binary files differ
diff --git a/src/widgets/doc/images/swipegesture.png b/src/widgets/doc/images/swipegesture.png
new file mode 100644
index 0000000000..0b7d35af3a
--- /dev/null
+++ b/src/widgets/doc/images/swipegesture.png
Binary files differ
diff --git a/src/widgets/doc/images/system-tray.png b/src/widgets/doc/images/system-tray.png
new file mode 100644
index 0000000000..298b193cf7
--- /dev/null
+++ b/src/widgets/doc/images/system-tray.png
Binary files differ
diff --git a/src/widgets/doc/images/tabWidget-stylesheet1.png b/src/widgets/doc/images/tabWidget-stylesheet1.png
new file mode 100644
index 0000000000..fc8fc19e74
--- /dev/null
+++ b/src/widgets/doc/images/tabWidget-stylesheet1.png
Binary files differ
diff --git a/src/widgets/doc/images/tabWidget-stylesheet2.png b/src/widgets/doc/images/tabWidget-stylesheet2.png
new file mode 100644
index 0000000000..2cbf2bf36d
--- /dev/null
+++ b/src/widgets/doc/images/tabWidget-stylesheet2.png
Binary files differ
diff --git a/src/widgets/doc/images/tabWidget-stylesheet3.png b/src/widgets/doc/images/tabWidget-stylesheet3.png
new file mode 100644
index 0000000000..f57a9c9f9c
--- /dev/null
+++ b/src/widgets/doc/images/tabWidget-stylesheet3.png
Binary files differ
diff --git a/src/widgets/doc/images/tableWidget-stylesheet.png b/src/widgets/doc/images/tableWidget-stylesheet.png
new file mode 100644
index 0000000000..e99e7a97c8
--- /dev/null
+++ b/src/widgets/doc/images/tableWidget-stylesheet.png
Binary files differ
diff --git a/src/widgets/doc/images/widgetdelegate.png b/src/widgets/doc/images/widgetdelegate.png
new file mode 100644
index 0000000000..3df4c4b6a5
--- /dev/null
+++ b/src/widgets/doc/images/widgetdelegate.png
Binary files differ
diff --git a/src/widgets/doc/images/windows-calendarwidget.png b/src/widgets/doc/images/windows-calendarwidget.png
new file mode 100644
index 0000000000..ad016238ad
--- /dev/null
+++ b/src/widgets/doc/images/windows-calendarwidget.png
Binary files differ
diff --git a/src/widgets/doc/images/windows-checkbox.png b/src/widgets/doc/images/windows-checkbox.png
new file mode 100644
index 0000000000..eb1be4b736
--- /dev/null
+++ b/src/widgets/doc/images/windows-checkbox.png
Binary files differ
diff --git a/src/widgets/doc/images/windows-combobox.png b/src/widgets/doc/images/windows-combobox.png
new file mode 100644
index 0000000000..d6bc483494
--- /dev/null
+++ b/src/widgets/doc/images/windows-combobox.png
Binary files differ
diff --git a/src/widgets/doc/images/windows-dateedit.png b/src/widgets/doc/images/windows-dateedit.png
new file mode 100644
index 0000000000..95587ec62e
--- /dev/null
+++ b/src/widgets/doc/images/windows-dateedit.png
Binary files differ
diff --git a/src/widgets/doc/images/windows-datetimeedit.png b/src/widgets/doc/images/windows-datetimeedit.png
new file mode 100644
index 0000000000..6aa1766146
--- /dev/null
+++ b/src/widgets/doc/images/windows-datetimeedit.png
Binary files differ
diff --git a/src/widgets/doc/images/windows-dial.png b/src/widgets/doc/images/windows-dial.png
new file mode 100644
index 0000000000..0aa3a26159
--- /dev/null
+++ b/src/widgets/doc/images/windows-dial.png
Binary files differ
diff --git a/src/widgets/doc/images/windows-doublespinbox.png b/src/widgets/doc/images/windows-doublespinbox.png
new file mode 100644
index 0000000000..244b5f66cd
--- /dev/null
+++ b/src/widgets/doc/images/windows-doublespinbox.png
Binary files differ
diff --git a/src/widgets/doc/images/windows-fontcombobox.png b/src/widgets/doc/images/windows-fontcombobox.png
new file mode 100644
index 0000000000..bf98cad922
--- /dev/null
+++ b/src/widgets/doc/images/windows-fontcombobox.png
Binary files differ
diff --git a/src/widgets/doc/images/windows-frame.png b/src/widgets/doc/images/windows-frame.png
new file mode 100644
index 0000000000..5979b31b25
--- /dev/null
+++ b/src/widgets/doc/images/windows-frame.png
Binary files differ
diff --git a/src/widgets/doc/images/windows-groupbox.png b/src/widgets/doc/images/windows-groupbox.png
new file mode 100644
index 0000000000..88f46a3832
--- /dev/null
+++ b/src/widgets/doc/images/windows-groupbox.png
Binary files differ
diff --git a/src/widgets/doc/images/windows-horizontalscrollbar.png b/src/widgets/doc/images/windows-horizontalscrollbar.png
new file mode 100644
index 0000000000..1f36b9a352
--- /dev/null
+++ b/src/widgets/doc/images/windows-horizontalscrollbar.png
Binary files differ
diff --git a/src/widgets/doc/images/windows-label.png b/src/widgets/doc/images/windows-label.png
new file mode 100644
index 0000000000..a1c3a396a9
--- /dev/null
+++ b/src/widgets/doc/images/windows-label.png
Binary files differ
diff --git a/src/widgets/doc/images/windows-lcdnumber.png b/src/widgets/doc/images/windows-lcdnumber.png
new file mode 100644
index 0000000000..b463511aab
--- /dev/null
+++ b/src/widgets/doc/images/windows-lcdnumber.png
Binary files differ
diff --git a/src/widgets/doc/images/windows-lineedit.png b/src/widgets/doc/images/windows-lineedit.png
new file mode 100644
index 0000000000..270e4517ff
--- /dev/null
+++ b/src/widgets/doc/images/windows-lineedit.png
Binary files differ
diff --git a/src/widgets/doc/images/windows-listview.png b/src/widgets/doc/images/windows-listview.png
new file mode 100644
index 0000000000..2884fae1b1
--- /dev/null
+++ b/src/widgets/doc/images/windows-listview.png
Binary files differ
diff --git a/src/widgets/doc/images/windows-progressbar.png b/src/widgets/doc/images/windows-progressbar.png
new file mode 100644
index 0000000000..361799a70e
--- /dev/null
+++ b/src/widgets/doc/images/windows-progressbar.png
Binary files differ
diff --git a/src/widgets/doc/images/windows-pushbutton.png b/src/widgets/doc/images/windows-pushbutton.png
new file mode 100644
index 0000000000..14528d6808
--- /dev/null
+++ b/src/widgets/doc/images/windows-pushbutton.png
Binary files differ
diff --git a/src/widgets/doc/images/windows-radiobutton.png b/src/widgets/doc/images/windows-radiobutton.png
new file mode 100644
index 0000000000..db328cb563
--- /dev/null
+++ b/src/widgets/doc/images/windows-radiobutton.png
Binary files differ
diff --git a/src/widgets/doc/images/windows-slider.png b/src/widgets/doc/images/windows-slider.png
new file mode 100644
index 0000000000..fde85024b6
--- /dev/null
+++ b/src/widgets/doc/images/windows-slider.png
Binary files differ
diff --git a/src/widgets/doc/images/windows-spinbox.png b/src/widgets/doc/images/windows-spinbox.png
new file mode 100644
index 0000000000..d4e93c584a
--- /dev/null
+++ b/src/widgets/doc/images/windows-spinbox.png
Binary files differ
diff --git a/src/widgets/doc/images/windows-tableview.png b/src/widgets/doc/images/windows-tableview.png
new file mode 100644
index 0000000000..89da89fb5f
--- /dev/null
+++ b/src/widgets/doc/images/windows-tableview.png
Binary files differ
diff --git a/src/widgets/doc/images/windows-tabwidget.png b/src/widgets/doc/images/windows-tabwidget.png
new file mode 100644
index 0000000000..8622f7ec6a
--- /dev/null
+++ b/src/widgets/doc/images/windows-tabwidget.png
Binary files differ
diff --git a/src/widgets/doc/images/windows-textedit.png b/src/widgets/doc/images/windows-textedit.png
new file mode 100644
index 0000000000..fd21ade02f
--- /dev/null
+++ b/src/widgets/doc/images/windows-textedit.png
Binary files differ
diff --git a/src/widgets/doc/images/windows-timeedit.png b/src/widgets/doc/images/windows-timeedit.png
new file mode 100644
index 0000000000..6ae0e406bc
--- /dev/null
+++ b/src/widgets/doc/images/windows-timeedit.png
Binary files differ
diff --git a/src/widgets/doc/images/windows-toolbox.png b/src/widgets/doc/images/windows-toolbox.png
new file mode 100644
index 0000000000..99b471e6df
--- /dev/null
+++ b/src/widgets/doc/images/windows-toolbox.png
Binary files differ
diff --git a/src/widgets/doc/images/windows-toolbutton.png b/src/widgets/doc/images/windows-toolbutton.png
new file mode 100644
index 0000000000..9ceb846ed4
--- /dev/null
+++ b/src/widgets/doc/images/windows-toolbutton.png
Binary files differ
diff --git a/src/widgets/doc/images/windows-treeview.png b/src/widgets/doc/images/windows-treeview.png
new file mode 100644
index 0000000000..f55cd69c79
--- /dev/null
+++ b/src/widgets/doc/images/windows-treeview.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsvista-calendarwidget.png b/src/widgets/doc/images/windowsvista-calendarwidget.png
new file mode 100644
index 0000000000..3cb1ab78dc
--- /dev/null
+++ b/src/widgets/doc/images/windowsvista-calendarwidget.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsvista-checkbox.png b/src/widgets/doc/images/windowsvista-checkbox.png
new file mode 100644
index 0000000000..b9bc909988
--- /dev/null
+++ b/src/widgets/doc/images/windowsvista-checkbox.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsvista-combobox.png b/src/widgets/doc/images/windowsvista-combobox.png
new file mode 100644
index 0000000000..f53192f45a
--- /dev/null
+++ b/src/widgets/doc/images/windowsvista-combobox.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsvista-dateedit.png b/src/widgets/doc/images/windowsvista-dateedit.png
new file mode 100644
index 0000000000..bb79482849
--- /dev/null
+++ b/src/widgets/doc/images/windowsvista-dateedit.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsvista-datetimeedit.png b/src/widgets/doc/images/windowsvista-datetimeedit.png
new file mode 100644
index 0000000000..0a104de084
--- /dev/null
+++ b/src/widgets/doc/images/windowsvista-datetimeedit.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsvista-dial.png b/src/widgets/doc/images/windowsvista-dial.png
new file mode 100644
index 0000000000..7081269c31
--- /dev/null
+++ b/src/widgets/doc/images/windowsvista-dial.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsvista-doublespinbox.png b/src/widgets/doc/images/windowsvista-doublespinbox.png
new file mode 100644
index 0000000000..6efa9379fd
--- /dev/null
+++ b/src/widgets/doc/images/windowsvista-doublespinbox.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsvista-fontcombobox.png b/src/widgets/doc/images/windowsvista-fontcombobox.png
new file mode 100644
index 0000000000..3771e84bd4
--- /dev/null
+++ b/src/widgets/doc/images/windowsvista-fontcombobox.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsvista-frame.png b/src/widgets/doc/images/windowsvista-frame.png
new file mode 100644
index 0000000000..63b8422d2b
--- /dev/null
+++ b/src/widgets/doc/images/windowsvista-frame.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsvista-groupbox.png b/src/widgets/doc/images/windowsvista-groupbox.png
new file mode 100644
index 0000000000..967d8878a7
--- /dev/null
+++ b/src/widgets/doc/images/windowsvista-groupbox.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsvista-horizontalscrollbar.png b/src/widgets/doc/images/windowsvista-horizontalscrollbar.png
new file mode 100644
index 0000000000..996865d66c
--- /dev/null
+++ b/src/widgets/doc/images/windowsvista-horizontalscrollbar.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsvista-label.png b/src/widgets/doc/images/windowsvista-label.png
new file mode 100644
index 0000000000..caef8d8361
--- /dev/null
+++ b/src/widgets/doc/images/windowsvista-label.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsvista-lcdnumber.png b/src/widgets/doc/images/windowsvista-lcdnumber.png
new file mode 100644
index 0000000000..911438e2b1
--- /dev/null
+++ b/src/widgets/doc/images/windowsvista-lcdnumber.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsvista-lineedit.png b/src/widgets/doc/images/windowsvista-lineedit.png
new file mode 100644
index 0000000000..9fcde3a851
--- /dev/null
+++ b/src/widgets/doc/images/windowsvista-lineedit.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsvista-listview.png b/src/widgets/doc/images/windowsvista-listview.png
new file mode 100644
index 0000000000..36a03438ab
--- /dev/null
+++ b/src/widgets/doc/images/windowsvista-listview.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsvista-progressbar.png b/src/widgets/doc/images/windowsvista-progressbar.png
new file mode 100644
index 0000000000..0bda010811
--- /dev/null
+++ b/src/widgets/doc/images/windowsvista-progressbar.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsvista-pushbutton.png b/src/widgets/doc/images/windowsvista-pushbutton.png
new file mode 100644
index 0000000000..3bc438dc10
--- /dev/null
+++ b/src/widgets/doc/images/windowsvista-pushbutton.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsvista-radiobutton.png b/src/widgets/doc/images/windowsvista-radiobutton.png
new file mode 100644
index 0000000000..fdfd2d66dd
--- /dev/null
+++ b/src/widgets/doc/images/windowsvista-radiobutton.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsvista-slider.png b/src/widgets/doc/images/windowsvista-slider.png
new file mode 100644
index 0000000000..be2fffb7b5
--- /dev/null
+++ b/src/widgets/doc/images/windowsvista-slider.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsvista-spinbox.png b/src/widgets/doc/images/windowsvista-spinbox.png
new file mode 100644
index 0000000000..4a2293e724
--- /dev/null
+++ b/src/widgets/doc/images/windowsvista-spinbox.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsvista-tableview.png b/src/widgets/doc/images/windowsvista-tableview.png
new file mode 100644
index 0000000000..96f4937bc1
--- /dev/null
+++ b/src/widgets/doc/images/windowsvista-tableview.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsvista-tabwidget.png b/src/widgets/doc/images/windowsvista-tabwidget.png
new file mode 100644
index 0000000000..259c4f1a89
--- /dev/null
+++ b/src/widgets/doc/images/windowsvista-tabwidget.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsvista-textedit.png b/src/widgets/doc/images/windowsvista-textedit.png
new file mode 100644
index 0000000000..5e5696623e
--- /dev/null
+++ b/src/widgets/doc/images/windowsvista-textedit.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsvista-timeedit.png b/src/widgets/doc/images/windowsvista-timeedit.png
new file mode 100644
index 0000000000..e24fdd268a
--- /dev/null
+++ b/src/widgets/doc/images/windowsvista-timeedit.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsvista-toolbox.png b/src/widgets/doc/images/windowsvista-toolbox.png
new file mode 100644
index 0000000000..8cfe5f9cab
--- /dev/null
+++ b/src/widgets/doc/images/windowsvista-toolbox.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsvista-toolbutton.png b/src/widgets/doc/images/windowsvista-toolbutton.png
new file mode 100644
index 0000000000..0baa9809c1
--- /dev/null
+++ b/src/widgets/doc/images/windowsvista-toolbutton.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsvista-treeview.png b/src/widgets/doc/images/windowsvista-treeview.png
new file mode 100644
index 0000000000..db211e4b5f
--- /dev/null
+++ b/src/widgets/doc/images/windowsvista-treeview.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsxp-calendarwidget.png b/src/widgets/doc/images/windowsxp-calendarwidget.png
new file mode 100644
index 0000000000..9a5fa6ebcd
--- /dev/null
+++ b/src/widgets/doc/images/windowsxp-calendarwidget.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsxp-checkbox.png b/src/widgets/doc/images/windowsxp-checkbox.png
new file mode 100644
index 0000000000..505d3a3641
--- /dev/null
+++ b/src/widgets/doc/images/windowsxp-checkbox.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsxp-combobox.png b/src/widgets/doc/images/windowsxp-combobox.png
new file mode 100644
index 0000000000..2363c8401c
--- /dev/null
+++ b/src/widgets/doc/images/windowsxp-combobox.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsxp-dateedit.png b/src/widgets/doc/images/windowsxp-dateedit.png
new file mode 100644
index 0000000000..060ba07b2c
--- /dev/null
+++ b/src/widgets/doc/images/windowsxp-dateedit.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsxp-datetimeedit.png b/src/widgets/doc/images/windowsxp-datetimeedit.png
new file mode 100644
index 0000000000..4e41f0fc14
--- /dev/null
+++ b/src/widgets/doc/images/windowsxp-datetimeedit.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsxp-dial.png b/src/widgets/doc/images/windowsxp-dial.png
new file mode 100644
index 0000000000..0aa3a26159
--- /dev/null
+++ b/src/widgets/doc/images/windowsxp-dial.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsxp-doublespinbox.png b/src/widgets/doc/images/windowsxp-doublespinbox.png
new file mode 100644
index 0000000000..3165a61b93
--- /dev/null
+++ b/src/widgets/doc/images/windowsxp-doublespinbox.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsxp-fontcombobox.png b/src/widgets/doc/images/windowsxp-fontcombobox.png
new file mode 100644
index 0000000000..96292b84ef
--- /dev/null
+++ b/src/widgets/doc/images/windowsxp-fontcombobox.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsxp-frame.png b/src/widgets/doc/images/windowsxp-frame.png
new file mode 100644
index 0000000000..5979b31b25
--- /dev/null
+++ b/src/widgets/doc/images/windowsxp-frame.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsxp-groupbox.png b/src/widgets/doc/images/windowsxp-groupbox.png
new file mode 100644
index 0000000000..0b6f7e21ad
--- /dev/null
+++ b/src/widgets/doc/images/windowsxp-groupbox.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsxp-horizontalscrollbar.png b/src/widgets/doc/images/windowsxp-horizontalscrollbar.png
new file mode 100644
index 0000000000..38812ec107
--- /dev/null
+++ b/src/widgets/doc/images/windowsxp-horizontalscrollbar.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsxp-label.png b/src/widgets/doc/images/windowsxp-label.png
new file mode 100644
index 0000000000..a1c3a396a9
--- /dev/null
+++ b/src/widgets/doc/images/windowsxp-label.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsxp-lcdnumber.png b/src/widgets/doc/images/windowsxp-lcdnumber.png
new file mode 100644
index 0000000000..102023c8ed
--- /dev/null
+++ b/src/widgets/doc/images/windowsxp-lcdnumber.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsxp-lineedit.png b/src/widgets/doc/images/windowsxp-lineedit.png
new file mode 100644
index 0000000000..9102b53ca4
--- /dev/null
+++ b/src/widgets/doc/images/windowsxp-lineedit.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsxp-listview.png b/src/widgets/doc/images/windowsxp-listview.png
new file mode 100644
index 0000000000..b0fc9bd3a7
--- /dev/null
+++ b/src/widgets/doc/images/windowsxp-listview.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsxp-menu.png b/src/widgets/doc/images/windowsxp-menu.png
new file mode 100644
index 0000000000..b8ca947e73
--- /dev/null
+++ b/src/widgets/doc/images/windowsxp-menu.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsxp-progressbar.png b/src/widgets/doc/images/windowsxp-progressbar.png
new file mode 100644
index 0000000000..c8a73d6754
--- /dev/null
+++ b/src/widgets/doc/images/windowsxp-progressbar.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsxp-pushbutton.png b/src/widgets/doc/images/windowsxp-pushbutton.png
new file mode 100644
index 0000000000..bf6b7bf15d
--- /dev/null
+++ b/src/widgets/doc/images/windowsxp-pushbutton.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsxp-radiobutton.png b/src/widgets/doc/images/windowsxp-radiobutton.png
new file mode 100644
index 0000000000..ad8a908fb2
--- /dev/null
+++ b/src/widgets/doc/images/windowsxp-radiobutton.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsxp-slider.png b/src/widgets/doc/images/windowsxp-slider.png
new file mode 100644
index 0000000000..9e2fca7c40
--- /dev/null
+++ b/src/widgets/doc/images/windowsxp-slider.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsxp-spinbox.png b/src/widgets/doc/images/windowsxp-spinbox.png
new file mode 100644
index 0000000000..e42073cd6b
--- /dev/null
+++ b/src/widgets/doc/images/windowsxp-spinbox.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsxp-tableview.png b/src/widgets/doc/images/windowsxp-tableview.png
new file mode 100644
index 0000000000..5d12137ad5
--- /dev/null
+++ b/src/widgets/doc/images/windowsxp-tableview.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsxp-tabwidget.png b/src/widgets/doc/images/windowsxp-tabwidget.png
new file mode 100644
index 0000000000..3c8e777a0b
--- /dev/null
+++ b/src/widgets/doc/images/windowsxp-tabwidget.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsxp-textedit.png b/src/widgets/doc/images/windowsxp-textedit.png
new file mode 100644
index 0000000000..d89c75c71b
--- /dev/null
+++ b/src/widgets/doc/images/windowsxp-textedit.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsxp-timeedit.png b/src/widgets/doc/images/windowsxp-timeedit.png
new file mode 100644
index 0000000000..751cca9e6a
--- /dev/null
+++ b/src/widgets/doc/images/windowsxp-timeedit.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsxp-toolbox.png b/src/widgets/doc/images/windowsxp-toolbox.png
new file mode 100644
index 0000000000..99b471e6df
--- /dev/null
+++ b/src/widgets/doc/images/windowsxp-toolbox.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsxp-toolbutton.png b/src/widgets/doc/images/windowsxp-toolbutton.png
new file mode 100644
index 0000000000..ea63e16aae
--- /dev/null
+++ b/src/widgets/doc/images/windowsxp-toolbutton.png
Binary files differ
diff --git a/src/widgets/doc/images/windowsxp-treeview.png b/src/widgets/doc/images/windowsxp-treeview.png
new file mode 100644
index 0000000000..050cc2f4d6
--- /dev/null
+++ b/src/widgets/doc/images/windowsxp-treeview.png
Binary files differ
diff --git a/src/widgets/doc/qtwidgets.qdocconf b/src/widgets/doc/qtwidgets.qdocconf
new file mode 100644
index 0000000000..c90f25338e
--- /dev/null
+++ b/src/widgets/doc/qtwidgets.qdocconf
@@ -0,0 +1,92 @@
+include(../../../doc/global/qt-cpp-ignore.qdocconf)
+
+project = QtWidgets
+description = Qt Widgets Reference Documentation
+url = http://qt-project.org/doc/qt-5.0/qtwidgets
+version = 5.0.0
+
+sourceencoding = UTF-8
+outputencoding = UTF-8
+naturallanguage = en_US
+qhp.projects = QtWidgets
+
+qhp.QtWidgets.file = qtwidgets.qhp
+qhp.QtWidgets.namespace = org.qt-project.qtwidgets.500
+qhp.QtWidgets.virtualFolder = qdoc
+qhp.QtWidgets.indexTitle = Qt Widgets Reference Documentation
+qhp.QtWidgets.indexRoot =
+
+qhp.QtWidgets.filterAttributes = qtwidgets 5.0.0 qtrefdoc
+qhp.QtWidgets.customFilters.Qt.name = QtWidgets 5.0.0
+qhp.QtWidgets.customFilters.Qt.filterAttributes = qtwidgets 5.0.0
+qhp.QtWidgets.subprojects = classes overviews examples
+qhp.QtWidgets.subprojects.classes.title = Classes
+qhp.QtWidgets.subprojects.classes.indexTitle = Qt Widgets' Classes
+qhp.QtWidgets.subprojects.classes.selectors = class fake:headerfile
+qhp.QtWidgets.subprojects.classes.sortPages = true
+qhp.QtWidgets.subprojects.overviews.title = Overviews
+qhp.QtWidgets.subprojects.overviews.indexTitle = All Overviews and HOWTOs
+qhp.QtWidgets.subprojects.overviews.selectors = fake:page,group,module
+qhp.QtWidgets.subprojects.examples.title = Qt Widgets Examples
+qhp.QtWidgets.subprojects.examples.indexTitle = Qt Widgets Examples
+qhp.QtWidgets.subprojects.examples.selectors = fake:example
+
+dita.metadata.default.author = Qt Project
+dita.metadata.default.permissions = all
+dita.metadata.default.publisher = Qt Project
+dita.metadata.default.copyryear = 2012
+dita.metadata.default.copyrholder = Nokia
+dita.metadata.default.audience = programmer
+
+sources.fileextensions = "*.c++ *.cc *.cpp *.cxx *.mm *.qml *.qdoc"
+headers.fileextensions = "*.ch *.h *.h++ *.hh *.hpp *.hxx"
+
+examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.qml *.css"
+examples.imageextensions = "*.png"
+
+outputdir = ../../../doc/qtwidgets
+tagfile = ../../../doc/qtwidgets/qtwidgets.tags
+
+HTML.generatemacrefs = "true"
+HTML.nobreadcrumbs = "true"
+
+HTML.templatedir = .
+
+HTML.stylesheets = ../../../doc/global/style/offline.css
+
+HTML.headerstyles = \
+ " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/offline.css\" />\n"
+
+HTML.endheader = \
+ "</head>\n" \
+
+defines = Q_QDOC \
+ QT_.*_SUPPORT \
+ QT_.*_LIB \
+ QT_COMPAT \
+ QT_KEYPAD_NAVIGATION \
+ QT_NO_EGL \
+ Q_WS_.* \
+ Q_OS_.* \
+ Q_BYTE_ORDER \
+ QT_DEPRECATED \
+ QT_DEPRECATED_* \
+ Q_NO_USING_KEYWORD \
+ __cplusplus \
+ Q_COMPILER_INITIALIZER_LISTS
+
+versionsym = QT_VERSION_STR
+
+codeindent = 1
+
+depends += qtcore qtgui
+
+headerdirs += ..
+
+sourcedirs += ..
+
+exampledirs += ../../../examples \
+ ../ \
+ snippets
+
+imagedirs += images
diff --git a/src/widgets/doc/snippets/code/doc_src_layout.cpp b/src/widgets/doc/snippets/code/doc_src_layout.cpp
new file mode 100644
index 0000000000..b6abab61d3
--- /dev/null
+++ b/src/widgets/doc/snippets/code/doc_src_layout.cpp
@@ -0,0 +1,166 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+#ifndef CARD_H
+#define CARD_H
+
+#include <QtGui>
+#include <QList>
+
+class CardLayout : public QLayout
+{
+public:
+ CardLayout(QWidget *parent, int dist): QLayout(parent, 0, dist) {}
+ CardLayout(QLayout *parent, int dist): QLayout(parent, dist) {}
+ CardLayout(int dist): QLayout(dist) {}
+ ~CardLayout();
+
+ void addItem(QLayoutItem *item);
+ QSize sizeHint() const;
+ QSize minimumSize() const;
+ QLayoutItem *count() const;
+ QLayoutItem *itemAt(int) const;
+ QLayoutItem *takeAt(int);
+ void setGeometry(const QRect &rect);
+
+private:
+ QList<QLayoutItem*> list;
+};
+#endif
+//! [0]
+
+
+//! [1]
+//#include "card.h"
+//! [1]
+
+//! [2]
+QLayoutItem *CardLayout::count() const
+{
+ // QList::size() returns the number of QLayoutItems in the list
+ return list.size();
+}
+//! [2]
+
+//! [3]
+QLayoutItem *CardLayout::itemAt(int idx) const
+{
+ // QList::value() performs index checking, and returns 0 if we are
+ // outside the valid range
+ return list.value(idx);
+}
+
+QLayoutItem *CardLayout::takeAt(int idx)
+{
+ // QList::take does not do index checking
+ return idx >= 0 && idx < list.size() ? list.takeAt(idx) : 0;
+}
+//! [3]
+
+
+//! [4]
+void CardLayout::addItem(QLayoutItem *item)
+{
+ list.append(item);
+}
+//! [4]
+
+
+//! [5]
+CardLayout::~CardLayout()
+{
+ QLayoutItem *item;
+ while ((item = takeAt(0)))
+ delete item;
+}
+//! [5]
+
+
+//! [6]
+void CardLayout::setGeometry(const QRect &r)
+{
+ QLayout::setGeometry(r);
+
+ if (list.size() == 0)
+ return;
+
+ int w = r.width() - (list.count() - 1) * spacing();
+ int h = r.height() - (list.count() - 1) * spacing();
+ int i = 0;
+ while (i < list.size()) {
+ QLayoutItem *o = list.at(i);
+ QRect geom(r.x() + i * spacing(), r.y() + i * spacing(), w, h);
+ o->setGeometry(geom);
+ ++i;
+ }
+}
+//! [6]
+
+
+//! [7]
+QSize CardLayout::sizeHint() const
+{
+ QSize s(0,0);
+ int n = list.count();
+ if (n > 0)
+ s = QSize(100,70); //start with a nice default size
+ int i = 0;
+ while (i < n) {
+ QLayoutItem *o = list.at(i);
+ s = s.expandedTo(o->sizeHint());
+ ++i;
+ }
+ return s + n*QSize(spacing(), spacing());
+}
+
+QSize CardLayout::minimumSize() const
+{
+ QSize s(0,0);
+ int n = list.count();
+ int i = 0;
+ while (i < n) {
+ QLayoutItem *o = list.at(i);
+ s = s.expandedTo(o->minimumSize());
+ ++i;
+ }
+ return s + n*QSize(spacing(), spacing());
+}
+//! [7]
diff --git a/src/widgets/doc/snippets/code/doc_src_qt4-styles.cpp b/src/widgets/doc/snippets/code/doc_src_qt4-styles.cpp
new file mode 100644
index 0000000000..9bebb825e4
--- /dev/null
+++ b/src/widgets/doc/snippets/code/doc_src_qt4-styles.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 documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+const QStyleOptionFocusRect *focusRectOption =
+ qstyleoption_cast<const QStyleOptionFocusRect *>(option);
+if (focusRectOption) {
+ ...
+}
+//! [0]
+
+
+//! [1]
+void MyWidget::paintEvent(QPaintEvent *event)
+{
+ QPainter painter(this);
+ ...
+
+ QStyleOptionFocusRect option(1);
+ option.init(this);
+ option.backgroundColor = palette().color(QPalette::Window);
+
+ style().drawPrimitive(QStyle::PE_FrameFocusRect, &option, &painter,
+ this);
+}
+//! [1]
+
+
+//! [2]
+void drawControl(ControlElement element,
+ QPainter *painter,
+ const QWidget *widget,
+ const QRect &rect,
+ const QColorGroup &colorGroup,
+ SFlags how = Style_Default,
+ const QStyleOption &option = QStyleOption::Default) const;
+//! [2]
+
+
+//! [3]
+void drawControl(ControlElement element,
+ const QStyleOption *option,
+ QPainter *painter,
+ const QWidget *widget = 0) const;
+//! [3]
diff --git a/src/widgets/doc/snippets/code/doc_src_qtwidgets.cpp b/src/widgets/doc/snippets/code/doc_src_qtwidgets.cpp
new file mode 100644
index 0000000000..74888e3891
--- /dev/null
+++ b/src/widgets/doc/snippets/code/doc_src_qtwidgets.cpp
@@ -0,0 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [1]
+#include <QtWidgets>
+//! [1]
diff --git a/src/widgets/doc/snippets/code/doc_src_qtwidgets.pro b/src/widgets/doc/snippets/code/doc_src_qtwidgets.pro
new file mode 100644
index 0000000000..7e3c633dd5
--- /dev/null
+++ b/src/widgets/doc/snippets/code/doc_src_qtwidgets.pro
@@ -0,0 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+#! [0]
+QT += widgets
+#! [0]
diff --git a/src/widgets/doc/snippets/code/doc_src_styles.cpp b/src/widgets/doc/snippets/code/doc_src_styles.cpp
new file mode 100644
index 0000000000..6c079c6637
--- /dev/null
+++ b/src/widgets/doc/snippets/code/doc_src_styles.cpp
@@ -0,0 +1,134 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+ opt.initFrom(q);
+ if (down)
+ opt.state |= QStyle::State_Sunken;
+ if (tristate && noChange)
+ opt.state |= QStyle::State_NoChange;
+ else
+ opt.state |= checked ? QStyle::State_On :
+ QStyle::State_Off;
+ if (q->testAttribute(Qt::WA_Hover) && q->underMouse()) {
+ if (hovering)
+ opt.state |= QStyle::State_MouseOver;
+ else
+ opt.state &= ~QStyle::State_MouseOver;
+ }
+ opt.text = text;
+ opt.icon = icon;
+ opt.iconSize = q->iconSize();
+//! [0]
+
+
+//! [1]
+ state = QStyle::State_None;
+ if (widget->isEnabled())
+ state |= QStyle::State_Enabled;
+ if (widget->hasFocus())
+ state |= QStyle::State_HasFocus;
+ if (widget->window()->testAttribute(Qt::WA_KeyboardFocusChange))
+ state |= QStyle::State_KeyboardFocusChange;
+ if (widget->underMouse())
+ state |= QStyle::State_MouseOver;
+ if (widget->window()->isActiveWindow())
+ state |= QStyle::State_Active;
+#ifdef Q_WS_MAC
+ extern bool qt_mac_can_clickThrough(const QWidget *w); //qwidget_mac.cpp
+ if (!(state & QStyle::State_Active) && !qt_mac_can_clickThrough(widget))
+ state &= ~QStyle::State_Enabled;
+#endif
+#ifdef QT_KEYPAD_NAVIGATION
+ if (widget->hasEditFocus())
+ state |= QStyle::State_HasEditFocus;
+#endif
+
+ direction = widget->layoutDirection();
+ rect = widget->rect();
+ palette = widget->palette();
+ fontMetrics = widget->fontMetrics();
+//! [1]
+
+
+//! [2]
+ QStylePainter p(this);
+ QStyleOptionButton opt = d->getStyleOption();
+ p.drawControl(QStyle::CE_CheckBox, opt);
+//! [2]
+
+
+//! [3]
+ QStyleOptionButton subopt = *btn;
+ subopt.rect = subElementRect(SE_CheckBoxIndicator, btn, widget);
+ drawPrimitive(PE_IndicatorCheckBox, &subopt, p, widget);
+ subopt.rect = subElementRect(SE_CheckBoxContents, btn, widget);
+ drawControl(CE_CheckBoxLabel, &subopt, p, widget);
+
+ if (btn->state & State_HasFocus) {
+ QStyleOptionFocusRect fropt;
+ fropt.QStyleOption::operator=(*btn);
+ fropt.rect = subElementRect(SE_CheckBoxFocusRect, btn, widget);
+ drawPrimitive(PE_FrameFocusRect, &fropt, p, widget);
+ }
+//! [3]
+
+
+//! [4]
+ const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt);
+ uint alignment = visualAlignment(btn->direction, Qt::AlignLeft | Qt::AlignVCenter);
+
+ if (!styleHint(SH_UnderlineShortcut, btn, widget))
+ alignment |= Qt::TextHideMnemonic;
+ QPixmap pix;
+ QRect textRect = btn->rect;
+ if (!btn->icon.isNull()) {
+ pix = btn->icon.pixmap(btn->iconSize, btn->state & State_Enabled ? QIcon::Normal : QIcon::Disabled);
+ drawItemPixmap(p, btn->rect, alignment, pix);
+ if (btn->direction == Qt::RightToLeft)
+ textRect.setRight(textRect.right() - btn->iconSize.width() - 4);
+ else
+ textRect.setLeft(textRect.left() + btn->iconSize.width() + 4);
+ }
+ if (!btn->text.isEmpty()){
+ drawItemText(p, textRect, alignment | Qt::TextShowMnemonic,
+ btn->palette, btn->state & State_Enabled, btn->text, QPalette::WindowText);
+ }
+//! [4]
diff --git a/src/widgets/doc/snippets/code/doc_src_stylesheet.cpp b/src/widgets/doc/snippets/code/doc_src_stylesheet.cpp
new file mode 100644
index 0000000000..eb02634c6d
--- /dev/null
+++ b/src/widgets/doc/snippets/code/doc_src_stylesheet.cpp
@@ -0,0 +1,140 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [21]
+qApp->setStyleSheet("QPushButton { color: white }");
+//! [21]
+
+
+//! [22]
+myPushButton->setStyleSheet("* { color: blue }");
+//! [22]
+
+
+//! [23]
+myPushButton->setStyleSheet("color: blue");
+//! [23]
+
+
+//! [24]
+qApp->setStyleSheet("QGroupBox { color: red; } ");
+//! [24]
+
+//! [25]
+qApp->setStyleSheet("QGroupBox, QGroupBox * { color: red; }");
+//! [25]
+
+
+//! [26]
+class MyPushButton : public QPushButton {
+ // ...
+}
+
+// ...
+qApp->setStyleSheet("MyPushButton { background: yellow; }");
+//! [26]
+
+
+//! [27]
+namespace ns {
+ class MyPushButton : public QPushButton {
+ // ...
+ }
+}
+
+// ...
+qApp->setStyleSheet("ns--MyPushButton { background: yellow; }");
+//! [27]
+
+
+//! [32]
+void CustomWidget::paintEvent(QPaintEvent *)
+{
+ QStyleOption opt;
+ opt.init(this);
+ QPainter p(this);
+ style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
+}
+//! [32]
+
+
+//! [88]
+qApp->setStyleSheet("QLineEdit { background-color: yellow }");
+//! [88]
+
+
+//! [89]
+myDialog->setStyleSheet("QLineEdit { background-color: yellow }");
+//! [89]
+
+
+//! [90]
+myDialog->setStyleSheet("QLineEdit#nameEdit { background-color: yellow }");
+//! [90]
+
+
+//! [91]
+nameEdit->setStyleSheet("background-color: yellow");
+//! [91]
+
+
+//! [92]
+nameEdit->setStyleSheet("color: blue; background-color: yellow");
+//! [92]
+
+
+//! [93]
+nameEdit->setStyleSheet("color: blue;"
+ "background-color: yellow;"
+ "selection-color: yellow;"
+ "selection-background-color: blue;");
+//! [93]
+
+
+//! [95]
+QLineEdit *nameEdit = new QLineEdit(this);
+nameEdit->setProperty("mandatoryField", true);
+
+QLineEdit *emailEdit = new QLineEdit(this);
+emailEdit->setProperty("mandatoryField", true);
+
+QSpinBox *ageSpinBox = new QSpinBox(this);
+ageSpinBox->setProperty("mandatoryField", true);
+//! [95]
diff --git a/src/widgets/doc/snippets/code/doc_src_stylesheet.qdoc b/src/widgets/doc/snippets/code/doc_src_stylesheet.qdoc
new file mode 100644
index 0000000000..9acba09c67
--- /dev/null
+++ b/src/widgets/doc/snippets/code/doc_src_stylesheet.qdoc
@@ -0,0 +1,1866 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+QLineEdit { background: yellow }
+QCheckBox { color: red }
+//! [0]
+
+
+//! [1]
+QPushButton { color: red }
+//! [1]
+
+
+//! [2]
+QPushButton, QLineEdit, QComboBox { color: red }
+//! [2]
+
+
+//! [3]
+QPushButton { color: red }
+QLineEdit { color: red }
+QComboBox { color: red }
+//! [3]
+
+
+//! [4]
+QPushButton { color: red; background-color: white }
+//! [4]
+
+
+//! [5]
+QComboBox::drop-down { image: url(dropdown.png) }
+//! [5]
+
+
+//! [6]
+QComboBox {
+ margin-right: 20px;
+}
+QComboBox::drop-down {
+ subcontrol-origin: margin;
+}
+//! [6]
+
+
+//! [7]
+QComboBox::down-arrow {
+ image: url(down_arrow.png);
+}
+QComboBox::down-arrow:pressed {
+ position: relative;
+ top: 1px; left: 1px;
+}
+//! [7]
+
+
+//! [8]
+QPushButton:hover { color: white }
+//! [8]
+
+
+//! [9]
+QRadioButton:!hover { color: red }
+//! [9]
+
+
+//! [10]
+QCheckBox:hover:checked { color: white }
+//! [10]
+
+
+//! [11]
+QPushButton:hover:!pressed { color: blue; }
+//! [11]
+
+
+//! [12]
+QCheckBox:hover, QCheckBox:checked { color: white }
+//! [12]
+
+
+//! [13]
+QComboBox::drop-down:hover { image: url(dropdown_bright.png) }
+//! [13]
+
+
+//! [14]
+QPushButton#okButton { color: gray }
+QPushButton { color: red }
+//! [14]
+
+
+//! [15]
+QPushButton:hover { color: white }
+QPushButton { color: red }
+//! [15]
+
+
+//! [16]
+QPushButton:hover { color: white }
+QPushButton:enabled { color: red }
+//! [16]
+
+
+//! [17]
+QPushButton:enabled { color: red }
+QPushButton:hover { color: white }
+//! [17]
+
+
+//! [18]
+QPushButton:hover:enabled { color: white }
+QPushButton:enabled { color: red }
+//! [18]
+
+
+//! [19]
+QPushButton { color: red }
+QAbstractButton { color: gray }
+//! [19]
+
+
+//! [20]
+* {} /* a=0 b=0 c=0 -> specificity = 0 */
+LI {} /* a=0 b=0 c=1 -> specificity = 1 */
+UL LI {} /* a=0 b=0 c=2 -> specificity = 2 */
+UL OL+LI {} /* a=0 b=0 c=3 -> specificity = 3 */
+H1 + *[REL=up]{} /* a=0 b=1 c=1 -> specificity = 11 */
+UL OL LI.red {} /* a=0 b=1 c=3 -> specificity = 13 */
+LI.red.level {} /* a=0 b=2 c=1 -> specificity = 21 */
+#x34y {} /* a=1 b=0 c=0 -> specificity = 100 */
+//! [20]
+
+
+//! [28]
+MyLabel { qproperty-pixmap: url(pixmap.png); }
+MyGroupBox { qproperty-titleColor: rgb(100, 200, 100); }
+QPushButton { qproperty-iconSize: 20px 20px; }
+//! [28]
+
+
+//! [30]
+QPushButton { background-color: red; border: none; }
+//! [30]
+
+
+//! [31]
+QToolButton { background-color: red; border: none; }
+//! [31]
+
+
+//! [33]
+QTreeView {
+ alternate-background-color: blue;
+ background: yellow;
+}
+//! [33]
+
+
+//! [34]
+QTextEdit { background: yellow }
+//! [34]
+
+
+//! [35]
+QLabel {
+ background-image: url(dense6pattern.png);
+ background-repeat: repeat-xy;
+}
+//! [35]
+
+
+//! [36]
+QLabel { background-color: yellow }
+QLineEdit { background-color: rgb(255, 0, 0) }
+//! [36]
+
+
+//! [37]
+QFrame { background-image: url(:/images/hydro.png) }
+//! [37]
+
+
+//! [38]
+QFrame {
+ background: white url(:/images/ring.png);
+ background-repeat: repeat-y;
+ background-position: left;
+}
+//! [38]
+
+
+//! [39]
+QFrame {
+ background: url(:/images/footer.png);
+ background-position: bottom left;
+}
+//! [39]
+
+
+//! [40]
+QTextEdit {
+ background-image: url("leaves.png");
+ background-attachment: fixed;
+}
+//! [40]
+
+
+//! [41]
+QFrame {
+ background-image: url(:/images/header.png);
+ background-position: top left;
+ background-origin: content;
+ background-clip: padding;
+}
+//! [41]
+
+
+//! [42]
+QFrame {
+ background-image: url(:/images/header.png);
+ background-position: top left;
+ background-origin: content;
+}
+//! [42]
+
+
+//! [43]
+QLineEdit { border: 1px solid white }
+//! [43]
+
+
+//! [44]
+QLineEdit {
+ border-width: 1px;
+ border-style: solid;
+ border-color: white;
+}
+//! [44]
+
+
+//! [45]
+QLineEdit {
+ border-width: 1px;
+ border-style: solid;
+ border-radius: 4px;
+}
+//! [45]
+
+
+//! [46]
+QLineEdit {
+ border-width: 1px;
+ border-style: solid;
+ border-color: blue;
+}
+//! [46]
+
+
+//! [47]
+QLineEdit {
+ border-width: 2px;
+ border-style: solid;
+ border-color: darkblue;
+}
+//! [47]
+
+
+//! [48]
+QSpinBox::down-button { bottom: 2px }
+//! [48]
+
+
+//! [49]
+* { button-layout: 2 }
+//! [49]
+
+
+//! [50]
+QPushButton { color: red }
+//! [50]
+
+
+//! [51]
+QDialogButtonBox { dialogbuttonbox-buttons-have-icons: 1; }
+//! [51]
+
+
+//! [52]
+* { etch-disabled-text: 1 }
+//! [52]
+
+
+//! [53]
+QCheckBox { font: bold italic large "Times New Roman" }
+//! [53]
+
+
+//! [54]
+QCheckBox { font-family: "New Century Schoolbook" }
+//! [54]
+
+
+//! [55]
+QTextEdit { font-size: 12px }
+//! [55]
+
+
+//! [56]
+QTextEdit { font-style: italic }
+//! [56]
+
+
+//! [57]
+* { gridline-color: gray }
+//! [57]
+
+
+//! [58]
+QSpinBox::down-button { height: 10px }
+//! [58]
+
+
+//! [59]
+/* implicitly sets the size of down-button to the size of spindown.png */
+QSpinBox::down-button { image: url(:/images/spindown.png) }
+//! [59]
+
+
+//! [60]
+QSpinBox::down-button { left: 2px }
+//! [60]
+
+
+//! [61]
+* { lineedit-password-character: 9679 }
+//! [61]
+
+
+//! [62]
+QLineEdit { margin: 2px }
+//! [62]
+
+
+//! [63]
+QSpinBox { max-height: 24px }
+//! [63]
+
+
+//! [64]
+QComboBox { max-width: 72px }
+//! [64]
+
+
+//! [65]
+QMessageBox { messagebox-text-interaction-flags: 5 }
+//! [65]
+
+
+//! [66]
+QComboBox { min-height: 24px }
+//! [66]
+
+
+//! [67]
+QComboBox { min-width: 72px }
+//! [67]
+
+
+//! [68]
+QToolTip { opacity: 223 }
+//! [68]
+
+
+//! [69]
+QLineEdit { padding: 3px }
+//! [69]
+
+
+//! [70]
+QSpinBox::down-button { right: 2px }
+//! [70]
+
+
+//! [71]
+QTextEdit { selection-background-color: darkblue }
+//! [71]
+
+
+//! [72]
+QTextEdit { selection-color: white }
+//! [72]
+
+
+//! [73]
+* { show-decoration-selected: 1 }
+//! [73]
+
+
+//! [74]
+QMenuBar { spacing: 10 }
+//! [74]
+
+
+//! [75]
+QSpinBox::up-button {
+ image: url(:/images/spinup.png);
+ subcontrol-origin: content;
+ subcontrol-position: right top;
+}
+//! [75]
+
+
+//! [76]
+QSpinBox::down-button {
+ image: url(:/images/spindown.png);
+ subcontrol-origin: padding;
+ subcontrol-position: right bottom;
+}
+//! [76]
+
+
+//! [77]
+QPushButton {
+ text-align: left;
+}
+//! [77]
+
+
+//! [78]
+QSpinBox::up-button { top: 2px }
+//! [78]
+
+
+//! [79]
+QSpinBox::up-button { width: 12px }
+//! [79]
+
+
+//! [80]
+QTextEdit { background-position: bottom center }
+//! [80]
+
+
+//! [81]
+QDialog { etch-disabled-text: 1 }
+//! [81]
+
+
+//! [82]
+QLabel { border-color: red } /* red red red red */
+QLabel { border-color: red blue } /* red blue red blue */
+QLabel { border-color: red blue green } /* red blue green blue */
+QLabel { border-color: red blue green yellow } /* red blue green yellow */
+//! [82]
+
+
+//! [83]
+QLabel { border-width: 1px } /* 1px 1px 1px 1px */
+QLabel { border-width: 1px 2px } /* 1px 2px 1px 2px */
+QLabel { border-width: 1px 2px 3px } /* 1px 2px 3px 2px */
+QLabel { border-width: 1px 2px 3px 4px } /* 1px 2px 3px 4px */
+//! [83]
+
+
+//! [84]
+QLabel { border-color: red } /* opaque red */
+QLabel { border-color: #FF0000 } /* opaque red */
+QLabel { border-color: rgba(255, 0, 0, 75%) } /* 75% opaque red */
+QLabel { border-color: rgb(255, 0, 0) } /* opaque red */
+QLabel { border-color: rgb(100%, 0%, 0%) } /* opaque red */
+QLabel { border-color: hsv(60, 255, 255) } /* opaque yellow */
+QLabel { border-color: hsva(240, 255, 255, 75%) } /* 75% blue */
+//! [84]
+
+
+//! [85]
+/* linear gradient from white to green */
+QTextEdit {
+ background: qlineargradient(x1:0, y1:0, x2:1, y2:1,
+ stop:0 white, stop: 0.4 gray, stop:1 green)
+}
+
+/* linear gradient from white to green */
+QTextEdit {
+ background: qlineargradient(x1:0, y1:0, x2:1, y2:1,
+ stop:0 white, stop: 0.4 rgba(10, 20, 30, 40), stop:1 rgb(0, 200, 230, 200))
+}
+
+
+/* conical gradient from white to green */
+QTextEdit {
+ background: qconicalgradient(cx:0.5, cy:0.5, angle:30,
+ stop:0 white, stop:1 #00FF00)
+}
+
+/* radial gradient from white to green */
+QTextEdit {
+ background: qradialgradient(cx:0, cy:0, radius: 1,
+ fx:0.5, fy:0.5, stop:0 white, stop:1 green)
+}
+//! [85]
+
+
+//! [86]
+* {
+ file-icon: url(file.png),
+ url(file_selected.png) selected;
+ }
+
+QMessageBox {
+ dialogbuttonbox-buttons-have-icons: true;
+ dialog-ok-icon: url(ok.svg);
+ dialog-cancel-icon: url(cancel.png), url(grayed_cancel.png) disabled;
+}
+//! [86]
+
+
+//! [87]
+QPushButton { color: palette(dark); }
+//! [87]
+
+
+//! [94]
+*[mandatoryField="true"] { background-color: yellow }
+//! [94]
+
+
+//! [96]
+QPushButton#evilButton { background-color: red }
+//! [96]
+
+
+//! [97]
+QPushButton#evilButton {
+ background-color: red;
+ border-style: outset;
+ border-width: 2px;
+ border-color: beige;
+}
+//! [97]
+
+
+//! [98]
+QPushButton#evilButton {
+ background-color: red;
+ border-style: outset;
+ border-width: 2px;
+ border-radius: 10px;
+ border-color: beige;
+ font: bold 14px;
+ min-width: 10em;
+ padding: 6px;
+}
+//! [98]
+
+
+//! [99]
+QPushButton#evilButton {
+ background-color: red;
+ border-style: outset;
+ border-width: 2px;
+ border-radius: 10px;
+ border-color: beige;
+ font: bold 14px;
+ min-width: 10em;
+ padding: 6px;
+}
+QPushButton#evilButton:pressed {
+ background-color: rgb(224, 0, 0);
+ border-style: inset;
+}
+//! [99]
+
+
+//! [100]
+QPushButton#evilButton::menu-indicator {
+ image: url(myindicator.png);
+}
+//! [100]
+
+
+//! [101]
+QPushButton::menu-indicator {
+ image: url(myindicator.png);
+ subcontrol-position: right center;
+ subcontrol-origin: padding;
+ left: -2px;
+}
+//! [101]
+
+
+//! [102]
+QLineEdit { color: red }
+//! [102]
+
+
+//! [103]
+QLineEdit { color: red }
+QLineEdit[readOnly="true"] { color: gray }
+//! [103]
+
+
+//! [104]
+QLineEdit { color: red }
+QLineEdit[readOnly="true"] { color: gray }
+#registrationDialog QLineEdit { color: brown }
+//! [104]
+
+
+//! [105]
+QLineEdit { color: red }
+QLineEdit[readOnly="true"] { color: gray }
+QDialog QLineEdit { color: brown }
+//! [105]
+
+
+//! [106]
+QTextEdit, QListView {
+ background-color: white;
+ background-image: url(draft.png);
+ background-attachment: scroll;
+}
+//! [106]
+
+
+//! [107]
+QTextEdit, QListView {
+ background-color: white;
+ background-image: url(draft.png);
+ background-attachment: fixed;
+}
+//! [107]
+
+
+//! [108]
+QCheckBox {
+ spacing: 5px;
+}
+
+QCheckBox::indicator {
+ width: 13px;
+ height: 13px;
+}
+
+QCheckBox::indicator:unchecked {
+ image: url(:/images/checkbox_unchecked.png);
+}
+
+QCheckBox::indicator:unchecked:hover {
+ image: url(:/images/checkbox_unchecked_hover.png);
+}
+
+QCheckBox::indicator:unchecked:pressed {
+ image: url(:/images/checkbox_unchecked_pressed.png);
+}
+
+QCheckBox::indicator:checked {
+ image: url(:/images/checkbox_checked.png);
+}
+
+QCheckBox::indicator:checked:hover {
+ image: url(:/images/checkbox_checked_hover.png);
+}
+
+QCheckBox::indicator:checked:pressed {
+ image: url(:/images/checkbox_checked_pressed.png);
+}
+
+QCheckBox::indicator:indeterminate:hover {
+ image: url(:/images/checkbox_indeterminate_hover.png);
+}
+
+QCheckBox::indicator:indeterminate:pressed {
+ image: url(:/images/checkbox_indeterminate_pressed.png);
+}
+//! [108]
+
+
+//! [109]
+QComboBox {
+ border: 1px solid gray;
+ border-radius: 3px;
+ padding: 1px 18px 1px 3px;
+ min-width: 6em;
+}
+
+QComboBox:editable {
+ background: white;
+}
+
+QComboBox:!editable, QComboBox::drop-down:editable {
+ background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
+ stop: 0 #E1E1E1, stop: 0.4 #DDDDDD,
+ stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);
+}
+
+/* QComboBox gets the "on" state when the popup is open */
+QComboBox:!editable:on, QComboBox::drop-down:editable:on {
+ background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
+ stop: 0 #D3D3D3, stop: 0.4 #D8D8D8,
+ stop: 0.5 #DDDDDD, stop: 1.0 #E1E1E1);
+}
+
+QComboBox:on { /* shift the text when the popup opens */
+ padding-top: 3px;
+ padding-left: 4px;
+}
+
+QComboBox::drop-down {
+ subcontrol-origin: padding;
+ subcontrol-position: top right;
+ width: 15px;
+
+ border-left-width: 1px;
+ border-left-color: darkgray;
+ border-left-style: solid; /* just a single line */
+ border-top-right-radius: 3px; /* same radius as the QComboBox */
+ border-bottom-right-radius: 3px;
+}
+
+QComboBox::down-arrow {
+ image: url(/usr/share/icons/crystalsvg/16x16/actions/1downarrow.png);
+}
+
+QComboBox::down-arrow:on { /* shift the arrow when popup is open */
+ top: 1px;
+ left: 1px;
+}
+//! [109]
+
+
+//! [110]
+QComboBox QAbstractItemView {
+ border: 2px solid darkgray;
+ selection-background-color: lightgray;
+}
+//! [110]
+
+
+//! [111]
+QDockWidget {
+ border: 1px solid lightgray;
+ titlebar-close-icon: url(close.png);
+ titlebar-normal-icon: url(undock.png);
+}
+
+QDockWidget::title {
+ text-align: left; /* align the text to the left */
+ background: lightgray;
+ padding-left: 5px;
+}
+
+QDockWidget::close-button, QDockWidget::float-button {
+ border: 1px solid transparent;
+ background: darkgray;
+ padding: 0px;
+}
+
+QDockWidget::close-button:hover, QDockWidget::float-button:hover {
+ background: gray;
+}
+
+QDockWidget::close-button:pressed, QDockWidget::float-button:pressed {
+ padding: 1px -1px -1px 1px;
+}
+//! [111]
+
+
+//! [112]
+QDockWidget {
+ border: 1px solid lightgray;
+ titlebar-close-icon: url(close.png);
+ titlebar-normal-icon: url(float.png);
+}
+
+QDockWidget::title {
+ text-align: left;
+ background: lightgray;
+ padding-left: 35px;
+}
+
+QDockWidget::close-button, QDockWidget::float-button {
+ background: darkgray;
+ padding: 0px;
+ icon-size: 14px; /* maximum icon size */
+}
+
+QDockWidget::close-button:hover, QDockWidget::float-button:hover {
+ background: gray;
+}
+
+QDockWidget::close-button:pressed, QDockWidget::float-button:pressed {
+ padding: 1px -1px -1px 1px;
+}
+
+QDockWidget::close-button {
+ subcontrol-position: top left;
+ subcontrol-origin: margin;
+ position: absolute;
+ top: 0px; left: 0px; bottom: 0px;
+ width: 14px;
+}
+
+QDockWidget::float-button {
+ subcontrol-position: top left;
+ subcontrol-origin: margin;
+ position: absolute;
+ top: 0px; left: 16px; bottom: 0px;
+ width: 14px;
+}
+//! [112]
+
+
+//! [113]
+QFrame, QLabel, QToolTip {
+ border: 2px solid green;
+ border-radius: 4px;
+ padding: 2px;
+ background-image: url(images/welcome.png);
+}
+//! [113]
+
+
+//! [114]
+QGroupBox {
+ background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
+ stop: 0 #E0E0E0, stop: 1 #FFFFFF);
+ border: 2px solid gray;
+ border-radius: 5px;
+ margin-top: 1ex; /* leave space at the top for the title */
+}
+
+QGroupBox::title {
+ subcontrol-origin: margin;
+ subcontrol-position: top center; /* position at the top center */
+ padding: 0 3px;
+ background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
+ stop: 0 #FFOECE, stop: 1 #FFFFFF);
+}
+//! [114]
+
+
+//! [115]
+QGroupBox::indicator {
+ width: 13px;
+ height: 13px;
+}
+
+QGroupBox::indicator:unchecked {
+ image: url(:/images/checkbox_unchecked.png);
+}
+
+/* proceed with styling just like QCheckBox */
+//! [115]
+
+
+//! [116]
+QHeaderView::section {
+ background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
+ stop:0 #616161, stop: 0.5 #505050,
+ stop: 0.6 #434343, stop:1 #656565);
+ color: white;
+ padding-left: 4px;
+ border: 1px solid #6c6c6c;
+}
+
+QHeaderView::section:checked
+{
+ background-color: red;
+}
+
+/* style the sort indicator */
+QHeaderView::down-arrow {
+ image: url(down_arrow.png);
+}
+
+QHeaderView::up-arrow {
+ image: url(up_arrow.png);
+}
+//! [116]
+
+
+//! [117]
+QLineEdit {
+ border: 2px solid gray;
+ border-radius: 10px;
+ padding: 0 8px;
+ background: yellow;
+ selection-background-color: darkgray;
+}
+//! [117]
+
+
+//! [118]
+QLineEdit[echoMode="2"] {
+ lineedit-password-character: 9679;
+}
+//! [118]
+
+
+//! [119]
+QLineEdit:read-only {
+ background: lightblue;
+//! [119]
+
+
+//! [120]
+QListView {
+ alternate-background-color: yellow;
+}
+//! [120]
+
+
+//! [121]
+QListView {
+ show-decoration-selected: 1; /* make the selection span the entire width of the view */
+}
+
+QListView::item:alternate {
+ background: #EEEEEE;
+}
+
+QListView::item:selected {
+ border: 1px solid #6a6ea9;
+}
+
+QListView::item:selected:!active {
+ background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
+ stop: 0 #ABAFE5, stop: 1 #8588B2);
+}
+
+QListView::item:selected:active {
+ background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
+ stop: 0 #6a6ea9, stop: 1 #888dd9);
+}
+
+QListView::item:hover {
+ background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
+ stop: 0 #FAFBFE, stop: 1 #DCDEF1);
+}
+//! [121]
+
+
+//! [122]
+QMainWindow::separator {
+ background: yellow;
+ width: 10px; /* when vertical */
+ height: 10px; /* when horizontal */
+}
+
+QMainWindow::separator:hover {
+ background: red;
+}
+//! [122]
+
+
+//! [123]
+QMenu {
+ background-color: #ABABAB; /* sets background of the menu */
+ border: 1px solid black;
+}
+
+QMenu::item {
+ /* sets background of menu item. set this to something non-transparent
+ if you want menu color and menu item color to be different */
+ background-color: transparent;
+}
+
+QMenu::item:selected { /* when user selects item using mouse or keyboard */
+ background-color: #654321;
+}
+//! [123]
+
+
+//! [124]
+QMenu {
+ background-color: white;
+ margin: 2px; /* some spacing around the menu */
+}
+
+QMenu::item {
+ padding: 2px 25px 2px 20px;
+ border: 1px solid transparent; /* reserve space for selection border */
+}
+
+QMenu::item:selected {
+ border-color: darkblue;
+ background: rgba(100, 100, 100, 150);
+}
+
+QMenu::icon:checked { /* appearance of a 'checked' icon */
+ background: gray;
+ border: 1px inset gray;
+ position: absolute;
+ top: 1px;
+ right: 1px;
+ bottom: 1px;
+ left: 1px;
+}
+
+QMenu::separator {
+ height: 2px;
+ background: lightblue;
+ margin-left: 10px;
+ margin-right: 5px;
+}
+
+QMenu::indicator {
+ width: 13px;
+ height: 13px;
+}
+
+/* non-exclusive indicator = check box style indicator (see QActionGroup::setExclusive) */
+QMenu::indicator:non-exclusive:unchecked {
+ image: url(:/images/checkbox_unchecked.png);
+}
+
+QMenu::indicator:non-exclusive:unchecked:selected {
+ image: url(:/images/checkbox_unchecked_hover.png);
+}
+
+QMenu::indicator:non-exclusive:checked {
+ image: url(:/images/checkbox_checked.png);
+}
+
+QMenu::indicator:non-exclusive:checked:selected {
+ image: url(:/images/checkbox_checked_hover.png);
+}
+
+/* exclusive indicator = radio button style indicator (see QActionGroup::setExclusive) */
+QMenu::indicator:exclusive:unchecked {
+ image: url(:/images/radiobutton_unchecked.png);
+}
+
+QMenu::indicator:exclusive:unchecked:selected {
+ image: url(:/images/radiobutton_unchecked_hover.png);
+}
+
+QMenu::indicator:exclusive:checked {
+ image: url(:/images/radiobutton_checked.png);
+}
+
+QMenu::indicator:exclusive:checked:selected {
+ image: url(:/images/radiobutton_checked_hover.png);
+}
+
+//! [124]
+
+
+//! [125]
+QMenuBar {
+ background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
+ stop:0 lightgray, stop:1 darkgray);
+}
+
+QMenuBar::item {
+ spacing: 3px; /* spacing between menu bar items */
+ padding: 1px 4px;
+ background: transparent;
+ border-radius: 4px;
+}
+
+QMenuBar::item:selected { /* when selected using mouse or keyboard */
+ background: #a8a8a8;
+}
+
+QMenuBar::item:pressed {
+ background: #888888;
+}
+//! [125]
+
+
+//! [126]
+QProgressBar {
+ border: 2px solid grey;
+ border-radius: 5px;
+}
+
+QProgressBar::chunk {
+ background-color: #05B8CC;
+ width: 20px;
+}
+//! [126]
+
+
+//! [127]
+QProgressBar {
+ border: 2px solid grey;
+ border-radius: 5px;
+ text-align: center;
+}
+//! [127]
+
+
+//! [128]
+QProgressBar::chunk {
+ background-color: #CD96CD;
+ width: 10px;
+ margin: 0.5px;
+}
+//! [128]
+
+
+//! [129]
+QPushButton {
+ border: 2px solid #8f8f91;
+ border-radius: 6px;
+ background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
+ stop: 0 #f6f7fa, stop: 1 #dadbde);
+ min-width: 80px;
+}
+
+QPushButton:pressed {
+ background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
+ stop: 0 #dadbde, stop: 1 #f6f7fa);
+}
+
+QPushButton:flat {
+ border: none; /* no border for a flat push button */
+}
+
+QPushButton:default {
+ border-color: navy; /* make the default button prominent */
+}
+//! [129]
+
+
+//! [130]
+QPushButton:open { /* when the button has its menu open */
+ background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
+ stop: 0 #dadbde, stop: 1 #f6f7fa);
+}
+
+QPushButton::menu-indicator {
+ image: url(menu_indicator.png);
+ subcontrol-origin: padding;
+ subcontrol-position: bottom right;
+}
+
+QPushButton::menu-indicator:pressed, QPushButton::menu-indicator:open {
+ position: relative;
+ top: 2px; left: 2px; /* shift the arrow by 2 px */
+}
+//! [130]
+
+
+//! [131]
+QRadioButton::indicator {
+ width: 13px;
+ height: 13px;
+}
+
+QRadioButton::indicator::unchecked {
+ image: url(:/images/radiobutton_unchecked.png);
+}
+
+QRadioButton::indicator:unchecked:hover {
+ image: url(:/images/radiobutton_unchecked_hover.png);
+}
+
+QRadioButton::indicator:unchecked:pressed {
+ image: url(:/images/radiobutton_unchecked_pressed.png);
+}
+
+QRadioButton::indicator::checked {
+ image: url(:/images/radiobutton_checked.png);
+}
+
+QRadioButton::indicator:checked:hover {
+ image: url(:/images/radiobutton_checked_hover.png);
+}
+
+QRadioButton::indicator:checked:pressed {
+ image: url(:/images/radiobutton_checked_pressed.png);
+}
+//! [131]
+
+
+//! [132]
+QScrollBar:horizontal {
+ border: 2px solid grey;
+ background: #32CC99;
+ height: 15px;
+ margin: 0px 20px 0 20px;
+}
+//! [132]
+
+
+//! [133]
+QScrollBar::handle:horizontal {
+ background: white;
+ min-width: 20px;
+}
+//! [133]
+
+
+//! [134]
+QScrollBar::add-line:horizontal {
+ border: 2px solid grey;
+ background: #32CC99;
+ width: 20px;
+ subcontrol-position: right;
+ subcontrol-origin: margin;
+}
+
+QScrollBar::sub-line:horizontal {
+ border: 2px solid grey;
+ background: #32CC99;
+ width: 20px;
+ subcontrol-position: left;
+ subcontrol-origin: margin;
+}
+//! [134]
+
+
+//! [135]
+QScrollBar:left-arrow:horizontal, QScrollBar::right-arrow:horizontal {
+ border: 2px solid grey;
+ width: 3px;
+ height: 3px;
+ background: white;
+}
+
+QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal {
+ background: none;
+}
+//! [135]
+
+
+//! [136]
+QScrollBar:horizontal {
+ border: 2px solid green;
+ background: cyan;
+ height: 15px;
+ margin: 0px 40px 0 0px;
+}
+
+QScrollBar::handle:horizontal {
+ background: gray;
+ min-width: 20px;
+}
+
+QScrollBar::add-line:horizontal {
+ background: blue;
+ width: 16px;
+ subcontrol-position: right;
+ subcontrol-origin: margin;
+ border: 2px solid black;
+}
+
+QScrollBar::sub-line:horizontal {
+ background: magenta;
+ width: 16px;
+ subcontrol-position: top right;
+ subcontrol-origin: margin;
+ border: 2px solid black;
+ position: absolute;
+ right: 20px;
+}
+
+QScrollBar:left-arrow:horizontal, QScrollBar::right-arrow:horizontal {
+ width: 3px;
+ height: 3px;
+ background: pink;
+}
+
+QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal {
+ background: none;
+}
+
+//! [136]
+
+
+//! [137]
+ QScrollBar:vertical {
+ border: 2px solid grey;
+ background: #32CC99;
+ width: 15px;
+ margin: 22px 0 22px 0;
+ }
+ QScrollBar::handle:vertical {
+ background: white;
+ min-height: 20px;
+ }
+ QScrollBar::add-line:vertical {
+ border: 2px solid grey;
+ background: #32CC99;
+ height: 20px;
+ subcontrol-position: bottom;
+ subcontrol-origin: margin;
+ }
+
+ QScrollBar::sub-line:vertical {
+ border: 2px solid grey;
+ background: #32CC99;
+ height: 20px;
+ subcontrol-position: top;
+ subcontrol-origin: margin;
+ }
+ QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical {
+ border: 2px solid grey;
+ width: 3px;
+ height: 3px;
+ background: white;
+ }
+
+ QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {
+ background: none;
+ }
+//! [137]
+
+
+//! [138]
+QSizeGrip {
+ image: url(:/images/sizegrip.png);
+ width: 16px;
+ height: 16px;
+}
+//! [138]
+
+
+//! [139]
+QSlider::groove:horizontal {
+ border: 1px solid #999999;
+ height: 8px; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */
+ background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #B1B1B1, stop:1 #c4c4c4);
+ margin: 2px 0;
+}
+
+QSlider::handle:horizontal {
+ background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #b4b4b4, stop:1 #8f8f8f);
+ border: 1px solid #5c5c5c;
+ width: 18px;
+ margin: -2px 0; /* handle is placed by default on the contents rect of the groove. Expand outside the groove */
+ border-radius: 3px;
+}
+//! [139]
+
+
+//! [140]
+QSlider::groove:vertical {
+ background: red;
+ position: absolute; /* absolutely position 4px from the left and right of the widget. setting margins on the widget should work too... */
+ left: 4px; right: 4px;
+}
+
+QSlider::handle:vertical {
+ height: 10px;
+ background: green;
+ margin: 0 -4px; /* expand outside the groove */
+}
+
+QSlider::add-page:vertical {
+ background: white;
+}
+
+QSlider::sub-page:vertical {
+ background: pink;
+}
+//! [140]
+
+
+//! [141]
+QSpinBox {
+ padding-right: 15px; /* make room for the arrows */
+ border-image: url(:/images/frame.png) 4;
+ border-width: 3;
+}
+
+QSpinBox::up-button {
+ subcontrol-origin: border;
+ subcontrol-position: top right; /* position at the top right corner */
+
+ width: 16px; /* 16 + 2*1px border-width = 15px padding + 3px parent border */
+ border-image: url(:/images/spinup.png) 1;
+ border-width: 1px;
+}
+
+QSpinBox::up-button:hover {
+ border-image: url(:/images/spinup_hover.png) 1;
+}
+
+QSpinBox::up-button:pressed {
+ border-image: url(:/images/spinup_pressed.png) 1;
+}
+
+QSpinBox::up-arrow {
+ image: url(:/images/up_arrow.png);
+ width: 7px;
+ height: 7px;
+}
+
+QSpinBox::up-arrow:disabled, QSpinBox::up-arrow:off { /* off state when value is max */
+ image: url(:/images/up_arrow_disabled.png);
+}
+
+QSpinBox::down-button {
+ subcontrol-origin: border;
+ subcontrol-position: bottom right; /* position at bottom right corner */
+
+ width: 16px;
+ border-image: url(:/images/spindown.png) 1;
+ border-width: 1px;
+ border-top-width: 0;
+}
+
+QSpinBox::down-button:hover {
+ border-image: url(:/images/spindown_hover.png) 1;
+}
+
+QSpinBox::down-button:pressed {
+ border-image: url(:/images/spindown_pressed.png) 1;
+}
+
+QSpinBox::down-arrow {
+ image: url(:/images/down_arrow.png);
+ width: 7px;
+ height: 7px;
+}
+
+QSpinBox::down-arrow:disabled,
+QSpinBox::down-arrow:off { /* off state when value in min */
+ image: url(:/images/down_arrow_disabled.png);
+}
+
+//! [141]
+
+
+//! [142]
+QSplitter::handle {
+ image: url(images/splitter.png);
+}
+
+QSplitter::handle:horizontal {
+ width: 2px;
+}
+
+QSplitter::handle:vertical {
+ height: 2px;
+}
+
+QSplitter::handle:pressed {
+ url(images/splitter_pressed.png);
+}
+
+//! [142]
+
+
+//! [143]
+QStatusBar {
+ background: brown;
+}
+
+QStatusBar::item {
+ border: 1px solid red;
+ border-radius: 3px;
+}
+//! [143]
+
+
+//! [144]
+QStatusBar QLabel {
+ border: 3px solid white;
+}
+//! [144]
+
+
+//! [145]
+QTabWidget::pane { /* The tab widget frame */
+ border-top: 2px solid #C2C7CB;
+}
+
+QTabWidget::tab-bar {
+ left: 5px; /* move to the right by 5px */
+}
+
+/* Style the tab using the tab sub-control. Note that
+ it reads QTabBar _not_ QTabWidget */
+QTabBar::tab {
+ background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
+ stop: 0 #E1E1E1, stop: 0.4 #DDDDDD,
+ stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);
+ border: 2px solid #C4C4C3;
+ border-bottom-color: #C2C7CB; /* same as the pane color */
+ border-top-left-radius: 4px;
+ border-top-right-radius: 4px;
+ min-width: 8ex;
+ padding: 2px;
+}
+
+QTabBar::tab:selected, QTabBar::tab:hover {
+ background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
+ stop: 0 #fafafa, stop: 0.4 #f4f4f4,
+ stop: 0.5 #e7e7e7, stop: 1.0 #fafafa);
+}
+
+QTabBar::tab:selected {
+ border-color: #9B9B9B;
+ border-bottom-color: #C2C7CB; /* same as pane color */
+}
+
+QTabBar::tab:!selected {
+ margin-top: 2px; /* make non-selected tabs look smaller */
+}
+//! [145]
+
+
+//! [146]
+QTabWidget::pane { /* The tab widget frame */
+ border-top: 2px solid #C2C7CB;
+}
+
+QTabWidget::tab-bar {
+ left: 5px; /* move to the right by 5px */
+}
+
+/* Style the tab using the tab sub-control. Note that
+ it reads QTabBar _not_ QTabWidget */
+QTabBar::tab {
+ background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
+ stop: 0 #E1E1E1, stop: 0.4 #DDDDDD,
+ stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);
+ border: 2px solid #C4C4C3;
+ border-bottom-color: #C2C7CB; /* same as the pane color */
+ border-top-left-radius: 4px;
+ border-top-right-radius: 4px;
+ min-width: 8ex;
+ padding: 2px;
+}
+
+QTabBar::tab:selected, QTabBar::tab:hover {
+ background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
+ stop: 0 #fafafa, stop: 0.4 #f4f4f4,
+ stop: 0.5 #e7e7e7, stop: 1.0 #fafafa);
+}
+
+QTabBar::tab:selected {
+ border-color: #9B9B9B;
+ border-bottom-color: #C2C7CB; /* same as pane color */
+}
+
+QTabBar::tab:!selected {
+ margin-top: 2px; /* make non-selected tabs look smaller */
+}
+
+/* make use of negative margins for overlapping tabs */
+QTabBar::tab:selected {
+ /* expand/overlap to the left and right by 4px */
+ margin-left: -4px;
+ margin-right: -4px;
+}
+
+QTabBar::tab:first:selected {
+ margin-left: 0; /* the first selected tab has nothing to overlap with on the left */
+}
+
+QTabBar::tab:last:selected {
+ margin-right: 0; /* the last selected tab has nothing to overlap with on the right */
+}
+
+QTabBar::tab:only-one {
+ margin: 0; /* if there is only one tab, we don't want overlapping margins */
+}
+//! [146]
+
+
+//! [147]
+QTabWidget::pane { /* The tab widget frame */
+ border-top: 2px solid #C2C7CB;
+ position: absolute;
+ top: -0.5em;
+}
+
+QTabWidget::tab-bar {
+ alignment: center;
+}
+
+/* Style the tab using the tab sub-control. Note that
+ it reads QTabBar _not_ QTabWidget */
+QTabBar::tab {
+ background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
+ stop: 0 #E1E1E1, stop: 0.4 #DDDDDD,
+ stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);
+ border: 2px solid #C4C4C3;
+ border-bottom-color: #C2C7CB; /* same as the pane color */
+ border-top-left-radius: 4px;
+ border-top-right-radius: 4px;
+ min-width: 8ex;
+ padding: 2px;
+}
+
+QTabBar::tab:selected, QTabBar::tab:hover {
+ background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
+ stop: 0 #fafafa, stop: 0.4 #f4f4f4,
+ stop: 0.5 #e7e7e7, stop: 1.0 #fafafa);
+}
+
+QTabBar::tab:selected {
+ border-color: #9B9B9B;
+ border-bottom-color: #C2C7CB; /* same as pane color */
+}
+//! [147]
+
+
+//! [148]
+QTabBar::tear {
+ image: url(tear_indicator.png);
+}
+
+QTabBar::scroller { /* the width of the scroll buttons */
+ width: 20px;
+}
+
+QTabBar QToolButton { /* the scroll buttons are tool buttons */
+ border-image: url(scrollbutton.png) 2;
+ border-width: 2px;
+}
+
+QTabBar QToolButton::right-arrow { /* the arrow mark in the tool buttons */
+ image: url(rightarrow.png);
+}
+
+QTabBar QToolButton::left-arrow {
+ image: url(leftarrow.png);
+}
+//! [148]
+
+
+//! [149]
+QTableView {
+ selection-background-color: qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,
+ stop: 0 #FF92BB, stop: 1 white);
+}
+//! [149]
+
+
+//! [150]
+QTableView QTableCornerButton::section {
+ background: red;
+ border: 2px outset red;
+}
+//! [150]
+
+
+//! [151]
+QToolBar {
+ background: red;
+ spacing: 3px; /* spacing between items in the tool bar */
+}
+
+QToolBar::handle {
+ image: url(handle.png);
+}
+//! [151]
+
+
+//! [152]
+QToolBox::tab {
+ background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
+ stop: 0 #E1E1E1, stop: 0.4 #DDDDDD,
+ stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);
+ border-radius: 5px;
+ color: darkgray;
+}
+
+QToolBox::tab:selected { /* italicize selected tabs */
+ font: italic;
+ color: white;
+}
+//! [152]
+
+
+//! [153]
+QToolButton { /* all types of tool button */
+ border: 2px solid #8f8f91;
+ border-radius: 6px;
+ background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
+ stop: 0 #f6f7fa, stop: 1 #dadbde);
+}
+
+QToolButton[popupMode="1"] { /* only for MenuButtonPopup */
+ padding-right: 20px; /* make way for the popup button */
+}
+
+QToolButton:pressed {
+ background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
+ stop: 0 #dadbde, stop: 1 #f6f7fa);
+}
+
+/* the subcontrols below are used only in the MenuButtonPopup mode */
+QToolButton::menu-button {
+ border: 2px solid gray;
+ border-top-right-radius: 6px;
+ border-bottom-right-radius: 6px;
+ /* 16px width + 4px for border = 20px allocated above */
+ width: 16px;
+}
+
+QToolButton::menu-arrow {
+ image: url(downarrow.png);
+}
+
+QToolButton::menu-arrow:open {
+ top: 1px; left: 1px; /* shift it a bit */
+}
+//! [153]
+
+
+//! [154]
+QToolTip {
+ border: 2px solid darkkhaki;
+ padding: 5px;
+ border-radius: 3px;
+ opacity: 200;
+}
+//! [154]
+
+
+//! [155]
+QTreeView {
+ alternate-background-color: yellow;
+}
+//! [155]
+
+
+//! [156]
+QTreeView {
+ show-decoration-selected: 1;
+}
+
+QTreeView::item {
+ border: 1px solid #d9d9d9;
+ border-top-color: transparent;
+ border-bottom-color: transparent;
+}
+
+QTreeView::item:hover {
+ background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #e7effd, stop: 1 #cbdaf1);
+ border: 1px solid #bfcde4;
+}
+
+QTreeView::item:selected {
+ border: 1px solid #567dbc;
+}
+
+QTreeView::item:selected:active{
+ background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #6ea1f1, stop: 1 #567dbc);
+}
+
+QTreeView::item:selected:!active {
+ background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #6b9be8, stop: 1 #577fbf);
+}
+//! [156]
+
+
+//! [157]
+QTreeView::branch {
+ background: palette(base);
+}
+
+QTreeView::branch:has-siblings:!adjoins-item {
+ background: cyan;
+}
+
+QTreeView::branch:has-siblings:adjoins-item {
+ background: red;
+}
+
+QTreeView::branch:!has-children:!has-siblings:adjoins-item {
+ background: blue;
+}
+
+QTreeView::branch:closed:has-children:has-siblings {
+ background: pink;
+}
+
+QTreeView::branch:has-children:!has-siblings:closed {
+ background: gray;
+}
+
+QTreeView::branch:open:has-children:has-siblings {
+ background: magenta;
+}
+
+QTreeView::branch:open:has-children:!has-siblings {
+ background: green;
+}
+
+//! [157]
+
+
+//! [158]
+QTreeView::branch:has-siblings:!adjoins-item {
+ border-image: url(vline.png) 0;
+}
+
+QTreeView::branch:has-siblings:adjoins-item {
+ border-image: url(branch-more.png) 0;
+}
+
+QTreeView::branch:!has-children:!has-siblings:adjoins-item {
+ border-image: url(branch-end.png) 0;
+}
+
+QTreeView::branch:has-children:!has-siblings:closed,
+QTreeView::branch:closed:has-children:has-siblings {
+ border-image: none;
+ image: url(branch-closed.png);
+}
+
+QTreeView::branch:open:has-children:!has-siblings,
+QTreeView::branch:open:has-children:has-siblings {
+ border-image: none;
+ image: url(branch-open.png);
+}
+//! [158]
+
+//! [159]
+QTabBar::close-button {
+ image: url(close.png)
+ subcontrol-position: left;
+}
+QTabBar::close-button:hover {
+ image: url(close-hover.png)
+}
+
+//! [159]
diff --git a/src/widgets/doc/snippets/code/src_gui_dialogs_qfiledialog.cpp b/src/widgets/doc/snippets/code/src_gui_dialogs_qfiledialog.cpp
new file mode 100644
index 0000000000..1a89ff327f
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_dialogs_qfiledialog.cpp
@@ -0,0 +1,131 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+fileName = QFileDialog::getOpenFileName(this,
+ tr("Open Image"), "/home/jana", tr("Image Files (*.png *.jpg *.bmp)"));
+//! [0]
+
+
+//! [1]
+"Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)"
+//! [1]
+
+
+//! [2]
+QFileDialog dialog(this);
+dialog.setFileMode(QFileDialog::AnyFile);
+//! [2]
+
+
+//! [3]
+dialog.setNameFilter(tr("Images (*.png *.xpm *.jpg)"));
+//! [3]
+
+
+//! [4]
+dialog.setViewMode(QFileDialog::Detail);
+//! [4]
+
+
+//! [5]
+QStringList fileNames;
+if (dialog.exec())
+ fileNames = dialog.selectedFiles();
+//! [5]
+
+
+//! [6]
+dialog.setNameFilter("All C++ files (*.cpp *.cc *.C *.cxx *.c++)");
+dialog.setNameFilter("*.cpp *.cc *.C *.cxx *.c++");
+//! [6]
+
+
+//! [7]
+QStringList filters;
+filters << "Image files (*.png *.xpm *.jpg)"
+ << "Text files (*.txt)"
+ << "Any files (*)";
+
+QFileDialog dialog(this);
+dialog.setNameFilters(filters);
+dialog.exec();
+//! [7]
+
+
+//! [8]
+QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"),
+ "/home",
+ tr("Images (*.png *.xpm *.jpg)"));
+//! [8]
+
+
+//! [9]
+QStringList files = QFileDialog::getOpenFileNames(
+ this,
+ "Select one or more files to open",
+ "/home",
+ "Images (*.png *.xpm *.jpg)");
+//! [9]
+
+
+//! [10]
+QStringList list = files;
+QStringList::Iterator it = list.begin();
+while(it != list.end()) {
+ myProcessing(*it);
+ ++it;
+}
+//! [10]
+
+
+//! [11]
+QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"),
+ "/home/jana/untitled.png",
+ tr("Images (*.png *.xpm *.jpg)"));
+//! [11]
+
+
+//! [12]
+QString dir = QFileDialog::getExistingDirectory(this, tr("Open Directory"),
+ "/home",
+ QFileDialog::ShowDirsOnly
+ | QFileDialog::DontResolveSymlinks);
+//! [12]
diff --git a/src/widgets/doc/snippets/code/src_gui_dialogs_qfontdialog.cpp b/src/widgets/doc/snippets/code/src_gui_dialogs_qfontdialog.cpp
new file mode 100644
index 0000000000..e07ecbca3e
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_dialogs_qfontdialog.cpp
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+bool ok;
+QFont font = QFontDialog::getFont(
+ &ok, QFont("Helvetica [Cronyx]", 10), this);
+if (ok) {
+ // the user clicked OK and font is set to the font the user selected
+} else {
+ // the user canceled the dialog; font is set to the initial
+ // value, in this case Helvetica [Cronyx], 10
+}
+//! [0]
+
+
+//! [1]
+myWidget.setFont(QFontDialog::getFont(0, myWidget.font()));
+//! [1]
+
+
+//! [2]
+bool ok;
+QFont font = QFontDialog::getFont(&ok, QFont("Times", 12), this);
+if (ok) {
+ // font is set to the font the user selected
+} else {
+ // the user canceled the dialog; font is set to the initial
+ // value, in this case Times, 12.
+}
+//! [2]
+
+
+//! [3]
+myWidget.setFont(QFontDialog::getFont(0, myWidget.font()));
+//! [3]
+
+
+//! [4]
+bool ok;
+QFont font = QFontDialog::getFont(&ok, this);
+if (ok) {
+ // font is set to the font the user selected
+} else {
+ // the user canceled the dialog; font is set to the default
+ // application font, QApplication::font()
+}
+//! [4]
diff --git a/src/widgets/doc/snippets/code/src_gui_dialogs_qmessagebox.cpp b/src/widgets/doc/snippets/code/src_gui_dialogs_qmessagebox.cpp
new file mode 100644
index 0000000000..90bc2e9b0a
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_dialogs_qmessagebox.cpp
@@ -0,0 +1,148 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+int ret = QMessageBox::warning(this, tr("My Application"),
+ tr("The document has been modified.\n"
+ "Do you want to save your changes?"),
+ QMessageBox::Save | QMessageBox::Discard
+ | QMessageBox::Cancel,
+ QMessageBox::Save);
+//! [0]
+
+
+//! [1]
+QMessageBox msgBox;
+msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
+switch (msgBox.exec()) {
+case QMessageBox::Yes:
+ // yes was clicked
+ break;
+case QMessageBox::No:
+ // no was clicked
+ break;
+default:
+ // should never be reached
+ break;
+}
+//! [1]
+
+
+//! [2]
+QMessageBox msgBox;
+QPushButton *connectButton = msgBox.addButton(tr("Connect"), QMessageBox::ActionRole);
+QPushButton *abortButton = msgBox.addButton(QMessageBox::Abort);
+
+msgBox.exec();
+
+if (msgBox.clickedButton() == connectButton) {
+ // connect
+} else if (msgBox.clickedButton() == abortButton) {
+ // abort
+}
+//! [2]
+
+
+//! [3]
+QMessageBox messageBox(this);
+QAbstractButton *disconnectButton =
+ messageBox.addButton(tr("Disconnect"), QMessageBox::ActionRole);
+...
+messageBox.exec();
+if (messageBox.clickedButton() == disconnectButton) {
+ ...
+}
+//! [3]
+
+
+//! [4]
+#include <QApplication>
+#include <QMessageBox>
+
+int main(int argc, char *argv[])
+{
+ QT_REQUIRE_VERSION(argc, argv, "4.0.2")
+
+ QApplication app(argc, argv);
+ ...
+ return app.exec();
+}
+//! [4]
+
+//! [5]
+QMessageBox msgBox;
+msgBox.setText("The document has been modified.");
+msgBox.exec();
+//! [5]
+
+//! [6]
+QMessageBox msgBox;
+msgBox.setText("The document has been modified.");
+msgBox.setInformativeText("Do you want to save your changes?");
+msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
+msgBox.setDefaultButton(QMessageBox::Save);
+int ret = msgBox.exec();
+//! [6]
+
+//! [7]
+switch (ret) {
+ case QMessageBox::Save:
+ // Save was clicked
+ break;
+ case QMessageBox::Discard:
+ // Don't Save was clicked
+ break;
+ case QMessageBox::Cancel:
+ // Cancel was clicked
+ break;
+ default:
+ // should never be reached
+ break;
+}
+//! [7]
+
+//! [9]
+QMessageBox msgBox(this);
+msgBox.setText(tr("The document has been modified.\n"
+ "Do you want to save your changes?"));
+msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard
+ | QMessageBox::Cancel);
+msgBox.setDefaultButton(QMessageBox::Save);
+//! [9]
diff --git a/src/widgets/doc/snippets/code/src_gui_dialogs_qwizard.cpp b/src/widgets/doc/snippets/code/src_gui_dialogs_qwizard.cpp
new file mode 100644
index 0000000000..47db20da99
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_dialogs_qwizard.cpp
@@ -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 documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+int LicenseWizard::nextId() const
+{
+ switch (currentId()) {
+ case Page_Intro:
+ if (field("intro.evaluate").toBool()) {
+ return Page_Evaluate;
+ } else {
+ return Page_Register;
+ }
+ case Page_Evaluate:
+ return Page_Conclusion;
+ case Page_Register:
+ if (field("register.upgradeKey").toString().isEmpty()) {
+ return Page_Details;
+ } else {
+ return Page_Conclusion;
+ }
+ case Page_Details:
+ return Page_Conclusion;
+ case Page_Conclusion:
+ default:
+ return -1;
+ }
+}
+//! [0]
+
+
+//! [1]
+MyWizard::MyWizard(QWidget *parent)
+ : QWizard(parent)
+{
+ ...
+ QList<QWizard::WizardButton> layout;
+ layout << QWizard::Stretch << QWizard::BackButton << QWizard::CancelButton
+ << QWizard::NextButton << QWizard::FinishButton;
+ setButtonLayout(layout);
+ ...
+}
+//! [1]
diff --git a/src/widgets/doc/snippets/code/src_gui_effects_qgraphicseffect.cpp b/src/widgets/doc/snippets/code/src_gui_effects_qgraphicseffect.cpp
new file mode 100644
index 0000000000..3e0b0b64ee
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_effects_qgraphicseffect.cpp
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+MyGraphicsOpacityEffect::draw(QPainter *painter)
+{
+ // Fully opaque; draw directly without going through a pixmap.
+ if (qFuzzyCompare(m_opacity, 1)) {
+ drawSource(painter);
+ return;
+ }
+ ...
+}
+//! [0]
+
+//! [1]
+MyGraphicsEffect::draw(QPainter *painter)
+{
+ ...
+ QPoint offset;
+ if (sourceIsPixmap()) {
+ // No point in drawing in device coordinates (pixmap will be scaled anyways).
+ const QPixmap pixmap = sourcePixmap(Qt::LogicalCoordinates, &offset);
+ ...
+ painter->drawPixmap(offset, pixmap);
+ } else {
+ // Draw pixmap in device coordinates to avoid pixmap scaling;
+ const QPixmap pixmap = sourcePixmap(Qt::DeviceCoordinates, &offset);
+ painter->setWorldTransform(QTransform());
+ ...
+ painter->drawPixmap(offset, pixmap);
+ }
+ ...
+}
+//! [1]
+
+//! [2]
+...
+QLinearGradient alphaGradient(rect.topLeft(), rect.bottomLeft());
+alphaGradient.setColorAt(0.0, Qt::transparent);
+alphaGradient.setColorAt(0.5, Qt::black);
+alphaGradient.setColorAt(1.0, Qt::transparent);
+QGraphicsOpacityEffect *effect = new QGraphicsOpacityEffect;
+effect->setOpacityMask(alphaGradient);
+...
+//! [2]
diff --git a/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicsgridlayout.cpp b/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicsgridlayout.cpp
new file mode 100644
index 0000000000..9a974de016
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicsgridlayout.cpp
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+QGraphicsScene scene;
+QGraphicsWidget *textEdit = scene.addWidget(new QTextEdit);
+QGraphicsWidget *pushButton = scene.addWidget(new QPushButton);
+
+QGraphicsGridLayout *layout = new QGraphicsGridLayout;
+layout->addItem(textEdit, 0, 0);
+layout->addItem(pushButton, 0, 1);
+
+QGraphicsWidget *form = new QGraphicsWidget;
+form->setLayout(layout);
+scene.addItem(form);
+//! [0]
diff --git a/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp b/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp
new file mode 100644
index 0000000000..01df05c084
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp
@@ -0,0 +1,278 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+class SimpleItem : public QGraphicsItem
+{
+public:
+ QRectF boundingRect() const
+ {
+ qreal penWidth = 1;
+ return QRectF(-10 - penWidth / 2, -10 - penWidth / 2,
+ 20 + penWidth, 20 + penWidth);
+ }
+
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
+ QWidget *widget)
+ {
+ painter->drawRoundedRect(-10, -10, 20, 20, 5, 5);
+ }
+};
+//! [0]
+
+
+//! [1]
+class CustomItem : public QGraphicsItem
+{
+ ...
+ enum { Type = UserType + 1 };
+
+ int type() const
+ {
+ // Enable the use of qgraphicsitem_cast with this item.
+ return Type;
+ }
+ ...
+};
+//! [1]
+
+
+//! [2]
+item->setCursor(Qt::IBeamCursor);
+//! [2]
+
+
+//! [3]
+item->setCursor(Qt::IBeamCursor);
+//! [3]
+
+
+//! [4]
+QGraphicsRectItem rect;
+rect.setPos(100, 100);
+
+rect.sceneTransform().map(QPointF(0, 0));
+// returns QPointF(100, 100);
+
+rect.sceneTransform().inverted().map(QPointF(100, 100));
+// returns QPointF(0, 0);
+//! [4]
+
+
+//! [5]
+QGraphicsRectItem rect;
+rect.setPos(100, 100);
+
+rect.deviceTransform(view->viewportTransform()).map(QPointF(0, 0));
+// returns the item's (0, 0) point in view's viewport coordinates
+
+rect.deviceTransform(view->viewportTransform()).inverted().map(QPointF(100, 100));
+// returns view's viewport's (100, 100) coordinate in item coordinates
+//! [5]
+
+
+//! [6]
+// Rotate an item 45 degrees around (0, 0).
+item->rotate(45);
+
+// Rotate an item 45 degrees around (x, y).
+item->setTransform(QTransform().translate(x, y).rotate(45).translate(-x, -y));
+//! [6]
+
+
+//! [7]
+// Scale an item by 3x2 from its origin
+item->scale(3, 2);
+
+// Scale an item by 3x2 from (x, y)
+item->setTransform(QTransform().translate(x, y).scale(3, 2).translate(-x, -y));
+//! [7]
+
+
+//! [8]
+QRectF CircleItem::boundingRect() const
+{
+ qreal penWidth = 1;
+ return QRectF(-radius - penWidth / 2, -radius - penWidth / 2,
+ diameter + penWidth, diameter + penWidth);
+}
+//! [8]
+
+
+//! [9]
+QPainterPath RoundItem::shape() const
+{
+ QPainterPath path;
+ path.addEllipse(boundingRect());
+ return path;
+}
+//! [9]
+
+
+//! [10]
+void RoundRectItem::paint(QPainter *painter,
+ const QStyleOptionGraphicsItem *option,
+ QWidget *widget)
+{
+ painter->drawRoundedRect(-10, -10, 20, 20, 5, 5);
+}
+//! [10]
+
+
+//! [11]
+static const int ObjectName = 0;
+
+QGraphicsItem *item = scene.itemAt(100, 50);
+if (item->data(ObjectName).toString().isEmpty()) {
+ if (qgraphicsitem_cast<ButtonItem *>(item))
+ item->setData(ObjectName, "Button");
+}
+//! [11]
+
+
+//! [12]
+QGraphicsScene scene;
+QGraphicsEllipseItem *ellipse = scene.addEllipse(QRectF(-10, -10, 20, 20));
+QGraphicsLineItem *line = scene.addLine(QLineF(-10, -10, 20, 20));
+
+line->installSceneEventFilter(ellipse);
+// line's events are filtered by ellipse's sceneEventFilter() function.
+
+ellipse->installSceneEventFilter(line);
+// ellipse's events are filtered by line's sceneEventFilter() function.
+//! [12]
+
+
+//! [13]
+void CustomItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
+{
+ QMenu menu;
+ QAction *removeAction = menu.addAction("Remove");
+ QAction *markAction = menu.addAction("Mark");
+ QAction *selectedAction = menu.exec(event->screenPos());
+ // ...
+}
+//! [13]
+
+
+//! [14]
+CustomItem::CustomItem()
+{
+ setAcceptDrops(true);
+ ...
+}
+
+void CustomItem::dragEnterEvent(QGraphicsSceneDragDropEvent *event)
+{
+ event->setAccepted(event->mimeData()->hasFormat("text/plain"));
+}
+//! [14]
+
+
+//! [15]
+QVariant Component::itemChange(GraphicsItemChange change, const QVariant &value)
+{
+ if (change == ItemPositionChange && scene()) {
+ // value is the new position.
+ QPointF newPos = value.toPointF();
+ QRectF rect = scene()->sceneRect();
+ if (!rect.contains(newPos)) {
+ // Keep the item inside the scene rect.
+ newPos.setX(qMin(rect.right(), qMax(newPos.x(), rect.left())));
+ newPos.setY(qMin(rect.bottom(), qMax(newPos.y(), rect.top())));
+ return newPos;
+ }
+ }
+ return QGraphicsItem::itemChange(change, value);
+}
+//! [15]
+
+
+//! [16]
+void CircleItem::setRadius(qreal newRadius)
+{
+ if (radius != newRadius) {
+ prepareGeometryChange();
+ radius = newRadius;
+ }
+}
+//! [16]
+
+
+//! [17]
+// Group all selected items together
+QGraphicsItemGroup *group = scene->createItemGroup(scene->selecteditems());
+
+// Destroy the group, and delete the group item
+scene->destroyItemGroup(group);
+//! [17]
+
+
+//! [QGraphicsItem type]
+class CustomItem : public QGraphicsItem
+{
+ ...
+ enum { Type = UserType + 1 };
+
+ int type() const
+ {
+ // Enable the use of qgraphicsitem_cast with this item.
+ return Type;
+ }
+ ...
+};
+//! [QGraphicsItem type]
+
+//! [18]
+class QGraphicsPathItem : public QAbstractGraphicsShapeItem
+{
+ public:
+ enum { Type = 2 };
+ int type() const { return Type; }
+ ...
+};
+//! [18]
+
+//! [19]
+QTransform xform = item->deviceTransform(view->viewportTransform());
+QRect deviceRect = xform.mapRect(rect).toAlignedRect();
+view->viewport()->scroll(dx, dy, deviceRect);
+//! [19]
+
diff --git a/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicslinearlayout.cpp b/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicslinearlayout.cpp
new file mode 100644
index 0000000000..e3998201af
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicslinearlayout.cpp
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+QGraphicsScene scene;
+QGraphicsWidget *textEdit = scene.addWidget(new QTextEdit);
+QGraphicsWidget *pushButton = scene.addWidget(new QPushButton);
+
+QGraphicsLinearLayout *layout = new QGraphicsLinearLayout;
+layout->addItem(textEdit);
+layout->addItem(pushButton);
+
+QGraphicsWidget *form = new QGraphicsWidget;
+form->setLayout(layout);
+scene.addItem(form);
+//! [0]
diff --git a/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicsproxywidget.cpp b/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicsproxywidget.cpp
new file mode 100644
index 0000000000..e508dbfb2b
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicsproxywidget.cpp
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+int main(int argc, char **argv)
+{
+ QApplication app(argc, argv);
+
+ QTabWidget *tabWidget = new QTabWidget;
+
+ QGraphicsScene scene;
+ QGraphicsProxyWidget *proxy = scene.addWidget(tabWidget);
+
+ QGraphicsView view(&scene);
+ view.show();
+
+ return app.exec();
+}
+//! [0]
+
+//! [1]
+QGroupBox *groupBox = new QGroupBox("Contact Details");
+QLabel *numberLabel = new QLabel("Telephone number");
+QLineEdit *numberEdit = new QLineEdit;
+
+QFormLayout *layout = new QFormLayout;
+layout->addRow(numberLabel, numberEdit);
+groupBox->setLayout(layout);
+
+QGraphicsScene scene;
+QGraphicsProxyWidget *proxy = scene.addWidget(groupBox);
+
+QGraphicsView view(&scene);
+view.show();
+//! [1]
+
+//! [2]
+QGraphicsScene scene;
+
+QLineEdit *edit = new QLineEdit;
+QGraphicsProxyWidget *proxy = scene.addWidget(edit);
+
+edit->isVisible(); // returns true
+proxy->isVisible(); // also returns true
+
+edit->hide();
+
+edit->isVisible(); // returns false
+proxy->isVisible(); // also returns false
+//! [2]
diff --git a/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicsscene.cpp b/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicsscene.cpp
new file mode 100644
index 0000000000..40b240c56f
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicsscene.cpp
@@ -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 documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+QGraphicsScene scene;
+scene.addText("Hello, world!");
+
+QGraphicsView view(&scene);
+view.show();
+//! [0]
+
+
+//! [1]
+QGraphicsScene scene;
+scene.addItem(...
+...
+QPrinter printer(QPrinter::HighResolution);
+printer.setPaperSize(QPrinter::A4);
+
+QPainter painter(&printer);
+scene.render(&painter);
+//! [1]
+
+
+//! [2]
+QSizeF segmentSize = sceneRect().size() / pow(2, depth - 1);
+//! [2]
+
+
+//! [3]
+QGraphicsScene scene;
+QGraphicsView view(&scene);
+view.show();
+
+// a blue background
+scene.setBackgroundBrush(Qt::blue);
+
+// a gradient background
+QRadialGradient gradient(0, 0, 10);
+gradient.setSpread(QGradient::RepeatSpread);
+scene.setBackgroundBrush(gradient);
+//! [3]
+
+
+//! [4]
+QGraphicsScene scene;
+QGraphicsView view(&scene);
+view.show();
+
+// a white semi-transparent foreground
+scene.setForegroundBrush(QColor(255, 255, 255, 127));
+
+// a grid foreground
+scene.setForegroundBrush(QBrush(Qt::lightGray, Qt::CrossPattern));
+//! [4]
+
+
+//! [5]
+QRectF TileScene::rectForTile(int x, int y) const
+{
+ // Return the rectangle for the tile at position (x, y).
+ return QRectF(x * tileWidth, y * tileHeight, tileWidth, tileHeight);
+}
+
+void TileScene::setTile(int x, int y, const QPixmap &pixmap)
+{
+ // Sets or replaces the tile at position (x, y) with pixmap.
+ if (x >= 0 && x < numTilesH && y >= 0 && y < numTilesV) {
+ tiles[y][x] = pixmap;
+ invalidate(rectForTile(x, y), BackgroundLayer);
+ }
+}
+
+void TileScene::drawBackground(QPainter *painter, const QRectF &exposed)
+{
+ // Draws all tiles that intersect the exposed area.
+ for (int y = 0; y < numTilesV; ++y) {
+ for (int x = 0; x < numTilesH; ++x) {
+ QRectF rect = rectForTile(x, y);
+ if (exposed.intersects(rect))
+ painter->drawPixmap(rect.topLeft(), tiles[y][x]);
+ }
+ }
+}
+//! [5]
diff --git a/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicssceneevent.cpp b/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicssceneevent.cpp
new file mode 100644
index 0000000000..0e9ceea6a0
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicssceneevent.cpp
@@ -0,0 +1,45 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+
+setDropAction(proposedAction());
+
+//! [0]
diff --git a/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicsview.cpp b/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicsview.cpp
new file mode 100644
index 0000000000..d07b5f7cf6
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicsview.cpp
@@ -0,0 +1,132 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+QGraphicsScene scene;
+scene.addText("Hello, world!");
+
+QGraphicsView view(&scene);
+view.show();
+//! [0]
+
+
+//! [1]
+QGraphicsScene scene;
+scene.addRect(QRectF(-10, -10, 20, 20));
+
+QGraphicsView view(&scene);
+view.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
+view.show();
+//! [1]
+
+
+//! [2]
+QGraphicsView view;
+view.setBackgroundBrush(QImage(":/images/backgroundtile.png"));
+view.setCacheMode(QGraphicsView::CacheBackground);
+//! [2]
+
+
+//! [3]
+QGraphicsScene scene;
+scene.addText("GraphicsView rotated clockwise");
+
+QGraphicsView view(&scene);
+view.rotate(90); // the text is rendered with a 90 degree clockwise rotation
+view.show();
+//! [3]
+
+
+//! [4]
+QGraphicsScene scene;
+scene.addItem(...
+...
+
+QGraphicsView view(&scene);
+view.show();
+...
+
+QPrinter printer(QPrinter::HighResolution);
+printer.setPageSize(QPrinter::A4);
+QPainter painter(&printer);
+
+// print, fitting the viewport contents into a full page
+view.render(&painter);
+
+// print the upper half of the viewport into the lower.
+// half of the page.
+QRect viewport = view.viewport()->rect();
+view.render(&painter,
+ QRectF(0, printer.height() / 2,
+ printer.width(), printer.height() / 2),
+ viewport.adjusted(0, 0, 0, -viewport.height() / 2));
+
+//! [4]
+
+
+//! [5]
+void CustomView::mousePressEvent(QMouseEvent *event)
+{
+ qDebug() << "There are" << items(event->pos()).size()
+ << "items at position" << mapToScene(event->pos());
+}
+//! [5]
+
+
+//! [6]
+void CustomView::mousePressEvent(QMouseEvent *event)
+{
+ if (QGraphicsItem *item = itemAt(event->pos())) {
+ qDebug() << "You clicked on item" << item;
+ } else {
+ qDebug() << "You didn't click on an item.";
+ }
+}
+//! [6]
+
+
+//! [7]
+QGraphicsScene scene;
+scene.addText("GraphicsView rotated clockwise");
+
+QGraphicsView view(&scene);
+view.rotate(90); // the text is rendered with a 90 degree clockwise rotation
+view.show();
+//! [7]
diff --git a/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicswidget.cpp b/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicswidget.cpp
new file mode 100644
index 0000000000..da92f2d2e1
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicswidget.cpp
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+void MyGroupBoxWidget::initStyleOption(QStyleOption *option) const
+{
+ QGraphicsWidget::initStyleOption(option);
+ if (QStyleOptionGroupBox *box = qstyleoption_cast<QStyleOptionGroupBox *>(option)) {
+ // Add group box specific state.
+ box->flat = isFlat();
+ ...
+ }
+}
+//! [0]
+
+
+//! [1]
+setTabOrder(a, b); // a to b
+setTabOrder(b, c); // a to b to c
+setTabOrder(c, d); // a to b to c to d
+//! [1]
+
+
+//! [2]
+// WRONG
+setTabOrder(c, d); // c to d
+setTabOrder(a, b); // a to b AND c to d
+setTabOrder(b, c); // a to b to c, but not c to d
+//! [2]
diff --git a/src/widgets/doc/snippets/code/src_gui_image_qicon.cpp b/src/widgets/doc/snippets/code/src_gui_image_qicon.cpp
new file mode 100644
index 0000000000..28ebea8f65
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_image_qicon.cpp
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+QToolButton *button = new QToolButton;
+button->setIcon(QIcon("open.xpm"));
+//! [0]
+
+
+//! [1]
+button->setIcon(QIcon());
+//! [1]
+
+
+//! [2]
+void MyWidget::drawIcon(QPainter *painter, QPoint pos)
+{
+ QPixmap pixmap = icon.pixmap(QSize(22, 22),
+ isEnabled() ? QIcon::Normal
+ : QIcon::Disabled,
+ isChecked() ? QIcon::On
+ : QIcon::Off);
+ painter->drawPixmap(pos, pixmap);
+}
+//! [2]
+
+//! [3]
+ QIcon undoicon = QIcon::fromTheme("edit-undo");
+//! [3]
+
+//! [4]
+ QIcon undoicon = QIcon::fromTheme("edit-undo", QIcon(":/undo.png"));
+//! [4]
+
diff --git a/src/widgets/doc/snippets/code/src_gui_image_qpixmapfilter.cpp b/src/widgets/doc/snippets/code/src_gui_image_qpixmapfilter.cpp
new file mode 100644
index 0000000000..55d5aa4897
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_image_qpixmapfilter.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+QPixmapColorizeFilter *myFilter = new QPixmapColorFilter;
+myFilter->setColor(QColor(128, 0, 0));
+myFilter->draw(painter, QPoint(0, 0), originalPixmap);
+//! [0]
+
+//! [1]
+QPixmapConvolutionFilter *myFilter = new QPixmapConvolutionFilter;
+qreal kernel[] = {
+ 0.0,-1.0, 0.0,
+ -1.0, 5.0,-1.0,
+ 0.0,-1.0, 0.0
+ };
+myFilter->setConvolutionKernel(kernel, 3, 3);
+myFilter->draw(painter, QPoint(0, 0), originalPixmap);
+//! [1]
+
+//! [2]
+QPixmapDropShadowFilter *myFilter = new QPixmapDropShadowFilter;
+myFilter->draw(painter, QPoint(0, 0), originalPixmap);
+//! [2]
+
diff --git a/src/widgets/doc/snippets/code/src_gui_itemviews_qabstractitemview.cpp b/src/widgets/doc/snippets/code/src_gui_itemviews_qabstractitemview.cpp
new file mode 100644
index 0000000000..2a497ff37c
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_itemviews_qabstractitemview.cpp
@@ -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 documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+void MyView::resizeEvent(QResizeEvent *event) {
+ horizontalScrollBar()->setRange(0, realWidth - width());
+ ...
+}
+//! [0]
+
+//! [1]
+setIndexWidget(index, new QLineEdit);
+...
+setIndexWidget(index, new QTextEdit);
+//! [1]
+
+//! [2]
+QItemSelectionModel *m = view->selectionModel();
+view->setModel(new model);
+delete m;
+//! [2]
diff --git a/src/widgets/doc/snippets/code/src_gui_itemviews_qdatawidgetmapper.cpp b/src/widgets/doc/snippets/code/src_gui_itemviews_qdatawidgetmapper.cpp
new file mode 100644
index 0000000000..d968260d39
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_itemviews_qdatawidgetmapper.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 documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+QDataWidgetMapper *mapper = new QDataWidgetMapper;
+mapper->setModel(model);
+mapper->addMapping(mySpinBox, 0);
+mapper->addMapping(myLineEdit, 1);
+mapper->addMapping(myCountryChooser, 2);
+mapper->toFirst();
+//! [0]
+
+
+//! [1]
+QDataWidgetMapper *mapper = new QDataWidgetMapper();
+mapper->setModel(myModel);
+mapper->addMapping(nameLineEdit, 0);
+mapper->addMapping(ageSpinBox, 1);
+//! [1]
+
+
+//! [2]
+QDataWidgetMapper *mapper = new QDataWidgetMapper();
+connect(myTableView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
+ mapper, SLOT(setCurrentModelIndex(QModelIndex)));
+//! [2]
diff --git a/src/widgets/doc/snippets/code/src_gui_itemviews_qitemeditorfactory.cpp b/src/widgets/doc/snippets/code/src_gui_itemviews_qitemeditorfactory.cpp
new file mode 100644
index 0000000000..3f1e11c04c
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_itemviews_qitemeditorfactory.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 documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+Q_PROPERTY(QColor color READ color WRITE setColor USER true)
+//! [0]
+
+
+//! [1]
+QItemEditorCreator<MyEditor> *itemCreator =
+ new QItemEditorCreator<MyEditor>("myProperty");
+
+QItemEditorFactory *factory = new QItemEditorFactory;
+//! [1]
+
+
+//! [2]
+QItemEditorFactory *editorFactory = new QItemEditorFactory;
+QItemEditorCreatorBase *creator = new QStandardItemEditorCreator<MyFancyDateTimeEdit>();
+editorFactory->registerEditor(QVariant::DateType, creator);
+//! [2]
+
+
+//! [3]
+Q_PROPERTY(QColor color READ color WRITE setColor USER true)
+//! [3]
diff --git a/src/widgets/doc/snippets/code/src_gui_itemviews_qstandarditemmodel.cpp b/src/widgets/doc/snippets/code/src_gui_itemviews_qstandarditemmodel.cpp
new file mode 100644
index 0000000000..ae91339867
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_itemviews_qstandarditemmodel.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 documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+QStandardItemModel model(4, 4);
+for (int row = 0; row < 4; ++row) {
+ for (int column = 0; column < 4; ++column) {
+ QStandardItem *item = new QStandardItem(QString("row %0, column %1").arg(row).arg(column));
+ model.setItem(row, column, item);
+ }
+}
+//! [0]
+
+
+//! [1]
+QStandardItemModel model;
+QStandardItem *parentItem = model.invisibleRootItem();
+for (int i = 0; i < 4; ++i) {
+ QStandardItem *item = new QStandardItem(QString("item %0").arg(i));
+ parentItem->appendRow(item);
+ parentItem = item;
+}
+//! [1]
+
+
+//! [2]
+QTreeView *treeView = new QTreeView(this);
+treeView->setModel(myStandardItemModel);
+connect(treeView, SIGNAL(clicked(QModelIndex)),
+ this, SLOT(clicked(QModelIndex)));
+//! [2]
+
+
+//! [3]
+void MyWidget::clicked(const QModelIndex &index)
+{
+ QStandardItem *item = myStandardItemModel->itemFromIndex(index);
+ // Do stuff with the item ...
+}
+//! [3]
+
+
+//! [4]
+treeView->scrollTo(item->index());
+//! [4]
diff --git a/src/widgets/doc/snippets/code/src_gui_itemviews_qtablewidget.cpp b/src/widgets/doc/snippets/code/src_gui_itemviews_qtablewidget.cpp
new file mode 100644
index 0000000000..169fff57b9
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_itemviews_qtablewidget.cpp
@@ -0,0 +1,45 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+setCellWidget(index, new QLineEdit);
+...
+setCellWidget(index, new QTextEdit);
+//! [0]
diff --git a/src/widgets/doc/snippets/code/src_gui_itemviews_qtreewidget.cpp b/src/widgets/doc/snippets/code/src_gui_itemviews_qtreewidget.cpp
new file mode 100644
index 0000000000..b299d765f3
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_itemviews_qtreewidget.cpp
@@ -0,0 +1,48 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+QTreeWidget *treeWidget = new QTreeWidget();
+treeWidget->setColumnCount(1);
+QList<QTreeWidgetItem *> items;
+for (int i = 0; i < 10; ++i)
+ items.append(new QTreeWidgetItem((QTreeWidget*)0, QStringList(QString("item: %1").arg(i))));
+treeWidget->insertTopLevelItems(0, items);
+//! [0]
diff --git a/src/widgets/doc/snippets/code/src_gui_kernel_qaction.cpp b/src/widgets/doc/snippets/code/src_gui_kernel_qaction.cpp
new file mode 100644
index 0000000000..af876cd872
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_kernel_qaction.cpp
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+QApplication app(argc, argv);
+app.setAttribute(Qt::AA_DontShowIconsInMenus); // Icons are *no longer shown* in menus
+// ...
+QAction *myAction = new QAction();
+// ...
+myAction->setIcon(SomeIcon);
+myAction->setIconVisibleInMenu(true); // Icon *will* be shown in menus for *this* action.
+//! [0]
diff --git a/src/widgets/doc/snippets/code/src_gui_kernel_qapplication.cpp b/src/widgets/doc/snippets/code/src_gui_kernel_qapplication.cpp
new file mode 100644
index 0000000000..b32e8c3f39
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_kernel_qapplication.cpp
@@ -0,0 +1,183 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+int main(int argc, char **argv)
+{
+#ifdef Q_WS_X11
+ bool useGUI = getenv("DISPLAY") != 0;
+#else
+ bool useGUI = true;
+#endif
+ QApplication app(argc, argv, useGUI);
+
+ if (useGUI) {
+ // start GUI version
+ ...
+ } else {
+ // start non-GUI version
+ ...
+ }
+ return app.exec();
+}
+//! [0]
+
+
+//! [1]
+QApplication::setStyle(new QWindowsStyle);
+//! [1]
+
+
+//! [2]
+int main(int argc, char *argv[])
+{
+ QApplication::setColorSpec(QApplication::ManyColor);
+ QApplication app(argc, argv);
+ ...
+ return app.exec();
+}
+//! [2]
+
+
+//! [3]
+QSize MyWidget::sizeHint() const
+{
+ return QSize(80, 25).expandedTo(QApplication::globalStrut());
+}
+//! [3]
+
+
+//! [4]
+void showAllHiddenTopLevelWidgets()
+{
+ foreach (QWidget *widget, QApplication::topLevelWidgets()) {
+ if (widget->isHidden())
+ widget->show();
+ }
+}
+//! [4]
+
+
+//! [5]
+void updateAllWidgets()
+{
+ foreach (QWidget *widget, QApplication::allWidgets())
+ widget->update();
+}
+//! [5]
+
+
+//! [6]
+int main(int argc, char *argv[])
+{
+ QApplication::setDesktopSettingsAware(false);
+ QApplication app(argc, argv);
+ ...
+ return app.exec();
+}
+//! [6]
+
+
+//! [7]
+if ((startPos - currentPos).manhattanLength() >=
+ QApplication::startDragDistance())
+ startTheDrag();
+//! [7]
+
+
+//! [8]
+void MyApplication::commitData(QSessionManager& manager)
+{
+ if (manager.allowsInteraction()) {
+ int ret = QMessageBox::warning(
+ mainWindow,
+ tr("My Application"),
+ tr("Save changes to document?"),
+ QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
+
+ switch (ret) {
+ case QMessageBox::Save:
+ manager.release();
+ if (!saveDocument())
+ manager.cancel();
+ break;
+ case QMessageBox::Discard:
+ break;
+ case QMessageBox::Cancel:
+ default:
+ manager.cancel();
+ }
+ } else {
+ // we did not get permission to interact, then
+ // do something reasonable instead
+ }
+}
+//! [8]
+
+
+//! [9]
+appname -session id
+//! [9]
+
+
+//! [10]
+foreach (const QString &command, mySession.restartCommand())
+ do_something(command);
+//! [10]
+
+
+//! [11]
+foreach (const QString &command, mySession.discardCommand())
+ do_something(command);
+//! [11]
+
+
+//! [12]
+QWidget *widget = qApp->widgetAt(x, y);
+if (widget)
+ widget = widget->window();
+//! [12]
+
+
+//! [13]
+QWidget *widget = qApp->widgetAt(point);
+if (widget)
+ widget = widget->window();
+//! [13]
diff --git a/src/widgets/doc/snippets/code/src_gui_kernel_qformlayout.cpp b/src/widgets/doc/snippets/code/src_gui_kernel_qformlayout.cpp
new file mode 100644
index 0000000000..1f7517b613
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_kernel_qformlayout.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 documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+QFormLayout *formLayout = new QFormLayout;
+formLayout->addRow(tr("&Name:"), nameLineEdit);
+formLayout->addRow(tr("&Email:"), emailLineEdit);
+formLayout->addRow(tr("&Age:"), ageSpinBox);
+setLayout(formLayout);
+//! [0]
+
+
+//! [1]
+nameLabel = new QLabel(tr("&Name:"));
+nameLabel->setBuddy(nameLineEdit);
+
+emailLabel = new QLabel(tr("&Name:"));
+emailLabel->setBuddy(emailLineEdit);
+
+ageLabel = new QLabel(tr("&Name:"));
+ageLabel->setBuddy(ageSpinBox);
+
+QGridLayout *gridLayout = new QGridLayout;
+gridLayout->addWidget(nameLabel, 0, 0);
+gridLayout->addWidget(nameLineEdit, 0, 1);
+gridLayout->addWidget(emailLabel, 1, 0);
+gridLayout->addWidget(emailLineEdit, 1, 1);
+gridLayout->addWidget(ageLabel, 2, 0);
+gridLayout->addWidget(ageSpinBox, 2, 1);
+setLayout(gridLayout);
+//! [1]
+
+
+//! [2]
+formLayout->setRowWrapPolicy(QFormLayout::DontWrapRows);
+formLayout->setFieldGrowthPolicy(QFormLayout::FieldsStayAtSizeHint);
+formLayout->setFormAlignment(Qt::AlignHCenter | Qt::AlignTop);
+formLayout->setLabelAlignment(Qt::AlignLeft);
+//! [2]
diff --git a/src/widgets/doc/snippets/code/src_gui_kernel_qlayout.cpp b/src/widgets/doc/snippets/code/src_gui_kernel_qlayout.cpp
new file mode 100644
index 0000000000..cabd753b5d
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_kernel_qlayout.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 documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+static void paintLayout(QPainter *painter, QLayoutItem *item)
+{
+ QLayout *layout = item->layout();
+ if (layout) {
+ for (int i = 0; i < layout->count(); ++i)
+ paintLayout(painter, layout->itemAt(i));
+ }
+ painter->drawRect(item->geometry());
+}
+
+void MyWidget::paintEvent(QPaintEvent *)
+{
+ QPainter painter(this);
+ if (layout())
+ paintLayout(&painter, layout());
+}
+//! [0]
+
+
+//! [1]
+QLayoutItem *child;
+while ((child = layout->takeAt(0)) != 0) {
+ ...
+ delete child;
+}
+//! [1]
diff --git a/src/widgets/doc/snippets/code/src_gui_kernel_qlayoutitem.cpp b/src/widgets/doc/snippets/code/src_gui_kernel_qlayoutitem.cpp
new file mode 100644
index 0000000000..378253c605
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_kernel_qlayoutitem.cpp
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+int MyLayout::heightForWidth(int w) const
+{
+ if (cache_dirty || cached_width != w) {
+ // not all C++ compilers support "mutable"
+ MyLayout *that = (MyLayout*)this;
+ int h = calculateHeightForWidth(w);
+ that->cached_hfw = h;
+ return h;
+ }
+ return cached_hfw;
+}
+//! [0]
diff --git a/src/widgets/doc/snippets/code/src_gui_kernel_qshortcut.cpp b/src/widgets/doc/snippets/code/src_gui_kernel_qshortcut.cpp
new file mode 100644
index 0000000000..31e3e3291e
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_kernel_qshortcut.cpp
@@ -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 documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+shortcut = new QShortcut(QKeySequence(tr("Ctrl+O", "File|Open")),
+ parent);
+//! [0]
+
+
+//! [1]
+setKey(0); // no signal emitted
+setKey(QKeySequence()); // no signal emitted
+setKey(0x3b1); // Greek letter alpha
+setKey(Qt::Key_D); // 'd', e.g. to delete
+setKey('q'); // 'q', e.g. to quit
+setKey(Qt::CTRL + Qt::Key_P); // Ctrl+P, e.g. to print document
+setKey("Ctrl+P"); // Ctrl+P, e.g. to print document
+//! [1]
diff --git a/src/widgets/doc/snippets/code/src_gui_kernel_qwidget.cpp b/src/widgets/doc/snippets/code/src_gui_kernel_qwidget.cpp
new file mode 100644
index 0000000000..3e94519073
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_kernel_qwidget.cpp
@@ -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 documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+w->setWindowState(w->windowState() ^ Qt::WindowFullScreen);
+//! [0]
+
+
+//! [1]
+w->setWindowState(w->windowState() & ~Qt::WindowMinimized | Qt::WindowActive);
+//! [1]
+
+
+//! [2]
+width = baseSize().width() + i * sizeIncrement().width();
+height = baseSize().height() + j * sizeIncrement().height();
+//! [2]
+
+
+//! [3]
+aWidget->window()->setWindowTitle("New Window Title");
+//! [3]
+
+
+//! [4]
+QFont font("Helvetica", 12, QFont::Bold);
+setFont(font);
+//! [4]
+
+
+//! [5]
+QFont font;
+font.setBold(false);
+setFont(font);
+//! [5]
+
+
+//! [6]
+setCursor(Qt::IBeamCursor);
+//! [6]
+
+
+//! [7]
+QPixmap pixmap(widget->size());
+widget->render(&pixmap);
+//! [7]
+
+
+//! [8]
+QPainter painter(this);
+...
+painter.end();
+myWidget->render(this);
+//! [8]
+
+
+//! [9]
+setTabOrder(a, b); // a to b
+setTabOrder(b, c); // a to b to c
+setTabOrder(c, d); // a to b to c to d
+//! [9]
+
+
+//! [10]
+// WRONG
+setTabOrder(c, d); // c to d
+setTabOrder(a, b); // a to b AND c to d
+setTabOrder(b, c); // a to b to c, but not c to d
+//! [10]
+
+
+//! [11]
+void MyWidget::closeEvent(QCloseEvent *event)
+{
+ QSettings settings("MyCompany", "MyApp");
+ settings.setValue("geometry", saveGeometry());
+ QWidget::closeEvent(event);
+}
+//! [11]
+
+
+//! [12]
+QSettings settings("MyCompany", "MyApp");
+myWidget->restoreGeometry(settings.value("myWidget/geometry").toByteArray());
+//! [12]
+
+
+//! [13]
+setUpdatesEnabled(false);
+bigVisualChanges();
+setUpdatesEnabled(true);
+//! [13]
+
+
+//! [14]
+...
+extern void qt_x11_set_global_double_buffer(bool);
+qt_x11_set_global_double_buffer(false);
+...
+//! [14]
diff --git a/src/widgets/doc/snippets/code/src_gui_painting_qdrawutil.cpp b/src/widgets/doc/snippets/code/src_gui_painting_qdrawutil.cpp
new file mode 100644
index 0000000000..0f70fce8ef
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_painting_qdrawutil.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 documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+QFrame frame:
+frame.setFrameStyle(QFrame::HLine | QFrame::Sunken);
+//! [0]
+
+
+//! [1]
+QFrame frame:
+frame.setFrameStyle(QFrame::Box | QFrame::Raised);
+//! [1]
+
+
+//! [2]
+QFrame frame:
+frame.setFrameStyle( QFrame::Panel | QFrame::Sunken);
+//! [2]
+
+
+//! [3]
+QFrame frame:
+frame.setFrameStyle(QFrame::WinPanel | QFrame::Raised);
+//! [3]
+
+
+//! [4]
+QFrame frame:
+frame.setFrameStyle(QFrame::Box | QFrame::Plain);
+//! [4]
+
+
+//! [5]
+QFrame frame:
+frame.setFrameStyle(QFrame::HLine | QFrame::Sunken);
+//! [5]
+
+
+//! [6]
+QFrame frame:
+frame.setFrameStyle(QFrame::Box | QFrame::Raised);
+//! [6]
+
+
+//! [7]
+QFrame frame:
+frame.setFrameStyle( QFrame::Panel | QFrame::Sunken);
+//! [7]
+
+
+//! [8]
+QFrame frame:
+frame.setFrameStyle(QFrame::WinPanel | QFrame::Raised);
+//! [8]
+
+
+//! [9]
+QFrame frame:
+frame.setFrameStyle(QFrame::Box | QFrame::Plain);
+//! [9]
diff --git a/src/widgets/doc/snippets/code/src_gui_qproxystyle.cpp b/src/widgets/doc/snippets/code/src_gui_qproxystyle.cpp
new file mode 100644
index 0000000000..ae9ff131aa
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_qproxystyle.cpp
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+class MyProxyStyle : public QProxyStyle
+{
+public:
+
+ int styleHint(StyleHint hint, const QStyleOption *option = 0,
+ const QWidget *widget = 0, QStyleHintReturn *returnData = 0) const
+ {
+ if (hint == QStyle::SH_UnderlineShortcut)
+ return 1;
+ return QProxyStyle::styleHint(hint, option, widget, returnData);
+ }
+};
+
+//! [0]
+
+//! [1]
+#include "textedit.h"
+#include <QApplication>
+#include <QProxyStyle>
+
+class MyProxyStyle : public QProxyStyle
+{
+ public:
+ int styleHint(StyleHint hint, const QStyleOption *option = 0,
+ const QWidget *widget = 0, QStyleHintReturn *returnData = 0) const
+ {
+ if (hint == QStyle::SH_UnderlineShortcut)
+ return 0;
+ return QProxyStyle::styleHint(hint, option, widget, returnData);
+ }
+};
+
+int main(int argc, char **argv)
+{
+ Q_INIT_RESOURCE(textedit);
+
+ QApplication a(argc, argv);
+ a.setStyle(new MyProxyStyle);
+ TextEdit mw;
+ mw.resize(700, 800);
+ mw.show();
+ //...
+}
+//! [1]
diff --git a/src/widgets/doc/snippets/code/src_gui_styles_qstyle.cpp b/src/widgets/doc/snippets/code/src_gui_styles_qstyle.cpp
new file mode 100644
index 0000000000..ed4ebb60a4
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_styles_qstyle.cpp
@@ -0,0 +1,48 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+./myapplication -style motif
+//! [0]
+
+
+//! [1]
+./myapplication -style custom
+//! [1]
diff --git a/src/widgets/doc/snippets/code/src_gui_styles_qstyleoption.cpp b/src/widgets/doc/snippets/code/src_gui_styles_qstyleoption.cpp
new file mode 100644
index 0000000000..962212388f
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_styles_qstyleoption.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 documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+int MyStyle::styleHint(StyleHint stylehint, const QStyleOption *opt,
+ const QWidget *widget, QStyleHintReturn* returnData) const;
+{
+ if (stylehint == SH_RubberBand_Mask) {
+ const QStyleHintReturnMask *maskReturn =
+ qstyleoption_cast<const QStyleHintReturnMask *>(hint);
+ if (maskReturn) {
+ ...
+ }
+ }
+ ...
+}
+//! [0]
diff --git a/src/widgets/doc/snippets/code/src_gui_util_qcompleter.cpp b/src/widgets/doc/snippets/code/src_gui_util_qcompleter.cpp
new file mode 100644
index 0000000000..2e8eac17ad
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_util_qcompleter.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 documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+QStringList wordList;
+wordList << "alpha" << "omega" << "omicron" << "zeta";
+
+QLineEdit *lineEdit = new QLineEdit(this);
+
+QCompleter *completer = new QCompleter(wordList, this);
+completer->setCaseSensitivity(Qt::CaseInsensitive);
+lineEdit->setCompleter(completer);
+//! [0]
+
+
+//! [1]
+QCompleter *completer = new QCompleter(this);
+completer->setModel(new QDirModel(completer));
+lineEdit->setCompleter(completer);
+//! [1]
+
+
+//! [2]
+for (int i = 0; completer->setCurrentRow(i); i++)
+ qDebug() << completer->currentCompletion() << " is match number " << i;
+//! [2]
diff --git a/src/widgets/doc/snippets/code/src_gui_util_qundostack.cpp b/src/widgets/doc/snippets/code/src_gui_util_qundostack.cpp
new file mode 100644
index 0000000000..7e06a8ef6f
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_util_qundostack.cpp
@@ -0,0 +1,109 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+class AppendText : public QUndoCommand
+{
+public:
+ AppendText(QString *doc, const QString &text)
+ : m_document(doc), m_text(text) { setText("append text"); }
+ virtual void undo()
+ { m_document->chop(m_text.length()); }
+ virtual void redo()
+ { m_document->append(m_text); }
+private:
+ QString *m_document;
+ QString m_text;
+};
+//! [0]
+
+
+//! [1]
+MyCommand *command1 = new MyCommand();
+stack->push(command1);
+MyCommand *command2 = new MyCommand();
+stack->push(command2);
+
+stack->undo();
+
+MyCommand *command3 = new MyCommand();
+stack->push(command3); // command2 gets deleted
+//! [1]
+
+
+//! [2]
+QUndoCommand *insertRed = new QUndoCommand(); // an empty command
+insertRed->setText("insert red text");
+
+new InsertText(document, idx, text, insertRed); // becomes child of insertRed
+new SetColor(document, idx, text.length(), Qt::red, insertRed);
+
+stack.push(insertRed);
+//! [2]
+
+
+//! [3]
+bool AppendText::mergeWith(const QUndoCommand *other)
+{
+ if (other->id() != id()) // make sure other is also an AppendText command
+ return false;
+ m_text += static_cast<const AppendText*>(other)->m_text;
+ return true;
+}
+//! [3]
+
+
+//! [4]
+stack.beginMacro("insert red text");
+stack.push(new InsertText(document, idx, text));
+stack.push(new SetColor(document, idx, text.length(), Qt::red));
+stack.endMacro(); // indexChanged() is emitted
+//! [4]
+
+
+//! [5]
+QUndoCommand *insertRed = new QUndoCommand(); // an empty command
+insertRed->setText("insert red text");
+
+new InsertText(document, idx, text, insertRed); // becomes child of insertRed
+new SetColor(document, idx, text.length(), Qt::red, insertRed);
+
+stack.push(insertRed);
+//! [5]
diff --git a/src/widgets/doc/snippets/code/src_gui_widgets_qabstractbutton.cpp b/src/widgets/doc/snippets/code/src_gui_widgets_qabstractbutton.cpp
new file mode 100644
index 0000000000..948ed0e958
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_widgets_qabstractbutton.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 documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+QPushButton *button = new QPushButton(tr("Ro&ck && Roll"), this);
+//! [0]
+
+
+//! [1]
+button->setIcon(QIcon(":/images/print.png"));
+button->setShortcut(tr("Alt+F7"));
+//! [1]
+
+
+//! [2]
+void MyWidget::reactToToggle(bool checked)
+{
+ if (checked) {
+ // Examine the new button states.
+ ...
+ }
+}
+//! [2]
diff --git a/src/widgets/doc/snippets/code/src_gui_widgets_qabstractspinbox.cpp b/src/widgets/doc/snippets/code/src_gui_widgets_qabstractspinbox.cpp
new file mode 100644
index 0000000000..66f3449760
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_widgets_qabstractspinbox.cpp
@@ -0,0 +1,48 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+QSpinBox *spinBox = new QSpinBox(this);
+spinBox->setRange(0, 100);
+spinBox->setWrapping(true);
+spinBox->setValue(100);
+spinBox->stepBy(1);
+// value is 0
+//! [0]
diff --git a/src/widgets/doc/snippets/code/src_gui_widgets_qcalendarwidget.cpp b/src/widgets/doc/snippets/code/src_gui_widgets_qcalendarwidget.cpp
new file mode 100644
index 0000000000..6f99bdf0ce
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_widgets_qcalendarwidget.cpp
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+QCalendarWidget *calendar;
+calendar->setGridVisible(true);
+//! [0]
+
+
+//! [1]
+QCalendarWidget *calendar;
+calendar->setGridVisible(true);
+calendar->setMinimumDate(QDate(2006, 6, 19));
+//! [1]
+
+
+//! [2]
+QCalendarWidget *calendar;
+calendar->setGridVisible(true);
+calendar->setMaximumDate(QDate(2006, 7, 3));
+//! [2]
+
+
+//! [3]
+QCalendarWidget *calendar;
+
+calendar->setDateRange(min, max);
+//! [3]
+
+
+//! [4]
+QCalendarWidget *calendar;
+
+calendar->setMinimumDate(min);
+calendar->setMaximumDate(max);
+//! [4]
+
+
+//! [5]
+QCalendarWidget *calendar;
+calendar->setGridVisible(true);
+//! [5]
diff --git a/src/widgets/doc/snippets/code/src_gui_widgets_qcheckbox.cpp b/src/widgets/doc/snippets/code/src_gui_widgets_qcheckbox.cpp
new file mode 100644
index 0000000000..71ee59bc85
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_widgets_qcheckbox.cpp
@@ -0,0 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+QCheckBox *checkbox = new QCheckBox("C&ase sensitive", this);
+//! [0]
diff --git a/src/widgets/doc/snippets/code/src_gui_widgets_qdatetimeedit.cpp b/src/widgets/doc/snippets/code/src_gui_widgets_qdatetimeedit.cpp
new file mode 100644
index 0000000000..5eb9e739ea
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_widgets_qdatetimeedit.cpp
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+QDateTimeEdit *dateEdit = new QDateTimeEdit(QDate::currentDate());
+dateEdit->setMinimumDate(QDate::currentDate().addDays(-365));
+dateEdit->setMaximumDate(QDate::currentDate().addDays(365));
+dateEdit->setDisplayFormat("yyyy.MM.dd");
+//! [0]
+
+
+//! [1]
+setDateTimeRange(min, max);
+//! [1]
+
+
+//! [2]
+setMinimumDateTime(min);
+setMaximumDateTime(max);
+//! [2]
+
+
+//! [3]
+setDateRange(min, max);
+//! [3]
+
+
+//! [4]
+setMinimumDate(min);
+setMaximumDate(max);
+//! [4]
+
+
+//! [5]
+setTimeRange(min, max);
+//! [5]
+
+
+//! [6]
+setMinimumTime(min);
+setMaximumTime(max);
+//! [6]
diff --git a/src/widgets/doc/snippets/code/src_gui_widgets_qdockwidget.cpp b/src/widgets/doc/snippets/code/src_gui_widgets_qdockwidget.cpp
new file mode 100644
index 0000000000..690e3d5f33
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_widgets_qdockwidget.cpp
@@ -0,0 +1,48 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+QDockWidget *dockWidget = qobject_cast<QDockWidget*>(parentWidget());
+if (dockWidget->features() & QDockWidget::DockWidgetVerticalTitleBar) {
+ // I need to be vertical
+} else {
+ // I need to be horizontal
+}
+//! [0]
diff --git a/src/widgets/doc/snippets/code/src_gui_widgets_qframe.cpp b/src/widgets/doc/snippets/code/src_gui_widgets_qframe.cpp
new file mode 100644
index 0000000000..6e3afcd8cf
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_widgets_qframe.cpp
@@ -0,0 +1,48 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+QLabel label(...);
+label.setFrameStyle(QFrame::Panel | QFrame::Raised);
+label.setLineWidth(2);
+
+QProgressBar pbar(...);
+label.setFrameStyle(QFrame::NoFrame);
+//! [0]
diff --git a/src/widgets/doc/snippets/code/src_gui_widgets_qgroupbox.cpp b/src/widgets/doc/snippets/code/src_gui_widgets_qgroupbox.cpp
new file mode 100644
index 0000000000..fc0339f690
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_widgets_qgroupbox.cpp
@@ -0,0 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+g->setTitle("&User information");
+//! [0]
diff --git a/src/widgets/doc/snippets/code/src_gui_widgets_qlabel.cpp b/src/widgets/doc/snippets/code/src_gui_widgets_qlabel.cpp
new file mode 100644
index 0000000000..83b02a2f22
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_widgets_qlabel.cpp
@@ -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 documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+QLabel *label = new QLabel(this);
+label->setFrameStyle(QFrame::Panel | QFrame::Sunken);
+label->setText("first line\nsecond line");
+label->setAlignment(Qt::AlignBottom | Qt::AlignRight);
+//! [0]
+
+
+//! [1]
+QLineEdit* phoneEdit = new QLineEdit(this);
+QLabel* phoneLabel = new QLabel("&Phone:", this);
+phoneLabel->setBuddy(phoneEdit);
+//! [1]
+
+
+//! [2]
+QLineEdit *nameEd = new QLineEdit(this);
+QLabel *nameLb = new QLabel("&Name:", this);
+nameLb->setBuddy(nameEd);
+QLineEdit *phoneEd = new QLineEdit(this);
+QLabel *phoneLb = new QLabel("&Phone:", this);
+phoneLb->setBuddy(phoneEd);
+// (layout setup not shown)
+//! [2]
diff --git a/src/widgets/doc/snippets/code/src_gui_widgets_qlineedit.cpp b/src/widgets/doc/snippets/code/src_gui_widgets_qlineedit.cpp
new file mode 100644
index 0000000000..12ed38ad65
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_widgets_qlineedit.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 documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+void LineEdit::contextMenuEvent(QContextMenuEvent *event)
+{
+ QMenu *menu = createStandardContextMenu();
+ menu->addAction(tr("My Menu Item"));
+ //...
+ menu->exec(event->globalPos());
+ delete menu;
+}
+//! [0]
diff --git a/src/widgets/doc/snippets/code/src_gui_widgets_qmainwindow.cpp b/src/widgets/doc/snippets/code/src_gui_widgets_qmainwindow.cpp
new file mode 100644
index 0000000000..3558922ec9
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_widgets_qmainwindow.cpp
@@ -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 documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+void MyMainWindow::closeEvent(QCloseEvent *event)
+{
+ QSettings settings("MyCompany", "MyApp");
+ settings.setValue("geometry", saveGeometry());
+ settings.setValue("windowState", saveState());
+ QMainWindow::closeEvent(event);
+}
+//! [0]
+
+
+//! [1]
+void MainWindow::readSettings()
+{
+ QSettings settings("MyCompany", "MyApp");
+ restoreGeometry(settings.value("myWidget/geometry").toByteArray());
+ restoreState(settings.value("myWidget/windowState").toByteArray());
+}
+//! [1]
diff --git a/src/widgets/doc/snippets/code/src_gui_widgets_qmenu.cpp b/src/widgets/doc/snippets/code/src_gui_widgets_qmenu.cpp
new file mode 100644
index 0000000000..5799248bf4
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_widgets_qmenu.cpp
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+exec(QCursor::pos());
+//! [0]
+
+
+//! [1]
+exec(somewidget.mapToGlobal(QPoint(0,0)));
+//! [1]
+
+
+//! [2]
+exec(e->globalPos());
+//! [2]
+
+
+//! [3]
+exec(QCursor::pos());
+//! [3]
+
+
+//! [4]
+exec(somewidget.mapToGlobal(QPoint(0, 0)));
+//! [4]
+
+
+//! [5]
+exec(e->globalPos());
+//! [5]
+
+
+//! [6]
+QMenu menu;
+QAction *at = actions[0]; // Assumes actions is not empty
+foreach (QAction *a, actions)
+ menu.addAction(a);
+menu.exec(pos, at);
+//! [6]
diff --git a/src/widgets/doc/snippets/code/src_gui_widgets_qmenubar.cpp b/src/widgets/doc/snippets/code/src_gui_widgets_qmenubar.cpp
new file mode 100644
index 0000000000..412bc2d5eb
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_widgets_qmenubar.cpp
@@ -0,0 +1,48 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+menubar->addMenu(fileMenu);
+//! [0]
+
+
+//! [1]
+QMenuBar *menuBar = new QMenuBar(0);
+//! [1]
diff --git a/src/widgets/doc/snippets/code/src_gui_widgets_qplaintextedit.cpp b/src/widgets/doc/snippets/code/src_gui_widgets_qplaintextedit.cpp
new file mode 100644
index 0000000000..931c6c69a6
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_widgets_qplaintextedit.cpp
@@ -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 documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+void MyQPlainTextEdit::contextMenuEvent(QContextMenuEvent *event)
+{
+ QMenu *menu = createStandardContextMenu();
+ menu->addAction(tr("My Menu Item"));
+ //...
+ menu->exec(event->globalPos());
+ delete menu;
+}
+//! [0]
+
+
+//! [1]
+edit->textCursor().insertText(text);
+//! [1]
diff --git a/src/widgets/doc/snippets/code/src_gui_widgets_qpushbutton.cpp b/src/widgets/doc/snippets/code/src_gui_widgets_qpushbutton.cpp
new file mode 100644
index 0000000000..e0ae945620
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_widgets_qpushbutton.cpp
@@ -0,0 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+QPushButton *button = new QPushButton("&Download", this);
+//! [0]
diff --git a/src/widgets/doc/snippets/code/src_gui_widgets_qradiobutton.cpp b/src/widgets/doc/snippets/code/src_gui_widgets_qradiobutton.cpp
new file mode 100644
index 0000000000..a93809fa5d
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_widgets_qradiobutton.cpp
@@ -0,0 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+QRadioButton *button = new QRadioButton("Search from the &cursor", this);
+//! [0]
diff --git a/src/widgets/doc/snippets/code/src_gui_widgets_qrubberband.cpp b/src/widgets/doc/snippets/code/src_gui_widgets_qrubberband.cpp
new file mode 100644
index 0000000000..b8d6a14d1c
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_widgets_qrubberband.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+void Widget::mousePressEvent(QMouseEvent *event)
+{
+ origin = event->pos();
+ if (!rubberBand)
+ rubberBand = new QRubberBand(QRubberBand::Rectangle, this);
+ rubberBand->setGeometry(QRect(origin, QSize()));
+ rubberBand->show();
+}
+
+void Widget::mouseMoveEvent(QMouseEvent *event)
+{
+ rubberBand->setGeometry(QRect(origin, event->pos()).normalized());
+}
+
+void Widget::mouseReleaseEvent(QMouseEvent *event)
+{
+ rubberBand->hide();
+ // determine selection, for example using QRect::intersects()
+ // and QRect::contains().
+}
+//! [0]
diff --git a/src/widgets/doc/snippets/code/src_gui_widgets_qscrollarea.cpp b/src/widgets/doc/snippets/code/src_gui_widgets_qscrollarea.cpp
new file mode 100644
index 0000000000..9c90a0c53d
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_widgets_qscrollarea.cpp
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+QLabel *imageLabel = new QLabel;
+QImage image("happyguy.png");
+imageLabel->setPixmap(QPixmap::fromImage(image));
+
+scrollArea = new QScrollArea;
+scrollArea->setBackgroundRole(QPalette::Dark);
+scrollArea->setWidget(imageLabel);
+//! [0]
diff --git a/src/widgets/doc/snippets/code/src_gui_widgets_qspinbox.cpp b/src/widgets/doc/snippets/code/src_gui_widgets_qspinbox.cpp
new file mode 100644
index 0000000000..fc1f5b7e47
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_widgets_qspinbox.cpp
@@ -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 documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+sb->setPrefix("$");
+//! [0]
+
+
+//! [1]
+sb->setSuffix(" km");
+//! [1]
+
+
+//! [2]
+setRange(minimum, maximum);
+//! [2]
+
+
+//! [3]
+setMinimum(minimum);
+setMaximum(maximum);
+//! [3]
+
+
+//! [4]
+spinbox->setPrefix("$");
+//! [4]
+
+
+//! [5]
+spinbox->setSuffix(" km");
+//! [5]
+
+
+//! [6]
+setRange(minimum, maximum);
+//! [6]
+
+
+//! [7]
+setMinimum(minimum);
+setMaximum(maximum);
+//! [7]
diff --git a/src/widgets/doc/snippets/code/src_gui_widgets_qsplashscreen.cpp b/src/widgets/doc/snippets/code/src_gui_widgets_qsplashscreen.cpp
new file mode 100644
index 0000000000..48f1051e2c
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_widgets_qsplashscreen.cpp
@@ -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 documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+QPixmap pixmap(":/splash.png");
+QSplashScreen *splash = new QSplashScreen(pixmap);
+splash->show();
+
+... // Loading some items
+splash->showMessage("Loaded modules");
+
+qApp->processEvents();
+
+... // Establishing connections
+splash->showMessage("Established connections");
+
+qApp->processEvents();
+//! [0]
diff --git a/src/widgets/doc/snippets/code/src_gui_widgets_qsplitter.cpp b/src/widgets/doc/snippets/code/src_gui_widgets_qsplitter.cpp
new file mode 100644
index 0000000000..18007a4cdf
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_widgets_qsplitter.cpp
@@ -0,0 +1,47 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+QWidget *widget = splitter->widget(index);
+QSizePolicy policy = widget->sizePolicy();
+policy.setHorizontalStretch(stretch);
+policy.setVerticalStretch(stretch);
+widget->setSizePolicy(policy);
+//! [0]
diff --git a/src/widgets/doc/snippets/code/src_gui_widgets_qstatusbar.cpp b/src/widgets/doc/snippets/code/src_gui_widgets_qstatusbar.cpp
new file mode 100644
index 0000000000..6ea752b237
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_widgets_qstatusbar.cpp
@@ -0,0 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+statusBar()->addWidget(new MyReadWriteIndication);
+//! [0]
diff --git a/src/widgets/doc/snippets/code/src_gui_widgets_qtextbrowser.cpp b/src/widgets/doc/snippets/code/src_gui_widgets_qtextbrowser.cpp
new file mode 100644
index 0000000000..ed30c2d80a
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_widgets_qtextbrowser.cpp
@@ -0,0 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+backaction.setToolTip(browser.historyTitle(-1));
+forwardaction.setToolTip(browser.historyTitle(+1));
+//! [0]
diff --git a/src/widgets/doc/snippets/code/src_gui_widgets_qtextedit.cpp b/src/widgets/doc/snippets/code/src_gui_widgets_qtextedit.cpp
new file mode 100644
index 0000000000..cd1ae62c84
--- /dev/null
+++ b/src/widgets/doc/snippets/code/src_gui_widgets_qtextedit.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 documentation 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$
+**
+****************************************************************************/
+
+//! [0]
+void MyTextEdit::contextMenuEvent(QContextMenuEvent *event)
+{
+ QMenu *menu = createStandardContextMenu();
+ menu->addAction(tr("My Menu Item"));
+ //...
+ menu->exec(event->globalPos());
+ delete menu;
+}
+//! [0]
+
+
+//! [1]
+edit->textCursor().insertText(text);
+//! [1]
+
+
+//! [2]
+edit->textCursor().insertHtml(fragment);
+//! [2]
diff --git a/src/widgets/doc/snippets/customstyle/customstyle.cpp b/src/widgets/doc/snippets/customstyle/customstyle.cpp
new file mode 100644
index 0000000000..2e0843c49c
--- /dev/null
+++ b/src/widgets/doc/snippets/customstyle/customstyle.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 documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+
+#include "customstyle.h"
+
+CustomStyle::CustomStyle()
+{
+//! [0]
+ QSpinBox *spinBox = qobject_cast<QSpinBox *>(widget);
+ if (spinBox) {
+//! [0] //! [1]
+ }
+//! [1]
+}
+
+//! [2]
+void CustomStyle::drawPrimitive(PrimitiveElement element, const QStyleOption *option,
+ QPainter *painter, const QWidget *widget) const
+{
+ if (element == PE_IndicatorSpinUp || element == PE_IndicatorSpinDown) {
+ QPolygon points(3);
+ int x = option->rect.x();
+ int y = option->rect.y();
+ int w = option->rect.width() / 2;
+ int h = option->rect.height() / 2;
+ x += (option->rect.width() - w) / 2;
+ y += (option->rect.height() - h) / 2;
+
+ if (element == PE_IndicatorSpinUp) {
+ points[0] = QPoint(x, y + h);
+ points[1] = QPoint(x + w, y + h);
+ points[2] = QPoint(x + w / 2, y);
+ } else { // PE_SpinBoxDown
+ points[0] = QPoint(x, y);
+ points[1] = QPoint(x + w, y);
+ points[2] = QPoint(x + w / 2, y + h);
+ }
+
+ if (option->state & State_Enabled) {
+ painter->setPen(option->palette.mid().color());
+ painter->setBrush(option->palette.buttonText());
+ } else {
+ painter->setPen(option->palette.buttonText().color());
+ painter->setBrush(option->palette.mid());
+ }
+ painter->drawPolygon(points);
+ } else {
+ QWindowsStyle::drawPrimitive(element, option, painter, widget);
+//! [2] //! [3]
+ }
+//! [3] //! [4]
+}
+//! [4]
diff --git a/src/widgets/doc/snippets/customstyle/customstyle.h b/src/widgets/doc/snippets/customstyle/customstyle.h
new file mode 100644
index 0000000000..437994d2e2
--- /dev/null
+++ b/src/widgets/doc/snippets/customstyle/customstyle.h
@@ -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 documentation 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 CUSTOMSTYLE_H
+#define CUSTOMSTYLE_H
+
+#include <QWindowsStyle>
+
+//! [0]
+class CustomStyle : public QWindowsStyle
+{
+ Q_OBJECT
+
+public:
+ CustomStyle()
+ ~CustomStyle() {}
+
+ void drawPrimitive(PrimitiveElement element, const QStyleOption *option,
+ QPainter *painter, const QWidget *widget) const;
+};
+//! [0]
+
+#endif
diff --git a/src/widgets/doc/snippets/customstyle/customstyle.pro b/src/widgets/doc/snippets/customstyle/customstyle.pro
new file mode 100644
index 0000000000..af0ee4e141
--- /dev/null
+++ b/src/widgets/doc/snippets/customstyle/customstyle.pro
@@ -0,0 +1,2 @@
+HEADERS += customstyle.h
+SOURCES += customstyle.cpp main.cpp
diff --git a/src/widgets/doc/snippets/customstyle/main.cpp b/src/widgets/doc/snippets/customstyle/main.cpp
new file mode 100644
index 0000000000..b3bea3bd7b
--- /dev/null
+++ b/src/widgets/doc/snippets/customstyle/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 documentation 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$
+**
+****************************************************************************/
+
+//! [using a custom style]
+#include <QtGui>
+
+#include "customstyle.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication::setStyle(new CustomStyle);
+ QApplication app(argc, argv);
+ QSpinBox spinBox;
+ spinBox.show();
+ return app.exec();
+}
+//! [using a custom style]
diff --git a/src/widgets/doc/snippets/customviewstyle.cpp b/src/widgets/doc/snippets/customviewstyle.cpp
new file mode 100644
index 0000000000..55a766d17d
--- /dev/null
+++ b/src/widgets/doc/snippets/customviewstyle.cpp
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+
+#include "customviewstyle.h"
+
+
+
+void CustomViewStyle::drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const
+{
+
+//![0]
+ switch (element) {
+ case (PE_PanelItemViewItem): {
+ painter->save();
+
+ QPoint topLeft = option->rect.topLeft();
+ QPoint bottomRight = option->rect.topRight();
+ QLinearGradient backgroundGradient(topLeft, bottomRight);
+ backgroundGradient.setColorAt(0.0, QColor(Qt::yellow).lighter(190));
+ backgroundGradient.setColorAt(1.0, Qt::white);
+ painter->fillRect(option->rect, QBrush(backgroundGradient));
+
+ painter->restore();
+ break;
+ }
+ default:
+ QWindowsStyle::drawPrimitive(element, option, painter, widget);
+ }
+//![0]
+}
diff --git a/src/widgets/doc/snippets/dialogs/dialogs.cpp b/src/widgets/doc/snippets/dialogs/dialogs.cpp
new file mode 100644
index 0000000000..78916f862c
--- /dev/null
+++ b/src/widgets/doc/snippets/dialogs/dialogs.cpp
@@ -0,0 +1,268 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+
+typedef QDialog WordCountDialog;
+typedef QDialog FindDialog;
+
+#define this 0
+#define setWordCount(x) isVisible()
+
+QString tr(const char *text)
+{
+ return QApplication::translate(text, text);
+}
+
+class EditorWindow : public QMainWindow
+{
+public:
+ void find();
+ void countWords();
+
+private:
+ FindDialog *findDialog;
+};
+
+//! [0]
+void EditorWindow::find()
+{
+ if (!findDialog) {
+ findDialog = new FindDialog(this);
+ connect(findDialog, SIGNAL(findNext()), this, SLOT(findNext()));
+ }
+
+ findDialog->show();
+ findDialog->raise();
+ findDialog->activateWindow();
+}
+//! [0]
+
+//! [1]
+void EditorWindow::countWords()
+{
+ WordCountDialog dialog(this);
+ dialog.setWordCount(document().wordCount());
+ dialog.exec();
+}
+//! [1]
+
+inline bool boo()
+{
+ QMessageBox::information(this, "Application name",
+ "Unable to find the user preferences file.\n"
+ "The factory default will be used instead.");
+
+ QString filename;
+ if (QFile::exists(filename) &&
+ QMessageBox::question(
+ this,
+ tr("Overwrite File? -- Application Name"),
+ tr("A file called %1 already exists."
+ "Do you want to overwrite it?")
+ .arg(filename),
+ tr("&Yes"), tr("&No"),
+ QString(), 0, 1))
+ return false;
+
+ switch(QMessageBox::warning(this, "Application name",
+ "Could not connect to the <mumble> server.\n"
+ "This program can't function correctly "
+ "without the server.\n\n",
+ "Retry",
+ "Quit", 0, 0, 1)) {
+ case 0: // The user clicked the Retry again button or pressed Enter
+ // try again
+ break;
+ case 1: // The user clicked the Quit or pressed Escape
+ // exit
+ break;
+ }
+
+ switch(QMessageBox::information(this, "Application name here",
+ "The document contains unsaved changes\n"
+ "Do you want to save the changes before exiting?",
+ "&Save", "&Discard", "Cancel",
+ 0, // Enter == button 0
+ 2)) { // Escape == button 2
+ case 0: // Save clicked or Alt+S pressed or Enter pressed.
+ // save
+ break;
+ case 1: // Discard clicked or Alt+D pressed
+ // don't save but exit
+ break;
+ case 2: // Cancel clicked or Escape pressed
+ // don't exit
+ break;
+ }
+
+ switch(QMessageBox::warning(this, "Application name here",
+ "Could not save the user preferences,\n"
+ "because the disk is full. You can delete\n"
+ "some files and press Retry, or you can\n"
+ "abort the Save Preferences operation.",
+ QMessageBox::Retry | QMessageBox::Default,
+ QMessageBox::Abort | QMessageBox::Escape)) {
+ case QMessageBox::Retry: // Retry clicked or Enter pressed
+ // try again
+ break;
+ case QMessageBox::Abort: // Abort clicked or Escape pressed
+ // abort
+ break;
+ }
+
+ QString errorDetails;
+ QMessageBox::critical(0, "Application name here",
+ QString("An internal error occurred. Please ") +
+ "call technical support at 1234-56789 and report\n"+
+ "these numbers:\n\n" + errorDetails +
+ "\n\nApplication will now exit.");
+
+ QMessageBox::about(this, "About <Application>",
+ "<Application> is a <one-paragraph blurb>\n\n"
+ "Copyright 1991-2003 Such-and-such. "
+ "<License words here.>\n\n"
+ "For technical support, call 1234-56789 or see\n"
+ "http://www.such-and-such.com/Application/\n");
+
+ {
+ // saving the file
+ QMessageBox mb("Application name here",
+ "Saving the file will overwrite the original file on the disk.\n"
+ "Do you really want to save?",
+ QMessageBox::Information,
+ QMessageBox::Yes | QMessageBox::Default,
+ QMessageBox::No,
+ QMessageBox::Cancel | QMessageBox::Escape);
+ mb.setButtonText(QMessageBox::Yes, "Save");
+ mb.setButtonText(QMessageBox::No, "Discard");
+ switch(mb.exec()) {
+ case QMessageBox::Yes:
+ // save and exit
+ break;
+ case QMessageBox::No:
+ // exit without saving
+ break;
+ case QMessageBox::Cancel:
+ // don't save and don't exit
+ break;
+ }
+ }
+
+ {
+ // hardware failure
+//! [2]
+ QMessageBox mb("Application Name",
+ "Hardware failure.\n\nDisk error detected\nDo you want to stop?",
+ QMessageBox::Question,
+ QMessageBox::Yes | QMessageBox::Default,
+ QMessageBox::No | QMessageBox::Escape,
+ QMessageBox::NoButton);
+ if (mb.exec() == QMessageBox::No) {
+ // try again
+//! [2]
+ }
+ }
+}
+
+inline void moo()
+{
+ int numFiles;
+//! [3]
+ QProgressDialog progress("Copying files...", "Abort Copy", 0, numFiles, this);
+ progress.setWindowModality(Qt::WindowModal);
+
+ for (int i = 0; i < numFiles; i++) {
+ progress.setValue(i);
+
+ if (progress.wasCanceled())
+ break;
+ //... copy one file
+ }
+ progress.setValue(numFiles);
+//! [3]
+}
+
+class Operation : public QObject
+{
+public:
+ Operation(QObject *parent);
+ void perform();
+ void cancel();
+
+private:
+ int steps;
+ QProgressDialog *pd;
+ QTimer *t;
+};
+
+//! [4]
+// Operation constructor
+Operation::Operation(QObject *parent)
+ : QObject(parent), steps(0)
+{
+ pd = new QProgressDialog("Operation in progress.", "Cancel", 0, 100);
+ connect(pd, SIGNAL(canceled()), this, SLOT(cancel()));
+ t = new QTimer(this);
+ connect(t, SIGNAL(timeout()), this, SLOT(perform()));
+ t->start(0);
+}
+//! [4] //! [5]
+
+void Operation::perform()
+{
+ pd->setValue(steps);
+ //... perform one percent of the operation
+ steps++;
+ if (steps > pd->maximum())
+ t->stop();
+}
+//! [5] //! [6]
+
+void Operation::cancel()
+{
+ t->stop();
+ //... cleanup
+}
+//! [6]
+
+int main()
+{
+}
diff --git a/src/widgets/doc/snippets/filedialogurls.cpp b/src/widgets/doc/snippets/filedialogurls.cpp
new file mode 100644
index 0000000000..b1e41cbcad
--- /dev/null
+++ b/src/widgets/doc/snippets/filedialogurls.cpp
@@ -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 documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+
+int main(int argv, char **args)
+{
+ QApplication app(argv, args);
+
+//![0]
+ QList<QUrl> urls;
+ urls << QUrl::fromLocalFile("/home/gvatteka/dev/qt-45")
+ << QUrl::fromLocalFile(QDesktopServices::storageLocation(QDesktopServices::MusicLocation));
+
+ QFileDialog dialog;
+ dialog.setSidebarUrls(urls);
+ dialog.setFileMode(QFileDialog::AnyFile);
+ if(dialog.exec()) {
+ // ...
+ }
+//![0]
+
+ return app.exec();
+}
diff --git a/src/widgets/doc/snippets/graphicssceneadditemsnippet.cpp b/src/widgets/doc/snippets/graphicssceneadditemsnippet.cpp
new file mode 100644
index 0000000000..1130a59217
--- /dev/null
+++ b/src/widgets/doc/snippets/graphicssceneadditemsnippet.cpp
@@ -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 documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+
+class CustomScene : public QGraphicsScene
+{
+public:
+ CustomScene()
+ { addItem(new QGraphicsEllipseItem(QRect(10, 10, 30, 30))); }
+
+ void drawItems(QPainter *painter, int numItems, QGraphicsItem *items[],
+ const QStyleOptionGraphicsItem options[],
+ QWidget *widget = 0);
+};
+
+//! [0]
+void CustomScene::drawItems(QPainter *painter, int numItems,
+ QGraphicsItem *items[],
+ const QStyleOptionGraphicsItem options[],
+ QWidget *widget)
+{
+ for (int i = 0; i < numItems; ++i) {
+ // Draw the item
+ painter->save();
+ painter->setMatrix(items[i]->sceneMatrix(), true);
+ items[i]->paint(painter, &options[i], widget);
+ painter->restore();
+ }
+}
+//! [0]
+
+int main(int argv, char **args)
+{
+ QApplication app(argv, args);
+
+ CustomScene scene;
+ QGraphicsView view(&scene);
+
+ view.show();
+
+ return app.exec();
+}
diff --git a/src/widgets/doc/snippets/javastyle.cpp b/src/widgets/doc/snippets/javastyle.cpp
new file mode 100644
index 0000000000..a00df57e82
--- /dev/null
+++ b/src/widgets/doc/snippets/javastyle.cpp
@@ -0,0 +1,2745 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+
+#include "javastyle.h"
+#include <math.h>
+
+static const int windowsItemFrame = 2;
+static const int windowsSepHeight = 2;
+static const int windowsItemHMargin = 3;
+static const int windowsItemVMargin = 2;
+static const int windowsArrowHMargin = 6;
+static const int windowsTabSpacing = 12;
+static const int windowsCheckMarkHMargin = 2;
+static const int windowsRightBorder = 15;
+static const int windowsCheckMarkWidth = 12;
+
+JavaStyle::JavaStyle()
+{
+ qApp->setPalette(standardPalette());
+}
+
+
+inline QPoint JavaStyle::adjustScrollPoint(const QPoint &point,
+ Qt::Orientation orientation,
+ bool add) const
+{
+ int adder = add ? -1 : 1;
+ QPoint retPoint;
+
+ if (orientation == Qt::Horizontal) {
+ retPoint = QPoint(point.y() * adder, point.x());
+ } else {
+ retPoint = QPoint(point.x(), point.y() * adder);
+ }
+
+ return retPoint;
+}
+
+QPalette JavaStyle::standardPalette() const
+{
+ QPalette palette = QWindowsStyle::standardPalette();
+
+ palette.setBrush(QPalette::Active, QPalette::Button,
+ QColor(184, 207, 229));
+ palette.setBrush(QPalette::Active, QPalette::WindowText,
+ Qt::black);
+ palette.setBrush(QPalette::Active, QPalette::Background,
+ QColor(238, 238, 238));
+ palette.setBrush(QPalette::Active, QPalette::Window,
+ QColor(238 ,238, 238));
+ palette.setBrush(QPalette::Active, QPalette::Base, Qt::white);
+ palette.setBrush(QPalette::Active, QPalette::AlternateBase, QColor(238, 238, 238));
+ palette.setBrush(QPalette::Active, QPalette::Text, Qt::black);
+ palette.setBrush(QPalette::Active, QPalette::BrightText, Qt::white);
+
+ palette.setBrush(QPalette::Active, QPalette::Light, QColor(163, 184, 204)); // focusFrameColor
+ palette.setBrush(QPalette::Active, QPalette::Midlight, QColor(99, 130, 191)); // tabBarBorderColor
+ palette.setBrush(QPalette::Active, QPalette::Dark, QColor(106, 104, 100));
+ palette.setBrush(QPalette::Active, QPalette::Mid, QColor(122, 138, 153)); //defaultFrameColor
+ palette.setBrush(QPalette::Active, QPalette::Shadow, QColor(122, 138, 153)); // defaultFrame
+
+ palette.setBrush(QPalette::Active, QPalette::Highlight, QColor(184, 207, 229));
+ palette.setBrush(QPalette::Active, QPalette::HighlightedText, Qt::black);
+
+ palette.setBrush(QPalette::Inactive, QPalette::Highlight, QColor(184, 207, 229));
+ palette.setBrush(QPalette::Inactive, QPalette::HighlightedText, Qt::black);
+
+ palette.setBrush(QPalette::Disabled, QPalette::Button,
+ QColor(238, 238, 238));
+ palette.setBrush(QPalette::Disabled, QPalette::WindowText,
+ QColor(153, 153, 153));
+ palette.setBrush(QPalette::Disabled, QPalette::Background, QColor(238, 238, 238));
+
+ palette.setBrush(QPalette::Inactive, QPalette::Button,
+ QColor(184, 207, 229));
+ palette.setBrush(QPalette::Inactive, QPalette::Background,
+ QColor(238, 238, 238));
+ palette.setBrush(QPalette::Inactive, QPalette::Window,
+ QColor(238 ,238, 238));
+ palette.setBrush(QPalette::Inactive, QPalette::Light, QColor(163, 184, 204)); // focusFrameColor
+ palette.setBrush(QPalette::Inactive, QPalette::Midlight, QColor(99, 130, 191)); // tabBarBorderColor
+ palette.setBrush(QPalette::Inactive, QPalette::Dark,QColor(106, 104, 100));
+ palette.setBrush(QPalette::Inactive, QPalette::Mid, QColor(122, 138, 153)); //defaultFrame
+ palette.setBrush(QPalette::Inactive, QPalette::Shadow, QColor(122, 138, 153)); // defaultFrame
+
+ return palette;
+}
+
+inline void JavaStyle::drawScrollBarArrow(const QRect &rect, QPainter *painter,
+ const QStyleOptionSlider *option,
+ bool add) const
+{
+
+ painter->save();
+
+ Qt::Orientation orient = option->orientation;
+ QPoint offset;
+
+ if (add) {
+ if (orient == Qt::Vertical) {
+ offset = rect.bottomLeft();
+ } else {
+ offset = rect.topRight();
+ }
+ } else {
+ offset = rect.topLeft();
+ }
+
+ QPainterPath arrow;
+ arrow.moveTo(offset + adjustScrollPoint(QPoint(4, 8), orient, add));
+ arrow.lineTo(offset + adjustScrollPoint(QPoint(7, 5), orient, add));
+ arrow.lineTo(offset + adjustScrollPoint(QPoint(8, 5), orient, add));
+ arrow.lineTo(offset + adjustScrollPoint(QPoint(11, 8), orient, add));
+ arrow.lineTo(offset + adjustScrollPoint(QPoint(4, 8), orient, add));
+
+ QColor fillColor;
+ if (option->state & State_Sunken)
+ fillColor = QColor(option->palette.color(QPalette::Button));
+ else
+ fillColor = option->palette.color(QPalette::Background);
+
+ painter->fillRect(rect, fillColor);
+
+ painter->setPen(option->palette.color(QPalette::Base));
+ int adjust = option->state & State_Sunken ? 0 : 1;
+ painter->drawRect(rect.adjusted(adjust, adjust, -1, -1));
+ painter->setPen(option->palette.color(QPalette::Mid));
+ painter->drawRect(rect.adjusted(0, 0, -1, -1));
+
+ painter->setPen(option->palette.color(QPalette::WindowText));
+ painter->setBrush(option->palette.color(QPalette::WindowText));
+ painter->drawPath(arrow);
+
+ painter->restore();
+}
+
+inline QPoint JavaStyle::adjustScrollHandlePoint(Qt::Orientation orig,
+ const QPoint &point) const
+{
+ QPoint retPoint;
+
+ if (orig == Qt::Vertical)
+ retPoint = point;
+ else
+ retPoint = QPoint(point.y(), point.x());
+
+ return retPoint;
+}
+
+void JavaStyle::drawControl(ControlElement control, const QStyleOption *option,
+ QPainter *painter, const QWidget *widget) const
+{
+
+ painter->save();
+
+ switch (control) {
+ case CE_ToolBoxTabShape: {
+ const QStyleOptionToolBox *box =
+ qstyleoption_cast<const QStyleOptionToolBox *>(option);
+
+ painter->save();
+
+ if (box->direction == Qt::RightToLeft) {
+ painter->rotate(1);
+ painter->translate(box->rect.width(), -box->rect.height());
+ }
+
+ int textWidth = box->fontMetrics.width(box->text) + 20;
+
+ QPolygon innerLine;
+ innerLine << (box->rect.topLeft() + QPoint(0, 1)) <<
+ (box->rect.topLeft() + QPoint(textWidth, 1)) <<
+ (box->rect.bottomLeft() + QPoint(textWidth + 15, -3)) <<
+ (box->rect.bottomRight() + QPoint(0, -3)) <<
+ box->rect.bottomRight() <<
+ box->rect.bottomLeft() <<
+ box->rect.topLeft();
+
+ painter->setPen(box->palette.color(QPalette::Base));
+ painter->setBrush(QColor(200, 221, 242));
+ painter->drawPolygon(innerLine);
+
+ QPolygon outerLine;
+ outerLine << (box->rect.bottomRight() + QPoint(0, -3)) <<
+ box->rect.bottomRight() <<
+ box->rect.bottomLeft() <<
+ box->rect.topLeft() <<
+ (box->rect.topLeft() + QPoint(textWidth, 0)) <<
+ (box->rect.bottomLeft() + QPoint(textWidth + 15, -4)) <<
+ (box->rect.bottomRight() + QPoint(0, -4));
+
+ painter->setPen(box->palette.color(QPalette::Midlight));
+ painter->setBrush(Qt::NoBrush);
+ painter->drawPolyline(outerLine);
+
+ painter->restore();
+ break;
+ }
+ case CE_DockWidgetTitle: {
+ const QStyleOptionDockWidgetV2 *docker =
+ new QStyleOptionDockWidgetV2(
+ *qstyleoption_cast<const QStyleOptionDockWidget *>(option));
+
+ QRect rect = docker->rect;
+ QRect titleRect = rect;
+ if (docker->verticalTitleBar) {
+ QRect r = rect;
+ QSize s = r.size();
+ s.transpose();
+ r.setSize(s);
+
+ titleRect = QRect(r.left() + rect.bottom()
+ - titleRect.bottom(),
+ r.top() + titleRect.left() - rect.left(),
+ titleRect.height(), titleRect.width());
+
+ painter->translate(r.left(), r.top() + r.width());
+ painter->rotate(-90);
+ painter->translate(-r.left(), -r.top());
+
+ rect = r;
+ }
+
+ QLinearGradient gradient(rect.topLeft(),
+ rect.bottomLeft());
+ gradient.setColorAt(1.0, QColor(191, 212, 231));
+ gradient.setColorAt(0.3, Qt::white);
+ gradient.setColorAt(0.0, QColor(221, 232, 243));
+
+ painter->setPen(Qt::NoPen);
+ painter->setBrush(gradient);
+ painter->drawRect(rect.adjusted(0, 0, -1, -1));
+
+ if (!docker->title.isEmpty()) {
+ QRect textRect = docker->fontMetrics.boundingRect(docker->title);
+ textRect.moveCenter(rect.center());
+
+ QFont font = painter->font();
+ font.setPointSize(font.pointSize() - 1);
+ painter->setFont(font);
+ painter->setPen(docker->palette.text().color());
+ painter->drawText(textRect, docker->title,
+ QTextOption(Qt::AlignHCenter |
+ Qt::AlignVCenter));
+ }
+ break;
+ }
+ case CE_RubberBand: {
+ painter->setPen(option->palette.color(QPalette::Active,
+ QPalette::WindowText));
+ painter->drawRect(option->rect.adjusted(0, 0, -1, -1));
+ break;
+ }
+ case CE_SizeGrip: {
+ break;
+ }
+ case CE_HeaderSection: {
+ const QStyleOptionHeader *header =
+ qstyleoption_cast<const QStyleOptionHeader *>(option);
+
+ painter->setPen(Qt::NoPen);
+ painter->setBrush(option->palette.color(QPalette::Active,
+ QPalette::Background));
+ painter->drawRect(option->rect);
+
+ painter->setPen(header->palette.color(QPalette::Mid));
+ if (header->orientation == Qt::Horizontal) {
+ if (header->position == QStyleOptionHeader::Beginning ||
+ header->position == QStyleOptionHeader::OnlyOneSection) {
+ painter->drawRect(header->rect.adjusted(0, 0, -1, -1));
+ painter->setPen(header->palette.color(QPalette::Base));
+ painter->drawLine(header->rect.bottomLeft() + QPoint(1, -1),
+ header->rect.topLeft() + QPoint(1, 1));
+ painter->drawLine(header->rect.topLeft() + QPoint(1, 1),
+ header->rect.topRight() + QPoint(-1, 1));
+ } else {
+ painter->drawLine(header->rect.bottomRight(),
+ header->rect.topRight());
+ painter->drawLine(header->rect.topLeft(),
+ header->rect.topRight());
+ painter->drawLine(header->rect.bottomLeft(),
+ header->rect.bottomRight());
+ painter->setPen(option->palette.color(QPalette::Base));
+ painter->drawLine(header->rect.bottomLeft() + QPoint(0, -1),
+ header->rect.topLeft() + QPoint(0, 1));
+ painter->drawLine(header->rect.topLeft() + QPoint(1, 1),
+ header->rect.topRight() + QPoint(-1, 1));
+ }
+ } else { // Vertical
+ if (header->position == QStyleOptionHeader::Beginning ||
+ header->position == QStyleOptionHeader::OnlyOneSection) {
+ painter->drawRect(header->rect.adjusted(0, 0, -1, -1));
+ painter->setPen(header->palette.color(QPalette::Base));
+ painter->drawLine(header->rect.bottomLeft() + QPoint(1, -1),
+ header->rect.topLeft() + QPoint(1, 1));
+ painter->drawLine(header->rect.topLeft() + QPoint(1, 1),
+ header->rect.topRight() + QPoint(-1, 1));
+ } else {
+ painter->drawLine(header->rect.bottomLeft(),
+ header->rect.bottomRight());
+ painter->drawLine(header->rect.topLeft(),
+ header->rect.bottomLeft());
+ painter->drawLine(header->rect.topRight(),
+ header->rect.bottomRight());
+ painter->setPen(header->palette.color(QPalette::Base));
+ painter->drawLine(header->rect.topLeft(),
+ header->rect.topRight() + QPoint(-1, 0));
+ painter->drawLine(header->rect.bottomLeft() + QPoint(1, -1),
+ header->rect.topLeft() + QPoint(1, 0));
+ }
+ }
+ break;
+ }
+ case CE_ToolBar: {
+ QRect rect = option->rect;
+
+ QLinearGradient gradient(rect.topLeft(), rect.bottomLeft());
+ gradient.setColorAt(1.0, QColor(221, 221, 221));
+ gradient.setColorAt(0.0, QColor(241, 241, 241));
+
+ if (option->state & State_Horizontal) {
+ painter->setPen(QColor(204, 204, 204));
+ painter->setBrush(gradient);
+ } else {
+ painter->setPen(Qt::NoPen);
+ painter->setBrush(option->palette.color(QPalette::Background));
+ }
+ painter->drawRect(rect.adjusted(0, 0, -1, -1));
+ break;
+ }
+ case CE_ProgressBar: {
+ const QStyleOptionProgressBar *bar1 =
+ qstyleoption_cast<const QStyleOptionProgressBar *>(option);
+
+ QStyleOptionProgressBarV2 *bar = new QStyleOptionProgressBarV2(*bar1);
+
+ QRect rect = bar->rect;
+ if (bar->orientation == Qt::Vertical) {
+ rect = QRect(rect.left(), rect.top(), rect.height(), rect.width());
+ QMatrix m;
+ m.translate(rect.height()-1, 0);
+ m.rotate(90.0);
+ painter->setMatrix(m);
+ }
+
+ painter->setPen(bar->palette.color(QPalette::Mid));
+ painter->drawRect(rect.adjusted(0, 0, -1, -1));
+
+ QRect grooveRect = subElementRect(SE_ProgressBarGroove, bar,
+ widget);
+ if (bar->orientation == Qt::Vertical) {
+ grooveRect = QRect(grooveRect.left(), grooveRect.top(),
+ grooveRect.height(), grooveRect.width());
+ }
+
+ QStyleOptionProgressBar grooveBar = *bar;
+ grooveBar.rect = grooveRect;
+
+ drawControl(CE_ProgressBarGroove, &grooveBar, painter, widget);
+
+ QRect progressRect = subElementRect(SE_ProgressBarContents, bar,
+ widget);
+ if (bar->orientation == Qt::Vertical) {
+ progressRect = QRect(progressRect.left(), progressRect.top(),
+ progressRect.height(), progressRect.width());
+ progressRect.adjust(0, 0, 0, -1);
+ }
+ QStyleOptionProgressBar progressOpt = *bar;
+ progressOpt.rect = progressRect;
+ drawControl(CE_ProgressBarContents, &progressOpt, painter, widget);
+
+ QRect labelRect = subElementRect(SE_ProgressBarLabel, bar, widget);
+ if (bar->orientation == Qt::Vertical) {
+ labelRect = QRect(labelRect.left(), labelRect.top(),
+ labelRect.height(), labelRect.width());
+ }
+ QStyleOptionProgressBar subBar = *bar;
+ subBar.rect = labelRect;
+ if (bar->textVisible)
+ drawControl(CE_ProgressBarLabel, &subBar, painter, widget);
+
+ delete bar;
+ break;
+ }
+ case CE_ProgressBarGroove: {
+ painter->setBrush(option->palette.color(QPalette::Background));
+ painter->setPen(Qt::NoPen);
+ painter->drawRect(option->rect.adjusted(0, 0, -1, -1));
+
+ painter->setPen(option->palette.color(QPalette::Button));
+ painter->drawLine(option->rect.topLeft() + QPoint(0, 0),
+ option->rect.topRight() + QPoint(0, 0));
+ break;
+ }
+ case CE_ProgressBarContents: {
+ const QStyleOptionProgressBar *bar =
+ qstyleoption_cast<const QStyleOptionProgressBar *>(option);
+ int progress = int((double(bar->progress) /
+ double(bar->maximum - bar->minimum)) *
+ bar->rect.width());
+
+ painter->setBrush(bar->palette.color(QPalette::Light));
+ painter->setPen(Qt::NoPen);
+ QRect progressRect = QRect(bar->rect.topLeft(), QPoint(progress,
+ bar->rect.bottom()));
+ painter->drawRect(progressRect);
+
+ painter->setPen(bar->palette.color(QPalette::Midlight));
+ painter->setBrush(Qt::NoBrush);
+
+ painter->drawLine(bar->rect.bottomLeft(), bar->rect.topLeft());
+ painter->drawLine(bar->rect.topLeft(), QPoint(progress,
+ bar->rect.top()));
+ break;
+ }
+ case CE_ProgressBarLabel: {
+ painter->save();
+ const QStyleOptionProgressBar *bar =
+ qstyleoption_cast<const QStyleOptionProgressBar *>(option);
+
+ QRect rect = bar->rect;
+ QRect leftRect;
+
+ int progressIndicatorPos = int((double(bar->progress) /
+ double(bar->maximum - bar->minimum)) *
+ bar->rect.width());
+
+ QFont font;
+ font.setBold(true);
+ painter->setFont(font);
+ painter->setPen(bar->palette.color(QPalette::Midlight));
+
+ if (progressIndicatorPos >= 0 &&
+ progressIndicatorPos <= rect.width()) {
+ leftRect = QRect(bar->rect.topLeft(),
+ QPoint(progressIndicatorPos,
+ bar->rect.bottom()));
+ } else if (progressIndicatorPos > rect.width()) {
+ painter->setPen(bar->palette.color(QPalette::Base));
+ } else {
+ painter->setPen(bar->palette.color(QPalette::Midlight));
+ }
+
+ QRect textRect = QFontMetrics(font).boundingRect(bar->text);
+ textRect.moveCenter(option->rect.center());
+ painter->drawText(textRect, bar->text,
+ QTextOption(Qt::AlignCenter));
+ if (!leftRect.isNull()) {
+ painter->setPen(bar->palette.color(QPalette::Base));
+ painter->setClipRect(leftRect, Qt::IntersectClip);
+ painter->drawText(textRect, bar->text,
+ QTextOption(Qt::AlignCenter));
+ }
+
+ painter->restore();
+ break;
+ }
+ case CE_MenuBarEmptyArea: {
+ QRect emptyArea = option->rect.adjusted(0, 0, -1, -1);
+ QLinearGradient gradient(emptyArea.topLeft(), emptyArea.bottomLeft()
+ - QPoint(0, 1));
+ gradient.setColorAt(0.0, option->palette.color(QPalette::Base));
+ gradient.setColorAt(1.0, QColor(223, 223, 223));
+
+ painter->setPen(QColor(238, 238, 238));
+ painter->setBrush(gradient);
+ painter->drawRect(emptyArea.adjusted(0, 0, 0, -1));
+ break;
+ }
+ case CE_MenuBarItem: {
+ if (!(option->state & State_Sunken)) {
+ QLinearGradient gradient(option->rect.topLeft(),
+ option->rect.bottomLeft());
+ gradient.setColorAt(0.0, Qt::white);
+ gradient.setColorAt(1.0, QColor(223, 223, 223));
+
+ painter->setPen(Qt::NoPen);
+ painter->setBrush(gradient);
+ } else {
+ painter->setBrush(option->palette.color(QPalette::Light));
+ }
+
+ painter->drawRect(option->rect);
+ if (option->state & State_Sunken) {
+ painter->setPen(option->palette.color(QPalette::Mid));
+ painter->drawRect(option->rect.adjusted(0, 0, -1, -1));
+ painter->setPen(option->palette.color(QPalette::Base));
+ painter->setBrush(Qt::NoBrush);
+ painter->drawLine(option->rect.bottomRight() + QPoint(0, -1),
+ option->rect.topRight() + QPoint(0, -1));
+ }
+ QCommonStyle::drawControl(control, option, painter, widget);
+ break;
+ }
+ case CE_MenuItem: {
+ const QStyleOptionMenuItem *menuItem =
+ qstyleoption_cast<const QStyleOptionMenuItem *>(option);
+
+ bool selected = menuItem->state & State_Selected;
+ bool checkable = menuItem->checkType !=
+ QStyleOptionMenuItem::NotCheckable;
+ bool checked = menuItem->checked;
+
+ if (menuItem->menuItemType == QStyleOptionMenuItem::Separator) {
+ QPoint center = menuItem->rect.center();
+
+ painter->setPen(menuItem->palette.color(QPalette::Midlight));
+ painter->drawLine(QPoint(menuItem->rect.left() - 2, center.y()),
+ QPoint(menuItem->rect.right(), center.y()));
+ painter->setPen(menuItem->palette.color(QPalette::Base));
+ painter->drawLine(QPoint(menuItem->rect.left() - 2,
+ center.y() + 1),
+ QPoint(menuItem->rect.right(),
+ center.y() + 1));
+
+ break;
+ }
+
+ if (selected) {
+ painter->setBrush(menuItem->palette.color(QPalette::Light));
+ painter->setPen(Qt::NoPen);
+ painter->drawRect(menuItem->rect);
+ painter->setPen(menuItem->palette.color(QPalette::Midlight));
+ painter->drawLine(menuItem->rect.topLeft(),
+ menuItem->rect.topRight());
+ painter->setPen(menuItem->palette.color(QPalette::Base));
+ painter->drawLine(menuItem->rect.bottomLeft(),
+ menuItem->rect.bottomRight());
+ }
+
+ if (checkable) {
+ QRect checkRect(option->rect.left() + 5,
+ option->rect.center().y() - 5, 10, 10);
+ if (menuItem->checkType & QStyleOptionMenuItem::Exclusive) {
+ QStyleOptionButton button;
+ button.rect = checkRect;
+ button.state = menuItem->state;
+ if (button.state & State_Sunken)
+ button.state ^= State_Sunken;
+ if (checked)
+ button.state |= State_On;
+ button.palette = menuItem->palette;
+ drawPrimitive(PE_IndicatorRadioButton, &button, painter,
+ widget);
+ } else {
+ QBrush buttonBrush = gradientBrush(option->rect);
+ painter->setBrush(buttonBrush);
+ painter->setPen(option->palette.color(QPalette::Mid));
+
+ painter->drawRect(checkRect);
+
+ if (checked) {
+ QImage image(":/images/checkboxchecked.png");
+ painter->drawImage(QPoint(option->rect.left() + 5,
+ option->rect.center().y() - 8), image);
+ }
+ }
+ }
+
+ bool dis = !(menuItem->state & State_Enabled);
+ bool act = menuItem->state & State_Selected;
+ const QStyleOption *opt = option;
+ const QStyleOptionMenuItem *menuitem = menuItem;
+ int checkcol = qMax(menuitem->maxIconWidth, 20);
+ if (menuItem->icon.isNull())
+ checkcol = 0;
+
+ QPainter *p = painter;
+ QRect vCheckRect = visualRect(opt->direction, menuitem->rect,
+ QRect(menuitem->rect.x(),
+ menuitem->rect.y(),
+ checkcol, menuitem->rect.height()));
+ if (!menuItem->icon.isNull()) {
+ QIcon::Mode mode = dis ? QIcon::Disabled : QIcon::Normal;
+ if (act && !dis)
+ mode = QIcon::Active;
+ QPixmap pixmap;
+ if (checked)
+ pixmap = menuItem->icon.pixmap(
+ pixelMetric(PM_SmallIconSize), mode, QIcon::On);
+ else
+ pixmap = menuItem->icon.pixmap(
+ pixelMetric(PM_SmallIconSize), mode);
+ int pixw = pixmap.width();
+ int pixh = pixmap.height();
+
+ int adjustedIcon = checkable ? 15 : 0;
+ QRect pmr(0, 0, pixw, pixh);
+ pmr.moveCenter(vCheckRect.center());
+ painter->setPen(menuItem->palette.text().color());
+ if (checkable && checked)
+ painter->drawPixmap(QPoint(pmr.left() +
+ adjustedIcon, pmr.top() + 1), pixmap);
+ else
+ painter->drawPixmap(pmr.topLeft() +
+ QPoint(adjustedIcon, 0), pixmap);
+ }
+
+ if (selected) {
+ painter->setPen(menuItem->palette.highlightedText().color());
+ } else {
+ painter->setPen(menuItem->palette.text().color());
+ }
+ int x, y, w, h;
+ menuitem->rect.getRect(&x, &y, &w, &h);
+ int tab = menuitem->tabWidth;
+ QColor discol;
+ if (dis) {
+ discol = menuitem->palette.text().color();
+ p->setPen(discol);
+ }
+ int xm = windowsItemFrame + checkcol + windowsItemHMargin;
+ int xpos = menuitem->rect.x() + xm;
+ QRect textRect;
+ if (!menuItem->icon.isNull())
+ textRect.setRect(xpos, y + windowsItemVMargin, w - xm -
+ windowsRightBorder - tab + 1, h - 2 * windowsItemVMargin);
+ else
+ textRect.setRect(menuItem->rect.left() + 9,
+ y + windowsItemVMargin,
+ w - xm - windowsRightBorder - tab,
+ h - 2 * windowsItemVMargin);
+
+ if (checkable)
+ textRect.adjust(10, 0, 10, 0);
+
+ QRect vTextRect = visualRect(opt->direction, menuitem->rect,
+ textRect);
+ QString s = menuitem->text;
+ if (!s.isEmpty()) {
+ int t = s.indexOf(QLatin1Char('\t'));
+ int text_flags = Qt::AlignVCenter | Qt::TextShowMnemonic |
+ Qt::TextDontClip | Qt::TextSingleLine;
+ if (!styleHint(SH_UnderlineShortcut, menuitem, widget))
+ text_flags |= Qt::TextHideMnemonic;
+ text_flags |= Qt::AlignLeft;
+ if (t >= 0) {
+ QRect vShortcutRect = visualRect(opt->direction,
+ menuitem->rect,
+ QRect(textRect.topRight(),
+ QPoint(menuitem->rect.right(), textRect.bottom())));
+ if (dis && !act) {
+ p->setPen(menuitem->palette.light().color());
+ p->drawText(vShortcutRect.adjusted(1, 1, 1, 1),
+ text_flags,
+ s.mid(t + 1));
+ p->setPen(discol);
+ }
+ p->drawText(vShortcutRect, text_flags, s.mid(t + 1));
+ s = s.left(t);
+ }
+ QFont font = menuitem->font;
+ if (menuitem->menuItemType == QStyleOptionMenuItem::DefaultItem)
+ font.setBold(true);
+ p->setFont(font);
+ if (dis && !act) {
+ p->setPen(menuitem->palette.light().color());
+ p->drawText(vTextRect.adjusted(1,1,1,1), text_flags,
+ s.left(t));
+ p->setPen(discol);
+ }
+ p->drawText(vTextRect, text_flags, s.left(t));
+ }
+
+ if (menuItem->menuItemType & QStyleOptionMenuItem::SubMenu) {
+ QPoint center = menuItem->rect.center();
+ QPoint drawStart(menuItem->rect.right() - 6, center.y() + 4);
+
+ QPainterPath arrow;
+ arrow.moveTo(drawStart);
+ arrow.lineTo(drawStart + QPoint(0, -8));
+ arrow.lineTo(drawStart + QPoint(4, -5));
+ arrow.lineTo(drawStart + QPoint(4, -4));
+ arrow.lineTo(drawStart + QPoint(0, 0));
+
+ painter->save();
+ painter->setBrush(menuItem->palette.color(QPalette::Text));
+ painter->setPen(Qt::NoPen);
+ painter->drawPath(arrow);
+ painter->restore();
+ }
+
+ break;
+ }
+ case CE_MenuVMargin: {
+ break;
+ }
+ case CE_MenuHMargin: {
+ break;
+ }
+ case CE_Splitter: {
+ drawSplitter(option, painter, option->state & State_Horizontal);
+ break;
+ }
+ case CE_ScrollBarAddPage: {
+ case CE_ScrollBarSubPage:
+ const QStyleOptionSlider *scrollBar =
+ qstyleoption_cast<const QStyleOptionSlider *>(option);
+ QRect myRect;
+ if (scrollBar->orientation == Qt::Horizontal) {
+ myRect = QRect(option->rect.topLeft(),
+ option->rect.bottomRight()).adjusted(0, 0, 1, -1);
+ } else {
+ myRect = option->rect;
+ }
+
+ painter->setPen(Qt::NoPen);
+ painter->setBrush(option->palette.color(QPalette::Background));
+ painter->drawRect(myRect);
+
+ painter->setBrush(Qt::NoBrush);
+ painter->setPen(scrollBar->palette.color(QPalette::Mid));
+ painter->drawRect(myRect.adjusted(0, 0, -1, 0));
+ painter->setPen(scrollBar->palette.color(QPalette::Button));
+ painter->drawLine(myRect.bottomLeft() + QPoint(1, 0),
+ myRect.topLeft() + QPoint(1, 1));
+ painter->drawLine(myRect.topLeft() + QPoint(1, 1),
+ myRect.topRight() + QPoint(-1, 1));
+ break;
+ }
+ case CE_ScrollBarSubLine: {
+ const QStyleOptionSlider *scrollBar =
+ qstyleoption_cast<const QStyleOptionSlider *>(option);
+ int scrollBarExtent = pixelMetric(PM_ScrollBarExtent);
+ QRect scrollBarSubLine = option->rect;
+
+ QRect button1;
+ QRect button2;
+
+ if (scrollBar->orientation == Qt::Horizontal) {
+ button1.setRect(scrollBarSubLine.left(), scrollBarSubLine.top(),
+ 16, scrollBarExtent);
+ button2.setRect(scrollBarSubLine.right() - 15,
+ scrollBarSubLine.top(), 16, scrollBarExtent);
+ } else {
+ button1.setRect(scrollBarSubLine.left(), scrollBarSubLine.top(),
+ scrollBarExtent, 16);
+ button2.setRect(scrollBarSubLine.left(),
+ scrollBarSubLine.bottom() - 15, scrollBarExtent, 16);
+ }
+
+ painter->fillRect(button2, Qt::blue);
+
+ drawScrollBarArrow(button1, painter, scrollBar);
+ drawScrollBarArrow(button2, painter, scrollBar);
+ break;
+ }
+ case CE_ScrollBarAddLine: {
+ const QStyleOptionSlider *scrollBar =
+ qstyleoption_cast<const QStyleOptionSlider *>(option);
+ QRect button(option->rect.left(), option->rect.top(), 16, 16);
+ drawScrollBarArrow(button, painter, scrollBar, true);
+ break;
+ }
+ case CE_ScrollBarSlider: {
+ const QStyleOptionSlider *scrollBar =
+ qstyleoption_cast<const QStyleOptionSlider *>(option);
+
+ painter->setPen(scrollBar->palette.color(QPalette::Midlight));
+ painter->drawRect(scrollBar->rect.adjusted(-1, 0, -3, -1));
+
+ QPoint g1, g2;
+ if (scrollBar->orientation == Qt::Horizontal) {
+ g1 = option->rect.topLeft();
+ g2 = option->rect.bottomLeft();
+ } else {
+ g1 = option->rect.topLeft();
+ g2 = option->rect.topRight();
+ }
+
+ if (scrollBar->state & State_Enabled) {
+ QLinearGradient gradient(g1, g2);
+ gradient.setColorAt(1.0, QColor(188, 210, 230));
+ gradient.setColorAt(0.3, Qt::white);
+ gradient.setColorAt(0.0, QColor(223, 233, 243));
+ painter->setBrush(gradient);
+ } else {
+ painter->setPen(scrollBar->palette.buttonText().color());
+ painter->setBrush(scrollBar->palette.button());
+ }
+ painter->drawRect(scrollBar->rect.adjusted(0, 0, -1, -1));
+
+ int sliderLength = option->rect.height();
+ int drawPos = scrollBar->orientation == Qt::Vertical ?
+ (sliderLength / 2) + 1 : 1 - ((option->rect.width() / 2));
+
+ QPoint origin;
+ if (scrollBar->orientation == Qt::Vertical)
+ origin = option->rect.bottomLeft();
+ else
+ origin = option->rect.topLeft();
+
+ painter->setPen(scrollBar->palette.color(QPalette::Base));
+ painter->drawLine(origin + adjustScrollHandlePoint(
+ scrollBar->orientation,
+ QPoint(4, -drawPos)),
+ origin + adjustScrollHandlePoint(
+ scrollBar->orientation,
+ QPoint(13, -drawPos)));
+ painter->drawLine(origin + adjustScrollHandlePoint(
+ scrollBar->orientation,
+ QPoint(4, 2 - drawPos)),
+ origin + adjustScrollHandlePoint(
+ scrollBar->orientation,
+ QPoint(13, 2 - drawPos)));
+ painter->drawLine(origin + adjustScrollHandlePoint(
+ scrollBar->orientation,
+ QPoint(4, 4 - drawPos)),
+ origin + adjustScrollHandlePoint(
+ scrollBar->orientation,
+ QPoint(13, 4 - drawPos)));
+
+ painter->setPen(option->palette.color(QPalette::Midlight));
+ painter->drawLine(origin + adjustScrollHandlePoint(
+ scrollBar->orientation,
+ QPoint(3, -(drawPos + 1))),
+ origin + adjustScrollHandlePoint(
+ scrollBar->orientation,
+ QPoint(12, -(drawPos + 1))));
+ painter->drawLine(origin + adjustScrollHandlePoint(
+ scrollBar->orientation,
+ QPoint(3, 1 - drawPos)),
+ origin + adjustScrollHandlePoint(
+ scrollBar->orientation,
+ QPoint(12, 1 - drawPos)));
+ painter->drawLine(origin + adjustScrollHandlePoint(
+ scrollBar->orientation,
+ QPoint(3, 3 - drawPos)),
+ origin + adjustScrollHandlePoint(
+ scrollBar->orientation,
+ QPoint(12, 3 - drawPos)));
+
+ break;
+ }
+ case CE_TabBarTabLabel: {
+ QStyleOptionTab copy =
+ *qstyleoption_cast<const QStyleOptionTab *>(option);
+ if (copy.state & State_HasFocus)
+ copy.state ^= State_HasFocus;
+ painter->setBrush(Qt::NoBrush);
+ QWindowsStyle::drawControl(CE_TabBarTabLabel, &copy, painter,
+ widget);
+ break;
+ }
+ case CE_TabBarTabShape: {
+ const QStyleOptionTab *tab =
+ qstyleoption_cast<const QStyleOptionTab *>(option);
+ QRect myRect = option->rect;
+ QPoint bottomLeft, bottomRight, topLeft, topRight;
+
+ if ((tab->position == QStyleOptionTab::Beginning) ||
+ (tab->position == QStyleOptionTab::OnlyOneTab)) {
+ if (tab->shape == QTabBar::RoundedSouth ||
+ tab->shape == QTabBar::RoundedNorth) {
+ myRect = myRect.adjusted(2, 0, 0, 0);
+ } else {
+ myRect = myRect.adjusted(0, 2, 0, 0);
+ }
+ }
+
+ switch (tab->shape) {
+ case QTabBar::RoundedNorth:
+ topLeft = myRect.topLeft();
+ topRight = myRect.topRight();
+ bottomLeft = myRect.bottomLeft();
+ bottomRight = myRect.bottomRight();
+ break;
+ case QTabBar::RoundedSouth:
+ topLeft = myRect.bottomLeft();
+ topRight = myRect.bottomRight();
+ bottomLeft = myRect.topLeft();
+ bottomRight = myRect.topRight();
+ break;
+ case QTabBar::RoundedWest:
+ topLeft = myRect.topLeft();
+ topRight = myRect.bottomLeft();
+ bottomLeft = myRect.topRight();
+ bottomRight = myRect.bottomRight();
+ break;
+ case QTabBar::RoundedEast:
+ topLeft = myRect.topRight();
+ topRight = myRect.bottomRight();
+ bottomLeft = myRect.topLeft();
+ bottomRight = myRect.bottomLeft();
+ break;
+ default:
+ ;
+ }
+
+ QPainterPath outerPath;
+ outerPath.moveTo(bottomLeft + adjustTabPoint(QPoint(0, -2),
+ tab->shape));
+ outerPath.lineTo(bottomLeft + adjustTabPoint(QPoint(0, -14),
+ tab->shape));
+ outerPath.lineTo(topLeft + adjustTabPoint(QPoint(6 , 0),
+ tab->shape));
+ outerPath.lineTo(topRight + adjustTabPoint(QPoint(0, 0),
+ tab->shape));
+ outerPath.lineTo(bottomRight + adjustTabPoint(QPoint(0, -2),
+ tab->shape));
+
+ if (tab->state & State_Selected ||
+ tab->position == QStyleOptionTab::OnlyOneTab) {
+ QPainterPath innerPath;
+ innerPath.moveTo(topLeft + adjustTabPoint(QPoint(6, 2),
+ tab->shape));
+ innerPath.lineTo(topRight + adjustTabPoint(QPoint(-1, 2),
+ tab->shape));
+ innerPath.lineTo(bottomRight + adjustTabPoint(QPoint(-1 , -2),
+ tab->shape));
+ innerPath.lineTo(bottomLeft + adjustTabPoint(QPoint(2 , -2),
+ tab->shape));
+ innerPath.lineTo(bottomLeft + adjustTabPoint(QPoint(2 , -14),
+ tab->shape));
+ innerPath.lineTo(topLeft + adjustTabPoint(QPoint(6, 2),
+ tab->shape));
+
+ QPainterPath whitePath;
+ whitePath.moveTo(bottomLeft + adjustTabPoint(QPoint(1, -2),
+ tab->shape));
+ whitePath.lineTo(bottomLeft + adjustTabPoint(QPoint(1, -14),
+ tab->shape));
+ whitePath.lineTo(topLeft + adjustTabPoint(QPoint(6, 1),
+ tab->shape));
+ whitePath.lineTo(topRight + adjustTabPoint(QPoint(-1, 1),
+ tab->shape));
+
+ painter->setPen(tab->palette.color(QPalette::Midlight));
+ painter->setBrush(QColor(200, 221, 242));
+ painter->drawPath(outerPath);
+ painter->setPen(QColor(200, 221, 242));
+ painter->drawRect(QRect(bottomLeft + adjustTabPoint(
+ QPoint(2, -3), tab->shape),
+ bottomRight + adjustTabPoint(
+ QPoint(-2, 0), tab->shape)));
+ painter->setPen(tab->palette.color(QPalette::Base));
+ painter->setBrush(Qt::NoBrush);
+ painter->drawPath(whitePath);
+
+ if (option->state & State_HasFocus) {
+ painter->setPen(option->palette.color(QPalette::Mid));
+ painter->drawPath(innerPath);
+ }
+ } else {
+ painter->setPen(tab->palette.color(QPalette::Mid));
+ painter->drawPath(outerPath);
+ }
+ break;
+ }
+ case CE_PushButtonLabel:
+ painter->save();
+
+ if (const QStyleOptionButton *button =
+ qstyleoption_cast<const QStyleOptionButton *>(option)) {
+ QRect ir = button->rect;
+ uint tf = Qt::AlignVCenter | Qt::TextShowMnemonic;
+ if (!styleHint(SH_UnderlineShortcut, button, widget))
+ tf |= Qt::TextHideMnemonic;
+
+ if (!button->icon.isNull()) {
+ QPoint point;
+
+ QIcon::Mode mode = button->state & State_Enabled ? QIcon::Normal
+ : QIcon::Disabled;
+ if (mode == QIcon::Normal && button->state & State_HasFocus)
+ mode = QIcon::Active;
+ QIcon::State state = QIcon::Off;
+ if (button->state & State_On)
+ state = QIcon::On;
+
+ QPixmap pixmap = button->icon.pixmap(button->iconSize, mode,
+ state);
+ int w = pixmap.width();
+ int h = pixmap.height();
+
+ if (!button->text.isEmpty())
+ w += button->fontMetrics.width(button->text) + 2;
+
+ point = QPoint(ir.x() + ir.width() / 2 - w / 2,
+ ir.y() + ir.height() / 2 - h / 2);
+
+ if (button->direction == Qt::RightToLeft)
+ point.rx() += pixmap.width();
+
+ painter->drawPixmap(visualPos(button->direction, button->rect,
+ point), pixmap);
+
+ if (button->direction == Qt::RightToLeft)
+ ir.translate(-point.x() - 2, 0);
+ else
+ ir.translate(point.x() + pixmap.width(), 0);
+
+ if (!button->text.isEmpty())
+ tf |= Qt::AlignLeft;
+
+ } else {
+ tf |= Qt::AlignHCenter;
+ }
+
+ if (button->fontMetrics.height() > 14)
+ ir.translate(0, 1);
+
+ drawItemText(painter, ir, tf, button->palette, (button->state &
+ State_Enabled),
+ button->text, QPalette::ButtonText);
+ }
+
+ painter->restore();
+ break;
+
+ default:
+ QWindowsStyle::drawControl(control, option, painter, widget);
+ }
+ painter->restore();
+}
+
+inline QPoint JavaStyle::adjustTabPoint(const QPoint &point,
+ QTabBar::Shape shape) const
+{
+ QPoint rPoint;
+
+ switch (shape) {
+ case QTabBar::RoundedWest:
+ rPoint = QPoint(point.y(), point.x());
+ break;
+ case QTabBar::RoundedSouth:
+ rPoint = QPoint(point.x(), point.y() * -1);
+ break;
+ case QTabBar::RoundedEast:
+ rPoint = QPoint(point.y() * -1, point.x());
+ break;
+ default:
+ rPoint = point;
+ }
+ return rPoint;
+}
+
+QRect JavaStyle::subControlRect(ComplexControl control,
+ const QStyleOptionComplex *option,
+ SubControl subControl,
+ const QWidget *widget) const
+{
+ QRect rect = QWindowsStyle::subControlRect(control, option, subControl,
+ widget);
+
+ switch (control) {
+ case CC_TitleBar: {
+ const QStyleOptionTitleBar *bar =
+ qstyleoption_cast<const QStyleOptionTitleBar *>(option);
+
+ switch (subControl) {
+ case SC_TitleBarMinButton: {
+ rect = QRect(bar->rect.topRight() + QPoint(-68, 2),
+ QSize(15, 15));
+ break;
+ }
+ case SC_TitleBarMaxButton: {
+ rect = QRect(bar->rect.topRight() + QPoint(-43, 3),
+ QSize(15, 15));
+ break;
+ }
+ case SC_TitleBarCloseButton: {
+ rect = QRect(bar->rect.topRight() + QPoint(-18, 3),
+ QSize(15, 15));
+ break;
+ }
+ case SC_TitleBarLabel: {
+ QRect labelRect = bar->fontMetrics.boundingRect(bar->text);
+ rect = labelRect;
+ rect.translate(bar->rect.left() + 30, 0);
+ rect.moveTop(bar->rect.top());
+ rect.adjust(0, 2, 2, 2);
+ break;
+ }
+ case SC_TitleBarSysMenu: {
+ rect = QRect(bar->rect.topLeft() + QPoint(6, 3),
+ QSize(16, 16));
+ break;
+ }
+ default:
+ ;
+ }
+ break;
+ }
+ case CC_GroupBox: {
+ const QStyleOptionGroupBox *box =
+ qstyleoption_cast<const QStyleOptionGroupBox *>(option);
+ bool hasCheckbox = box->subControls & SC_GroupBoxCheckBox;
+ int checkAdjust = 13;
+
+ QRect textRect = box->fontMetrics.boundingRect(box->text);
+
+ switch (subControl) {
+ case SC_GroupBoxFrame: {
+ rect = box->rect;
+ break;
+ }
+ case SC_GroupBoxCheckBox: {
+ if (hasCheckbox) {
+ rect = QRect(box->rect.topLeft() + QPoint(7, 4 +
+ (textRect.height() / 2 - checkAdjust / 2)),
+ QSize(checkAdjust, checkAdjust));
+ }
+ else {
+ rect = QRect();
+ }
+ break;
+ }
+ case SC_GroupBoxLabel: {
+ rect = QRect(box->rect.topLeft() + QPoint(7 + (hasCheckbox ?
+ checkAdjust + 2 : 0), 4), textRect.size());
+ break;
+ }
+ case SC_GroupBoxContents: {
+ rect = box->rect.adjusted(10, 10 + textRect.height(), -10,
+ -10);
+ break;
+ }
+ default:
+ ;
+ }
+ break;
+ }
+ case CC_SpinBox: {
+ const QStyleOptionSpinBox *spinBox =
+ qstyleoption_cast<const QStyleOptionSpinBox *>(option);
+ int spinnerWidth = 16;
+ QRect myRect = spinBox->rect;
+ QPoint center = myRect.center();
+ int frameWidth = pixelMetric(PM_SpinBoxFrameWidth, spinBox, widget);
+
+ switch (subControl) {
+ case SC_SpinBoxUp: {
+ rect = QRect(myRect.topRight() + QPoint(-16, 0),
+ QSize(16, center.y() - myRect.topRight().y()));
+ break;
+ }
+ case SC_SpinBoxDown: {
+ rect = QRect(QPoint(myRect.bottomRight().x() - 16,
+ center.y() + 1),
+ QSize(16, myRect.bottomRight().y() -
+ center.y() - 1));
+ break;
+ }
+ case SC_SpinBoxFrame: {
+ rect = QRect(myRect.topLeft(), myRect.bottomRight() +
+ QPoint(-16, 0));
+ break;
+ }
+ case SC_SpinBoxEditField: {
+ rect = QRect(myRect.topLeft() + QPoint(2, 2),
+ myRect.bottomRight() + QPoint(-15 - frameWidth, -2));
+ break;
+ }
+ default:
+ ;
+ }
+ break;
+ }
+ case CC_ToolButton: {
+ const QStyleOptionToolButton *button =
+ qstyleoption_cast<const QStyleOptionToolButton *>(option);
+
+ switch (subControl) {
+ case SC_ToolButton: {
+ rect = option->rect.adjusted(1, 1, -1, -1);
+ break;
+ }
+ case SC_ToolButtonMenu: {
+ rect = QRect(option->rect.bottomRight() +
+ QPoint(-11, -11), QSize(10, 10));
+ break;
+ }
+ }
+ break;
+ }
+ case CC_ComboBox: {
+ const QStyleOptionComboBox *combo =
+ qstyleoption_cast<const QStyleOptionComboBox *>(option);
+
+ bool reverse = combo->direction == Qt::RightToLeft;
+
+ switch (subControl) {
+ case SC_ComboBoxFrame:
+ rect = combo->rect;
+ break;
+ case SC_ComboBoxArrow:
+ if (reverse) {
+ rect = QRect(combo->rect.topLeft(),
+ combo->rect.bottomLeft() + QPoint(17, 0));
+ } else {
+ rect = QRect(combo->rect.topRight() + QPoint(-17, 0),
+ combo->rect.bottomRight());
+ }
+ break;
+ case SC_ComboBoxEditField:
+ if (reverse) {
+ rect = QRect(combo->rect.topLeft() + QPoint(19, 2),
+ combo->rect.bottomRight() + QPoint(-2, 2));
+ } else {
+ rect = QRect(combo->rect.topLeft() + QPoint(2, 2),
+ combo->rect.bottomRight() + QPoint(-19, -2));
+ }
+ break;
+ case SC_ComboBoxListBoxPopup:
+ rect = combo->rect;
+ break;
+ }
+ break;
+ }
+ case CC_ScrollBar: {
+ const QStyleOptionSlider *scrollBar =
+ qstyleoption_cast<const QStyleOptionSlider *>(option);
+ int scrollBarExtent = pixelMetric(PM_ScrollBarExtent, scrollBar,
+ widget);
+ int sliderMaxLength = ((scrollBar->orientation == Qt::Horizontal) ?
+ scrollBar->rect.width() :
+ scrollBar->rect.height()) - (16 * 3);
+ int sliderMinLength = pixelMetric(PM_ScrollBarSliderMin, scrollBar,
+ widget);
+ int sliderLength;
+
+ if (scrollBar->maximum != scrollBar->minimum) {
+ uint valueRange = scrollBar->maximum - scrollBar->minimum;
+ sliderLength = (scrollBar->pageStep * sliderMaxLength) /
+ (valueRange + scrollBar->pageStep);
+
+ if (sliderLength < sliderMinLength || valueRange > INT_MAX / 2)
+ sliderLength = sliderMinLength;
+ if (sliderLength > sliderMaxLength)
+ sliderLength = sliderMaxLength;
+ } else {
+ sliderLength = sliderMaxLength;
+ }
+ int sliderStart = 16 + sliderPositionFromValue(scrollBar->minimum,
+ scrollBar->maximum,
+ scrollBar->sliderPosition,
+ sliderMaxLength - sliderLength,
+ scrollBar->upsideDown);
+ QRect scrollBarRect = scrollBar->rect;
+
+ switch (subControl) {
+ case SC_ScrollBarSubLine:
+ if (scrollBar->orientation == Qt::Horizontal) {
+ rect.setRect(scrollBarRect.left(), scrollBarRect.top(),
+ scrollBarRect.width() - 16, scrollBarExtent);
+ } else {
+ rect.setRect(scrollBarRect.left(), scrollBarRect.top(),
+ scrollBarExtent, scrollBarRect.height() - 16);
+ }
+ break;
+ case SC_ScrollBarAddLine:
+ if (scrollBar->orientation == Qt::Horizontal) {
+ rect.setRect(scrollBarRect.right() - 15,
+ scrollBarRect.top(), 16, scrollBarExtent);
+ } else {
+ rect.setRect(scrollBarRect.left(), scrollBarRect.bottom()
+ - 15, scrollBarExtent, 16);
+ }
+ break;
+ case SC_ScrollBarSubPage:
+ if (scrollBar->orientation == Qt::Horizontal) {
+ rect.setRect(scrollBarRect.left() + 16, scrollBarRect.top(),
+ sliderStart - (scrollBarRect.left() + 16),
+ scrollBarExtent);
+ } else {
+ rect.setRect(scrollBarRect.left(), scrollBarRect.top() + 16,
+ scrollBarExtent,
+ sliderStart - (scrollBarRect.left() + 16));
+ }
+ break;
+ case SC_ScrollBarAddPage:
+ if (scrollBar->orientation == Qt::Horizontal)
+ rect.setRect(sliderStart + sliderLength, 0,
+ sliderMaxLength - sliderStart -
+ sliderLength + 16, scrollBarExtent);
+ else
+ rect.setRect(0, sliderStart + sliderLength,
+ scrollBarExtent, sliderMaxLength -
+ sliderStart - sliderLength + 16);
+ break;
+ case SC_ScrollBarGroove:
+ if (scrollBar->orientation == Qt::Horizontal) {
+ rect = scrollBarRect.adjusted(16, 0, -32, 0);
+ } else {
+ rect = scrollBarRect.adjusted(0, 16, 0, -32);
+ }
+ break;
+ case SC_ScrollBarSlider:
+ if (scrollBar->orientation == Qt::Horizontal) {
+ rect.setRect(sliderStart, 0, sliderLength,
+ scrollBarExtent);
+ } else {
+ rect.setRect(0, sliderStart, scrollBarExtent,
+ sliderLength);
+ }
+ break;
+ default:
+ return QWindowsStyle::subControlRect(control, option,
+ subControl, widget);
+ }
+ break;
+ }
+ case CC_Slider: {
+ const QStyleOptionSlider *slider =
+ qstyleoption_cast<const QStyleOptionSlider *>(option);
+ rect = slider->rect;
+ int tickSize = pixelMetric(PM_SliderTickmarkOffset, option, widget);
+ int handleSize = pixelMetric(PM_SliderControlThickness, option,
+ widget);
+
+ int dist = slider->orientation == Qt::Vertical ? slider->rect.height() :
+ slider->rect.width();
+ int pos = QStyle::sliderPositionFromValue(slider->minimum,
+ slider->maximum, slider->sliderValue, dist - handleSize);
+
+ switch (subControl) {
+ case SC_SliderGroove: {
+ QPoint center = rect.center();
+
+ if (slider->orientation == Qt::Horizontal) {
+ rect.setHeight(handleSize);
+ if (slider->tickPosition == QSlider::TicksBelow) {
+ center.ry() -= tickSize;
+ }
+ } else {
+ rect.adjust(0, 0, 0, 0);
+ rect.setWidth(handleSize);
+ if (slider->tickPosition == QSlider::TicksBelow) {
+ center.rx() -= tickSize;
+ }
+ }
+ rect.moveCenter(center);
+ break;
+ }
+ case SC_SliderHandle: {
+ QPoint center = rect.center();
+
+ if (slider->orientation == Qt::Horizontal) {
+ rect.setHeight(handleSize);
+ if (slider->tickPosition == QSlider::TicksBelow) {
+ center.ry() -= tickSize;
+ }
+
+ rect.moveCenter(center);
+
+ if (slider->upsideDown)
+ rect.setLeft(slider->rect.right() -
+ pos - (handleSize - 1));
+ else
+ rect.setLeft(pos);
+
+ rect.setWidth(handleSize - 1);
+ } else {
+ rect.setWidth(handleSize);
+ if (slider->tickPosition == QSlider::TicksBelow) {
+ center.rx() -= tickSize;
+ }
+
+ rect.moveCenter(center);
+
+ if (slider->upsideDown)
+ rect.setTop(slider->rect.bottom() -
+ ((pos + handleSize) - 2));
+ else
+ rect.setTop(slider->rect.top() + pos);
+
+ rect.setHeight(handleSize);
+ }
+ break;
+ }
+ case SC_SliderTickmarks: {
+ QPoint center = slider->rect.center();
+
+ if (slider->tickPosition & QSlider::TicksBelow) {
+ if (slider->orientation == Qt::Horizontal) {
+ rect.setHeight(tickSize);
+ center.ry() += tickSize / 2;
+ rect.adjust(6, 0, -10, 0);
+ } else {
+ rect.setWidth(tickSize);
+ center.rx() += tickSize / 2;
+ rect.adjust(0, 6, 0, -10);
+ }
+ } else {
+ rect = QRect();
+ }
+ rect.moveCenter(center);
+ break;
+ }
+ default:
+ ;
+ }
+ break;
+ }
+ default:
+ return QWindowsStyle::subControlRect(control, option, subControl,
+ widget);
+ }
+ return rect;
+}
+
+static const char * const sliderHandleImage[] = {
+ "15 16 7 1",
+ " c None",
+ "+ c #FFFFFF",
+ "@ c #FFFFFF",
+ "$ c #FFFFFF",
+ "( c #E5EDF5",
+ ") c #F2F6FA",
+ "[ c #FFFFFF",
+ " +++++++++++++ ",
+ "+@@@@@@@@@@@@@+",
+ "+@(((((((((((@+",
+ "+@(((((((((((@+",
+ "+@)))))))))))@+",
+ "+@[[[[[[[[[[[@+",
+ "+@[[[[[[[[[[[@+",
+ "+@)))))))))))@+",
+ "+@)))))))))))@+",
+ " +@)))))))))@+ ",
+ " +@(((((((@+ ",
+ " +@(((((@+ ",
+ " +@(((@+ ",
+ " +@(@+ ",
+ " +@+ ",
+ " + "};
+
+
+void JavaStyle::drawComplexControl(ComplexControl control,
+ const QStyleOptionComplex *option,
+ QPainter *painter,
+ const QWidget *widget) const
+{
+ painter->save();
+
+ switch (control) {
+ case CC_TitleBar: {
+ const QStyleOptionTitleBar *bar =
+ qstyleoption_cast<const QStyleOptionTitleBar *>(option);
+
+ bool sunken = bar->state & State_Sunken;
+
+ QLinearGradient gradient(bar->rect.bottomLeft(),
+ bar->rect.topLeft());
+ gradient.setColorAt(0.0, QColor(191, 212, 231));
+ gradient.setColorAt(0.7, Qt::white);
+ gradient.setColorAt(1.0, QColor(221, 232, 243));
+
+ painter->setPen(Qt::NoPen);
+ if (bar->titleBarState & State_Active) {
+ painter->setBrush(gradient);
+ }
+ else
+ painter->setBrush(bar->palette.color(QPalette::Active,
+ QPalette::Background));
+
+ painter->drawRect(bar->rect.adjusted(0, 0, -1, -1));
+
+ painter->setBrush(QColor(233, 233, 233));
+ painter->drawRect(QRect(bar->rect.bottomLeft() + QPoint(0, 1),
+ bar->rect.bottomRight() + QPoint(0, 2)));
+
+ QRect minButtonRect = subControlRect(control, bar,
+ SC_TitleBarMinButton);
+ QRect maxButtonRect = subControlRect(control, bar,
+ SC_TitleBarMaxButton);
+ QRect closeButtonRect = subControlRect(control, bar,
+ SC_TitleBarCloseButton);
+ QRect systemButtonRect = subControlRect(control, bar,
+ SC_TitleBarSysMenu);
+ QRect labelRect = subControlRect(control, bar, SC_TitleBarLabel);
+ QRect gripRect = QRect(QPoint(labelRect.right() + 5, bar->rect.top() + 5),
+ QPoint(minButtonRect.left() - 5,
+ bar->rect.bottom() - 4));
+
+ QColor textColor = option->palette.color(QPalette::Text);
+ painter->setPen(textColor);
+ painter->setBrush(Qt::NoBrush);
+
+ drawItemText(painter, labelRect, Qt::TextShowMnemonic |
+ Qt::AlignHCenter | Qt::AlignCenter,
+ bar->palette, bar->state & State_Enabled, bar->text,
+ textColor.isValid() ? QPalette::NoRole :
+ QPalette::WindowText);
+
+ for (int i = 0; i < gripRect.width(); ++i) {
+ painter->setPen(i % 2 ? bar->palette.color(QPalette::Midlight)
+ : Qt::white);
+
+ for (int j = 0; j < 4; ++j) {
+ painter->drawPoint(i + gripRect.left(),
+ gripRect.top() - 2 + i % 4 + 4 * j);
+ }
+ }
+
+ QPixmap maximizePixmap(":/images/internalmaximize.png");
+ QPixmap minimizePixmap(":/images/internalminimize.png");
+ QPixmap closePixmap(":/images/internalclose.png");
+ QPixmap internalPixmap(":/images/internalsystem.png");
+ QPixmap internalCloseDownPixmap(":/images/internalclosedown.png");
+ QPixmap minimizeDownPixmap(":/images/internalminimizedown.png");
+ QPixmap maximizeDownPixmap(":/images/internalmaximizedown.png");
+
+ if (bar->activeSubControls & SC_TitleBarCloseButton &&
+ bar->state & State_Sunken)
+ painter->drawPixmap(closeButtonRect.topLeft(),
+ internalCloseDownPixmap);
+ else
+ painter->drawPixmap(closeButtonRect.topLeft(), closePixmap);
+
+ if (bar->activeSubControls & SC_TitleBarMinButton &&
+ bar->state & State_Sunken)
+ painter->drawPixmap(minButtonRect.topLeft(),
+ minimizeDownPixmap);
+ else
+ painter->drawPixmap(minButtonRect.topLeft(), minimizePixmap);
+
+ if (bar->activeSubControls & SC_TitleBarMaxButton &&
+ bar->state & State_Sunken)
+ painter->drawPixmap(maxButtonRect.topLeft(),
+ maximizeDownPixmap);
+ else
+ painter->drawPixmap(maxButtonRect.topLeft(), maximizePixmap);
+
+ painter->drawPixmap(systemButtonRect.topLeft(), internalPixmap);
+
+ break;
+ }
+ case CC_GroupBox: {
+ const QStyleOptionGroupBox *box =
+ qstyleoption_cast<const QStyleOptionGroupBox *>(option);
+
+ QRect frameRect = subControlRect(control, box, SC_GroupBoxFrame);
+ QRect labelRect = subControlRect(control, box, SC_GroupBoxLabel);
+ QRect contentsRect = subControlRect(control, box,
+ SC_GroupBoxContents);
+ QRect checkerRect = subControlRect(control, box,
+ SC_GroupBoxCheckBox);
+
+ int y = labelRect.center().y();
+
+ painter->setPen(box->palette.color(QPalette::Button));
+ painter->drawRect(frameRect.adjusted(2, y - frameRect.top(), -2,
+ -2));
+
+ painter->setPen(box->palette.color(QPalette::Background));
+
+ if (box->subControls & SC_GroupBoxCheckBox) {
+ painter->drawLine(checkerRect.left() - 1, y,
+ checkerRect.right() + 2, y);
+ QStyleOptionButton checker;
+ checker.QStyleOption::operator=(*box);
+ checker.rect = checkerRect;
+ drawPrimitive(PE_IndicatorCheckBox, &checker, painter, widget);
+ }
+
+ if (box->subControls & SC_GroupBoxLabel && !box->text.isEmpty()) {
+ painter->drawLine(labelRect.left() - 1, y,
+ labelRect.right() +1, y);
+
+ QColor textColor = box->textColor;
+ if (textColor.isValid())
+ painter->setPen(textColor);
+
+ drawItemText(painter, labelRect, Qt::TextShowMnemonic |
+ Qt::AlignHCenter | int(box->textAlignment),
+ box->palette, box->state & State_Enabled,
+ box->text, textColor.isValid() ? QPalette::NoRole :
+ QPalette::WindowText);
+ }
+ break;
+ }
+ case CC_SpinBox: {
+ const QStyleOptionSpinBox *spinner =
+ qstyleoption_cast<const QStyleOptionSpinBox *>(option);
+
+ QRect frameRect = subControlRect(control, spinner, SC_SpinBoxFrame);
+ QRect upRect = subControlRect(control, spinner, SC_SpinBoxUp);
+ QRect downRect = subControlRect(control, spinner, SC_SpinBoxDown);
+
+ painter->setPen(Qt::white);
+ painter->drawRect(frameRect.adjusted(1, 1, -1, -1));
+ painter->drawPoint(frameRect.bottomLeft());
+
+ painter->setPen(spinner->palette.color(QPalette::Mid));
+ painter->drawRect(frameRect.adjusted(0, 0, -1, -2));
+
+ bool isEnabled = (spinner->state & State_Enabled);
+ bool hover = isEnabled && (spinner->state & State_MouseOver);
+ bool sunken = (spinner->state & State_Sunken);
+ bool upIsActive = (spinner->activeSubControls == SC_SpinBoxUp);
+ bool downIsActive = (spinner->activeSubControls == SC_SpinBoxDown);
+ bool stepUpEnabled = spinner->stepEnabled &
+ QAbstractSpinBox::StepUpEnabled;
+ bool stepDownEnabled = spinner->stepEnabled &
+ QAbstractSpinBox::StepDownEnabled;
+
+ painter->setBrush(spinner->palette.color(QPalette::Background));
+
+ painter->drawRect(upRect);
+ if (upIsActive && stepUpEnabled) {
+ if (sunken) {
+ drawSunkenButtonShadow(painter, upRect,
+ spinner->palette.color(QPalette::Mid));
+ } else if (hover) {
+ drawButtonHoverFrame(painter, upRect,
+ spinner->palette.color(QPalette::Mid),
+ spinner->palette.color(QPalette::Button));
+ }
+ }
+
+ QStyleOptionSpinBox upSpin = *spinner;
+ upSpin.rect = upRect;
+ drawPrimitive(PE_IndicatorSpinUp, &upSpin, painter, widget);
+
+ painter->drawRect(downRect);
+ if (downIsActive && stepDownEnabled) {
+ if (sunken) {
+ drawSunkenButtonShadow(painter, downRect,
+ spinner->palette.color(QPalette::Mid));
+ } else if (hover) {
+ drawButtonHoverFrame(painter, downRect,
+ spinner->palette.color(QPalette::Mid),
+ spinner->palette.color(QPalette::Button));
+ }
+ }
+
+ QStyleOptionSpinBox downSpin = *spinner;
+ downSpin.rect = downRect;
+ drawPrimitive(PE_IndicatorSpinDown, &downSpin, painter, widget);
+
+ break;
+ }
+ case CC_ToolButton: {
+ const QStyleOptionToolButton *button =
+ qstyleoption_cast<const QStyleOptionToolButton *>(option);
+
+ painter->setPen(Qt::white);
+ painter->drawRect(button->rect.adjusted(1, 1, -1, -1));
+
+ QStyleOptionToolButton panelOption = *button;
+ QRect panelRect;
+ if (!(button->state & State_MouseOver) &&
+ !(button->state & State_On)) {
+ painter->setPen(QColor(153, 153, 153));
+ painter->drawRect(button->rect.adjusted(0, 0, -2, -2));
+
+ panelRect = subControlRect(control, option, SC_ToolButton);
+ panelOption.rect = panelRect;
+ } else {
+ panelOption.rect.adjust(0, 0, -1, -1);
+ }
+
+ QRect menuRect = subControlRect(control, option, SC_ToolButtonMenu);
+
+ drawPrimitive(PE_PanelButtonTool, &panelOption, painter, widget);
+
+ QStyleOptionToolButton menuOption = *button;
+ menuOption.rect = menuRect;
+
+ QStyleOptionToolButton label = *button;
+ int fw = 5;
+
+ drawControl(CE_ToolButtonLabel, &label, painter, widget);
+ if (button->subControls & SC_ToolButtonMenu) {
+ painter->setPen(button->palette.color(QPalette::WindowText));
+ drawPrimitive(PE_IndicatorArrowDown, &menuOption, painter, widget);
+ }
+
+ if (button->state & State_HasFocus) {
+ QStyleOptionToolButton focusOption = *button;
+ focusOption.rect = label.rect.adjusted(-1, -1, 1, 1);
+
+ drawPrimitive(PE_FrameFocusRect, &focusOption, painter, widget);
+ }
+
+ break;
+ }
+ case CC_ComboBox: {
+ const QStyleOptionComboBox *combo =
+ qstyleoption_cast<const QStyleOptionComboBox *>(option);
+
+ QRect frameRect = subControlRect(control, option, SC_ComboBoxFrame,
+ widget);
+ painter->setPen(combo->palette.color(QPalette::Mid));
+
+ if (option->state & State_HasFocus)
+ painter->setBrush(option->palette.color(QPalette::Light));
+ else
+ painter->setBrush(combo->palette.color(QPalette::Background));
+
+ painter->drawRect(frameRect.adjusted(0, 0, -1, -1));
+
+ QRect arrowRect = subControlRect(control, option, SC_ComboBoxArrow,
+ widget);
+ painter->setPen(combo->palette.color(QPalette::Button));
+ painter->setBrush(Qt::NoBrush);
+
+ if (combo->direction == Qt::LeftToRight) {
+ painter->drawRect(QRect(frameRect.topLeft() + QPoint(1, 1),
+ arrowRect.bottomLeft() + QPoint(-2, -2)));
+ } else {
+ painter->drawRect(QRect(arrowRect.topLeft() + QPoint(1, 1),
+ frameRect.bottomRight() + QPoint(-2, -2)));
+ }
+
+ QStyleOptionButton button;
+ button.rect = arrowRect;
+ button.state = combo->state;
+ button.palette = combo->palette;
+
+ if (button.state & State_On)
+ button.state ^= State_On;
+
+ painter->save();
+ drawButtonBackground(&button, painter, false);
+ painter->restore();
+
+ QPoint center = arrowRect.center();
+ QPoint offset = QPoint(arrowRect.bottomLeft().x() + 1,
+ center.y() + 7);
+ QPainterPath arrow;
+ arrow.moveTo(offset + QPoint(4, -8));
+ arrow.lineTo(offset + QPoint(7, -5));
+ arrow.lineTo(offset + QPoint(8, -5));
+ arrow.lineTo(offset + QPoint(11, -8));
+ arrow.lineTo(offset + QPoint(4, -8));
+
+ painter->setBrush(combo->palette.color(QPalette::WindowText));
+ painter->setPen(combo->palette.color(QPalette::WindowText));
+
+ painter->drawPath(arrow);
+
+ QRect fieldRect = subControlRect(control, option,
+ SC_ComboBoxEditField, widget);
+
+ break;
+ }
+ case CC_Slider: {
+ const QStyleOptionSlider *slider =
+ qstyleoption_cast<const QStyleOptionSlider *>(option);
+
+ bool horizontal = slider->orientation == Qt::Horizontal;
+
+ QRect groove = subControlRect(control, option, SC_SliderGroove,
+ widget);
+ QRect ticks = subControlRect(control, option, SC_SliderTickmarks,
+ widget);
+ QRect handle = subControlRect(control, option, SC_SliderHandle,
+ widget);
+
+ QRect afterHandle = QRect(handle.topLeft() + xySwitch(QPoint(4, 6), horizontal),
+ groove.bottomRight() + xySwitch(QPoint(-4, -6), horizontal));
+ QRect beforeHandle = QRect(groove.topLeft() + xySwitch(QPoint(4, 6), horizontal),
+ handle.bottomRight() + xySwitch(QPoint(-4, -6), horizontal));
+
+ if (slider->upsideDown || !horizontal) {
+ QRect remember;
+ remember = afterHandle;
+ afterHandle = beforeHandle;
+ beforeHandle = remember;
+ }
+
+ painter->setPen(slider->palette.color(QPalette::Mid));
+ painter->setBrush(option->palette.color(QPalette::Background));
+ painter->drawRect(afterHandle);
+ painter->setPen(slider->palette.color(QPalette::Light));
+ painter->drawLine(afterHandle.topLeft() + xySwitch(QPoint(0, 1), horizontal),
+ afterHandle.topRight() + xySwitch(QPoint(0, 1), horizontal));
+ painter->setPen(option->palette.color(QPalette::Midlight));
+
+ if (horizontal) {
+ painter->setBrush(gradientBrush(QRect(QPoint(groove.x(),
+ handle.y() + 1),
+ QSize(groove.width(),
+ handle.height() + 1))));
+ } else {
+ QRect rect = QRect(QPoint(groove.x(),
+ handle.x() - 1),
+ QSize(groove.height(),
+ handle.width() + 1));
+ QLinearGradient gradient(groove.bottomLeft(),
+ groove.bottomRight());
+ gradient.setColorAt(1.0, QColor(188, 210, 230));
+ gradient.setColorAt(0.3, Qt::white);
+ gradient.setColorAt(0.0, QColor(223, 233, 243));
+
+ painter->setBrush(gradient);
+ }
+
+ painter->drawRect(beforeHandle);
+
+ QPainterPath handlePath;
+ QPainterPath innerPath;
+ QPoint topLeft, topRight, bottomLeft;
+ if (horizontal) {
+ topLeft = handle.topLeft();
+ topRight = handle.topRight();
+ bottomLeft = handle.bottomLeft();
+ } else {
+ topLeft = handle.bottomLeft();
+ topRight = handle.topLeft();
+ bottomLeft = handle.topRight();
+ }
+
+ if (horizontal) {
+ QImage image(sliderHandleImage);
+
+ image.setColor(1,
+ option->palette.color(QPalette::Midlight).rgb());
+ image.setColor(2,
+ option->palette.color(QPalette::Button).rgb());
+
+ if (!(slider->state & State_Enabled)) {
+ image.setColor(4, slider->palette.color(QPalette::Background).rgb());
+ image.setColor(5, slider->palette.color(QPalette::Background).rgb());
+ image.setColor(6, slider->palette.color(QPalette::Background).rgb());
+ }
+
+ painter->drawImage(handle.topLeft(), image);
+ } else {
+ QImage image(":/images/verticalsliderhandle.png");
+ painter->drawImage(handle.topLeft(), image);
+ }
+
+ if (slider->tickPosition & QSlider::TicksBelow) {
+ painter->setPen(slider->palette.color(QPalette::Light));
+ int tickInterval = slider->tickInt