From 97b5b8009254004608feefb903cbf44abaa099f6 Mon Sep 17 00:00:00 2001 From: Casper van Donderen Date: Mon, 7 May 2012 18:49:48 +0200 Subject: Doc: Modularize QtWidgets documentation. This change moves the snippets and images to the modularized directories. Change-Id: Idec1afb9db7ea6add1ca4cf25ec4019d8bce0c4d Reviewed-by: Marius Storm-Olsen --- doc/src/images/cde-calendarwidget.png | Bin 10187 -> 0 bytes doc/src/images/cde-checkbox.png | Bin 1331 -> 0 bytes doc/src/images/cde-combobox.png | Bin 1269 -> 0 bytes doc/src/images/cde-dateedit.png | Bin 1183 -> 0 bytes doc/src/images/cde-datetimeedit.png | Bin 1701 -> 0 bytes doc/src/images/cde-dial.png | Bin 4481 -> 0 bytes doc/src/images/cde-doublespinbox.png | Bin 1007 -> 0 bytes doc/src/images/cde-fontcombobox.png | Bin 1603 -> 0 bytes doc/src/images/cde-frame.png | Bin 2976 -> 0 bytes doc/src/images/cde-groupbox.png | Bin 2592 -> 0 bytes doc/src/images/cde-horizontalscrollbar.png | Bin 569 -> 0 bytes doc/src/images/cde-label.png | Bin 1043 -> 0 bytes doc/src/images/cde-lcdnumber.png | Bin 538 -> 0 bytes doc/src/images/cde-lineedit.png | Bin 1355 -> 0 bytes doc/src/images/cde-listview.png | Bin 5166 -> 0 bytes doc/src/images/cde-progressbar.png | Bin 934 -> 0 bytes doc/src/images/cde-pushbutton.png | Bin 1099 -> 0 bytes doc/src/images/cde-radiobutton.png | Bin 1562 -> 0 bytes doc/src/images/cde-slider.png | Bin 526 -> 0 bytes doc/src/images/cde-spinbox.png | Bin 863 -> 0 bytes doc/src/images/cde-tableview.png | Bin 2467 -> 0 bytes doc/src/images/cde-tabwidget.png | Bin 2483 -> 0 bytes doc/src/images/cde-textedit.png | Bin 7374 -> 0 bytes doc/src/images/cde-timeedit.png | Bin 1248 -> 0 bytes doc/src/images/cde-toolbox.png | Bin 1813 -> 0 bytes doc/src/images/cde-toolbutton.png | Bin 1169 -> 0 bytes doc/src/images/cde-treeview.png | Bin 6703 -> 0 bytes doc/src/images/cleanlooks-calendarwidget.png | Bin 9748 -> 0 bytes doc/src/images/cleanlooks-checkbox.png | Bin 1416 -> 0 bytes doc/src/images/cleanlooks-combobox.png | Bin 2348 -> 0 bytes doc/src/images/cleanlooks-dateedit.png | Bin 1369 -> 0 bytes doc/src/images/cleanlooks-datetimeedit.png | Bin 1892 -> 0 bytes doc/src/images/cleanlooks-dial.png | Bin 4297 -> 0 bytes doc/src/images/cleanlooks-doublespinbox.png | Bin 1141 -> 0 bytes doc/src/images/cleanlooks-fontcombobox.png | Bin 1835 -> 0 bytes doc/src/images/cleanlooks-frame.png | Bin 2989 -> 0 bytes doc/src/images/cleanlooks-groupbox.png | Bin 2630 -> 0 bytes doc/src/images/cleanlooks-horizontalscrollbar.png | Bin 837 -> 0 bytes doc/src/images/cleanlooks-label.png | Bin 1043 -> 0 bytes doc/src/images/cleanlooks-lcdnumber.png | Bin 538 -> 0 bytes doc/src/images/cleanlooks-lineedit.png | Bin 1406 -> 0 bytes doc/src/images/cleanlooks-listview.png | Bin 5559 -> 0 bytes doc/src/images/cleanlooks-progressbar.png | Bin 1292 -> 0 bytes doc/src/images/cleanlooks-pushbutton.png | Bin 1332 -> 0 bytes doc/src/images/cleanlooks-radiobutton.png | Bin 1782 -> 0 bytes doc/src/images/cleanlooks-slider.png | Bin 671 -> 0 bytes doc/src/images/cleanlooks-spinbox.png | Bin 983 -> 0 bytes doc/src/images/cleanlooks-tableview.png | Bin 2465 -> 0 bytes doc/src/images/cleanlooks-tabwidget.png | Bin 5007 -> 0 bytes doc/src/images/cleanlooks-textedit.png | Bin 7560 -> 0 bytes doc/src/images/cleanlooks-timeedit.png | Bin 1388 -> 0 bytes doc/src/images/cleanlooks-toolbox.png | Bin 1445 -> 0 bytes doc/src/images/cleanlooks-toolbutton.png | Bin 1469 -> 0 bytes doc/src/images/cleanlooks-treeview.png | Bin 6981 -> 0 bytes doc/src/images/designer-stylesheet-options.png | Bin 18914 -> 0 bytes doc/src/images/designer-stylesheet-usage.png | Bin 8128 -> 0 bytes doc/src/images/designer-validator-highlighter.png | Bin 27153 -> 0 bytes doc/src/images/filedialogurls.png | Bin 29132 -> 0 bytes doc/src/images/frames.png | Bin 25735 -> 0 bytes doc/src/images/graphicsview-items.png | Bin 62593 -> 0 bytes doc/src/images/graphicsview-pathitem.png | Bin 5710 -> 0 bytes doc/src/images/graphicsview-pixmapitem.png | Bin 10764 -> 0 bytes doc/src/images/graphicsview-polygonitem.png | Bin 5829 -> 0 bytes doc/src/images/graphicsview-rectitem.png | Bin 3305 -> 0 bytes doc/src/images/graphicsview-zorder.png | Bin 6724 -> 0 bytes doc/src/images/gridlayout.png | Bin 1445 -> 0 bytes doc/src/images/gtk-calendarwidget.png | Bin 16761 -> 0 bytes doc/src/images/gtk-checkbox.png | Bin 2323 -> 0 bytes doc/src/images/gtk-combobox.png | Bin 2730 -> 0 bytes doc/src/images/gtk-dateedit.png | Bin 2163 -> 0 bytes doc/src/images/gtk-datetimeedit.png | Bin 2923 -> 0 bytes doc/src/images/gtk-dial.png | Bin 7221 -> 0 bytes doc/src/images/gtk-doublespinbox.png | Bin 2325 -> 0 bytes doc/src/images/gtk-fontcombobox.png | Bin 3022 -> 0 bytes doc/src/images/gtk-frame.png | Bin 2340 -> 0 bytes doc/src/images/gtk-groupbox.png | Bin 6650 -> 0 bytes doc/src/images/gtk-horizontalscrollbar.png | Bin 1701 -> 0 bytes doc/src/images/gtk-label.png | Bin 1582 -> 0 bytes doc/src/images/gtk-lcdnumber.png | Bin 1193 -> 0 bytes doc/src/images/gtk-lineedit.png | Bin 2528 -> 0 bytes doc/src/images/gtk-listview.png | Bin 8493 -> 0 bytes doc/src/images/gtk-progressbar.png | Bin 2228 -> 0 bytes doc/src/images/gtk-pushbutton.png | Bin 2153 -> 0 bytes doc/src/images/gtk-radiobutton.png | Bin 3142 -> 0 bytes doc/src/images/gtk-slider.png | Bin 1359 -> 0 bytes doc/src/images/gtk-spinbox.png | Bin 2078 -> 0 bytes doc/src/images/gtk-tableview.png | Bin 8364 -> 0 bytes doc/src/images/gtk-tabwidget.png | Bin 8179 -> 0 bytes doc/src/images/gtk-textedit.png | Bin 12641 -> 0 bytes doc/src/images/gtk-timeedit.png | Bin 2621 -> 0 bytes doc/src/images/gtk-toolbox.png | Bin 4240 -> 0 bytes doc/src/images/gtk-toolbutton.png | Bin 2260 -> 0 bytes doc/src/images/gtk-treeview.png | Bin 9722 -> 0 bytes doc/src/images/javastyle/branchindicatorimage.png | Bin 18867 -> 0 bytes doc/src/images/javastyle/button.png | Bin 5475 -> 0 bytes doc/src/images/javastyle/checkbox.png | Bin 3634 -> 0 bytes doc/src/images/javastyle/checkboxexample.png | Bin 911 -> 0 bytes doc/src/images/javastyle/combobox.png | Bin 3537 -> 0 bytes doc/src/images/javastyle/comboboximage.png | Bin 6527 -> 0 bytes .../images/javastyle/conceptualpushbuttontree.png | Bin 3590 -> 0 bytes doc/src/images/javastyle/dockwidget.png | Bin 7181 -> 0 bytes doc/src/images/javastyle/dockwidgetimage.png | Bin 21774 -> 0 bytes doc/src/images/javastyle/groupbox.png | Bin 2010 -> 0 bytes doc/src/images/javastyle/groupboximage.png | Bin 7067 -> 0 bytes doc/src/images/javastyle/header.png | Bin 4399 -> 0 bytes doc/src/images/javastyle/headerimage.png | Bin 6474 -> 0 bytes doc/src/images/javastyle/menu.png | Bin 6508 -> 0 bytes doc/src/images/javastyle/menubar.png | Bin 4315 -> 0 bytes doc/src/images/javastyle/menubarimage.png | Bin 4487 -> 0 bytes doc/src/images/javastyle/menuimage.png | Bin 5584 -> 0 bytes doc/src/images/javastyle/progressbar.png | Bin 4493 -> 0 bytes doc/src/images/javastyle/progressbarimage.png | Bin 6921 -> 0 bytes doc/src/images/javastyle/pushbutton.png | Bin 6820 -> 0 bytes doc/src/images/javastyle/rubberband.png | Bin 765 -> 0 bytes doc/src/images/javastyle/rubberbandimage.png | Bin 6452 -> 0 bytes doc/src/images/javastyle/scrollbar.png | Bin 7199 -> 0 bytes doc/src/images/javastyle/scrollbarimage.png | Bin 6196 -> 0 bytes doc/src/images/javastyle/sizegrip.png | Bin 708 -> 0 bytes doc/src/images/javastyle/sizegripimage.png | Bin 1793 -> 0 bytes doc/src/images/javastyle/slider.png | Bin 2844 -> 0 bytes doc/src/images/javastyle/sliderimage.png | Bin 3442 -> 0 bytes doc/src/images/javastyle/spinbox.png | Bin 2864 -> 0 bytes doc/src/images/javastyle/spinboximage.png | Bin 4544 -> 0 bytes doc/src/images/javastyle/tab.png | Bin 12176 -> 0 bytes doc/src/images/javastyle/tabwidget.png | Bin 4725 -> 0 bytes doc/src/images/javastyle/titlebar.png | Bin 2609 -> 0 bytes doc/src/images/javastyle/titlebarimage.png | Bin 6882 -> 0 bytes doc/src/images/javastyle/toolbar.png | Bin 6303 -> 0 bytes doc/src/images/javastyle/toolbarimage.png | Bin 8245 -> 0 bytes doc/src/images/javastyle/toolbox.png | Bin 3211 -> 0 bytes doc/src/images/javastyle/toolboximage.png | Bin 5580 -> 0 bytes doc/src/images/javastyle/toolbutton.png | Bin 4487 -> 0 bytes doc/src/images/javastyle/toolbuttonimage.png | Bin 5124 -> 0 bytes doc/src/images/javastyle/windowstabimage.png | Bin 6898 -> 0 bytes doc/src/images/licensewizard-flow.png | Bin 15306 -> 0 bytes doc/src/images/macintosh-calendarwidget.png | Bin 13560 -> 0 bytes doc/src/images/macintosh-checkbox.png | Bin 2473 -> 0 bytes doc/src/images/macintosh-combobox.png | Bin 3273 -> 0 bytes doc/src/images/macintosh-dateedit.png | Bin 1703 -> 0 bytes doc/src/images/macintosh-datetimeedit.png | Bin 2633 -> 0 bytes doc/src/images/macintosh-dial.png | Bin 2563 -> 0 bytes doc/src/images/macintosh-doublespinbox.png | Bin 2306 -> 0 bytes doc/src/images/macintosh-fontcombobox.png | Bin 2967 -> 0 bytes doc/src/images/macintosh-frame.png | Bin 6187 -> 0 bytes doc/src/images/macintosh-groupbox.png | Bin 6469 -> 0 bytes doc/src/images/macintosh-horizontalscrollbar.png | Bin 2242 -> 0 bytes doc/src/images/macintosh-label.png | Bin 1450 -> 0 bytes doc/src/images/macintosh-lcdnumber.png | Bin 492 -> 0 bytes doc/src/images/macintosh-lineedit.png | Bin 1854 -> 0 bytes doc/src/images/macintosh-listview.png | Bin 9987 -> 0 bytes doc/src/images/macintosh-progressbar.png | Bin 1127 -> 0 bytes doc/src/images/macintosh-pushbutton.png | Bin 2966 -> 0 bytes doc/src/images/macintosh-radiobutton.png | Bin 2914 -> 0 bytes doc/src/images/macintosh-slider.png | Bin 1694 -> 0 bytes doc/src/images/macintosh-spinbox.png | Bin 1964 -> 0 bytes doc/src/images/macintosh-tableview.png | Bin 10024 -> 0 bytes doc/src/images/macintosh-tabwidget.png | Bin 9562 -> 0 bytes doc/src/images/macintosh-textedit.png | Bin 7845 -> 0 bytes doc/src/images/macintosh-timeedit.png | Bin 2244 -> 0 bytes doc/src/images/macintosh-toolbox.png | Bin 2576 -> 0 bytes doc/src/images/macintosh-toolbutton.png | Bin 2003 -> 0 bytes doc/src/images/macintosh-treeview.png | Bin 11728 -> 0 bytes doc/src/images/mainwindow-docks.png | Bin 37240 -> 0 bytes doc/src/images/mainwindowlayout.png | Bin 6782 -> 0 bytes doc/src/images/motif-calendarwidget.png | Bin 9989 -> 0 bytes doc/src/images/motif-checkbox.png | Bin 1284 -> 0 bytes doc/src/images/motif-combobox.png | Bin 1276 -> 0 bytes doc/src/images/motif-dateedit.png | Bin 1214 -> 0 bytes doc/src/images/motif-datetimeedit.png | Bin 1730 -> 0 bytes doc/src/images/motif-dial.png | Bin 2017 -> 0 bytes doc/src/images/motif-doublespinbox.png | Bin 1019 -> 0 bytes doc/src/images/motif-fontcombobox.png | Bin 1633 -> 0 bytes doc/src/images/motif-frame.png | Bin 5631 -> 0 bytes doc/src/images/motif-groupbox.png | Bin 2514 -> 0 bytes doc/src/images/motif-horizontalscrollbar.png | Bin 628 -> 0 bytes doc/src/images/motif-label.png | Bin 699 -> 0 bytes doc/src/images/motif-lcdnumber.png | Bin 538 -> 0 bytes doc/src/images/motif-lineedit.png | Bin 1360 -> 0 bytes doc/src/images/motif-listview.png | Bin 5189 -> 0 bytes doc/src/images/motif-progressbar.png | Bin 927 -> 0 bytes doc/src/images/motif-pushbutton.png | Bin 1045 -> 0 bytes doc/src/images/motif-radiobutton.png | Bin 1545 -> 0 bytes doc/src/images/motif-slider.png | Bin 543 -> 0 bytes doc/src/images/motif-spinbox.png | Bin 875 -> 0 bytes doc/src/images/motif-tableview.png | Bin 3102 -> 0 bytes doc/src/images/motif-tabwidget.png | Bin 2490 -> 0 bytes doc/src/images/motif-textedit.png | Bin 7378 -> 0 bytes doc/src/images/motif-timeedit.png | Bin 1280 -> 0 bytes doc/src/images/motif-toolbox.png | Bin 1667 -> 0 bytes doc/src/images/motif-toolbutton.png | Bin 1152 -> 0 bytes doc/src/images/motif-treeview.png | Bin 6386 -> 0 bytes doc/src/images/msgbox1.png | Bin 4529 -> 0 bytes doc/src/images/msgbox2.png | Bin 9175 -> 0 bytes doc/src/images/msgbox3.png | Bin 9589 -> 0 bytes doc/src/images/msgbox4.png | Bin 17520 -> 0 bytes doc/src/images/pangesture.png | Bin 7153 -> 0 bytes doc/src/images/parent-child-widgets.png | Bin 47824 -> 0 bytes doc/src/images/pinchgesture.png | Bin 10094 -> 0 bytes doc/src/images/plastique-calendarwidget.png | Bin 9629 -> 0 bytes doc/src/images/plastique-checkbox.png | Bin 1069 -> 0 bytes doc/src/images/plastique-colordialog.png | Bin 22595 -> 0 bytes doc/src/images/plastique-combobox.png | Bin 1714 -> 0 bytes doc/src/images/plastique-dateedit.png | Bin 1271 -> 0 bytes doc/src/images/plastique-datetimeedit.png | Bin 1771 -> 0 bytes doc/src/images/plastique-dial.png | Bin 2995 -> 0 bytes doc/src/images/plastique-doublespinbox.png | Bin 1102 -> 0 bytes doc/src/images/plastique-fontcombobox.png | Bin 1904 -> 0 bytes doc/src/images/plastique-fontdialog.png | Bin 23835 -> 0 bytes doc/src/images/plastique-frame.png | Bin 5616 -> 0 bytes doc/src/images/plastique-groupbox.png | Bin 2704 -> 0 bytes doc/src/images/plastique-horizontalscrollbar.png | Bin 868 -> 0 bytes doc/src/images/plastique-label.png | Bin 696 -> 0 bytes doc/src/images/plastique-lcdnumber.png | Bin 470 -> 0 bytes doc/src/images/plastique-lineedit.png | Bin 1015 -> 0 bytes doc/src/images/plastique-listview.png | Bin 4895 -> 0 bytes doc/src/images/plastique-progressbar.png | Bin 1044 -> 0 bytes doc/src/images/plastique-progressdialog.png | Bin 6311 -> 0 bytes doc/src/images/plastique-pushbutton.png | Bin 1409 -> 0 bytes doc/src/images/plastique-radiobutton.png | Bin 1667 -> 0 bytes doc/src/images/plastique-slider.png | Bin 632 -> 0 bytes doc/src/images/plastique-spinbox.png | Bin 968 -> 0 bytes doc/src/images/plastique-statusbar.png | Bin 878 -> 0 bytes doc/src/images/plastique-tableview.png | Bin 6052 -> 0 bytes doc/src/images/plastique-tabwidget.png | Bin 4705 -> 0 bytes doc/src/images/plastique-textedit.png | Bin 5141 -> 0 bytes doc/src/images/plastique-timeedit.png | Bin 1336 -> 0 bytes doc/src/images/plastique-toolbox.png | Bin 1858 -> 0 bytes doc/src/images/plastique-toolbutton.png | Bin 1254 -> 0 bytes doc/src/images/plastique-treeview.png | Bin 8453 -> 0 bytes doc/src/images/progressBar-stylesheet.png | Bin 455 -> 0 bytes doc/src/images/progressBar2-stylesheet.png | Bin 494 -> 0 bytes doc/src/images/propagation-custom.png | Bin 163413 -> 0 bytes doc/src/images/propagation-standard.png | Bin 83382 -> 0 bytes doc/src/images/qcalendarwidget-grid.png | Bin 9601 -> 0 bytes doc/src/images/qcalendarwidget-maximum.png | Bin 9709 -> 0 bytes doc/src/images/qcalendarwidget-minimum.png | Bin 9770 -> 0 bytes doc/src/images/qcolumnview.png | Bin 3075 -> 0 bytes doc/src/images/qdesktopwidget.png | Bin 42328 -> 0 bytes doc/src/images/qformlayout-with-6-children.png | Bin 3264 -> 0 bytes doc/src/images/qgraphicsproxywidget-embed.png | Bin 2199 -> 0 bytes doc/src/images/qgridlayout-with-5-children.png | Bin 3201 -> 0 bytes doc/src/images/qhboxlayout-with-5-children.png | Bin 2652 -> 0 bytes doc/src/images/qmdisubwindowlayout.png | Bin 3153 -> 0 bytes doc/src/images/qscrollbar-picture.png | Bin 6568 -> 0 bytes doc/src/images/qstyle-comboboxes.png | Bin 19437 -> 0 bytes doc/src/images/qstyleoptiontoolbar-position.png | Bin 13707 -> 0 bytes doc/src/images/qtwizard-macpage.png | Bin 23095 -> 0 bytes doc/src/images/qtwizard-nonmacpage.png | Bin 26557 -> 0 bytes doc/src/images/qundoview.png | Bin 5993 -> 0 bytes doc/src/images/qvboxlayout-with-5-children.png | Bin 2974 -> 0 bytes doc/src/images/stylesheet-border-image-normal.png | Bin 5769 -> 0 bytes doc/src/images/stylesheet-boxmodel.png | Bin 18144 -> 0 bytes doc/src/images/stylesheet-pagefold.png | Bin 15989 -> 0 bytes doc/src/images/stylesheet-redbutton1.png | Bin 378 -> 0 bytes doc/src/images/stylesheet-redbutton2.png | Bin 410 -> 0 bytes doc/src/images/stylesheet-redbutton3.png | Bin 664 -> 0 bytes doc/src/images/stylesheet-scrollbar1.png | Bin 150 -> 0 bytes doc/src/images/stylesheet-scrollbar2.png | Bin 169 -> 0 bytes doc/src/images/stylesheet-treeview.png | Bin 2412 -> 0 bytes doc/src/images/swipegesture.png | Bin 6864 -> 0 bytes doc/src/images/system-tray.png | Bin 6326 -> 0 bytes doc/src/images/tabWidget-stylesheet1.png | Bin 1321 -> 0 bytes doc/src/images/tabWidget-stylesheet2.png | Bin 1434 -> 0 bytes doc/src/images/tabWidget-stylesheet3.png | Bin 1206 -> 0 bytes doc/src/images/tableWidget-stylesheet.png | Bin 3478 -> 0 bytes doc/src/images/widgetdelegate.png | Bin 7449 -> 0 bytes doc/src/images/windows-calendarwidget.png | Bin 5055 -> 0 bytes doc/src/images/windows-checkbox.png | Bin 929 -> 0 bytes doc/src/images/windows-combobox.png | Bin 1002 -> 0 bytes doc/src/images/windows-dateedit.png | Bin 817 -> 0 bytes doc/src/images/windows-datetimeedit.png | Bin 1026 -> 0 bytes doc/src/images/windows-dial.png | Bin 4598 -> 0 bytes doc/src/images/windows-doublespinbox.png | Bin 762 -> 0 bytes doc/src/images/windows-fontcombobox.png | Bin 1022 -> 0 bytes doc/src/images/windows-frame.png | Bin 1837 -> 0 bytes doc/src/images/windows-groupbox.png | Bin 1617 -> 0 bytes doc/src/images/windows-horizontalscrollbar.png | Bin 566 -> 0 bytes doc/src/images/windows-label.png | Bin 696 -> 0 bytes doc/src/images/windows-lcdnumber.png | Bin 491 -> 0 bytes doc/src/images/windows-lineedit.png | Bin 884 -> 0 bytes doc/src/images/windows-listview.png | Bin 2781 -> 0 bytes doc/src/images/windows-progressbar.png | Bin 674 -> 0 bytes doc/src/images/windows-pushbutton.png | Bin 722 -> 0 bytes doc/src/images/windows-radiobutton.png | Bin 1005 -> 0 bytes doc/src/images/windows-slider.png | Bin 485 -> 0 bytes doc/src/images/windows-spinbox.png | Bin 667 -> 0 bytes doc/src/images/windows-tableview.png | Bin 1738 -> 0 bytes doc/src/images/windows-tabwidget.png | Bin 1707 -> 0 bytes doc/src/images/windows-textedit.png | Bin 3192 -> 0 bytes doc/src/images/windows-timeedit.png | Bin 873 -> 0 bytes doc/src/images/windows-toolbox.png | Bin 925 -> 0 bytes doc/src/images/windows-toolbutton.png | Bin 771 -> 0 bytes doc/src/images/windows-treeview.png | Bin 2723 -> 0 bytes doc/src/images/windowsvista-calendarwidget.png | Bin 5144 -> 0 bytes doc/src/images/windowsvista-checkbox.png | Bin 1115 -> 0 bytes doc/src/images/windowsvista-combobox.png | Bin 1457 -> 0 bytes doc/src/images/windowsvista-dateedit.png | Bin 855 -> 0 bytes doc/src/images/windowsvista-datetimeedit.png | Bin 1034 -> 0 bytes doc/src/images/windowsvista-dial.png | Bin 2431 -> 0 bytes doc/src/images/windowsvista-doublespinbox.png | Bin 852 -> 0 bytes doc/src/images/windowsvista-fontcombobox.png | Bin 919 -> 0 bytes doc/src/images/windowsvista-frame.png | Bin 1800 -> 0 bytes doc/src/images/windowsvista-groupbox.png | Bin 1991 -> 0 bytes .../images/windowsvista-horizontalscrollbar.png | Bin 1049 -> 0 bytes doc/src/images/windowsvista-label.png | Bin 599 -> 0 bytes doc/src/images/windowsvista-lcdnumber.png | Bin 491 -> 0 bytes doc/src/images/windowsvista-lineedit.png | Bin 873 -> 0 bytes doc/src/images/windowsvista-listview.png | Bin 6872 -> 0 bytes doc/src/images/windowsvista-progressbar.png | Bin 1437 -> 0 bytes doc/src/images/windowsvista-pushbutton.png | Bin 1085 -> 0 bytes doc/src/images/windowsvista-radiobutton.png | Bin 1266 -> 0 bytes doc/src/images/windowsvista-slider.png | Bin 624 -> 0 bytes doc/src/images/windowsvista-spinbox.png | Bin 767 -> 0 bytes doc/src/images/windowsvista-tableview.png | Bin 3941 -> 0 bytes doc/src/images/windowsvista-tabwidget.png | Bin 3286 -> 0 bytes doc/src/images/windowsvista-textedit.png | Bin 3122 -> 0 bytes doc/src/images/windowsvista-timeedit.png | Bin 764 -> 0 bytes doc/src/images/windowsvista-toolbox.png | Bin 891 -> 0 bytes doc/src/images/windowsvista-toolbutton.png | Bin 981 -> 0 bytes doc/src/images/windowsvista-treeview.png | Bin 5760 -> 0 bytes doc/src/images/windowsxp-calendarwidget.png | Bin 5009 -> 0 bytes doc/src/images/windowsxp-checkbox.png | Bin 1006 -> 0 bytes doc/src/images/windowsxp-combobox.png | Bin 1450 -> 0 bytes doc/src/images/windowsxp-dateedit.png | Bin 1107 -> 0 bytes doc/src/images/windowsxp-datetimeedit.png | Bin 1321 -> 0 bytes doc/src/images/windowsxp-dial.png | Bin 4598 -> 0 bytes doc/src/images/windowsxp-doublespinbox.png | Bin 1065 -> 0 bytes doc/src/images/windowsxp-fontcombobox.png | Bin 1408 -> 0 bytes doc/src/images/windowsxp-frame.png | Bin 1837 -> 0 bytes doc/src/images/windowsxp-groupbox.png | Bin 2016 -> 0 bytes doc/src/images/windowsxp-horizontalscrollbar.png | Bin 1498 -> 0 bytes doc/src/images/windowsxp-label.png | Bin 696 -> 0 bytes doc/src/images/windowsxp-lcdnumber.png | Bin 493 -> 0 bytes doc/src/images/windowsxp-lineedit.png | Bin 861 -> 0 bytes doc/src/images/windowsxp-listview.png | Bin 5391 -> 0 bytes doc/src/images/windowsxp-progressbar.png | Bin 1007 -> 0 bytes doc/src/images/windowsxp-pushbutton.png | Bin 1462 -> 0 bytes doc/src/images/windowsxp-radiobutton.png | Bin 1270 -> 0 bytes doc/src/images/windowsxp-slider.png | Bin 732 -> 0 bytes doc/src/images/windowsxp-spinbox.png | Bin 974 -> 0 bytes doc/src/images/windowsxp-tableview.png | Bin 3204 -> 0 bytes doc/src/images/windowsxp-tabwidget.png | Bin 5220 -> 0 bytes doc/src/images/windowsxp-textedit.png | Bin 3159 -> 0 bytes doc/src/images/windowsxp-timeedit.png | Bin 1172 -> 0 bytes doc/src/images/windowsxp-toolbox.png | Bin 925 -> 0 bytes doc/src/images/windowsxp-toolbutton.png | Bin 1549 -> 0 bytes doc/src/images/windowsxp-treeview.png | Bin 5795 -> 0 bytes doc/src/snippets/code/doc_src_layout.cpp | 166 - doc/src/snippets/code/doc_src_qt4-styles.cpp | 82 - doc/src/snippets/code/doc_src_styles.cpp | 134 - doc/src/snippets/code/doc_src_stylesheet.cpp | 140 - doc/src/snippets/code/doc_src_stylesheet.qdoc | 1866 --------- .../snippets/code/src_gui_dialogs_qfiledialog.cpp | 131 - .../snippets/code/src_gui_dialogs_qfontdialog.cpp | 85 - doc/src/snippets/code/src_gui_dialogs_qwizard.cpp | 80 - .../code/src_gui_effects_qgraphicseffect.cpp | 83 - .../src_gui_graphicsview_qgraphicsgridlayout.cpp | 53 - .../code/src_gui_graphicsview_qgraphicsitem.cpp | 278 -- .../src_gui_graphicsview_qgraphicslinearlayout.cpp | 53 - .../src_gui_graphicsview_qgraphicsproxywidget.cpp | 87 - .../code/src_gui_graphicsview_qgraphicsscene.cpp | 122 - .../src_gui_graphicsview_qgraphicssceneevent.cpp | 45 - .../code/src_gui_graphicsview_qgraphicsview.cpp | 132 - .../code/src_gui_graphicsview_qgraphicswidget.cpp | 66 - doc/src/snippets/code/src_gui_image_qicon.cpp | 71 - .../snippets/code/src_gui_image_qpixmapfilter.cpp | 62 - .../code/src_gui_itemviews_qabstractitemview.cpp | 58 - .../code/src_gui_itemviews_qdatawidgetmapper.cpp | 63 - .../code/src_gui_itemviews_qitemeditorfactory.cpp | 63 - .../code/src_gui_itemviews_qstandarditemmodel.cpp | 82 - .../code/src_gui_itemviews_qtablewidget.cpp | 45 - .../code/src_gui_itemviews_qtreewidget.cpp | 48 - doc/src/snippets/code/src_gui_kernel_qaction.cpp | 49 - .../snippets/code/src_gui_kernel_qformlayout.cpp | 76 - doc/src/snippets/code/src_gui_kernel_qlayout.cpp | 67 - .../snippets/code/src_gui_kernel_qlayoutitem.cpp | 53 - doc/src/snippets/code/src_gui_kernel_qshortcut.cpp | 55 - doc/src/snippets/code/src_gui_kernel_qwidget.cpp | 137 - .../snippets/code/src_gui_painting_qdrawutil.cpp | 98 - doc/src/snippets/code/src_gui_qproxystyle.cpp | 85 - doc/src/snippets/code/src_gui_styles_qstyle.cpp | 48 - .../snippets/code/src_gui_styles_qstyleoption.cpp | 54 - doc/src/snippets/code/src_gui_util_qcompleter.cpp | 63 - doc/src/snippets/code/src_gui_util_qundostack.cpp | 109 - .../code/src_gui_widgets_qabstractbutton.cpp | 60 - .../code/src_gui_widgets_qabstractspinbox.cpp | 48 - .../code/src_gui_widgets_qcalendarwidget.cpp | 79 - .../snippets/code/src_gui_widgets_qcheckbox.cpp | 43 - .../code/src_gui_widgets_qdatetimeedit.cpp | 79 - .../snippets/code/src_gui_widgets_qdockwidget.cpp | 48 - doc/src/snippets/code/src_gui_widgets_qframe.cpp | 48 - .../snippets/code/src_gui_widgets_qgroupbox.cpp | 43 - doc/src/snippets/code/src_gui_widgets_qlabel.cpp | 64 - .../snippets/code/src_gui_widgets_qlineedit.cpp | 50 - .../snippets/code/src_gui_widgets_qmainwindow.cpp | 59 - doc/src/snippets/code/src_gui_widgets_qmenu.cpp | 77 - doc/src/snippets/code/src_gui_widgets_qmenubar.cpp | 48 - .../code/src_gui_widgets_qplaintextedit.cpp | 55 - .../snippets/code/src_gui_widgets_qpushbutton.cpp | 43 - .../snippets/code/src_gui_widgets_qradiobutton.cpp | 43 - .../snippets/code/src_gui_widgets_qrubberband.cpp | 62 - .../snippets/code/src_gui_widgets_qscrollarea.cpp | 49 - doc/src/snippets/code/src_gui_widgets_qspinbox.cpp | 80 - .../code/src_gui_widgets_qsplashscreen.cpp | 55 - .../snippets/code/src_gui_widgets_qsplitter.cpp | 47 - .../snippets/code/src_gui_widgets_qstatusbar.cpp | 43 - .../snippets/code/src_gui_widgets_qtextbrowser.cpp | 44 - .../snippets/code/src_gui_widgets_qtextedit.cpp | 60 - doc/src/snippets/customstyle/customstyle.cpp | 92 - doc/src/snippets/customstyle/customstyle.h | 60 - doc/src/snippets/customviewstyle.cpp | 69 - doc/src/snippets/dialogs/dialogs.cpp | 268 -- doc/src/snippets/filedialogurls.cpp | 61 - doc/src/snippets/graphicssceneadditemsnippet.cpp | 80 - doc/src/snippets/javastyle.cpp | 2745 -------------- doc/src/snippets/layouts/layouts.cpp | 165 - doc/src/snippets/mainwindowsnippet.cpp | 92 - doc/src/snippets/mdiareasnippets.cpp | 97 - doc/src/snippets/myscrollarea.cpp | 128 - doc/src/snippets/qlistwidget-using/mainwindow.cpp | 158 - doc/src/snippets/qmacnativewidget/main.mm | 84 - doc/src/snippets/qsplashscreen/main.cpp | 63 - doc/src/snippets/qstackedlayout/main.cpp | 89 - doc/src/snippets/qstackedwidget/main.cpp | 87 - doc/src/snippets/qstyleoption/main.cpp | 139 - doc/src/snippets/qstyleplugin/main.cpp | 97 - .../snippets/qtablewidget-resizing/mainwindow.cpp | 115 - doc/src/snippets/qtablewidget-using/mainwindow.cpp | 150 - doc/src/snippets/qtreewidget-using/mainwindow.cpp | 230 -- .../qtreewidgetitemiterator-using/mainwindow.cpp | 197 - doc/src/snippets/shareddirmodel/main.cpp | 81 - doc/src/snippets/splitter/splitter.cpp | 84 - doc/src/snippets/splitterhandle/splitter.cpp | 78 - doc/src/snippets/splitterhandle/splitter.h | 73 - doc/src/snippets/styles/styles.cpp | 91 - doc/src/snippets/stylesheet/common-mistakes.cpp | 52 - .../snippets/textdocument-imagedrop/textedit.cpp | 71 - doc/src/snippets/timeline/main.cpp | 72 - doc/src/snippets/whatsthis/whatsthis.cpp | 64 - doc/src/snippets/widget-mask/main.cpp | 54 - doc/src/snippets/widgetdelegate.cpp | 66 - doc/src/widgets/qtwidgets.qdoc | 45 - doc/src/widgets/widgets-and-layouts/focus.qdoc | 186 - .../widgets/widgets-and-layouts/gallery-cde.qdoc | 133 - .../widgets-and-layouts/gallery-cleanlooks.qdoc | 138 - .../widgets/widgets-and-layouts/gallery-gtk.qdoc | 141 - .../widgets-and-layouts/gallery-macintosh.qdoc | 138 - .../widgets/widgets-and-layouts/gallery-motif.qdoc | 138 - .../widgets-and-layouts/gallery-plastique.qdoc | 138 - .../widgets-and-layouts/gallery-windows.qdoc | 138 - .../widgets-and-layouts/gallery-windowsvista.qdoc | 138 - .../widgets-and-layouts/gallery-windowsxp.qdoc | 138 - doc/src/widgets/widgets-and-layouts/gallery.qdoc | 84 - doc/src/widgets/widgets-and-layouts/layout.qdoc | 396 -- doc/src/widgets/widgets-and-layouts/styles.qdoc | 2102 ----------- .../widgets/widgets-and-layouts/stylesheet.qdoc | 3963 -------------------- doc/src/widgets/widgets-and-layouts/widgets.qdoc | 162 - 457 files changed, 20546 deletions(-) delete mode 100644 doc/src/images/cde-calendarwidget.png delete mode 100644 doc/src/images/cde-checkbox.png delete mode 100644 doc/src/images/cde-combobox.png delete mode 100644 doc/src/images/cde-dateedit.png delete mode 100644 doc/src/images/cde-datetimeedit.png delete mode 100644 doc/src/images/cde-dial.png delete mode 100644 doc/src/images/cde-doublespinbox.png delete mode 100644 doc/src/images/cde-fontcombobox.png delete mode 100644 doc/src/images/cde-frame.png delete mode 100644 doc/src/images/cde-groupbox.png delete mode 100644 doc/src/images/cde-horizontalscrollbar.png delete mode 100644 doc/src/images/cde-label.png delete mode 100644 doc/src/images/cde-lcdnumber.png delete mode 100644 doc/src/images/cde-lineedit.png delete mode 100644 doc/src/images/cde-listview.png delete mode 100644 doc/src/images/cde-progressbar.png delete mode 100644 doc/src/images/cde-pushbutton.png delete mode 100644 doc/src/images/cde-radiobutton.png delete mode 100644 doc/src/images/cde-slider.png delete mode 100644 doc/src/images/cde-spinbox.png delete mode 100644 doc/src/images/cde-tableview.png delete mode 100644 doc/src/images/cde-tabwidget.png delete mode 100644 doc/src/images/cde-textedit.png delete mode 100644 doc/src/images/cde-timeedit.png delete mode 100644 doc/src/images/cde-toolbox.png delete mode 100644 doc/src/images/cde-toolbutton.png delete mode 100644 doc/src/images/cde-treeview.png delete mode 100644 doc/src/images/cleanlooks-calendarwidget.png delete mode 100644 doc/src/images/cleanlooks-checkbox.png delete mode 100644 doc/src/images/cleanlooks-combobox.png delete mode 100644 doc/src/images/cleanlooks-dateedit.png delete mode 100644 doc/src/images/cleanlooks-datetimeedit.png delete mode 100644 doc/src/images/cleanlooks-dial.png delete mode 100644 doc/src/images/cleanlooks-doublespinbox.png delete mode 100644 doc/src/images/cleanlooks-fontcombobox.png delete mode 100644 doc/src/images/cleanlooks-frame.png delete mode 100644 doc/src/images/cleanlooks-groupbox.png delete mode 100644 doc/src/images/cleanlooks-horizontalscrollbar.png delete mode 100644 doc/src/images/cleanlooks-label.png delete mode 100644 doc/src/images/cleanlooks-lcdnumber.png delete mode 100644 doc/src/images/cleanlooks-lineedit.png delete mode 100644 doc/src/images/cleanlooks-listview.png delete mode 100644 doc/src/images/cleanlooks-progressbar.png delete mode 100644 doc/src/images/cleanlooks-pushbutton.png delete mode 100644 doc/src/images/cleanlooks-radiobutton.png delete mode 100644 doc/src/images/cleanlooks-slider.png delete mode 100644 doc/src/images/cleanlooks-spinbox.png delete mode 100644 doc/src/images/cleanlooks-tableview.png delete mode 100644 doc/src/images/cleanlooks-tabwidget.png delete mode 100644 doc/src/images/cleanlooks-textedit.png delete mode 100644 doc/src/images/cleanlooks-timeedit.png delete mode 100644 doc/src/images/cleanlooks-toolbox.png delete mode 100644 doc/src/images/cleanlooks-toolbutton.png delete mode 100644 doc/src/images/cleanlooks-treeview.png delete mode 100644 doc/src/images/designer-stylesheet-options.png delete mode 100644 doc/src/images/designer-stylesheet-usage.png delete mode 100644 doc/src/images/designer-validator-highlighter.png delete mode 100644 doc/src/images/filedialogurls.png delete mode 100644 doc/src/images/frames.png delete mode 100644 doc/src/images/graphicsview-items.png delete mode 100644 doc/src/images/graphicsview-pathitem.png delete mode 100644 doc/src/images/graphicsview-pixmapitem.png delete mode 100644 doc/src/images/graphicsview-polygonitem.png delete mode 100644 doc/src/images/graphicsview-rectitem.png delete mode 100644 doc/src/images/graphicsview-zorder.png delete mode 100644 doc/src/images/gridlayout.png delete mode 100644 doc/src/images/gtk-calendarwidget.png delete mode 100644 doc/src/images/gtk-checkbox.png delete mode 100644 doc/src/images/gtk-combobox.png delete mode 100644 doc/src/images/gtk-dateedit.png delete mode 100644 doc/src/images/gtk-datetimeedit.png delete mode 100644 doc/src/images/gtk-dial.png delete mode 100644 doc/src/images/gtk-doublespinbox.png delete mode 100644 doc/src/images/gtk-fontcombobox.png delete mode 100644 doc/src/images/gtk-frame.png delete mode 100644 doc/src/images/gtk-groupbox.png delete mode 100644 doc/src/images/gtk-horizontalscrollbar.png delete mode 100644 doc/src/images/gtk-label.png delete mode 100644 doc/src/images/gtk-lcdnumber.png delete mode 100644 doc/src/images/gtk-lineedit.png delete mode 100644 doc/src/images/gtk-listview.png delete mode 100644 doc/src/images/gtk-progressbar.png delete mode 100644 doc/src/images/gtk-pushbutton.png delete mode 100644 doc/src/images/gtk-radiobutton.png delete mode 100644 doc/src/images/gtk-slider.png delete mode 100644 doc/src/images/gtk-spinbox.png delete mode 100644 doc/src/images/gtk-tableview.png delete mode 100644 doc/src/images/gtk-tabwidget.png delete mode 100644 doc/src/images/gtk-textedit.png delete mode 100644 doc/src/images/gtk-timeedit.png delete mode 100644 doc/src/images/gtk-toolbox.png delete mode 100644 doc/src/images/gtk-toolbutton.png delete mode 100644 doc/src/images/gtk-treeview.png delete mode 100644 doc/src/images/javastyle/branchindicatorimage.png delete mode 100644 doc/src/images/javastyle/button.png delete mode 100644 doc/src/images/javastyle/checkbox.png delete mode 100644 doc/src/images/javastyle/checkboxexample.png delete mode 100644 doc/src/images/javastyle/combobox.png delete mode 100644 doc/src/images/javastyle/comboboximage.png delete mode 100644 doc/src/images/javastyle/conceptualpushbuttontree.png delete mode 100644 doc/src/images/javastyle/dockwidget.png delete mode 100644 doc/src/images/javastyle/dockwidgetimage.png delete mode 100644 doc/src/images/javastyle/groupbox.png delete mode 100644 doc/src/images/javastyle/groupboximage.png delete mode 100644 doc/src/images/javastyle/header.png delete mode 100644 doc/src/images/javastyle/headerimage.png delete mode 100644 doc/src/images/javastyle/menu.png delete mode 100644 doc/src/images/javastyle/menubar.png delete mode 100644 doc/src/images/javastyle/menubarimage.png delete mode 100644 doc/src/images/javastyle/menuimage.png delete mode 100644 doc/src/images/javastyle/progressbar.png delete mode 100644 doc/src/images/javastyle/progressbarimage.png delete mode 100644 doc/src/images/javastyle/pushbutton.png delete mode 100644 doc/src/images/javastyle/rubberband.png delete mode 100644 doc/src/images/javastyle/rubberbandimage.png delete mode 100644 doc/src/images/javastyle/scrollbar.png delete mode 100644 doc/src/images/javastyle/scrollbarimage.png delete mode 100644 doc/src/images/javastyle/sizegrip.png delete mode 100644 doc/src/images/javastyle/sizegripimage.png delete mode 100644 doc/src/images/javastyle/slider.png delete mode 100644 doc/src/images/javastyle/sliderimage.png delete mode 100644 doc/src/images/javastyle/spinbox.png delete mode 100644 doc/src/images/javastyle/spinboximage.png delete mode 100644 doc/src/images/javastyle/tab.png delete mode 100644 doc/src/images/javastyle/tabwidget.png delete mode 100644 doc/src/images/javastyle/titlebar.png delete mode 100644 doc/src/images/javastyle/titlebarimage.png delete mode 100644 doc/src/images/javastyle/toolbar.png delete mode 100644 doc/src/images/javastyle/toolbarimage.png delete mode 100644 doc/src/images/javastyle/toolbox.png delete mode 100644 doc/src/images/javastyle/toolboximage.png delete mode 100644 doc/src/images/javastyle/toolbutton.png delete mode 100644 doc/src/images/javastyle/toolbuttonimage.png delete mode 100644 doc/src/images/javastyle/windowstabimage.png delete mode 100644 doc/src/images/licensewizard-flow.png delete mode 100644 doc/src/images/macintosh-calendarwidget.png delete mode 100644 doc/src/images/macintosh-checkbox.png delete mode 100644 doc/src/images/macintosh-combobox.png delete mode 100644 doc/src/images/macintosh-dateedit.png delete mode 100644 doc/src/images/macintosh-datetimeedit.png delete mode 100644 doc/src/images/macintosh-dial.png delete mode 100644 doc/src/images/macintosh-doublespinbox.png delete mode 100644 doc/src/images/macintosh-fontcombobox.png delete mode 100644 doc/src/images/macintosh-frame.png delete mode 100644 doc/src/images/macintosh-groupbox.png delete mode 100644 doc/src/images/macintosh-horizontalscrollbar.png delete mode 100644 doc/src/images/macintosh-label.png delete mode 100644 doc/src/images/macintosh-lcdnumber.png delete mode 100644 doc/src/images/macintosh-lineedit.png delete mode 100644 doc/src/images/macintosh-listview.png delete mode 100644 doc/src/images/macintosh-progressbar.png delete mode 100644 doc/src/images/macintosh-pushbutton.png delete mode 100644 doc/src/images/macintosh-radiobutton.png delete mode 100644 doc/src/images/macintosh-slider.png delete mode 100644 doc/src/images/macintosh-spinbox.png delete mode 100644 doc/src/images/macintosh-tableview.png delete mode 100644 doc/src/images/macintosh-tabwidget.png delete mode 100644 doc/src/images/macintosh-textedit.png delete mode 100644 doc/src/images/macintosh-timeedit.png delete mode 100644 doc/src/images/macintosh-toolbox.png delete mode 100644 doc/src/images/macintosh-toolbutton.png delete mode 100644 doc/src/images/macintosh-treeview.png delete mode 100644 doc/src/images/mainwindow-docks.png delete mode 100644 doc/src/images/mainwindowlayout.png delete mode 100644 doc/src/images/motif-calendarwidget.png delete mode 100644 doc/src/images/motif-checkbox.png delete mode 100644 doc/src/images/motif-combobox.png delete mode 100644 doc/src/images/motif-dateedit.png delete mode 100644 doc/src/images/motif-datetimeedit.png delete mode 100644 doc/src/images/motif-dial.png delete mode 100644 doc/src/images/motif-doublespinbox.png delete mode 100644 doc/src/images/motif-fontcombobox.png delete mode 100644 doc/src/images/motif-frame.png delete mode 100644 doc/src/images/motif-groupbox.png delete mode 100644 doc/src/images/motif-horizontalscrollbar.png delete mode 100644 doc/src/images/motif-label.png delete mode 100644 doc/src/images/motif-lcdnumber.png delete mode 100644 doc/src/images/motif-lineedit.png delete mode 100644 doc/src/images/motif-listview.png delete mode 100644 doc/src/images/motif-progressbar.png delete mode 100644 doc/src/images/motif-pushbutton.png delete mode 100644 doc/src/images/motif-radiobutton.png delete mode 100644 doc/src/images/motif-slider.png delete mode 100644 doc/src/images/motif-spinbox.png delete mode 100644 doc/src/images/motif-tableview.png delete mode 100644 doc/src/images/motif-tabwidget.png delete mode 100644 doc/src/images/motif-textedit.png delete mode 100644 doc/src/images/motif-timeedit.png delete mode 100644 doc/src/images/motif-toolbox.png delete mode 100644 doc/src/images/motif-toolbutton.png delete mode 100644 doc/src/images/motif-treeview.png delete mode 100644 doc/src/images/msgbox1.png delete mode 100644 doc/src/images/msgbox2.png delete mode 100644 doc/src/images/msgbox3.png delete mode 100644 doc/src/images/msgbox4.png delete mode 100644 doc/src/images/pangesture.png delete mode 100644 doc/src/images/parent-child-widgets.png delete mode 100644 doc/src/images/pinchgesture.png delete mode 100644 doc/src/images/plastique-calendarwidget.png delete mode 100644 doc/src/images/plastique-checkbox.png delete mode 100644 doc/src/images/plastique-colordialog.png delete mode 100644 doc/src/images/plastique-combobox.png delete mode 100644 doc/src/images/plastique-dateedit.png delete mode 100644 doc/src/images/plastique-datetimeedit.png delete mode 100644 doc/src/images/plastique-dial.png delete mode 100644 doc/src/images/plastique-doublespinbox.png delete mode 100644 doc/src/images/plastique-fontcombobox.png delete mode 100644 doc/src/images/plastique-fontdialog.png delete mode 100644 doc/src/images/plastique-frame.png delete mode 100644 doc/src/images/plastique-groupbox.png delete mode 100644 doc/src/images/plastique-horizontalscrollbar.png delete mode 100644 doc/src/images/plastique-label.png delete mode 100644 doc/src/images/plastique-lcdnumber.png delete mode 100644 doc/src/images/plastique-lineedit.png delete mode 100644 doc/src/images/plastique-listview.png delete mode 100644 doc/src/images/plastique-progressbar.png delete mode 100644 doc/src/images/plastique-progressdialog.png delete mode 100644 doc/src/images/plastique-pushbutton.png delete mode 100644 doc/src/images/plastique-radiobutton.png delete mode 100644 doc/src/images/plastique-slider.png delete mode 100644 doc/src/images/plastique-spinbox.png delete mode 100644 doc/src/images/plastique-statusbar.png delete mode 100644 doc/src/images/plastique-tableview.png delete mode 100644 doc/src/images/plastique-tabwidget.png delete mode 100644 doc/src/images/plastique-textedit.png delete mode 100644 doc/src/images/plastique-timeedit.png delete mode 100644 doc/src/images/plastique-toolbox.png delete mode 100644 doc/src/images/plastique-toolbutton.png delete mode 100644 doc/src/images/plastique-treeview.png delete mode 100644 doc/src/images/progressBar-stylesheet.png delete mode 100644 doc/src/images/progressBar2-stylesheet.png delete mode 100644 doc/src/images/propagation-custom.png delete mode 100644 doc/src/images/propagation-standard.png delete mode 100644 doc/src/images/qcalendarwidget-grid.png delete mode 100644 doc/src/images/qcalendarwidget-maximum.png delete mode 100644 doc/src/images/qcalendarwidget-minimum.png delete mode 100644 doc/src/images/qcolumnview.png delete mode 100644 doc/src/images/qdesktopwidget.png delete mode 100644 doc/src/images/qformlayout-with-6-children.png delete mode 100644 doc/src/images/qgraphicsproxywidget-embed.png delete mode 100644 doc/src/images/qgridlayout-with-5-children.png delete mode 100644 doc/src/images/qhboxlayout-with-5-children.png delete mode 100644 doc/src/images/qmdisubwindowlayout.png delete mode 100644 doc/src/images/qscrollbar-picture.png delete mode 100644 doc/src/images/qstyle-comboboxes.png delete mode 100644 doc/src/images/qstyleoptiontoolbar-position.png delete mode 100644 doc/src/images/qtwizard-macpage.png delete mode 100644 doc/src/images/qtwizard-nonmacpage.png delete mode 100644 doc/src/images/qundoview.png delete mode 100644 doc/src/images/qvboxlayout-with-5-children.png delete mode 100644 doc/src/images/stylesheet-border-image-normal.png delete mode 100644 doc/src/images/stylesheet-boxmodel.png delete mode 100644 doc/src/images/stylesheet-pagefold.png delete mode 100644 doc/src/images/stylesheet-redbutton1.png delete mode 100644 doc/src/images/stylesheet-redbutton2.png delete mode 100644 doc/src/images/stylesheet-redbutton3.png delete mode 100644 doc/src/images/stylesheet-scrollbar1.png delete mode 100644 doc/src/images/stylesheet-scrollbar2.png delete mode 100644 doc/src/images/stylesheet-treeview.png delete mode 100644 doc/src/images/swipegesture.png delete mode 100644 doc/src/images/system-tray.png delete mode 100644 doc/src/images/tabWidget-stylesheet1.png delete mode 100644 doc/src/images/tabWidget-stylesheet2.png delete mode 100644 doc/src/images/tabWidget-stylesheet3.png delete mode 100644 doc/src/images/tableWidget-stylesheet.png delete mode 100644 doc/src/images/widgetdelegate.png delete mode 100644 doc/src/images/windows-calendarwidget.png delete mode 100644 doc/src/images/windows-checkbox.png delete mode 100644 doc/src/images/windows-combobox.png delete mode 100644 doc/src/images/windows-dateedit.png delete mode 100644 doc/src/images/windows-datetimeedit.png delete mode 100644 doc/src/images/windows-dial.png delete mode 100644 doc/src/images/windows-doublespinbox.png delete mode 100644 doc/src/images/windows-fontcombobox.png delete mode 100644 doc/src/images/windows-frame.png delete mode 100644 doc/src/images/windows-groupbox.png delete mode 100644 doc/src/images/windows-horizontalscrollbar.png delete mode 100644 doc/src/images/windows-label.png delete mode 100644 doc/src/images/windows-lcdnumber.png delete mode 100644 doc/src/images/windows-lineedit.png delete mode 100644 doc/src/images/windows-listview.png delete mode 100644 doc/src/images/windows-progressbar.png delete mode 100644 doc/src/images/windows-pushbutton.png delete mode 100644 doc/src/images/windows-radiobutton.png delete mode 100644 doc/src/images/windows-slider.png delete mode 100644 doc/src/images/windows-spinbox.png delete mode 100644 doc/src/images/windows-tableview.png delete mode 100644 doc/src/images/windows-tabwidget.png delete mode 100644 doc/src/images/windows-textedit.png delete mode 100644 doc/src/images/windows-timeedit.png delete mode 100644 doc/src/images/windows-toolbox.png delete mode 100644 doc/src/images/windows-toolbutton.png delete mode 100644 doc/src/images/windows-treeview.png delete mode 100644 doc/src/images/windowsvista-calendarwidget.png delete mode 100644 doc/src/images/windowsvista-checkbox.png delete mode 100644 doc/src/images/windowsvista-combobox.png delete mode 100644 doc/src/images/windowsvista-dateedit.png delete mode 100644 doc/src/images/windowsvista-datetimeedit.png delete mode 100644 doc/src/images/windowsvista-dial.png delete mode 100644 doc/src/images/windowsvista-doublespinbox.png delete mode 100644 doc/src/images/windowsvista-fontcombobox.png delete mode 100644 doc/src/images/windowsvista-frame.png delete mode 100644 doc/src/images/windowsvista-groupbox.png delete mode 100644 doc/src/images/windowsvista-horizontalscrollbar.png delete mode 100644 doc/src/images/windowsvista-label.png delete mode 100644 doc/src/images/windowsvista-lcdnumber.png delete mode 100644 doc/src/images/windowsvista-lineedit.png delete mode 100644 doc/src/images/windowsvista-listview.png delete mode 100644 doc/src/images/windowsvista-progressbar.png delete mode 100644 doc/src/images/windowsvista-pushbutton.png delete mode 100644 doc/src/images/windowsvista-radiobutton.png delete mode 100644 doc/src/images/windowsvista-slider.png delete mode 100644 doc/src/images/windowsvista-spinbox.png delete mode 100644 doc/src/images/windowsvista-tableview.png delete mode 100644 doc/src/images/windowsvista-tabwidget.png delete mode 100644 doc/src/images/windowsvista-textedit.png delete mode 100644 doc/src/images/windowsvista-timeedit.png delete mode 100644 doc/src/images/windowsvista-toolbox.png delete mode 100644 doc/src/images/windowsvista-toolbutton.png delete mode 100644 doc/src/images/windowsvista-treeview.png delete mode 100644 doc/src/images/windowsxp-calendarwidget.png delete mode 100644 doc/src/images/windowsxp-checkbox.png delete mode 100644 doc/src/images/windowsxp-combobox.png delete mode 100644 doc/src/images/windowsxp-dateedit.png delete mode 100644 doc/src/images/windowsxp-datetimeedit.png delete mode 100644 doc/src/images/windowsxp-dial.png delete mode 100644 doc/src/images/windowsxp-doublespinbox.png delete mode 100644 doc/src/images/windowsxp-fontcombobox.png delete mode 100644 doc/src/images/windowsxp-frame.png delete mode 100644 doc/src/images/windowsxp-groupbox.png delete mode 100644 doc/src/images/windowsxp-horizontalscrollbar.png delete mode 100644 doc/src/images/windowsxp-label.png delete mode 100644 doc/src/images/windowsxp-lcdnumber.png delete mode 100644 doc/src/images/windowsxp-lineedit.png delete mode 100644 doc/src/images/windowsxp-listview.png delete mode 100644 doc/src/images/windowsxp-progressbar.png delete mode 100644 doc/src/images/windowsxp-pushbutton.png delete mode 100644 doc/src/images/windowsxp-radiobutton.png delete mode 100644 doc/src/images/windowsxp-slider.png delete mode 100644 doc/src/images/windowsxp-spinbox.png delete mode 100644 doc/src/images/windowsxp-tableview.png delete mode 100644 doc/src/images/windowsxp-tabwidget.png delete mode 100644 doc/src/images/windowsxp-textedit.png delete mode 100644 doc/src/images/windowsxp-timeedit.png delete mode 100644 doc/src/images/windowsxp-toolbox.png delete mode 100644 doc/src/images/windowsxp-toolbutton.png delete mode 100644 doc/src/images/windowsxp-treeview.png delete mode 100644 doc/src/snippets/code/doc_src_layout.cpp delete mode 100644 doc/src/snippets/code/doc_src_qt4-styles.cpp delete mode 100644 doc/src/snippets/code/doc_src_styles.cpp delete mode 100644 doc/src/snippets/code/doc_src_stylesheet.cpp delete mode 100644 doc/src/snippets/code/doc_src_stylesheet.qdoc delete mode 100644 doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp delete mode 100644 doc/src/snippets/code/src_gui_dialogs_qfontdialog.cpp delete mode 100644 doc/src/snippets/code/src_gui_dialogs_qwizard.cpp delete mode 100644 doc/src/snippets/code/src_gui_effects_qgraphicseffect.cpp delete mode 100644 doc/src/snippets/code/src_gui_graphicsview_qgraphicsgridlayout.cpp delete mode 100644 doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp delete mode 100644 doc/src/snippets/code/src_gui_graphicsview_qgraphicslinearlayout.cpp delete mode 100644 doc/src/snippets/code/src_gui_graphicsview_qgraphicsproxywidget.cpp delete mode 100644 doc/src/snippets/code/src_gui_graphicsview_qgraphicsscene.cpp delete mode 100644 doc/src/snippets/code/src_gui_graphicsview_qgraphicssceneevent.cpp delete mode 100644 doc/src/snippets/code/src_gui_graphicsview_qgraphicsview.cpp delete mode 100644 doc/src/snippets/code/src_gui_graphicsview_qgraphicswidget.cpp delete mode 100644 doc/src/snippets/code/src_gui_image_qicon.cpp delete mode 100644 doc/src/snippets/code/src_gui_image_qpixmapfilter.cpp delete mode 100644 doc/src/snippets/code/src_gui_itemviews_qabstractitemview.cpp delete mode 100644 doc/src/snippets/code/src_gui_itemviews_qdatawidgetmapper.cpp delete mode 100644 doc/src/snippets/code/src_gui_itemviews_qitemeditorfactory.cpp delete mode 100644 doc/src/snippets/code/src_gui_itemviews_qstandarditemmodel.cpp delete mode 100644 doc/src/snippets/code/src_gui_itemviews_qtablewidget.cpp delete mode 100644 doc/src/snippets/code/src_gui_itemviews_qtreewidget.cpp delete mode 100644 doc/src/snippets/code/src_gui_kernel_qaction.cpp delete mode 100644 doc/src/snippets/code/src_gui_kernel_qformlayout.cpp delete mode 100644 doc/src/snippets/code/src_gui_kernel_qlayout.cpp delete mode 100644 doc/src/snippets/code/src_gui_kernel_qlayoutitem.cpp delete mode 100644 doc/src/snippets/code/src_gui_kernel_qshortcut.cpp delete mode 100644 doc/src/snippets/code/src_gui_kernel_qwidget.cpp delete mode 100644 doc/src/snippets/code/src_gui_painting_qdrawutil.cpp delete mode 100644 doc/src/snippets/code/src_gui_qproxystyle.cpp delete mode 100644 doc/src/snippets/code/src_gui_styles_qstyle.cpp delete mode 100644 doc/src/snippets/code/src_gui_styles_qstyleoption.cpp delete mode 100644 doc/src/snippets/code/src_gui_util_qcompleter.cpp delete mode 100644 doc/src/snippets/code/src_gui_util_qundostack.cpp delete mode 100644 doc/src/snippets/code/src_gui_widgets_qabstractbutton.cpp delete mode 100644 doc/src/snippets/code/src_gui_widgets_qabstractspinbox.cpp delete mode 100644 doc/src/snippets/code/src_gui_widgets_qcalendarwidget.cpp delete mode 100644 doc/src/snippets/code/src_gui_widgets_qcheckbox.cpp delete mode 100644 doc/src/snippets/code/src_gui_widgets_qdatetimeedit.cpp delete mode 100644 doc/src/snippets/code/src_gui_widgets_qdockwidget.cpp delete mode 100644 doc/src/snippets/code/src_gui_widgets_qframe.cpp delete mode 100644 doc/src/snippets/code/src_gui_widgets_qgroupbox.cpp delete mode 100644 doc/src/snippets/code/src_gui_widgets_qlabel.cpp delete mode 100644 doc/src/snippets/code/src_gui_widgets_qlineedit.cpp delete mode 100644 doc/src/snippets/code/src_gui_widgets_qmainwindow.cpp delete mode 100644 doc/src/snippets/code/src_gui_widgets_qmenu.cpp delete mode 100644 doc/src/snippets/code/src_gui_widgets_qmenubar.cpp delete mode 100644 doc/src/snippets/code/src_gui_widgets_qplaintextedit.cpp delete mode 100644 doc/src/snippets/code/src_gui_widgets_qpushbutton.cpp delete mode 100644 doc/src/snippets/code/src_gui_widgets_qradiobutton.cpp delete mode 100644 doc/src/snippets/code/src_gui_widgets_qrubberband.cpp delete mode 100644 doc/src/snippets/code/src_gui_widgets_qscrollarea.cpp delete mode 100644 doc/src/snippets/code/src_gui_widgets_qspinbox.cpp delete mode 100644 doc/src/snippets/code/src_gui_widgets_qsplashscreen.cpp delete mode 100644 doc/src/snippets/code/src_gui_widgets_qsplitter.cpp delete mode 100644 doc/src/snippets/code/src_gui_widgets_qstatusbar.cpp delete mode 100644 doc/src/snippets/code/src_gui_widgets_qtextbrowser.cpp delete mode 100644 doc/src/snippets/code/src_gui_widgets_qtextedit.cpp delete mode 100644 doc/src/snippets/customstyle/customstyle.cpp delete mode 100644 doc/src/snippets/customstyle/customstyle.h delete mode 100644 doc/src/snippets/customviewstyle.cpp delete mode 100644 doc/src/snippets/dialogs/dialogs.cpp delete mode 100644 doc/src/snippets/filedialogurls.cpp delete mode 100644 doc/src/snippets/graphicssceneadditemsnippet.cpp delete mode 100644 doc/src/snippets/javastyle.cpp delete mode 100644 doc/src/snippets/layouts/layouts.cpp delete mode 100644 doc/src/snippets/mainwindowsnippet.cpp delete mode 100644 doc/src/snippets/mdiareasnippets.cpp delete mode 100644 doc/src/snippets/myscrollarea.cpp delete mode 100644 doc/src/snippets/qlistwidget-using/mainwindow.cpp delete mode 100644 doc/src/snippets/qmacnativewidget/main.mm delete mode 100644 doc/src/snippets/qsplashscreen/main.cpp delete mode 100644 doc/src/snippets/qstackedlayout/main.cpp delete mode 100644 doc/src/snippets/qstackedwidget/main.cpp delete mode 100644 doc/src/snippets/qstyleoption/main.cpp delete mode 100644 doc/src/snippets/qstyleplugin/main.cpp delete mode 100644 doc/src/snippets/qtablewidget-resizing/mainwindow.cpp delete mode 100644 doc/src/snippets/qtablewidget-using/mainwindow.cpp delete mode 100644 doc/src/snippets/qtreewidget-using/mainwindow.cpp delete mode 100644 doc/src/snippets/qtreewidgetitemiterator-using/mainwindow.cpp delete mode 100644 doc/src/snippets/shareddirmodel/main.cpp delete mode 100644 doc/src/snippets/splitter/splitter.cpp delete mode 100644 doc/src/snippets/splitterhandle/splitter.cpp delete mode 100644 doc/src/snippets/splitterhandle/splitter.h delete mode 100644 doc/src/snippets/styles/styles.cpp delete mode 100644 doc/src/snippets/stylesheet/common-mistakes.cpp delete mode 100644 doc/src/snippets/textdocument-imagedrop/textedit.cpp delete mode 100644 doc/src/snippets/timeline/main.cpp delete mode 100644 doc/src/snippets/whatsthis/whatsthis.cpp delete mode 100644 doc/src/snippets/widget-mask/main.cpp delete mode 100644 doc/src/snippets/widgetdelegate.cpp delete mode 100644 doc/src/widgets/qtwidgets.qdoc delete mode 100644 doc/src/widgets/widgets-and-layouts/focus.qdoc delete mode 100644 doc/src/widgets/widgets-and-layouts/gallery-cde.qdoc delete mode 100644 doc/src/widgets/widgets-and-layouts/gallery-cleanlooks.qdoc delete mode 100644 doc/src/widgets/widgets-and-layouts/gallery-gtk.qdoc delete mode 100644 doc/src/widgets/widgets-and-layouts/gallery-macintosh.qdoc delete mode 100644 doc/src/widgets/widgets-and-layouts/gallery-motif.qdoc delete mode 100644 doc/src/widgets/widgets-and-layouts/gallery-plastique.qdoc delete mode 100644 doc/src/widgets/widgets-and-layouts/gallery-windows.qdoc delete mode 100644 doc/src/widgets/widgets-and-layouts/gallery-windowsvista.qdoc delete mode 100644 doc/src/widgets/widgets-and-layouts/gallery-windowsxp.qdoc delete mode 100644 doc/src/widgets/widgets-and-layouts/gallery.qdoc delete mode 100644 doc/src/widgets/widgets-and-layouts/layout.qdoc delete mode 100644 doc/src/widgets/widgets-and-layouts/styles.qdoc delete mode 100644 doc/src/widgets/widgets-and-layouts/stylesheet.qdoc delete mode 100644 doc/src/widgets/widgets-and-layouts/widgets.qdoc (limited to 'doc') diff --git a/doc/src/images/cde-calendarwidget.png b/doc/src/images/cde-calendarwidget.png deleted file mode 100644 index 9615eaeab8..0000000000 Binary files a/doc/src/images/cde-calendarwidget.png and /dev/null differ diff --git a/doc/src/images/cde-checkbox.png b/doc/src/images/cde-checkbox.png deleted file mode 100644 index b2528dc5de..0000000000 Binary files a/doc/src/images/cde-checkbox.png and /dev/null differ diff --git a/doc/src/images/cde-combobox.png b/doc/src/images/cde-combobox.png deleted file mode 100644 index 74586433eb..0000000000 Binary files a/doc/src/images/cde-combobox.png and /dev/null differ diff --git a/doc/src/images/cde-dateedit.png b/doc/src/images/cde-dateedit.png deleted file mode 100644 index ebb24d59cf..0000000000 Binary files a/doc/src/images/cde-dateedit.png and /dev/null differ diff --git a/doc/src/images/cde-datetimeedit.png b/doc/src/images/cde-datetimeedit.png deleted file mode 100644 index 9ac659a3f3..0000000000 Binary files a/doc/src/images/cde-datetimeedit.png and /dev/null differ diff --git a/doc/src/images/cde-dial.png b/doc/src/images/cde-dial.png deleted file mode 100644 index 956d19cb6c..0000000000 Binary files a/doc/src/images/cde-dial.png and /dev/null differ diff --git a/doc/src/images/cde-doublespinbox.png b/doc/src/images/cde-doublespinbox.png deleted file mode 100644 index 30a9af66fa..0000000000 Binary files a/doc/src/images/cde-doublespinbox.png and /dev/null differ diff --git a/doc/src/images/cde-fontcombobox.png b/doc/src/images/cde-fontcombobox.png deleted file mode 100644 index 043ca1d20f..0000000000 Binary files a/doc/src/images/cde-fontcombobox.png and /dev/null differ diff --git a/doc/src/images/cde-frame.png b/doc/src/images/cde-frame.png deleted file mode 100644 index 221576e849..0000000000 Binary files a/doc/src/images/cde-frame.png and /dev/null differ diff --git a/doc/src/images/cde-groupbox.png b/doc/src/images/cde-groupbox.png deleted file mode 100644 index 8bad69be4e..0000000000 Binary files a/doc/src/images/cde-groupbox.png and /dev/null differ diff --git a/doc/src/images/cde-horizontalscrollbar.png b/doc/src/images/cde-horizontalscrollbar.png deleted file mode 100644 index 6e7cde8da1..0000000000 Binary files a/doc/src/images/cde-horizontalscrollbar.png and /dev/null differ diff --git a/doc/src/images/cde-label.png b/doc/src/images/cde-label.png deleted file mode 100644 index 4e906eaa00..0000000000 Binary files a/doc/src/images/cde-label.png and /dev/null differ diff --git a/doc/src/images/cde-lcdnumber.png b/doc/src/images/cde-lcdnumber.png deleted file mode 100644 index 97324c1a6c..0000000000 Binary files a/doc/src/images/cde-lcdnumber.png and /dev/null differ diff --git a/doc/src/images/cde-lineedit.png b/doc/src/images/cde-lineedit.png deleted file mode 100644 index 6c1527ba19..0000000000 Binary files a/doc/src/images/cde-lineedit.png and /dev/null differ diff --git a/doc/src/images/cde-listview.png b/doc/src/images/cde-listview.png deleted file mode 100644 index 2e58140880..0000000000 Binary files a/doc/src/images/cde-listview.png and /dev/null differ diff --git a/doc/src/images/cde-progressbar.png b/doc/src/images/cde-progressbar.png deleted file mode 100644 index 41715deb48..0000000000 Binary files a/doc/src/images/cde-progressbar.png and /dev/null differ diff --git a/doc/src/images/cde-pushbutton.png b/doc/src/images/cde-pushbutton.png deleted file mode 100644 index 2d9bdd25a4..0000000000 Binary files a/doc/src/images/cde-pushbutton.png and /dev/null differ diff --git a/doc/src/images/cde-radiobutton.png b/doc/src/images/cde-radiobutton.png deleted file mode 100644 index e053665f5a..0000000000 Binary files a/doc/src/images/cde-radiobutton.png and /dev/null differ diff --git a/doc/src/images/cde-slider.png b/doc/src/images/cde-slider.png deleted file mode 100644 index bd84371898..0000000000 Binary files a/doc/src/images/cde-slider.png and /dev/null differ diff --git a/doc/src/images/cde-spinbox.png b/doc/src/images/cde-spinbox.png deleted file mode 100644 index 5f53c8e902..0000000000 Binary files a/doc/src/images/cde-spinbox.png and /dev/null differ diff --git a/doc/src/images/cde-tableview.png b/doc/src/images/cde-tableview.png deleted file mode 100644 index 7a99217560..0000000000 Binary files a/doc/src/images/cde-tableview.png and /dev/null differ diff --git a/doc/src/images/cde-tabwidget.png b/doc/src/images/cde-tabwidget.png deleted file mode 100644 index 8cf5473fc2..0000000000 Binary files a/doc/src/images/cde-tabwidget.png and /dev/null differ diff --git a/doc/src/images/cde-textedit.png b/doc/src/images/cde-textedit.png deleted file mode 100644 index c65b8da8f4..0000000000 Binary files a/doc/src/images/cde-textedit.png and /dev/null differ diff --git a/doc/src/images/cde-timeedit.png b/doc/src/images/cde-timeedit.png deleted file mode 100644 index 6a5a4b953f..0000000000 Binary files a/doc/src/images/cde-timeedit.png and /dev/null differ diff --git a/doc/src/images/cde-toolbox.png b/doc/src/images/cde-toolbox.png deleted file mode 100644 index c0dd4e9400..0000000000 Binary files a/doc/src/images/cde-toolbox.png and /dev/null differ diff --git a/doc/src/images/cde-toolbutton.png b/doc/src/images/cde-toolbutton.png deleted file mode 100644 index baff25c25b..0000000000 Binary files a/doc/src/images/cde-toolbutton.png and /dev/null differ diff --git a/doc/src/images/cde-treeview.png b/doc/src/images/cde-treeview.png deleted file mode 100644 index df3184b31b..0000000000 Binary files a/doc/src/images/cde-treeview.png and /dev/null differ diff --git a/doc/src/images/cleanlooks-calendarwidget.png b/doc/src/images/cleanlooks-calendarwidget.png deleted file mode 100644 index 99c57b61ee..0000000000 Binary files a/doc/src/images/cleanlooks-calendarwidget.png and /dev/null differ diff --git a/doc/src/images/cleanlooks-checkbox.png b/doc/src/images/cleanlooks-checkbox.png deleted file mode 100644 index aaf2daae4e..0000000000 Binary files a/doc/src/images/cleanlooks-checkbox.png and /dev/null differ diff --git a/doc/src/images/cleanlooks-combobox.png b/doc/src/images/cleanlooks-combobox.png deleted file mode 100644 index 5fff4c87f6..0000000000 Binary files a/doc/src/images/cleanlooks-combobox.png and /dev/null differ diff --git a/doc/src/images/cleanlooks-dateedit.png b/doc/src/images/cleanlooks-dateedit.png deleted file mode 100644 index 384136a162..0000000000 Binary files a/doc/src/images/cleanlooks-dateedit.png and /dev/null differ diff --git a/doc/src/images/cleanlooks-datetimeedit.png b/doc/src/images/cleanlooks-datetimeedit.png deleted file mode 100644 index 7a62cebfb4..0000000000 Binary files a/doc/src/images/cleanlooks-datetimeedit.png and /dev/null differ diff --git a/doc/src/images/cleanlooks-dial.png b/doc/src/images/cleanlooks-dial.png deleted file mode 100644 index 259a0888b6..0000000000 Binary files a/doc/src/images/cleanlooks-dial.png and /dev/null differ diff --git a/doc/src/images/cleanlooks-doublespinbox.png b/doc/src/images/cleanlooks-doublespinbox.png deleted file mode 100644 index 93b11f919a..0000000000 Binary files a/doc/src/images/cleanlooks-doublespinbox.png and /dev/null differ diff --git a/doc/src/images/cleanlooks-fontcombobox.png b/doc/src/images/cleanlooks-fontcombobox.png deleted file mode 100644 index 47a5907f56..0000000000 Binary files a/doc/src/images/cleanlooks-fontcombobox.png and /dev/null differ diff --git a/doc/src/images/cleanlooks-frame.png b/doc/src/images/cleanlooks-frame.png deleted file mode 100644 index 2427b08d8f..0000000000 Binary files a/doc/src/images/cleanlooks-frame.png and /dev/null differ diff --git a/doc/src/images/cleanlooks-groupbox.png b/doc/src/images/cleanlooks-groupbox.png deleted file mode 100644 index 89c6eb2f39..0000000000 Binary files a/doc/src/images/cleanlooks-groupbox.png and /dev/null differ diff --git a/doc/src/images/cleanlooks-horizontalscrollbar.png b/doc/src/images/cleanlooks-horizontalscrollbar.png deleted file mode 100644 index ca1c806c91..0000000000 Binary files a/doc/src/images/cleanlooks-horizontalscrollbar.png and /dev/null differ diff --git a/doc/src/images/cleanlooks-label.png b/doc/src/images/cleanlooks-label.png deleted file mode 100644 index 199758fd69..0000000000 Binary files a/doc/src/images/cleanlooks-label.png and /dev/null differ diff --git a/doc/src/images/cleanlooks-lcdnumber.png b/doc/src/images/cleanlooks-lcdnumber.png deleted file mode 100644 index c6e34127cf..0000000000 Binary files a/doc/src/images/cleanlooks-lcdnumber.png and /dev/null differ diff --git a/doc/src/images/cleanlooks-lineedit.png b/doc/src/images/cleanlooks-lineedit.png deleted file mode 100644 index 3e9f1a4be3..0000000000 Binary files a/doc/src/images/cleanlooks-lineedit.png and /dev/null differ diff --git a/doc/src/images/cleanlooks-listview.png b/doc/src/images/cleanlooks-listview.png deleted file mode 100644 index 95f836c66b..0000000000 Binary files a/doc/src/images/cleanlooks-listview.png and /dev/null differ diff --git a/doc/src/images/cleanlooks-progressbar.png b/doc/src/images/cleanlooks-progressbar.png deleted file mode 100644 index 53fc6c1faa..0000000000 Binary files a/doc/src/images/cleanlooks-progressbar.png and /dev/null differ diff --git a/doc/src/images/cleanlooks-pushbutton.png b/doc/src/images/cleanlooks-pushbutton.png deleted file mode 100644 index 7b3b3357c1..0000000000 Binary files a/doc/src/images/cleanlooks-pushbutton.png and /dev/null differ diff --git a/doc/src/images/cleanlooks-radiobutton.png b/doc/src/images/cleanlooks-radiobutton.png deleted file mode 100644 index 4e077688c2..0000000000 Binary files a/doc/src/images/cleanlooks-radiobutton.png and /dev/null differ diff --git a/doc/src/images/cleanlooks-slider.png b/doc/src/images/cleanlooks-slider.png deleted file mode 100644 index 8dfaa01092..0000000000 Binary files a/doc/src/images/cleanlooks-slider.png and /dev/null differ diff --git a/doc/src/images/cleanlooks-spinbox.png b/doc/src/images/cleanlooks-spinbox.png deleted file mode 100644 index ad5b5a01b6..0000000000 Binary files a/doc/src/images/cleanlooks-spinbox.png and /dev/null differ diff --git a/doc/src/images/cleanlooks-tableview.png b/doc/src/images/cleanlooks-tableview.png deleted file mode 100644 index d89fecc5ad..0000000000 Binary files a/doc/src/images/cleanlooks-tableview.png and /dev/null differ diff --git a/doc/src/images/cleanlooks-tabwidget.png b/doc/src/images/cleanlooks-tabwidget.png deleted file mode 100644 index bcff2967aa..0000000000 Binary files a/doc/src/images/cleanlooks-tabwidget.png and /dev/null differ diff --git a/doc/src/images/cleanlooks-textedit.png b/doc/src/images/cleanlooks-textedit.png deleted file mode 100644 index 0c825a1e04..0000000000 Binary files a/doc/src/images/cleanlooks-textedit.png and /dev/null differ diff --git a/doc/src/images/cleanlooks-timeedit.png b/doc/src/images/cleanlooks-timeedit.png deleted file mode 100644 index 00420a2f18..0000000000 Binary files a/doc/src/images/cleanlooks-timeedit.png and /dev/null differ diff --git a/doc/src/images/cleanlooks-toolbox.png b/doc/src/images/cleanlooks-toolbox.png deleted file mode 100644 index 63366e5422..0000000000 Binary files a/doc/src/images/cleanlooks-toolbox.png and /dev/null differ diff --git a/doc/src/images/cleanlooks-toolbutton.png b/doc/src/images/cleanlooks-toolbutton.png deleted file mode 100644 index bcf86ea26f..0000000000 Binary files a/doc/src/images/cleanlooks-toolbutton.png and /dev/null differ diff --git a/doc/src/images/cleanlooks-treeview.png b/doc/src/images/cleanlooks-treeview.png deleted file mode 100644 index 5bc4a06a3c..0000000000 Binary files a/doc/src/images/cleanlooks-treeview.png and /dev/null differ diff --git a/doc/src/images/designer-stylesheet-options.png b/doc/src/images/designer-stylesheet-options.png deleted file mode 100644 index a6893e770b..0000000000 Binary files a/doc/src/images/designer-stylesheet-options.png and /dev/null differ diff --git a/doc/src/images/designer-stylesheet-usage.png b/doc/src/images/designer-stylesheet-usage.png deleted file mode 100644 index f6875900de..0000000000 Binary files a/doc/src/images/designer-stylesheet-usage.png and /dev/null differ diff --git a/doc/src/images/designer-validator-highlighter.png b/doc/src/images/designer-validator-highlighter.png deleted file mode 100644 index a6661d5c95..0000000000 Binary files a/doc/src/images/designer-validator-highlighter.png and /dev/null differ diff --git a/doc/src/images/filedialogurls.png b/doc/src/images/filedialogurls.png deleted file mode 100644 index 7d22ef33ae..0000000000 Binary files a/doc/src/images/filedialogurls.png and /dev/null differ diff --git a/doc/src/images/frames.png b/doc/src/images/frames.png deleted file mode 100644 index 13c08508a2..0000000000 Binary files a/doc/src/images/frames.png and /dev/null differ diff --git a/doc/src/images/graphicsview-items.png b/doc/src/images/graphicsview-items.png deleted file mode 100644 index 73be2ddaee..0000000000 Binary files a/doc/src/images/graphicsview-items.png and /dev/null differ diff --git a/doc/src/images/graphicsview-pathitem.png b/doc/src/images/graphicsview-pathitem.png deleted file mode 100644 index c1ddd5620a..0000000000 Binary files a/doc/src/images/graphicsview-pathitem.png and /dev/null differ diff --git a/doc/src/images/graphicsview-pixmapitem.png b/doc/src/images/graphicsview-pixmapitem.png deleted file mode 100644 index d14fac55e0..0000000000 Binary files a/doc/src/images/graphicsview-pixmapitem.png and /dev/null differ diff --git a/doc/src/images/graphicsview-polygonitem.png b/doc/src/images/graphicsview-polygonitem.png deleted file mode 100644 index 3cd2232574..0000000000 Binary files a/doc/src/images/graphicsview-polygonitem.png and /dev/null differ diff --git a/doc/src/images/graphicsview-rectitem.png b/doc/src/images/graphicsview-rectitem.png deleted file mode 100644 index a5917e55dd..0000000000 Binary files a/doc/src/images/graphicsview-rectitem.png and /dev/null differ diff --git a/doc/src/images/graphicsview-zorder.png b/doc/src/images/graphicsview-zorder.png deleted file mode 100644 index a1cc3d0168..0000000000 Binary files a/doc/src/images/graphicsview-zorder.png and /dev/null differ diff --git a/doc/src/images/gridlayout.png b/doc/src/images/gridlayout.png deleted file mode 100644 index ae76c0487b..0000000000 Binary files a/doc/src/images/gridlayout.png and /dev/null differ diff --git a/doc/src/images/gtk-calendarwidget.png b/doc/src/images/gtk-calendarwidget.png deleted file mode 100644 index 568cd1a5da..0000000000 Binary files a/doc/src/images/gtk-calendarwidget.png and /dev/null differ diff --git a/doc/src/images/gtk-checkbox.png b/doc/src/images/gtk-checkbox.png deleted file mode 100644 index 1fd5fc77bf..0000000000 Binary files a/doc/src/images/gtk-checkbox.png and /dev/null differ diff --git a/doc/src/images/gtk-combobox.png b/doc/src/images/gtk-combobox.png deleted file mode 100644 index 3b4544df13..0000000000 Binary files a/doc/src/images/gtk-combobox.png and /dev/null differ diff --git a/doc/src/images/gtk-dateedit.png b/doc/src/images/gtk-dateedit.png deleted file mode 100644 index 25229f0b3b..0000000000 Binary files a/doc/src/images/gtk-dateedit.png and /dev/null differ diff --git a/doc/src/images/gtk-datetimeedit.png b/doc/src/images/gtk-datetimeedit.png deleted file mode 100644 index 0c934a4d0d..0000000000 Binary files a/doc/src/images/gtk-datetimeedit.png and /dev/null differ diff --git a/doc/src/images/gtk-dial.png b/doc/src/images/gtk-dial.png deleted file mode 100644 index 18e14b3650..0000000000 Binary files a/doc/src/images/gtk-dial.png and /dev/null differ diff --git a/doc/src/images/gtk-doublespinbox.png b/doc/src/images/gtk-doublespinbox.png deleted file mode 100644 index 3a69043c0b..0000000000 Binary files a/doc/src/images/gtk-doublespinbox.png and /dev/null differ diff --git a/doc/src/images/gtk-fontcombobox.png b/doc/src/images/gtk-fontcombobox.png deleted file mode 100644 index 4cb1bc1343..0000000000 Binary files a/doc/src/images/gtk-fontcombobox.png and /dev/null differ diff --git a/doc/src/images/gtk-frame.png b/doc/src/images/gtk-frame.png deleted file mode 100644 index c1bf52f6a6..0000000000 Binary files a/doc/src/images/gtk-frame.png and /dev/null differ diff --git a/doc/src/images/gtk-groupbox.png b/doc/src/images/gtk-groupbox.png deleted file mode 100644 index 6d217c89f9..0000000000 Binary files a/doc/src/images/gtk-groupbox.png and /dev/null differ diff --git a/doc/src/images/gtk-horizontalscrollbar.png b/doc/src/images/gtk-horizontalscrollbar.png deleted file mode 100644 index 2887730c13..0000000000 Binary files a/doc/src/images/gtk-horizontalscrollbar.png and /dev/null differ diff --git a/doc/src/images/gtk-label.png b/doc/src/images/gtk-label.png deleted file mode 100644 index 006d0133d8..0000000000 Binary files a/doc/src/images/gtk-label.png and /dev/null differ diff --git a/doc/src/images/gtk-lcdnumber.png b/doc/src/images/gtk-lcdnumber.png deleted file mode 100644 index 142d298ffc..0000000000 Binary files a/doc/src/images/gtk-lcdnumber.png and /dev/null differ diff --git a/doc/src/images/gtk-lineedit.png b/doc/src/images/gtk-lineedit.png deleted file mode 100644 index 8fb513c39f..0000000000 Binary files a/doc/src/images/gtk-lineedit.png and /dev/null differ diff --git a/doc/src/images/gtk-listview.png b/doc/src/images/gtk-listview.png deleted file mode 100644 index d32f8e8aee..0000000000 Binary files a/doc/src/images/gtk-listview.png and /dev/null differ diff --git a/doc/src/images/gtk-progressbar.png b/doc/src/images/gtk-progressbar.png deleted file mode 100644 index 6162484bf3..0000000000 Binary files a/doc/src/images/gtk-progressbar.png and /dev/null differ diff --git a/doc/src/images/gtk-pushbutton.png b/doc/src/images/gtk-pushbutton.png deleted file mode 100644 index f4f4d7c1e4..0000000000 Binary files a/doc/src/images/gtk-pushbutton.png and /dev/null differ diff --git a/doc/src/images/gtk-radiobutton.png b/doc/src/images/gtk-radiobutton.png deleted file mode 100644 index b3620fa054..0000000000 Binary files a/doc/src/images/gtk-radiobutton.png and /dev/null differ diff --git a/doc/src/images/gtk-slider.png b/doc/src/images/gtk-slider.png deleted file mode 100644 index 3d8e0ee89e..0000000000 Binary files a/doc/src/images/gtk-slider.png and /dev/null differ diff --git a/doc/src/images/gtk-spinbox.png b/doc/src/images/gtk-spinbox.png deleted file mode 100644 index a39eb3aa93..0000000000 Binary files a/doc/src/images/gtk-spinbox.png and /dev/null differ diff --git a/doc/src/images/gtk-tableview.png b/doc/src/images/gtk-tableview.png deleted file mode 100644 index a025193188..0000000000 Binary files a/doc/src/images/gtk-tableview.png and /dev/null differ diff --git a/doc/src/images/gtk-tabwidget.png b/doc/src/images/gtk-tabwidget.png deleted file mode 100644 index 089c76dad2..0000000000 Binary files a/doc/src/images/gtk-tabwidget.png and /dev/null differ diff --git a/doc/src/images/gtk-textedit.png b/doc/src/images/gtk-textedit.png deleted file mode 100644 index e4b91c01c9..0000000000 Binary files a/doc/src/images/gtk-textedit.png and /dev/null differ diff --git a/doc/src/images/gtk-timeedit.png b/doc/src/images/gtk-timeedit.png deleted file mode 100644 index acf6730a86..0000000000 Binary files a/doc/src/images/gtk-timeedit.png and /dev/null differ diff --git a/doc/src/images/gtk-toolbox.png b/doc/src/images/gtk-toolbox.png deleted file mode 100644 index 25e6137699..0000000000 Binary files a/doc/src/images/gtk-toolbox.png and /dev/null differ diff --git a/doc/src/images/gtk-toolbutton.png b/doc/src/images/gtk-toolbutton.png deleted file mode 100644 index f0eb86efc5..0000000000 Binary files a/doc/src/images/gtk-toolbutton.png and /dev/null differ diff --git a/doc/src/images/gtk-treeview.png b/doc/src/images/gtk-treeview.png deleted file mode 100644 index 7b4e3044be..0000000000 Binary files a/doc/src/images/gtk-treeview.png and /dev/null differ diff --git a/doc/src/images/javastyle/branchindicatorimage.png b/doc/src/images/javastyle/branchindicatorimage.png deleted file mode 100644 index f2cfc4b2e9..0000000000 Binary files a/doc/src/images/javastyle/branchindicatorimage.png and /dev/null differ diff --git a/doc/src/images/javastyle/button.png b/doc/src/images/javastyle/button.png deleted file mode 100644 index c3a97425b1..0000000000 Binary files a/doc/src/images/javastyle/button.png and /dev/null differ diff --git a/doc/src/images/javastyle/checkbox.png b/doc/src/images/javastyle/checkbox.png deleted file mode 100644 index bc841a6a6d..0000000000 Binary files a/doc/src/images/javastyle/checkbox.png and /dev/null differ diff --git a/doc/src/images/javastyle/checkboxexample.png b/doc/src/images/javastyle/checkboxexample.png deleted file mode 100644 index 69217fb2e5..0000000000 Binary files a/doc/src/images/javastyle/checkboxexample.png and /dev/null differ diff --git a/doc/src/images/javastyle/combobox.png b/doc/src/images/javastyle/combobox.png deleted file mode 100644 index de9745a218..0000000000 Binary files a/doc/src/images/javastyle/combobox.png and /dev/null differ diff --git a/doc/src/images/javastyle/comboboximage.png b/doc/src/images/javastyle/comboboximage.png deleted file mode 100644 index 1f05e5fe86..0000000000 Binary files a/doc/src/images/javastyle/comboboximage.png and /dev/null differ diff --git a/doc/src/images/javastyle/conceptualpushbuttontree.png b/doc/src/images/javastyle/conceptualpushbuttontree.png deleted file mode 100644 index 910000a6e8..0000000000 Binary files a/doc/src/images/javastyle/conceptualpushbuttontree.png and /dev/null differ diff --git a/doc/src/images/javastyle/dockwidget.png b/doc/src/images/javastyle/dockwidget.png deleted file mode 100644 index 4bfec142bf..0000000000 Binary files a/doc/src/images/javastyle/dockwidget.png and /dev/null differ diff --git a/doc/src/images/javastyle/dockwidgetimage.png b/doc/src/images/javastyle/dockwidgetimage.png deleted file mode 100644 index eefe171e3e..0000000000 Binary files a/doc/src/images/javastyle/dockwidgetimage.png and /dev/null differ diff --git a/doc/src/images/javastyle/groupbox.png b/doc/src/images/javastyle/groupbox.png deleted file mode 100644 index a39cd42c9f..0000000000 Binary files a/doc/src/images/javastyle/groupbox.png and /dev/null differ diff --git a/doc/src/images/javastyle/groupboximage.png b/doc/src/images/javastyle/groupboximage.png deleted file mode 100644 index 5baf6092d4..0000000000 Binary files a/doc/src/images/javastyle/groupboximage.png and /dev/null differ diff --git a/doc/src/images/javastyle/header.png b/doc/src/images/javastyle/header.png deleted file mode 100644 index b4546d840e..0000000000 Binary files a/doc/src/images/javastyle/header.png and /dev/null differ diff --git a/doc/src/images/javastyle/headerimage.png b/doc/src/images/javastyle/headerimage.png deleted file mode 100644 index 41171497d5..0000000000 Binary files a/doc/src/images/javastyle/headerimage.png and /dev/null differ diff --git a/doc/src/images/javastyle/menu.png b/doc/src/images/javastyle/menu.png deleted file mode 100644 index 8d44da4054..0000000000 Binary files a/doc/src/images/javastyle/menu.png and /dev/null differ diff --git a/doc/src/images/javastyle/menubar.png b/doc/src/images/javastyle/menubar.png deleted file mode 100644 index e68e4a3a55..0000000000 Binary files a/doc/src/images/javastyle/menubar.png and /dev/null differ diff --git a/doc/src/images/javastyle/menubarimage.png b/doc/src/images/javastyle/menubarimage.png deleted file mode 100644 index b0cf28edcc..0000000000 Binary files a/doc/src/images/javastyle/menubarimage.png and /dev/null differ diff --git a/doc/src/images/javastyle/menuimage.png b/doc/src/images/javastyle/menuimage.png deleted file mode 100644 index 282dde7159..0000000000 Binary files a/doc/src/images/javastyle/menuimage.png and /dev/null differ diff --git a/doc/src/images/javastyle/progressbar.png b/doc/src/images/javastyle/progressbar.png deleted file mode 100644 index de3a838c38..0000000000 Binary files a/doc/src/images/javastyle/progressbar.png and /dev/null differ diff --git a/doc/src/images/javastyle/progressbarimage.png b/doc/src/images/javastyle/progressbarimage.png deleted file mode 100644 index 433b900ab5..0000000000 Binary files a/doc/src/images/javastyle/progressbarimage.png and /dev/null differ diff --git a/doc/src/images/javastyle/pushbutton.png b/doc/src/images/javastyle/pushbutton.png deleted file mode 100644 index e5f92bea12..0000000000 Binary files a/doc/src/images/javastyle/pushbutton.png and /dev/null differ diff --git a/doc/src/images/javastyle/rubberband.png b/doc/src/images/javastyle/rubberband.png deleted file mode 100644 index 087424a3f0..0000000000 Binary files a/doc/src/images/javastyle/rubberband.png and /dev/null differ diff --git a/doc/src/images/javastyle/rubberbandimage.png b/doc/src/images/javastyle/rubberbandimage.png deleted file mode 100644 index 2794638dbc..0000000000 Binary files a/doc/src/images/javastyle/rubberbandimage.png and /dev/null differ diff --git a/doc/src/images/javastyle/scrollbar.png b/doc/src/images/javastyle/scrollbar.png deleted file mode 100644 index c1ecb5d655..0000000000 Binary files a/doc/src/images/javastyle/scrollbar.png and /dev/null differ diff --git a/doc/src/images/javastyle/scrollbarimage.png b/doc/src/images/javastyle/scrollbarimage.png deleted file mode 100644 index 6d3e29d8dd..0000000000 Binary files a/doc/src/images/javastyle/scrollbarimage.png and /dev/null differ diff --git a/doc/src/images/javastyle/sizegrip.png b/doc/src/images/javastyle/sizegrip.png deleted file mode 100644 index 667e6fb465..0000000000 Binary files a/doc/src/images/javastyle/sizegrip.png and /dev/null differ diff --git a/doc/src/images/javastyle/sizegripimage.png b/doc/src/images/javastyle/sizegripimage.png deleted file mode 100644 index ccbf5254d3..0000000000 Binary files a/doc/src/images/javastyle/sizegripimage.png and /dev/null differ diff --git a/doc/src/images/javastyle/slider.png b/doc/src/images/javastyle/slider.png deleted file mode 100644 index a382233f58..0000000000 Binary files a/doc/src/images/javastyle/slider.png and /dev/null differ diff --git a/doc/src/images/javastyle/sliderimage.png b/doc/src/images/javastyle/sliderimage.png deleted file mode 100644 index df700dd712..0000000000 Binary files a/doc/src/images/javastyle/sliderimage.png and /dev/null differ diff --git a/doc/src/images/javastyle/spinbox.png b/doc/src/images/javastyle/spinbox.png deleted file mode 100644 index ec9d6e0d75..0000000000 Binary files a/doc/src/images/javastyle/spinbox.png and /dev/null differ diff --git a/doc/src/images/javastyle/spinboximage.png b/doc/src/images/javastyle/spinboximage.png deleted file mode 100644 index d0d57c8ffb..0000000000 Binary files a/doc/src/images/javastyle/spinboximage.png and /dev/null differ diff --git a/doc/src/images/javastyle/tab.png b/doc/src/images/javastyle/tab.png deleted file mode 100644 index 616580c839..0000000000 Binary files a/doc/src/images/javastyle/tab.png and /dev/null differ diff --git a/doc/src/images/javastyle/tabwidget.png b/doc/src/images/javastyle/tabwidget.png deleted file mode 100644 index 737155ccb9..0000000000 Binary files a/doc/src/images/javastyle/tabwidget.png and /dev/null differ diff --git a/doc/src/images/javastyle/titlebar.png b/doc/src/images/javastyle/titlebar.png deleted file mode 100644 index 5d7ecc481d..0000000000 Binary files a/doc/src/images/javastyle/titlebar.png and /dev/null differ diff --git a/doc/src/images/javastyle/titlebarimage.png b/doc/src/images/javastyle/titlebarimage.png deleted file mode 100644 index 50287aeb1d..0000000000 Binary files a/doc/src/images/javastyle/titlebarimage.png and /dev/null differ diff --git a/doc/src/images/javastyle/toolbar.png b/doc/src/images/javastyle/toolbar.png deleted file mode 100644 index e69e8df4c8..0000000000 Binary files a/doc/src/images/javastyle/toolbar.png and /dev/null differ diff --git a/doc/src/images/javastyle/toolbarimage.png b/doc/src/images/javastyle/toolbarimage.png deleted file mode 100644 index b9025f582a..0000000000 Binary files a/doc/src/images/javastyle/toolbarimage.png and /dev/null differ diff --git a/doc/src/images/javastyle/toolbox.png b/doc/src/images/javastyle/toolbox.png deleted file mode 100644 index c5f61ecec8..0000000000 Binary files a/doc/src/images/javastyle/toolbox.png and /dev/null differ diff --git a/doc/src/images/javastyle/toolboximage.png b/doc/src/images/javastyle/toolboximage.png deleted file mode 100644 index 7bcbd26432..0000000000 Binary files a/doc/src/images/javastyle/toolboximage.png and /dev/null differ diff --git a/doc/src/images/javastyle/toolbutton.png b/doc/src/images/javastyle/toolbutton.png deleted file mode 100644 index 9167e83f75..0000000000 Binary files a/doc/src/images/javastyle/toolbutton.png and /dev/null differ diff --git a/doc/src/images/javastyle/toolbuttonimage.png b/doc/src/images/javastyle/toolbuttonimage.png deleted file mode 100644 index 3217172fca..0000000000 Binary files a/doc/src/images/javastyle/toolbuttonimage.png and /dev/null differ diff --git a/doc/src/images/javastyle/windowstabimage.png b/doc/src/images/javastyle/windowstabimage.png deleted file mode 100644 index 485e847844..0000000000 Binary files a/doc/src/images/javastyle/windowstabimage.png and /dev/null differ diff --git a/doc/src/images/licensewizard-flow.png b/doc/src/images/licensewizard-flow.png deleted file mode 100644 index 76df63a98f..0000000000 Binary files a/doc/src/images/licensewizard-flow.png and /dev/null differ diff --git a/doc/src/images/macintosh-calendarwidget.png b/doc/src/images/macintosh-calendarwidget.png deleted file mode 100644 index 2f743501a9..0000000000 Binary files a/doc/src/images/macintosh-calendarwidget.png and /dev/null differ diff --git a/doc/src/images/macintosh-checkbox.png b/doc/src/images/macintosh-checkbox.png deleted file mode 100644 index d0130e3f22..0000000000 Binary files a/doc/src/images/macintosh-checkbox.png and /dev/null differ diff --git a/doc/src/images/macintosh-combobox.png b/doc/src/images/macintosh-combobox.png deleted file mode 100644 index c1dc3c0c96..0000000000 Binary files a/doc/src/images/macintosh-combobox.png and /dev/null differ diff --git a/doc/src/images/macintosh-dateedit.png b/doc/src/images/macintosh-dateedit.png deleted file mode 100644 index 45aee90a9b..0000000000 Binary files a/doc/src/images/macintosh-dateedit.png and /dev/null differ diff --git a/doc/src/images/macintosh-datetimeedit.png b/doc/src/images/macintosh-datetimeedit.png deleted file mode 100644 index 62af02d64e..0000000000 Binary files a/doc/src/images/macintosh-datetimeedit.png and /dev/null differ diff --git a/doc/src/images/macintosh-dial.png b/doc/src/images/macintosh-dial.png deleted file mode 100644 index df0ffe23a1..0000000000 Binary files a/doc/src/images/macintosh-dial.png and /dev/null differ diff --git a/doc/src/images/macintosh-doublespinbox.png b/doc/src/images/macintosh-doublespinbox.png deleted file mode 100644 index a0695ff278..0000000000 Binary files a/doc/src/images/macintosh-doublespinbox.png and /dev/null differ diff --git a/doc/src/images/macintosh-fontcombobox.png b/doc/src/images/macintosh-fontcombobox.png deleted file mode 100644 index 8a5a3c78a3..0000000000 Binary files a/doc/src/images/macintosh-fontcombobox.png and /dev/null differ diff --git a/doc/src/images/macintosh-frame.png b/doc/src/images/macintosh-frame.png deleted file mode 100644 index fee61a3643..0000000000 Binary files a/doc/src/images/macintosh-frame.png and /dev/null differ diff --git a/doc/src/images/macintosh-groupbox.png b/doc/src/images/macintosh-groupbox.png deleted file mode 100644 index f6c7bce580..0000000000 Binary files a/doc/src/images/macintosh-groupbox.png and /dev/null differ diff --git a/doc/src/images/macintosh-horizontalscrollbar.png b/doc/src/images/macintosh-horizontalscrollbar.png deleted file mode 100644 index 8b63572a9e..0000000000 Binary files a/doc/src/images/macintosh-horizontalscrollbar.png and /dev/null differ diff --git a/doc/src/images/macintosh-label.png b/doc/src/images/macintosh-label.png deleted file mode 100644 index 753aa4d138..0000000000 Binary files a/doc/src/images/macintosh-label.png and /dev/null differ diff --git a/doc/src/images/macintosh-lcdnumber.png b/doc/src/images/macintosh-lcdnumber.png deleted file mode 100644 index 2ea9ea0713..0000000000 Binary files a/doc/src/images/macintosh-lcdnumber.png and /dev/null differ diff --git a/doc/src/images/macintosh-lineedit.png b/doc/src/images/macintosh-lineedit.png deleted file mode 100644 index 0e992c7ffe..0000000000 Binary files a/doc/src/images/macintosh-lineedit.png and /dev/null differ diff --git a/doc/src/images/macintosh-listview.png b/doc/src/images/macintosh-listview.png deleted file mode 100644 index 346e6427ff..0000000000 Binary files a/doc/src/images/macintosh-listview.png and /dev/null differ diff --git a/doc/src/images/macintosh-progressbar.png b/doc/src/images/macintosh-progressbar.png deleted file mode 100644 index 2dfc8aba81..0000000000 Binary files a/doc/src/images/macintosh-progressbar.png and /dev/null differ diff --git a/doc/src/images/macintosh-pushbutton.png b/doc/src/images/macintosh-pushbutton.png deleted file mode 100644 index 7ec14910d8..0000000000 Binary files a/doc/src/images/macintosh-pushbutton.png and /dev/null differ diff --git a/doc/src/images/macintosh-radiobutton.png b/doc/src/images/macintosh-radiobutton.png deleted file mode 100644 index 8b02f509ff..0000000000 Binary files a/doc/src/images/macintosh-radiobutton.png and /dev/null differ diff --git a/doc/src/images/macintosh-slider.png b/doc/src/images/macintosh-slider.png deleted file mode 100644 index bf0c5464e9..0000000000 Binary files a/doc/src/images/macintosh-slider.png and /dev/null differ diff --git a/doc/src/images/macintosh-spinbox.png b/doc/src/images/macintosh-spinbox.png deleted file mode 100644 index 4196c37246..0000000000 Binary files a/doc/src/images/macintosh-spinbox.png and /dev/null differ diff --git a/doc/src/images/macintosh-tableview.png b/doc/src/images/macintosh-tableview.png deleted file mode 100644 index e6512494de..0000000000 Binary files a/doc/src/images/macintosh-tableview.png and /dev/null differ diff --git a/doc/src/images/macintosh-tabwidget.png b/doc/src/images/macintosh-tabwidget.png deleted file mode 100644 index 1d174a47e6..0000000000 Binary files a/doc/src/images/macintosh-tabwidget.png and /dev/null differ diff --git a/doc/src/images/macintosh-textedit.png b/doc/src/images/macintosh-textedit.png deleted file mode 100644 index 4f0ce36baf..0000000000 Binary files a/doc/src/images/macintosh-textedit.png and /dev/null differ diff --git a/doc/src/images/macintosh-timeedit.png b/doc/src/images/macintosh-timeedit.png deleted file mode 100644 index 4bcfce33f8..0000000000 Binary files a/doc/src/images/macintosh-timeedit.png and /dev/null differ diff --git a/doc/src/images/macintosh-toolbox.png b/doc/src/images/macintosh-toolbox.png deleted file mode 100644 index 18d41ea595..0000000000 Binary files a/doc/src/images/macintosh-toolbox.png and /dev/null differ diff --git a/doc/src/images/macintosh-toolbutton.png b/doc/src/images/macintosh-toolbutton.png deleted file mode 100644 index f91331cc51..0000000000 Binary files a/doc/src/images/macintosh-toolbutton.png and /dev/null differ diff --git a/doc/src/images/macintosh-treeview.png b/doc/src/images/macintosh-treeview.png deleted file mode 100644 index afda6d8372..0000000000 Binary files a/doc/src/images/macintosh-treeview.png and /dev/null differ diff --git a/doc/src/images/mainwindow-docks.png b/doc/src/images/mainwindow-docks.png deleted file mode 100644 index 24f42a28ea..0000000000 Binary files a/doc/src/images/mainwindow-docks.png and /dev/null differ diff --git a/doc/src/images/mainwindowlayout.png b/doc/src/images/mainwindowlayout.png deleted file mode 100644 index 4776ce4f1b..0000000000 Binary files a/doc/src/images/mainwindowlayout.png and /dev/null differ diff --git a/doc/src/images/motif-calendarwidget.png b/doc/src/images/motif-calendarwidget.png deleted file mode 100644 index 4ce6aebc21..0000000000 Binary files a/doc/src/images/motif-calendarwidget.png and /dev/null differ diff --git a/doc/src/images/motif-checkbox.png b/doc/src/images/motif-checkbox.png deleted file mode 100644 index 2a263273a6..0000000000 Binary files a/doc/src/images/motif-checkbox.png and /dev/null differ diff --git a/doc/src/images/motif-combobox.png b/doc/src/images/motif-combobox.png deleted file mode 100644 index 2a288d9f40..0000000000 Binary files a/doc/src/images/motif-combobox.png and /dev/null differ diff --git a/doc/src/images/motif-dateedit.png b/doc/src/images/motif-dateedit.png deleted file mode 100644 index d00c45ff65..0000000000 Binary files a/doc/src/images/motif-dateedit.png and /dev/null differ diff --git a/doc/src/images/motif-datetimeedit.png b/doc/src/images/motif-datetimeedit.png deleted file mode 100644 index cc43ef888d..0000000000 Binary files a/doc/src/images/motif-datetimeedit.png and /dev/null differ diff --git a/doc/src/images/motif-dial.png b/doc/src/images/motif-dial.png deleted file mode 100644 index 36b3ff7be0..0000000000 Binary files a/doc/src/images/motif-dial.png and /dev/null differ diff --git a/doc/src/images/motif-doublespinbox.png b/doc/src/images/motif-doublespinbox.png deleted file mode 100644 index 6092913ab0..0000000000 Binary files a/doc/src/images/motif-doublespinbox.png and /dev/null differ diff --git a/doc/src/images/motif-fontcombobox.png b/doc/src/images/motif-fontcombobox.png deleted file mode 100644 index c07452d85e..0000000000 Binary files a/doc/src/images/motif-fontcombobox.png and /dev/null differ diff --git a/doc/src/images/motif-frame.png b/doc/src/images/motif-frame.png deleted file mode 100644 index 55dcc32227..0000000000 Binary files a/doc/src/images/motif-frame.png and /dev/null differ diff --git a/doc/src/images/motif-groupbox.png b/doc/src/images/motif-groupbox.png deleted file mode 100644 index 13742b116e..0000000000 Binary files a/doc/src/images/motif-groupbox.png and /dev/null differ diff --git a/doc/src/images/motif-horizontalscrollbar.png b/doc/src/images/motif-horizontalscrollbar.png deleted file mode 100644 index dab1d3f6f6..0000000000 Binary files a/doc/src/images/motif-horizontalscrollbar.png and /dev/null differ diff --git a/doc/src/images/motif-label.png b/doc/src/images/motif-label.png deleted file mode 100644 index 7ae6674f50..0000000000 Binary files a/doc/src/images/motif-label.png and /dev/null differ diff --git a/doc/src/images/motif-lcdnumber.png b/doc/src/images/motif-lcdnumber.png deleted file mode 100644 index e2cc9a8058..0000000000 Binary files a/doc/src/images/motif-lcdnumber.png and /dev/null differ diff --git a/doc/src/images/motif-lineedit.png b/doc/src/images/motif-lineedit.png deleted file mode 100644 index a335c8c107..0000000000 Binary files a/doc/src/images/motif-lineedit.png and /dev/null differ diff --git a/doc/src/images/motif-listview.png b/doc/src/images/motif-listview.png deleted file mode 100644 index 47bd3eae6d..0000000000 Binary files a/doc/src/images/motif-listview.png and /dev/null differ diff --git a/doc/src/images/motif-progressbar.png b/doc/src/images/motif-progressbar.png deleted file mode 100644 index f6d6979b86..0000000000 Binary files a/doc/src/images/motif-progressbar.png and /dev/null differ diff --git a/doc/src/images/motif-pushbutton.png b/doc/src/images/motif-pushbutton.png deleted file mode 100644 index 9dc6a9db78..0000000000 Binary files a/doc/src/images/motif-pushbutton.png and /dev/null differ diff --git a/doc/src/images/motif-radiobutton.png b/doc/src/images/motif-radiobutton.png deleted file mode 100644 index 468e54cfcf..0000000000 Binary files a/doc/src/images/motif-radiobutton.png and /dev/null differ diff --git a/doc/src/images/motif-slider.png b/doc/src/images/motif-slider.png deleted file mode 100644 index 6301e2b26d..0000000000 Binary files a/doc/src/images/motif-slider.png and /dev/null differ diff --git a/doc/src/images/motif-spinbox.png b/doc/src/images/motif-spinbox.png deleted file mode 100644 index 9acc2821c8..0000000000 Binary files a/doc/src/images/motif-spinbox.png and /dev/null differ diff --git a/doc/src/images/motif-tableview.png b/doc/src/images/motif-tableview.png deleted file mode 100644 index a1d205aaed..0000000000 Binary files a/doc/src/images/motif-tableview.png and /dev/null differ diff --git a/doc/src/images/motif-tabwidget.png b/doc/src/images/motif-tabwidget.png deleted file mode 100644 index 19da66a76c..0000000000 Binary files a/doc/src/images/motif-tabwidget.png and /dev/null differ diff --git a/doc/src/images/motif-textedit.png b/doc/src/images/motif-textedit.png deleted file mode 100644 index 205bc19cfa..0000000000 Binary files a/doc/src/images/motif-textedit.png and /dev/null differ diff --git a/doc/src/images/motif-timeedit.png b/doc/src/images/motif-timeedit.png deleted file mode 100644 index 1ad459b886..0000000000 Binary files a/doc/src/images/motif-timeedit.png and /dev/null differ diff --git a/doc/src/images/motif-toolbox.png b/doc/src/images/motif-toolbox.png deleted file mode 100644 index 4bc3c37bb2..0000000000 Binary files a/doc/src/images/motif-toolbox.png and /dev/null differ diff --git a/doc/src/images/motif-toolbutton.png b/doc/src/images/motif-toolbutton.png deleted file mode 100644 index 8ef51ddd8d..0000000000 Binary files a/doc/src/images/motif-toolbutton.png and /dev/null differ diff --git a/doc/src/images/motif-treeview.png b/doc/src/images/motif-treeview.png deleted file mode 100644 index a7dd0f2466..0000000000 Binary files a/doc/src/images/motif-treeview.png and /dev/null differ diff --git a/doc/src/images/msgbox1.png b/doc/src/images/msgbox1.png deleted file mode 100644 index 1380e20a5f..0000000000 Binary files a/doc/src/images/msgbox1.png and /dev/null differ diff --git a/doc/src/images/msgbox2.png b/doc/src/images/msgbox2.png deleted file mode 100644 index e7946996e4..0000000000 Binary files a/doc/src/images/msgbox2.png and /dev/null differ diff --git a/doc/src/images/msgbox3.png b/doc/src/images/msgbox3.png deleted file mode 100644 index bd81f4d4da..0000000000 Binary files a/doc/src/images/msgbox3.png and /dev/null differ diff --git a/doc/src/images/msgbox4.png b/doc/src/images/msgbox4.png deleted file mode 100644 index dbe6701cdd..0000000000 Binary files a/doc/src/images/msgbox4.png and /dev/null differ diff --git a/doc/src/images/pangesture.png b/doc/src/images/pangesture.png deleted file mode 100644 index 24caf91d3b..0000000000 Binary files a/doc/src/images/pangesture.png and /dev/null differ diff --git a/doc/src/images/parent-child-widgets.png b/doc/src/images/parent-child-widgets.png deleted file mode 100644 index 094e2e96b6..0000000000 Binary files a/doc/src/images/parent-child-widgets.png and /dev/null differ diff --git a/doc/src/images/pinchgesture.png b/doc/src/images/pinchgesture.png deleted file mode 100644 index 95614c4052..0000000000 Binary files a/doc/src/images/pinchgesture.png and /dev/null differ diff --git a/doc/src/images/plastique-calendarwidget.png b/doc/src/images/plastique-calendarwidget.png deleted file mode 100644 index 5e65945c72..0000000000 Binary files a/doc/src/images/plastique-calendarwidget.png and /dev/null differ diff --git a/doc/src/images/plastique-checkbox.png b/doc/src/images/plastique-checkbox.png deleted file mode 100644 index 91a5109d65..0000000000 Binary files a/doc/src/images/plastique-checkbox.png and /dev/null differ diff --git a/doc/src/images/plastique-colordialog.png b/doc/src/images/plastique-colordialog.png deleted file mode 100644 index 68bf4d0b4b..0000000000 Binary files a/doc/src/images/plastique-colordialog.png and /dev/null differ diff --git a/doc/src/images/plastique-combobox.png b/doc/src/images/plastique-combobox.png deleted file mode 100644 index e3bf8a321f..0000000000 Binary files a/doc/src/images/plastique-combobox.png and /dev/null differ diff --git a/doc/src/images/plastique-dateedit.png b/doc/src/images/plastique-dateedit.png deleted file mode 100644 index 2e28a40f01..0000000000 Binary files a/doc/src/images/plastique-dateedit.png and /dev/null differ diff --git a/doc/src/images/plastique-datetimeedit.png b/doc/src/images/plastique-datetimeedit.png deleted file mode 100644 index 810bf1660a..0000000000 Binary files a/doc/src/images/plastique-datetimeedit.png and /dev/null differ diff --git a/doc/src/images/plastique-dial.png b/doc/src/images/plastique-dial.png deleted file mode 100644 index b65e7c78cd..0000000000 Binary files a/doc/src/images/plastique-dial.png and /dev/null differ diff --git a/doc/src/images/plastique-doublespinbox.png b/doc/src/images/plastique-doublespinbox.png deleted file mode 100644 index 627c4a20fe..0000000000 Binary files a/doc/src/images/plastique-doublespinbox.png and /dev/null differ diff --git a/doc/src/images/plastique-fontcombobox.png b/doc/src/images/plastique-fontcombobox.png deleted file mode 100644 index d3823081d8..0000000000 Binary files a/doc/src/images/plastique-fontcombobox.png and /dev/null differ diff --git a/doc/src/images/plastique-fontdialog.png b/doc/src/images/plastique-fontdialog.png deleted file mode 100644 index 7e799a8815..0000000000 Binary files a/doc/src/images/plastique-fontdialog.png and /dev/null differ diff --git a/doc/src/images/plastique-frame.png b/doc/src/images/plastique-frame.png deleted file mode 100644 index 9f81f6cba4..0000000000 Binary files a/doc/src/images/plastique-frame.png and /dev/null differ diff --git a/doc/src/images/plastique-groupbox.png b/doc/src/images/plastique-groupbox.png deleted file mode 100644 index d353c40071..0000000000 Binary files a/doc/src/images/plastique-groupbox.png and /dev/null differ diff --git a/doc/src/images/plastique-horizontalscrollbar.png b/doc/src/images/plastique-horizontalscrollbar.png deleted file mode 100644 index d20300c23f..0000000000 Binary files a/doc/src/images/plastique-horizontalscrollbar.png and /dev/null differ diff --git a/doc/src/images/plastique-label.png b/doc/src/images/plastique-label.png deleted file mode 100644 index d2a55a862c..0000000000 Binary files a/doc/src/images/plastique-label.png and /dev/null differ diff --git a/doc/src/images/plastique-lcdnumber.png b/doc/src/images/plastique-lcdnumber.png deleted file mode 100644 index 74149ee158..0000000000 Binary files a/doc/src/images/plastique-lcdnumber.png and /dev/null differ diff --git a/doc/src/images/plastique-lineedit.png b/doc/src/images/plastique-lineedit.png deleted file mode 100644 index f455383520..0000000000 Binary files a/doc/src/images/plastique-lineedit.png and /dev/null differ diff --git a/doc/src/images/plastique-listview.png b/doc/src/images/plastique-listview.png deleted file mode 100644 index 64bd00fe1f..0000000000 Binary files a/doc/src/images/plastique-listview.png and /dev/null differ diff --git a/doc/src/images/plastique-progressbar.png b/doc/src/images/plastique-progressbar.png deleted file mode 100644 index fe8dd90274..0000000000 Binary files a/doc/src/images/plastique-progressbar.png and /dev/null differ diff --git a/doc/src/images/plastique-progressdialog.png b/doc/src/images/plastique-progressdialog.png deleted file mode 100644 index 4373bcac16..0000000000 Binary files a/doc/src/images/plastique-progressdialog.png and /dev/null differ diff --git a/doc/src/images/plastique-pushbutton.png b/doc/src/images/plastique-pushbutton.png deleted file mode 100644 index 83c44fd38d..0000000000 Binary files a/doc/src/images/plastique-pushbutton.png and /dev/null differ diff --git a/doc/src/images/plastique-radiobutton.png b/doc/src/images/plastique-radiobutton.png deleted file mode 100644 index a2c820d7d1..0000000000 Binary files a/doc/src/images/plastique-radiobutton.png and /dev/null differ diff --git a/doc/src/images/plastique-slider.png b/doc/src/images/plastique-slider.png deleted file mode 100644 index 492f0fdfbd..0000000000 Binary files a/doc/src/images/plastique-slider.png and /dev/null differ diff --git a/doc/src/images/plastique-spinbox.png b/doc/src/images/plastique-spinbox.png deleted file mode 100644 index af15db3c23..0000000000 Binary files a/doc/src/images/plastique-spinbox.png and /dev/null differ diff --git a/doc/src/images/plastique-statusbar.png b/doc/src/images/plastique-statusbar.png deleted file mode 100644 index c8f9792ab9..0000000000 Binary files a/doc/src/images/plastique-statusbar.png and /dev/null differ diff --git a/doc/src/images/plastique-tableview.png b/doc/src/images/plastique-tableview.png deleted file mode 100644 index b20c1cce7f..0000000000 Binary files a/doc/src/images/plastique-tableview.png and /dev/null differ diff --git a/doc/src/images/plastique-tabwidget.png b/doc/src/images/plastique-tabwidget.png deleted file mode 100644 index 92ae398844..0000000000 Binary files a/doc/src/images/plastique-tabwidget.png and /dev/null differ diff --git a/doc/src/images/plastique-textedit.png b/doc/src/images/plastique-textedit.png deleted file mode 100644 index a802d75fcc..0000000000 Binary files a/doc/src/images/plastique-textedit.png and /dev/null differ diff --git a/doc/src/images/plastique-timeedit.png b/doc/src/images/plastique-timeedit.png deleted file mode 100644 index 2d70b84c4c..0000000000 Binary files a/doc/src/images/plastique-timeedit.png and /dev/null differ diff --git a/doc/src/images/plastique-toolbox.png b/doc/src/images/plastique-toolbox.png deleted file mode 100644 index 10bcd7af62..0000000000 Binary files a/doc/src/images/plastique-toolbox.png and /dev/null differ diff --git a/doc/src/images/plastique-toolbutton.png b/doc/src/images/plastique-toolbutton.png deleted file mode 100644 index 4e51831408..0000000000 Binary files a/doc/src/images/plastique-toolbutton.png and /dev/null differ diff --git a/doc/src/images/plastique-treeview.png b/doc/src/images/plastique-treeview.png deleted file mode 100644 index db0bc01a25..0000000000 Binary files a/doc/src/images/plastique-treeview.png and /dev/null differ diff --git a/doc/src/images/progressBar-stylesheet.png b/doc/src/images/progressBar-stylesheet.png deleted file mode 100644 index b4bf755b6c..0000000000 Binary files a/doc/src/images/progressBar-stylesheet.png and /dev/null differ diff --git a/doc/src/images/progressBar2-stylesheet.png b/doc/src/images/progressBar2-stylesheet.png deleted file mode 100644 index 8b5ecc0a66..0000000000 Binary files a/doc/src/images/progressBar2-stylesheet.png and /dev/null differ diff --git a/doc/src/images/propagation-custom.png b/doc/src/images/propagation-custom.png deleted file mode 100644 index 866b44d677..0000000000 Binary files a/doc/src/images/propagation-custom.png and /dev/null differ diff --git a/doc/src/images/propagation-standard.png b/doc/src/images/propagation-standard.png deleted file mode 100644 index b010fccc95..0000000000 Binary files a/doc/src/images/propagation-standard.png and /dev/null differ diff --git a/doc/src/images/qcalendarwidget-grid.png b/doc/src/images/qcalendarwidget-grid.png deleted file mode 100644 index 3df4dd99e2..0000000000 Binary files a/doc/src/images/qcalendarwidget-grid.png and /dev/null differ diff --git a/doc/src/images/qcalendarwidget-maximum.png b/doc/src/images/qcalendarwidget-maximum.png deleted file mode 100644 index 1e78d20e85..0000000000 Binary files a/doc/src/images/qcalendarwidget-maximum.png and /dev/null differ diff --git a/doc/src/images/qcalendarwidget-minimum.png b/doc/src/images/qcalendarwidget-minimum.png deleted file mode 100644 index f860429309..0000000000 Binary files a/doc/src/images/qcalendarwidget-minimum.png and /dev/null differ diff --git a/doc/src/images/qcolumnview.png b/doc/src/images/qcolumnview.png deleted file mode 100644 index 1d312bf953..0000000000 Binary files a/doc/src/images/qcolumnview.png and /dev/null differ diff --git a/doc/src/images/qdesktopwidget.png b/doc/src/images/qdesktopwidget.png deleted file mode 100644 index 02f8e8b5ad..0000000000 Binary files a/doc/src/images/qdesktopwidget.png and /dev/null differ diff --git a/doc/src/images/qformlayout-with-6-children.png b/doc/src/images/qformlayout-with-6-children.png deleted file mode 100644 index f743599702..0000000000 Binary files a/doc/src/images/qformlayout-with-6-children.png and /dev/null differ diff --git a/doc/src/images/qgraphicsproxywidget-embed.png b/doc/src/images/qgraphicsproxywidget-embed.png deleted file mode 100644 index 10d8f6fddd..0000000000 Binary files a/doc/src/images/qgraphicsproxywidget-embed.png and /dev/null differ diff --git a/doc/src/images/qgridlayout-with-5-children.png b/doc/src/images/qgridlayout-with-5-children.png deleted file mode 100644 index 8d0c2962e4..0000000000 Binary files a/doc/src/images/qgridlayout-with-5-children.png and /dev/null differ diff --git a/doc/src/images/qhboxlayout-with-5-children.png b/doc/src/images/qhboxlayout-with-5-children.png deleted file mode 100644 index 9b48dc5c47..0000000000 Binary files a/doc/src/images/qhboxlayout-with-5-children.png and /dev/null differ diff --git a/doc/src/images/qmdisubwindowlayout.png b/doc/src/images/qmdisubwindowlayout.png deleted file mode 100644 index ffe5cc3949..0000000000 Binary files a/doc/src/images/qmdisubwindowlayout.png and /dev/null differ diff --git a/doc/src/images/qscrollbar-picture.png b/doc/src/images/qscrollbar-picture.png deleted file mode 100644 index 898e014c40..0000000000 Binary files a/doc/src/images/qscrollbar-picture.png and /dev/null differ diff --git a/doc/src/images/qstyle-comboboxes.png b/doc/src/images/qstyle-comboboxes.png deleted file mode 100644 index aecec914a0..0000000000 Binary files a/doc/src/images/qstyle-comboboxes.png and /dev/null differ diff --git a/doc/src/images/qstyleoptiontoolbar-position.png b/doc/src/images/qstyleoptiontoolbar-position.png deleted file mode 100644 index 5eaae7e4cd..0000000000 Binary files a/doc/src/images/qstyleoptiontoolbar-position.png and /dev/null differ diff --git a/doc/src/images/qtwizard-macpage.png b/doc/src/images/qtwizard-macpage.png deleted file mode 100644 index 1ba3122f91..0000000000 Binary files a/doc/src/images/qtwizard-macpage.png and /dev/null differ diff --git a/doc/src/images/qtwizard-nonmacpage.png b/doc/src/images/qtwizard-nonmacpage.png deleted file mode 100644 index cbe464d57f..0000000000 Binary files a/doc/src/images/qtwizard-nonmacpage.png and /dev/null differ diff --git a/doc/src/images/qundoview.png b/doc/src/images/qundoview.png deleted file mode 100644 index 3bdb1cf2ed..0000000000 Binary files a/doc/src/images/qundoview.png and /dev/null differ diff --git a/doc/src/images/qvboxlayout-with-5-children.png b/doc/src/images/qvboxlayout-with-5-children.png deleted file mode 100644 index 57c37d7247..0000000000 Binary files a/doc/src/images/qvboxlayout-with-5-children.png and /dev/null differ diff --git a/doc/src/images/stylesheet-border-image-normal.png b/doc/src/images/stylesheet-border-image-normal.png deleted file mode 100644 index 8afe3c9a67..0000000000 Binary files a/doc/src/images/stylesheet-border-image-normal.png and /dev/null differ diff --git a/doc/src/images/stylesheet-boxmodel.png b/doc/src/images/stylesheet-boxmodel.png deleted file mode 100644 index a0249d77b7..0000000000 Binary files a/doc/src/images/stylesheet-boxmodel.png and /dev/null differ diff --git a/doc/src/images/stylesheet-pagefold.png b/doc/src/images/stylesheet-pagefold.png deleted file mode 100644 index 5ccb4edbc9..0000000000 Binary files a/doc/src/images/stylesheet-pagefold.png and /dev/null differ diff --git a/doc/src/images/stylesheet-redbutton1.png b/doc/src/images/stylesheet-redbutton1.png deleted file mode 100644 index cb03375e12..0000000000 Binary files a/doc/src/images/stylesheet-redbutton1.png and /dev/null differ diff --git a/doc/src/images/stylesheet-redbutton2.png b/doc/src/images/stylesheet-redbutton2.png deleted file mode 100644 index 5325708942..0000000000 Binary files a/doc/src/images/stylesheet-redbutton2.png and /dev/null differ diff --git a/doc/src/images/stylesheet-redbutton3.png b/doc/src/images/stylesheet-redbutton3.png deleted file mode 100644 index dd976f0760..0000000000 Binary files a/doc/src/images/stylesheet-redbutton3.png and /dev/null differ diff --git a/doc/src/images/stylesheet-scrollbar1.png b/doc/src/images/stylesheet-scrollbar1.png deleted file mode 100644 index 666ff1119a..0000000000 Binary files a/doc/src/images/stylesheet-scrollbar1.png and /dev/null differ diff --git a/doc/src/images/stylesheet-scrollbar2.png b/doc/src/images/stylesheet-scrollbar2.png deleted file mode 100644 index 439cf8035d..0000000000 Binary files a/doc/src/images/stylesheet-scrollbar2.png and /dev/null differ diff --git a/doc/src/images/stylesheet-treeview.png b/doc/src/images/stylesheet-treeview.png deleted file mode 100644 index 883d190f36..0000000000 Binary files a/doc/src/images/stylesheet-treeview.png and /dev/null differ diff --git a/doc/src/images/swipegesture.png b/doc/src/images/swipegesture.png deleted file mode 100644 index 0b7d35af3a..0000000000 Binary files a/doc/src/images/swipegesture.png and /dev/null differ diff --git a/doc/src/images/system-tray.png b/doc/src/images/system-tray.png deleted file mode 100644 index 298b193cf7..0000000000 Binary files a/doc/src/images/system-tray.png and /dev/null differ diff --git a/doc/src/images/tabWidget-stylesheet1.png b/doc/src/images/tabWidget-stylesheet1.png deleted file mode 100644 index fc8fc19e74..0000000000 Binary files a/doc/src/images/tabWidget-stylesheet1.png and /dev/null differ diff --git a/doc/src/images/tabWidget-stylesheet2.png b/doc/src/images/tabWidget-stylesheet2.png deleted file mode 100644 index 2cbf2bf36d..0000000000 Binary files a/doc/src/images/tabWidget-stylesheet2.png and /dev/null differ diff --git a/doc/src/images/tabWidget-stylesheet3.png b/doc/src/images/tabWidget-stylesheet3.png deleted file mode 100644 index f57a9c9f9c..0000000000 Binary files a/doc/src/images/tabWidget-stylesheet3.png and /dev/null differ diff --git a/doc/src/images/tableWidget-stylesheet.png b/doc/src/images/tableWidget-stylesheet.png deleted file mode 100644 index e99e7a97c8..0000000000 Binary files a/doc/src/images/tableWidget-stylesheet.png and /dev/null differ diff --git a/doc/src/images/widgetdelegate.png b/doc/src/images/widgetdelegate.png deleted file mode 100644 index 3df4c4b6a5..0000000000 Binary files a/doc/src/images/widgetdelegate.png and /dev/null differ diff --git a/doc/src/images/windows-calendarwidget.png b/doc/src/images/windows-calendarwidget.png deleted file mode 100644 index ad016238ad..0000000000 Binary files a/doc/src/images/windows-calendarwidget.png and /dev/null differ diff --git a/doc/src/images/windows-checkbox.png b/doc/src/images/windows-checkbox.png deleted file mode 100644 index eb1be4b736..0000000000 Binary files a/doc/src/images/windows-checkbox.png and /dev/null differ diff --git a/doc/src/images/windows-combobox.png b/doc/src/images/windows-combobox.png deleted file mode 100644 index d6bc483494..0000000000 Binary files a/doc/src/images/windows-combobox.png and /dev/null differ diff --git a/doc/src/images/windows-dateedit.png b/doc/src/images/windows-dateedit.png deleted file mode 100644 index 95587ec62e..0000000000 Binary files a/doc/src/images/windows-dateedit.png and /dev/null differ diff --git a/doc/src/images/windows-datetimeedit.png b/doc/src/images/windows-datetimeedit.png deleted file mode 100644 index 6aa1766146..0000000000 Binary files a/doc/src/images/windows-datetimeedit.png and /dev/null differ diff --git a/doc/src/images/windows-dial.png b/doc/src/images/windows-dial.png deleted file mode 100644 index 0aa3a26159..0000000000 Binary files a/doc/src/images/windows-dial.png and /dev/null differ diff --git a/doc/src/images/windows-doublespinbox.png b/doc/src/images/windows-doublespinbox.png deleted file mode 100644 index 244b5f66cd..0000000000 Binary files a/doc/src/images/windows-doublespinbox.png and /dev/null differ diff --git a/doc/src/images/windows-fontcombobox.png b/doc/src/images/windows-fontcombobox.png deleted file mode 100644 index bf98cad922..0000000000 Binary files a/doc/src/images/windows-fontcombobox.png and /dev/null differ diff --git a/doc/src/images/windows-frame.png b/doc/src/images/windows-frame.png deleted file mode 100644 index 5979b31b25..0000000000 Binary files a/doc/src/images/windows-frame.png and /dev/null differ diff --git a/doc/src/images/windows-groupbox.png b/doc/src/images/windows-groupbox.png deleted file mode 100644 index 88f46a3832..0000000000 Binary files a/doc/src/images/windows-groupbox.png and /dev/null differ diff --git a/doc/src/images/windows-horizontalscrollbar.png b/doc/src/images/windows-horizontalscrollbar.png deleted file mode 100644 index 1f36b9a352..0000000000 Binary files a/doc/src/images/windows-horizontalscrollbar.png and /dev/null differ diff --git a/doc/src/images/windows-label.png b/doc/src/images/windows-label.png deleted file mode 100644 index a1c3a396a9..0000000000 Binary files a/doc/src/images/windows-label.png and /dev/null differ diff --git a/doc/src/images/windows-lcdnumber.png b/doc/src/images/windows-lcdnumber.png deleted file mode 100644 index b463511aab..0000000000 Binary files a/doc/src/images/windows-lcdnumber.png and /dev/null differ diff --git a/doc/src/images/windows-lineedit.png b/doc/src/images/windows-lineedit.png deleted file mode 100644 index 270e4517ff..0000000000 Binary files a/doc/src/images/windows-lineedit.png and /dev/null differ diff --git a/doc/src/images/windows-listview.png b/doc/src/images/windows-listview.png deleted file mode 100644 index 2884fae1b1..0000000000 Binary files a/doc/src/images/windows-listview.png and /dev/null differ diff --git a/doc/src/images/windows-progressbar.png b/doc/src/images/windows-progressbar.png deleted file mode 100644 index 361799a70e..0000000000 Binary files a/doc/src/images/windows-progressbar.png and /dev/null differ diff --git a/doc/src/images/windows-pushbutton.png b/doc/src/images/windows-pushbutton.png deleted file mode 100644 index 14528d6808..0000000000 Binary files a/doc/src/images/windows-pushbutton.png and /dev/null differ diff --git a/doc/src/images/windows-radiobutton.png b/doc/src/images/windows-radiobutton.png deleted file mode 100644 index db328cb563..0000000000 Binary files a/doc/src/images/windows-radiobutton.png and /dev/null differ diff --git a/doc/src/images/windows-slider.png b/doc/src/images/windows-slider.png deleted file mode 100644 index fde85024b6..0000000000 Binary files a/doc/src/images/windows-slider.png and /dev/null differ diff --git a/doc/src/images/windows-spinbox.png b/doc/src/images/windows-spinbox.png deleted file mode 100644 index d4e93c584a..0000000000 Binary files a/doc/src/images/windows-spinbox.png and /dev/null differ diff --git a/doc/src/images/windows-tableview.png b/doc/src/images/windows-tableview.png deleted file mode 100644 index 89da89fb5f..0000000000 Binary files a/doc/src/images/windows-tableview.png and /dev/null differ diff --git a/doc/src/images/windows-tabwidget.png b/doc/src/images/windows-tabwidget.png deleted file mode 100644 index 8622f7ec6a..0000000000 Binary files a/doc/src/images/windows-tabwidget.png and /dev/null differ diff --git a/doc/src/images/windows-textedit.png b/doc/src/images/windows-textedit.png deleted file mode 100644 index fd21ade02f..0000000000 Binary files a/doc/src/images/windows-textedit.png and /dev/null differ diff --git a/doc/src/images/windows-timeedit.png b/doc/src/images/windows-timeedit.png deleted file mode 100644 index 6ae0e406bc..0000000000 Binary files a/doc/src/images/windows-timeedit.png and /dev/null differ diff --git a/doc/src/images/windows-toolbox.png b/doc/src/images/windows-toolbox.png deleted file mode 100644 index 99b471e6df..0000000000 Binary files a/doc/src/images/windows-toolbox.png and /dev/null differ diff --git a/doc/src/images/windows-toolbutton.png b/doc/src/images/windows-toolbutton.png deleted file mode 100644 index 9ceb846ed4..0000000000 Binary files a/doc/src/images/windows-toolbutton.png and /dev/null differ diff --git a/doc/src/images/windows-treeview.png b/doc/src/images/windows-treeview.png deleted file mode 100644 index f55cd69c79..0000000000 Binary files a/doc/src/images/windows-treeview.png and /dev/null differ diff --git a/doc/src/images/windowsvista-calendarwidget.png b/doc/src/images/windowsvista-calendarwidget.png deleted file mode 100644 index 3cb1ab78dc..0000000000 Binary files a/doc/src/images/windowsvista-calendarwidget.png and /dev/null differ diff --git a/doc/src/images/windowsvista-checkbox.png b/doc/src/images/windowsvista-checkbox.png deleted file mode 100644 index b9bc909988..0000000000 Binary files a/doc/src/images/windowsvista-checkbox.png and /dev/null differ diff --git a/doc/src/images/windowsvista-combobox.png b/doc/src/images/windowsvista-combobox.png deleted file mode 100644 index f53192f45a..0000000000 Binary files a/doc/src/images/windowsvista-combobox.png and /dev/null differ diff --git a/doc/src/images/windowsvista-dateedit.png b/doc/src/images/windowsvista-dateedit.png deleted file mode 100644 index bb79482849..0000000000 Binary files a/doc/src/images/windowsvista-dateedit.png and /dev/null differ diff --git a/doc/src/images/windowsvista-datetimeedit.png b/doc/src/images/windowsvista-datetimeedit.png deleted file mode 100644 index 0a104de084..0000000000 Binary files a/doc/src/images/windowsvista-datetimeedit.png and /dev/null differ diff --git a/doc/src/images/windowsvista-dial.png b/doc/src/images/windowsvista-dial.png deleted file mode 100644 index 7081269c31..0000000000 Binary files a/doc/src/images/windowsvista-dial.png and /dev/null differ diff --git a/doc/src/images/windowsvista-doublespinbox.png b/doc/src/images/windowsvista-doublespinbox.png deleted file mode 100644 index 6efa9379fd..0000000000 Binary files a/doc/src/images/windowsvista-doublespinbox.png and /dev/null differ diff --git a/doc/src/images/windowsvista-fontcombobox.png b/doc/src/images/windowsvista-fontcombobox.png deleted file mode 100644 index 3771e84bd4..0000000000 Binary files a/doc/src/images/windowsvista-fontcombobox.png and /dev/null differ diff --git a/doc/src/images/windowsvista-frame.png b/doc/src/images/windowsvista-frame.png deleted file mode 100644 index 63b8422d2b..0000000000 Binary files a/doc/src/images/windowsvista-frame.png and /dev/null differ diff --git a/doc/src/images/windowsvista-groupbox.png b/doc/src/images/windowsvista-groupbox.png deleted file mode 100644 index 967d8878a7..0000000000 Binary files a/doc/src/images/windowsvista-groupbox.png and /dev/null differ diff --git a/doc/src/images/windowsvista-horizontalscrollbar.png b/doc/src/images/windowsvista-horizontalscrollbar.png deleted file mode 100644 index 996865d66c..0000000000 Binary files a/doc/src/images/windowsvista-horizontalscrollbar.png and /dev/null differ diff --git a/doc/src/images/windowsvista-label.png b/doc/src/images/windowsvista-label.png deleted file mode 100644 index caef8d8361..0000000000 Binary files a/doc/src/images/windowsvista-label.png and /dev/null differ diff --git a/doc/src/images/windowsvista-lcdnumber.png b/doc/src/images/windowsvista-lcdnumber.png deleted file mode 100644 index 911438e2b1..0000000000 Binary files a/doc/src/images/windowsvista-lcdnumber.png and /dev/null differ diff --git a/doc/src/images/windowsvista-lineedit.png b/doc/src/images/windowsvista-lineedit.png deleted file mode 100644 index 9fcde3a851..0000000000 Binary files a/doc/src/images/windowsvista-lineedit.png and /dev/null differ diff --git a/doc/src/images/windowsvista-listview.png b/doc/src/images/windowsvista-listview.png deleted file mode 100644 index 36a03438ab..0000000000 Binary files a/doc/src/images/windowsvista-listview.png and /dev/null differ diff --git a/doc/src/images/windowsvista-progressbar.png b/doc/src/images/windowsvista-progressbar.png deleted file mode 100644 index 0bda010811..0000000000 Binary files a/doc/src/images/windowsvista-progressbar.png and /dev/null differ diff --git a/doc/src/images/windowsvista-pushbutton.png b/doc/src/images/windowsvista-pushbutton.png deleted file mode 100644 index 3bc438dc10..0000000000 Binary files a/doc/src/images/windowsvista-pushbutton.png and /dev/null differ diff --git a/doc/src/images/windowsvista-radiobutton.png b/doc/src/images/windowsvista-radiobutton.png deleted file mode 100644 index fdfd2d66dd..0000000000 Binary files a/doc/src/images/windowsvista-radiobutton.png and /dev/null differ diff --git a/doc/src/images/windowsvista-slider.png b/doc/src/images/windowsvista-slider.png deleted file mode 100644 index be2fffb7b5..0000000000 Binary files a/doc/src/images/windowsvista-slider.png and /dev/null differ diff --git a/doc/src/images/windowsvista-spinbox.png b/doc/src/images/windowsvista-spinbox.png deleted file mode 100644 index 4a2293e724..0000000000 Binary files a/doc/src/images/windowsvista-spinbox.png and /dev/null differ diff --git a/doc/src/images/windowsvista-tableview.png b/doc/src/images/windowsvista-tableview.png deleted file mode 100644 index 96f4937bc1..0000000000 Binary files a/doc/src/images/windowsvista-tableview.png and /dev/null differ diff --git a/doc/src/images/windowsvista-tabwidget.png b/doc/src/images/windowsvista-tabwidget.png deleted file mode 100644 index 259c4f1a89..0000000000 Binary files a/doc/src/images/windowsvista-tabwidget.png and /dev/null differ diff --git a/doc/src/images/windowsvista-textedit.png b/doc/src/images/windowsvista-textedit.png deleted file mode 100644 index 5e5696623e..0000000000 Binary files a/doc/src/images/windowsvista-textedit.png and /dev/null differ diff --git a/doc/src/images/windowsvista-timeedit.png b/doc/src/images/windowsvista-timeedit.png deleted file mode 100644 index e24fdd268a..0000000000 Binary files a/doc/src/images/windowsvista-timeedit.png and /dev/null differ diff --git a/doc/src/images/windowsvista-toolbox.png b/doc/src/images/windowsvista-toolbox.png deleted file mode 100644 index 8cfe5f9cab..0000000000 Binary files a/doc/src/images/windowsvista-toolbox.png and /dev/null differ diff --git a/doc/src/images/windowsvista-toolbutton.png b/doc/src/images/windowsvista-toolbutton.png deleted file mode 100644 index 0baa9809c1..0000000000 Binary files a/doc/src/images/windowsvista-toolbutton.png and /dev/null differ diff --git a/doc/src/images/windowsvista-treeview.png b/doc/src/images/windowsvista-treeview.png deleted file mode 100644 index db211e4b5f..0000000000 Binary files a/doc/src/images/windowsvista-treeview.png and /dev/null differ diff --git a/doc/src/images/windowsxp-calendarwidget.png b/doc/src/images/windowsxp-calendarwidget.png deleted file mode 100644 index 9a5fa6ebcd..0000000000 Binary files a/doc/src/images/windowsxp-calendarwidget.png and /dev/null differ diff --git a/doc/src/images/windowsxp-checkbox.png b/doc/src/images/windowsxp-checkbox.png deleted file mode 100644 index 505d3a3641..0000000000 Binary files a/doc/src/images/windowsxp-checkbox.png and /dev/null differ diff --git a/doc/src/images/windowsxp-combobox.png b/doc/src/images/windowsxp-combobox.png deleted file mode 100644 index 2363c8401c..0000000000 Binary files a/doc/src/images/windowsxp-combobox.png and /dev/null differ diff --git a/doc/src/images/windowsxp-dateedit.png b/doc/src/images/windowsxp-dateedit.png deleted file mode 100644 index 060ba07b2c..0000000000 Binary files a/doc/src/images/windowsxp-dateedit.png and /dev/null differ diff --git a/doc/src/images/windowsxp-datetimeedit.png b/doc/src/images/windowsxp-datetimeedit.png deleted file mode 100644 index 4e41f0fc14..0000000000 Binary files a/doc/src/images/windowsxp-datetimeedit.png and /dev/null differ diff --git a/doc/src/images/windowsxp-dial.png b/doc/src/images/windowsxp-dial.png deleted file mode 100644 index 0aa3a26159..0000000000 Binary files a/doc/src/images/windowsxp-dial.png and /dev/null differ diff --git a/doc/src/images/windowsxp-doublespinbox.png b/doc/src/images/windowsxp-doublespinbox.png deleted file mode 100644 index 3165a61b93..0000000000 Binary files a/doc/src/images/windowsxp-doublespinbox.png and /dev/null differ diff --git a/doc/src/images/windowsxp-fontcombobox.png b/doc/src/images/windowsxp-fontcombobox.png deleted file mode 100644 index 96292b84ef..0000000000 Binary files a/doc/src/images/windowsxp-fontcombobox.png and /dev/null differ diff --git a/doc/src/images/windowsxp-frame.png b/doc/src/images/windowsxp-frame.png deleted file mode 100644 index 5979b31b25..0000000000 Binary files a/doc/src/images/windowsxp-frame.png and /dev/null differ diff --git a/doc/src/images/windowsxp-groupbox.png b/doc/src/images/windowsxp-groupbox.png deleted file mode 100644 index 0b6f7e21ad..0000000000 Binary files a/doc/src/images/windowsxp-groupbox.png and /dev/null differ diff --git a/doc/src/images/windowsxp-horizontalscrollbar.png b/doc/src/images/windowsxp-horizontalscrollbar.png deleted file mode 100644 index 38812ec107..0000000000 Binary files a/doc/src/images/windowsxp-horizontalscrollbar.png and /dev/null differ diff --git a/doc/src/images/windowsxp-label.png b/doc/src/images/windowsxp-label.png deleted file mode 100644 index a1c3a396a9..0000000000 Binary files a/doc/src/images/windowsxp-label.png and /dev/null differ diff --git a/doc/src/images/windowsxp-lcdnumber.png b/doc/src/images/windowsxp-lcdnumber.png deleted file mode 100644 index 102023c8ed..0000000000 Binary files a/doc/src/images/windowsxp-lcdnumber.png and /dev/null differ diff --git a/doc/src/images/windowsxp-lineedit.png b/doc/src/images/windowsxp-lineedit.png deleted file mode 100644 index 9102b53ca4..0000000000 Binary files a/doc/src/images/windowsxp-lineedit.png and /dev/null differ diff --git a/doc/src/images/windowsxp-listview.png b/doc/src/images/windowsxp-listview.png deleted file mode 100644 index b0fc9bd3a7..0000000000 Binary files a/doc/src/images/windowsxp-listview.png and /dev/null differ diff --git a/doc/src/images/windowsxp-progressbar.png b/doc/src/images/windowsxp-progressbar.png deleted file mode 100644 index c8a73d6754..0000000000 Binary files a/doc/src/images/windowsxp-progressbar.png and /dev/null differ diff --git a/doc/src/images/windowsxp-pushbutton.png b/doc/src/images/windowsxp-pushbutton.png deleted file mode 100644 index bf6b7bf15d..0000000000 Binary files a/doc/src/images/windowsxp-pushbutton.png and /dev/null differ diff --git a/doc/src/images/windowsxp-radiobutton.png b/doc/src/images/windowsxp-radiobutton.png deleted file mode 100644 index ad8a908fb2..0000000000 Binary files a/doc/src/images/windowsxp-radiobutton.png and /dev/null differ diff --git a/doc/src/images/windowsxp-slider.png b/doc/src/images/windowsxp-slider.png deleted file mode 100644 index 9e2fca7c40..0000000000 Binary files a/doc/src/images/windowsxp-slider.png and /dev/null differ diff --git a/doc/src/images/windowsxp-spinbox.png b/doc/src/images/windowsxp-spinbox.png deleted file mode 100644 index e42073cd6b..0000000000 Binary files a/doc/src/images/windowsxp-spinbox.png and /dev/null differ diff --git a/doc/src/images/windowsxp-tableview.png b/doc/src/images/windowsxp-tableview.png deleted file mode 100644 index 5d12137ad5..0000000000 Binary files a/doc/src/images/windowsxp-tableview.png and /dev/null differ diff --git a/doc/src/images/windowsxp-tabwidget.png b/doc/src/images/windowsxp-tabwidget.png deleted file mode 100644 index 3c8e777a0b..0000000000 Binary files a/doc/src/images/windowsxp-tabwidget.png and /dev/null differ diff --git a/doc/src/images/windowsxp-textedit.png b/doc/src/images/windowsxp-textedit.png deleted file mode 100644 index d89c75c71b..0000000000 Binary files a/doc/src/images/windowsxp-textedit.png and /dev/null differ diff --git a/doc/src/images/windowsxp-timeedit.png b/doc/src/images/windowsxp-timeedit.png deleted file mode 100644 index 751cca9e6a..0000000000 Binary files a/doc/src/images/windowsxp-timeedit.png and /dev/null differ diff --git a/doc/src/images/windowsxp-toolbox.png b/doc/src/images/windowsxp-toolbox.png deleted file mode 100644 index 99b471e6df..0000000000 Binary files a/doc/src/images/windowsxp-toolbox.png and /dev/null differ diff --git a/doc/src/images/windowsxp-toolbutton.png b/doc/src/images/windowsxp-toolbutton.png deleted file mode 100644 index ea63e16aae..0000000000 Binary files a/doc/src/images/windowsxp-toolbutton.png and /dev/null differ diff --git a/doc/src/images/windowsxp-treeview.png b/doc/src/images/windowsxp-treeview.png deleted file mode 100644 index 050cc2f4d6..0000000000 Binary files a/doc/src/images/windowsxp-treeview.png and /dev/null differ diff --git a/doc/src/snippets/code/doc_src_layout.cpp b/doc/src/snippets/code/doc_src_layout.cpp deleted file mode 100644 index b6abab61d3..0000000000 --- a/doc/src/snippets/code/doc_src_layout.cpp +++ /dev/null @@ -1,166 +0,0 @@ -/**************************************************************************** -** -** 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 -#include - -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 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/doc/src/snippets/code/doc_src_qt4-styles.cpp b/doc/src/snippets/code/doc_src_qt4-styles.cpp deleted file mode 100644 index 9bebb825e4..0000000000 --- a/doc/src/snippets/code/doc_src_qt4-styles.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** 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(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/doc/src/snippets/code/doc_src_styles.cpp b/doc/src/snippets/code/doc_src_styles.cpp deleted file mode 100644 index 6c079c6637..0000000000 --- a/doc/src/snippets/code/doc_src_styles.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/**************************************************************************** -** -** 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(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/doc/src/snippets/code/doc_src_stylesheet.cpp b/doc/src/snippets/code/doc_src_stylesheet.cpp deleted file mode 100644 index eb02634c6d..0000000000 --- a/doc/src/snippets/code/doc_src_stylesheet.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/doc_src_stylesheet.qdoc b/doc/src/snippets/code/doc_src_stylesheet.qdoc deleted file mode 100644 index 9acba09c67..0000000000 --- a/doc/src/snippets/code/doc_src_stylesheet.qdoc +++ /dev/null @@ -1,1866 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp b/doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp deleted file mode 100644 index 1a89ff327f..0000000000 --- a/doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp +++ /dev/null @@ -1,131 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_dialogs_qfontdialog.cpp b/doc/src/snippets/code/src_gui_dialogs_qfontdialog.cpp deleted file mode 100644 index e07ecbca3e..0000000000 --- a/doc/src/snippets/code/src_gui_dialogs_qfontdialog.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_dialogs_qwizard.cpp b/doc/src/snippets/code/src_gui_dialogs_qwizard.cpp deleted file mode 100644 index 47db20da99..0000000000 --- a/doc/src/snippets/code/src_gui_dialogs_qwizard.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** 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 layout; - layout << QWizard::Stretch << QWizard::BackButton << QWizard::CancelButton - << QWizard::NextButton << QWizard::FinishButton; - setButtonLayout(layout); - ... -} -//! [1] diff --git a/doc/src/snippets/code/src_gui_effects_qgraphicseffect.cpp b/doc/src/snippets/code/src_gui_effects_qgraphicseffect.cpp deleted file mode 100644 index 3e0b0b64ee..0000000000 --- a/doc/src/snippets/code/src_gui_effects_qgraphicseffect.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_graphicsview_qgraphicsgridlayout.cpp b/doc/src/snippets/code/src_gui_graphicsview_qgraphicsgridlayout.cpp deleted file mode 100644 index 9a974de016..0000000000 --- a/doc/src/snippets/code/src_gui_graphicsview_qgraphicsgridlayout.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp b/doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp deleted file mode 100644 index 01df05c084..0000000000 --- a/doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp +++ /dev/null @@ -1,278 +0,0 @@ -/**************************************************************************** -** -** 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(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/doc/src/snippets/code/src_gui_graphicsview_qgraphicslinearlayout.cpp b/doc/src/snippets/code/src_gui_graphicsview_qgraphicslinearlayout.cpp deleted file mode 100644 index e3998201af..0000000000 --- a/doc/src/snippets/code/src_gui_graphicsview_qgraphicslinearlayout.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_graphicsview_qgraphicsproxywidget.cpp b/doc/src/snippets/code/src_gui_graphicsview_qgraphicsproxywidget.cpp deleted file mode 100644 index e508dbfb2b..0000000000 --- a/doc/src/snippets/code/src_gui_graphicsview_qgraphicsproxywidget.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_graphicsview_qgraphicsscene.cpp b/doc/src/snippets/code/src_gui_graphicsview_qgraphicsscene.cpp deleted file mode 100644 index 40b240c56f..0000000000 --- a/doc/src/snippets/code/src_gui_graphicsview_qgraphicsscene.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_graphicsview_qgraphicssceneevent.cpp b/doc/src/snippets/code/src_gui_graphicsview_qgraphicssceneevent.cpp deleted file mode 100644 index 0e9ceea6a0..0000000000 --- a/doc/src/snippets/code/src_gui_graphicsview_qgraphicssceneevent.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_graphicsview_qgraphicsview.cpp b/doc/src/snippets/code/src_gui_graphicsview_qgraphicsview.cpp deleted file mode 100644 index d07b5f7cf6..0000000000 --- a/doc/src/snippets/code/src_gui_graphicsview_qgraphicsview.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_graphicsview_qgraphicswidget.cpp b/doc/src/snippets/code/src_gui_graphicsview_qgraphicswidget.cpp deleted file mode 100644 index da92f2d2e1..0000000000 --- a/doc/src/snippets/code/src_gui_graphicsview_qgraphicswidget.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** 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(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/doc/src/snippets/code/src_gui_image_qicon.cpp b/doc/src/snippets/code/src_gui_image_qicon.cpp deleted file mode 100644 index 28ebea8f65..0000000000 --- a/doc/src/snippets/code/src_gui_image_qicon.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_image_qpixmapfilter.cpp b/doc/src/snippets/code/src_gui_image_qpixmapfilter.cpp deleted file mode 100644 index 55d5aa4897..0000000000 --- a/doc/src/snippets/code/src_gui_image_qpixmapfilter.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_itemviews_qabstractitemview.cpp b/doc/src/snippets/code/src_gui_itemviews_qabstractitemview.cpp deleted file mode 100644 index 2a497ff37c..0000000000 --- a/doc/src/snippets/code/src_gui_itemviews_qabstractitemview.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the 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/doc/src/snippets/code/src_gui_itemviews_qdatawidgetmapper.cpp b/doc/src/snippets/code/src_gui_itemviews_qdatawidgetmapper.cpp deleted file mode 100644 index d968260d39..0000000000 --- a/doc/src/snippets/code/src_gui_itemviews_qdatawidgetmapper.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the 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/doc/src/snippets/code/src_gui_itemviews_qitemeditorfactory.cpp b/doc/src/snippets/code/src_gui_itemviews_qitemeditorfactory.cpp deleted file mode 100644 index 3f1e11c04c..0000000000 --- a/doc/src/snippets/code/src_gui_itemviews_qitemeditorfactory.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the 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 *itemCreator = - new QItemEditorCreator("myProperty"); - -QItemEditorFactory *factory = new QItemEditorFactory; -//! [1] - - -//! [2] -QItemEditorFactory *editorFactory = new QItemEditorFactory; -QItemEditorCreatorBase *creator = new QStandardItemEditorCreator(); -editorFactory->registerEditor(QVariant::DateType, creator); -//! [2] - - -//! [3] -Q_PROPERTY(QColor color READ color WRITE setColor USER true) -//! [3] diff --git a/doc/src/snippets/code/src_gui_itemviews_qstandarditemmodel.cpp b/doc/src/snippets/code/src_gui_itemviews_qstandarditemmodel.cpp deleted file mode 100644 index ae91339867..0000000000 --- a/doc/src/snippets/code/src_gui_itemviews_qstandarditemmodel.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_itemviews_qtablewidget.cpp b/doc/src/snippets/code/src_gui_itemviews_qtablewidget.cpp deleted file mode 100644 index 169fff57b9..0000000000 --- a/doc/src/snippets/code/src_gui_itemviews_qtablewidget.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_itemviews_qtreewidget.cpp b/doc/src/snippets/code/src_gui_itemviews_qtreewidget.cpp deleted file mode 100644 index b299d765f3..0000000000 --- a/doc/src/snippets/code/src_gui_itemviews_qtreewidget.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** 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 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/doc/src/snippets/code/src_gui_kernel_qaction.cpp b/doc/src/snippets/code/src_gui_kernel_qaction.cpp deleted file mode 100644 index af876cd872..0000000000 --- a/doc/src/snippets/code/src_gui_kernel_qaction.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_kernel_qformlayout.cpp b/doc/src/snippets/code/src_gui_kernel_qformlayout.cpp deleted file mode 100644 index 1f7517b613..0000000000 --- a/doc/src/snippets/code/src_gui_kernel_qformlayout.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_kernel_qlayout.cpp b/doc/src/snippets/code/src_gui_kernel_qlayout.cpp deleted file mode 100644 index cabd753b5d..0000000000 --- a/doc/src/snippets/code/src_gui_kernel_qlayout.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_kernel_qlayoutitem.cpp b/doc/src/snippets/code/src_gui_kernel_qlayoutitem.cpp deleted file mode 100644 index 378253c605..0000000000 --- a/doc/src/snippets/code/src_gui_kernel_qlayoutitem.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_kernel_qshortcut.cpp b/doc/src/snippets/code/src_gui_kernel_qshortcut.cpp deleted file mode 100644 index 31e3e3291e..0000000000 --- a/doc/src/snippets/code/src_gui_kernel_qshortcut.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_kernel_qwidget.cpp b/doc/src/snippets/code/src_gui_kernel_qwidget.cpp deleted file mode 100644 index 3e94519073..0000000000 --- a/doc/src/snippets/code/src_gui_kernel_qwidget.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_painting_qdrawutil.cpp b/doc/src/snippets/code/src_gui_painting_qdrawutil.cpp deleted file mode 100644 index 0f70fce8ef..0000000000 --- a/doc/src/snippets/code/src_gui_painting_qdrawutil.cpp +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_qproxystyle.cpp b/doc/src/snippets/code/src_gui_qproxystyle.cpp deleted file mode 100644 index ae9ff131aa..0000000000 --- a/doc/src/snippets/code/src_gui_qproxystyle.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** 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 -#include - -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/doc/src/snippets/code/src_gui_styles_qstyle.cpp b/doc/src/snippets/code/src_gui_styles_qstyle.cpp deleted file mode 100644 index ed4ebb60a4..0000000000 --- a/doc/src/snippets/code/src_gui_styles_qstyle.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_styles_qstyleoption.cpp b/doc/src/snippets/code/src_gui_styles_qstyleoption.cpp deleted file mode 100644 index 962212388f..0000000000 --- a/doc/src/snippets/code/src_gui_styles_qstyleoption.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** 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(hint); - if (maskReturn) { - ... - } - } - ... -} -//! [0] diff --git a/doc/src/snippets/code/src_gui_util_qcompleter.cpp b/doc/src/snippets/code/src_gui_util_qcompleter.cpp deleted file mode 100644 index 2e8eac17ad..0000000000 --- a/doc/src/snippets/code/src_gui_util_qcompleter.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the 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/doc/src/snippets/code/src_gui_util_qundostack.cpp b/doc/src/snippets/code/src_gui_util_qundostack.cpp deleted file mode 100644 index 7e06a8ef6f..0000000000 --- a/doc/src/snippets/code/src_gui_util_qundostack.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/**************************************************************************** -** -** 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(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/doc/src/snippets/code/src_gui_widgets_qabstractbutton.cpp b/doc/src/snippets/code/src_gui_widgets_qabstractbutton.cpp deleted file mode 100644 index 948ed0e958..0000000000 --- a/doc/src/snippets/code/src_gui_widgets_qabstractbutton.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_widgets_qabstractspinbox.cpp b/doc/src/snippets/code/src_gui_widgets_qabstractspinbox.cpp deleted file mode 100644 index 66f3449760..0000000000 --- a/doc/src/snippets/code/src_gui_widgets_qabstractspinbox.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_widgets_qcalendarwidget.cpp b/doc/src/snippets/code/src_gui_widgets_qcalendarwidget.cpp deleted file mode 100644 index 6f99bdf0ce..0000000000 --- a/doc/src/snippets/code/src_gui_widgets_qcalendarwidget.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_widgets_qcheckbox.cpp b/doc/src/snippets/code/src_gui_widgets_qcheckbox.cpp deleted file mode 100644 index 71ee59bc85..0000000000 --- a/doc/src/snippets/code/src_gui_widgets_qcheckbox.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_widgets_qdatetimeedit.cpp b/doc/src/snippets/code/src_gui_widgets_qdatetimeedit.cpp deleted file mode 100644 index 5eb9e739ea..0000000000 --- a/doc/src/snippets/code/src_gui_widgets_qdatetimeedit.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_widgets_qdockwidget.cpp b/doc/src/snippets/code/src_gui_widgets_qdockwidget.cpp deleted file mode 100644 index 690e3d5f33..0000000000 --- a/doc/src/snippets/code/src_gui_widgets_qdockwidget.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** 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(parentWidget()); -if (dockWidget->features() & QDockWidget::DockWidgetVerticalTitleBar) { - // I need to be vertical -} else { - // I need to be horizontal -} -//! [0] diff --git a/doc/src/snippets/code/src_gui_widgets_qframe.cpp b/doc/src/snippets/code/src_gui_widgets_qframe.cpp deleted file mode 100644 index 6e3afcd8cf..0000000000 --- a/doc/src/snippets/code/src_gui_widgets_qframe.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_widgets_qgroupbox.cpp b/doc/src/snippets/code/src_gui_widgets_qgroupbox.cpp deleted file mode 100644 index fc0339f690..0000000000 --- a/doc/src/snippets/code/src_gui_widgets_qgroupbox.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_widgets_qlabel.cpp b/doc/src/snippets/code/src_gui_widgets_qlabel.cpp deleted file mode 100644 index 83b02a2f22..0000000000 --- a/doc/src/snippets/code/src_gui_widgets_qlabel.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_widgets_qlineedit.cpp b/doc/src/snippets/code/src_gui_widgets_qlineedit.cpp deleted file mode 100644 index 12ed38ad65..0000000000 --- a/doc/src/snippets/code/src_gui_widgets_qlineedit.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the 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/doc/src/snippets/code/src_gui_widgets_qmainwindow.cpp b/doc/src/snippets/code/src_gui_widgets_qmainwindow.cpp deleted file mode 100644 index 3558922ec9..0000000000 --- a/doc/src/snippets/code/src_gui_widgets_qmainwindow.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the 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/doc/src/snippets/code/src_gui_widgets_qmenu.cpp b/doc/src/snippets/code/src_gui_widgets_qmenu.cpp deleted file mode 100644 index 5799248bf4..0000000000 --- a/doc/src/snippets/code/src_gui_widgets_qmenu.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_widgets_qmenubar.cpp b/doc/src/snippets/code/src_gui_widgets_qmenubar.cpp deleted file mode 100644 index 412bc2d5eb..0000000000 --- a/doc/src/snippets/code/src_gui_widgets_qmenubar.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_widgets_qplaintextedit.cpp b/doc/src/snippets/code/src_gui_widgets_qplaintextedit.cpp deleted file mode 100644 index 931c6c69a6..0000000000 --- a/doc/src/snippets/code/src_gui_widgets_qplaintextedit.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_widgets_qpushbutton.cpp b/doc/src/snippets/code/src_gui_widgets_qpushbutton.cpp deleted file mode 100644 index e0ae945620..0000000000 --- a/doc/src/snippets/code/src_gui_widgets_qpushbutton.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_widgets_qradiobutton.cpp b/doc/src/snippets/code/src_gui_widgets_qradiobutton.cpp deleted file mode 100644 index a93809fa5d..0000000000 --- a/doc/src/snippets/code/src_gui_widgets_qradiobutton.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_widgets_qrubberband.cpp b/doc/src/snippets/code/src_gui_widgets_qrubberband.cpp deleted file mode 100644 index b8d6a14d1c..0000000000 --- a/doc/src/snippets/code/src_gui_widgets_qrubberband.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_widgets_qscrollarea.cpp b/doc/src/snippets/code/src_gui_widgets_qscrollarea.cpp deleted file mode 100644 index 9c90a0c53d..0000000000 --- a/doc/src/snippets/code/src_gui_widgets_qscrollarea.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_widgets_qspinbox.cpp b/doc/src/snippets/code/src_gui_widgets_qspinbox.cpp deleted file mode 100644 index fc1f5b7e47..0000000000 --- a/doc/src/snippets/code/src_gui_widgets_qspinbox.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_widgets_qsplashscreen.cpp b/doc/src/snippets/code/src_gui_widgets_qsplashscreen.cpp deleted file mode 100644 index 48f1051e2c..0000000000 --- a/doc/src/snippets/code/src_gui_widgets_qsplashscreen.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_widgets_qsplitter.cpp b/doc/src/snippets/code/src_gui_widgets_qsplitter.cpp deleted file mode 100644 index 18007a4cdf..0000000000 --- a/doc/src/snippets/code/src_gui_widgets_qsplitter.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_widgets_qstatusbar.cpp b/doc/src/snippets/code/src_gui_widgets_qstatusbar.cpp deleted file mode 100644 index 6ea752b237..0000000000 --- a/doc/src/snippets/code/src_gui_widgets_qstatusbar.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_widgets_qtextbrowser.cpp b/doc/src/snippets/code/src_gui_widgets_qtextbrowser.cpp deleted file mode 100644 index ed30c2d80a..0000000000 --- a/doc/src/snippets/code/src_gui_widgets_qtextbrowser.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/code/src_gui_widgets_qtextedit.cpp b/doc/src/snippets/code/src_gui_widgets_qtextedit.cpp deleted file mode 100644 index cd1ae62c84..0000000000 --- a/doc/src/snippets/code/src_gui_widgets_qtextedit.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** 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/doc/src/snippets/customstyle/customstyle.cpp b/doc/src/snippets/customstyle/customstyle.cpp deleted file mode 100644 index 2e0843c49c..0000000000 --- a/doc/src/snippets/customstyle/customstyle.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** -** -** 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 - -#include "customstyle.h" - -CustomStyle::CustomStyle() -{ -//! [0] - QSpinBox *spinBox = qobject_cast(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/doc/src/snippets/customstyle/customstyle.h b/doc/src/snippets/customstyle/customstyle.h deleted file mode 100644 index 437994d2e2..0000000000 --- a/doc/src/snippets/customstyle/customstyle.h +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** 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 - -//! [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/doc/src/snippets/customviewstyle.cpp b/doc/src/snippets/customviewstyle.cpp deleted file mode 100644 index 55a766d17d..0000000000 --- a/doc/src/snippets/customviewstyle.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** 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 - -#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/doc/src/snippets/dialogs/dialogs.cpp b/doc/src/snippets/dialogs/dialogs.cpp deleted file mode 100644 index 78916f862c..0000000000 --- a/doc/src/snippets/dialogs/dialogs.cpp +++ /dev/null @@ -1,268 +0,0 @@ -/**************************************************************************** -** -** 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 - -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 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 ", - " is a \n\n" - "Copyright 1991-2003 Such-and-such. " - "\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/doc/src/snippets/filedialogurls.cpp b/doc/src/snippets/filedialogurls.cpp deleted file mode 100644 index b1e41cbcad..0000000000 --- a/doc/src/snippets/filedialogurls.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** 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 - -int main(int argv, char **args) -{ - QApplication app(argv, args); - -//![0] - QList 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/doc/src/snippets/graphicssceneadditemsnippet.cpp b/doc/src/snippets/graphicssceneadditemsnippet.cpp deleted file mode 100644 index 1130a59217..0000000000 --- a/doc/src/snippets/graphicssceneadditemsnippet.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** 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 - -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/doc/src/snippets/javastyle.cpp b/doc/src/snippets/javastyle.cpp deleted file mode 100644 index a00df57e82..0000000000 --- a/doc/src/snippets/javastyle.cpp +++ /dev/null @@ -1,2745 +0,0 @@ -/**************************************************************************** -** -** 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 - -#include "javastyle.h" -#include - -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(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(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(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(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(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(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(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(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(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(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(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(option); - if (copy.state & State_HasFocus) - copy.state ^= State_HasFocus; - painter->setBrush(Qt::NoBrush); - QWindowsStyle::drawControl(CE_TabBarTabLabel, ©, painter, - widget); - break; - } - case CE_TabBarTabShape: { - const QStyleOptionTab *tab = - qstyleoption_cast(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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->tickInterval ? slider->tickInterval : - slider->pageStep; - - for (int i = 0; i <= slider->maximum; i += tickInterval) { - if (horizontal) { - int pos = int(((i / double(slider->maximum)) * - ticks.width()) - 1); - painter->drawLine(QPoint(ticks.left() + pos, - ticks.top() + 2), QPoint(ticks.left() + pos, ticks.top() + 8)); - } else { - int pos = int(((i / double(slider->maximum)) * - ticks.height()) - 1); - painter->drawLine(QPoint(ticks.left() + 2, ticks.bottom() - pos), - QPoint(ticks.right() - 2, ticks.bottom() - pos)); - } - } - if (horizontal) { - painter->drawLine(QPoint(ticks.right(), ticks.top() + 2), - QPoint(ticks.right(), ticks.top() + 8)); - } else { - painter->drawLine(QPoint(ticks.left() + 2, ticks.top()), - QPoint(ticks.right() - 2, ticks.top())); - } - } - break; - } - default: - QWindowsStyle::drawComplexControl(control, option, painter, widget); - } - painter->restore(); -} - -inline void JavaStyle::drawSunkenButtonShadow(QPainter *painter, - QRect rect, - const QColor &frameColor, - bool reverse) const -{ - painter->save(); - - painter->setPen(frameColor); - - if (!reverse) { - painter->drawLine(QLine(QPoint(rect.x() + 1, rect.y() + 1), - QPoint(rect.x() + rect.width() - 1, rect.y() + 1))); - painter->drawLine(QLine(QPoint(rect.x() + 1, rect.y()), - QPoint(rect.x() + 1, rect.y() + rect.height()))); - } else { - painter->drawLine(QLine(QPoint(rect.right(), rect.bottom()), - QPoint(rect.right(), rect.top()))); - painter->drawLine(QLine(QPoint(rect.left(), rect.top() + 1), - QPoint(rect.right(), rect.top() + 1))); - } - painter->restore(); -} - -inline void JavaStyle::drawButtonHoverFrame(QPainter *painter, QRect rect, - const QColor &frameColor, - const QColor &activeFrame) const -{ - painter->save(); - - painter->setPen(activeFrame); - painter->drawRect(rect); - rect.adjust(1, 1, -1, -1); - painter->setPen(frameColor); - painter->drawRect(rect); - rect.adjust(1, 1, -1, -1); - painter->setPen(activeFrame); - painter->drawRect(rect); - - painter->restore(); -} - -QStyle::SubControl JavaStyle::hitTestComplexControl(ComplexControl control, - const QStyleOptionComplex *option, - const QPoint &pos, - const QWidget *widget) const -{ - SubControl ret = SC_None; - - switch (control) { - case CC_TitleBar: { - const QStyleOptionTitleBar *bar = - qstyleoption_cast(option); - - QRect maximize = subControlRect(control, bar, SC_TitleBarMaxButton); - if (maximize.contains(pos)) { - ret = SC_TitleBarMaxButton; - break; - } - QRect minimize = subControlRect(control, bar, SC_TitleBarMinButton); - if (minimize.contains(pos)) { - ret = SC_TitleBarMinButton; - break; - } - QRect close = subControlRect(control, bar, SC_TitleBarCloseButton); - if (close.contains(pos)) { - ret = SC_TitleBarCloseButton; - break; - } - QRect system = subControlRect(control, bar, SC_TitleBarSysMenu); - if (system.contains(pos)) { - ret = SC_TitleBarSysMenu; - break; - } - ret = SC_TitleBarLabel; - break; - } - case CC_ScrollBar: - if (const QStyleOptionSlider *scrollBar = - qstyleoption_cast(option)) { - QRect slider = subControlRect(control, scrollBar, - SC_ScrollBarSlider, widget); - if (slider.contains(pos)) { - ret = SC_ScrollBarSlider; - break; - } - - QRect scrollBarAddLine = subControlRect(control, scrollBar, - SC_ScrollBarAddLine, widget); - if (scrollBarAddLine.contains(pos)) { - ret = SC_ScrollBarAddLine; - break; - } - - QRect scrollBarSubPage = subControlRect(control, scrollBar, - SC_ScrollBarSubPage, widget); - if (scrollBarSubPage.contains(pos)) { - ret = SC_ScrollBarSubPage; - break; - } - - QRect scrollBarAddPage = subControlRect(control, scrollBar, - SC_ScrollBarAddPage, widget); - if (scrollBarAddPage.contains(pos)) { - ret = SC_ScrollBarAddPage; - break; - } - - QRect scrollBarSubLine = subControlRect(control, scrollBar, - SC_ScrollBarSubLine, widget); - if (scrollBarSubLine.contains(pos)) { - ret = SC_ScrollBarSubLine; - break; - } - } - break; - - default: - ret = QWindowsStyle::hitTestComplexControl(control, option, pos, - widget); - } - return ret; -} - -void JavaStyle::polish(QWidget *widget) -{ - if (qobject_cast(widget) || - qobject_cast(widget) || - qobject_cast(widget) || - qobject_cast(widget) || - qobject_cast(widget) || - qobject_cast(widget)) - widget->setAttribute(Qt::WA_Hover, true); -} - -void JavaStyle::unpolish(QWidget *widget) -{ - if (qobject_cast(widget) || - qobject_cast(widget) || - qobject_cast(widget) || - qobject_cast(widget) || - qobject_cast(widget) || - qobject_cast(widget)) - widget->setAttribute(Qt::WA_Hover, false); -} - -void JavaStyle::drawSplitter(const QStyleOption *option, QPainter *painter, - bool horizontal) const -{ - QRect rect = option->rect; - - painter->setPen(Qt::NoPen); - painter->setBrush(option->palette.color(QPalette::Background)); - - painter->drawRect(rect); - - QColor colors[] = { Qt::white, option->palette.color(QPalette::Mid) }; - int iterations = horizontal ? rect.height() - 1 : rect.width() - 1; - for (int i = 0; i < iterations; ++i) { - painter->setPen(colors[i % 2]); - painter->drawPoint(xySwitch(QPoint(rect.x() + 0 + (i % 4), - rect.y() + i), horizontal)); - } -} - -inline QPoint JavaStyle::xySwitch(const QPoint &point, bool horizontal) const -{ - QPoint retPoint = point; - - if (!horizontal) { - retPoint = QPoint(point.y(), point.x()); - } - - return retPoint; -} - -void JavaStyle::drawPrimitive(PrimitiveElement element, - const QStyleOption *option, - QPainter *painter, - const QWidget *widget) const -{ - painter->save(); - - switch (element) { - case PE_PanelButtonBevel: - case PE_FrameButtonBevel: { - painter->save(); - painter->setBrush(option->palette.background()); - painter->setPen(Qt::NoPen); - painter->drawRect(option->rect); - painter->restore(); - break; - } - case PE_IndicatorBranch: { - painter->save(); - QColor lineColor(204, 204, 255); - QPixmap openPixmap(":/images/jtreeopen.png"); - QPixmap closedPixmap(":/images/jtreeclosed.png"); - QRect pixmapRect(QPoint(0, 0), QSize(12, 12)); - pixmapRect.moveCenter(option->rect.center()); - pixmapRect.translate(2, 0); - QPoint center = option->rect.center(); - - painter->setPen(lineColor); - painter->setBrush(Qt::NoBrush); - - if (option->state & State_Item) { - painter->drawLine(center, - QPoint(option->rect.right(), center.y())); - - painter->drawLine(center, QPoint(center.x(), - option->rect.top())); - - if (option->state & State_Sibling) { - painter->drawLine(center, QPoint(center.x(), - option->rect.bottom())); - } - - if (option->state & State_Children) - if (option->state & State_Open) - painter->drawPixmap(pixmapRect.topLeft(), closedPixmap); - else - painter->drawPixmap(pixmapRect.topLeft(), openPixmap); - } else if (option->state & State_Sibling) { - painter->drawLine(center.x(), option->rect.top(), center.x(), - option->rect.bottom()); - } - - painter->restore(); - break; - } - case PE_IndicatorViewItemCheck: { - break; - } - case PE_FrameWindow: { - painter->save(); - bool active = option->state & State_Active; - - painter->setPen(Qt::NoPen); - painter->setBrush(active ? option->palette.color(QPalette::Midlight) - : option->palette.color(QPalette::Mid)); - - painter->drawRect(QRect(option->rect.topLeft(), option->rect.bottomLeft() + QPoint(5, 0))); - painter->drawRect(QRect(option->rect.bottomLeft(), option->rect.bottomRight() + QPoint(0, -5))); - painter->drawRect(QRect(option->rect.bottomRight() + QPoint(-5, 0), option->rect.topRight())); - painter->drawRect(QRect(option->rect.topLeft(), option->rect.topRight() + QPoint(0, 4))); - - painter->setBrush(Qt::NoBrush); - painter->setPen(option->palette.color(QPalette::Active, QPalette::WindowText)); - painter->drawLine(option->rect.topLeft() + QPoint(2, 14), - option->rect.bottomLeft() + QPoint(2, -14)); - - painter->drawLine(option->rect.topRight() + QPoint(-2, 14), - option->rect.bottomRight() + QPoint(-2, -14)); - - painter->drawLine(option->rect.topLeft() + QPoint(14, 2), - option->rect.topRight() + QPoint(-14, 2)); - - painter->drawLine(option->rect.bottomLeft() + QPoint(14, -2), - option->rect.bottomRight() + QPoint(-14, -2)); - - painter->setPen(active ? option->palette.color(QPalette::Light) : - option->palette.color(QPalette::Button)); - painter->drawLine(option->rect.topLeft() + QPoint(3, 15), - option->rect.bottomLeft() + QPoint(3, -13)); - - painter->drawLine(option->rect.topRight() + QPoint(-1, 15), - option->rect.bottomRight() + QPoint(-1, -13)); - - painter->drawLine(option->rect.topLeft() + QPoint(15, 3), - option->rect.topRight() + QPoint(-13, 3)); - - painter->drawLine(option->rect.bottomLeft() + QPoint(15, -1), - option->rect.bottomRight() + QPoint(-13, -1)); - - painter->restore(); - break; - } - case PE_IndicatorSpinUp: { - const QStyleOptionSpinBox *spinner = - qstyleoption_cast(option); - int add = spinner->state & State_Sunken && - spinner->activeSubControls & SC_SpinBoxUp ? 1 : 0; - - QPoint center = option->rect.center(); - painter->drawLine(center.x() + add, center.y() + 1 + add, - center.x() + 2 + add, center.y() + 1 + add); - painter->drawPoint(center.x() + 1 + add, center.y() + add); - break; - } - case PE_IndicatorSpinDown: { - const QStyleOptionSpinBox *spinner = - qstyleoption_cast(option); - - int add = spinner->state & State_Sunken && - spinner->activeSubControls & SC_SpinBoxDown ? 1 : 0; - QPoint center = option->rect.center(); - painter->drawLine(center.x() + add, center.y() + add, - center.x() + 2 + add, center.y() + add); - painter->drawPoint(center.x() + 1 + add, center.y() + 1 + add); - break; - } - case PE_FrameDockWidget: { - drawPrimitive(PE_FrameWindow, option, painter, widget); - break; - } - case PE_IndicatorToolBarHandle: { - QPoint offset; - bool horizontal = option->state & State_Horizontal; - - if (horizontal) - offset = option->rect.topLeft(); - else - offset = option->rect.topLeft(); - - int iterations = horizontal ? option->rect.height() : - option->rect.width(); - - for (int i = 0; i < iterations; ++i) { - painter->setPen(i % 2 ? Qt::white : - option->palette.color(QPalette::Mid)); - int add = i % 4; - painter->drawPoint(offset + xySwitch(QPoint(add, i), - horizontal)); - painter->drawPoint(offset + xySwitch(QPoint(add + 4, i), - horizontal)); - if (add + 8 < 10) - painter->drawPoint(offset + xySwitch(QPoint(add + 8, i), - horizontal)); - } - - break; - } - case PE_IndicatorToolBarSeparator: { - break; - } - case PE_PanelButtonTool: { - const QStyleOptionToolButton *button = - qstyleoption_cast(option); - - if (!button) { - painter->setPen(Qt::red); - if (!(option->state & State_Enabled)) - painter->drawRect(option->rect.adjusted(0, 0, -1, -1)); - drawButtonBackground(option, painter, false); - break; - } - - if (button->state & State_MouseOver || button->state & State_On) { - QStyleOptionButton bevel; - bevel.state = button->state; - bevel.rect = button->rect; - bevel.palette = button->palette; - - drawButtonBackground(&bevel, painter, false); - } else { - painter->setPen(Qt::NoPen); - painter->setBrush(button->palette.color(QPalette::Background)); - - painter->drawRect(button->rect.adjusted(0, 0, -1, -1)); - } - break; - } - case PE_FrameMenu: { - painter->setPen(option->palette.color(QPalette::Midlight)); - painter->drawRect(option->rect.adjusted(0, 0, -1, -1)); - break; - } - case PE_PanelButtonCommand: { - const QStyleOptionButton *btn = - qstyleoption_cast(option); - bool hover = (btn->state & State_Enabled) && - (btn->state & State_MouseOver); - bool sunken = btn->state & State_Sunken; - bool isDefault = btn->features & QStyleOptionButton::DefaultButton; - bool on = option->state & State_On; - - drawButtonBackground(option, painter, false); - - QRect rect = option->rect.adjusted(0, 0, -1, -1); - if (hover && !sunken && !isDefault && !on) { - drawButtonHoverFrame(painter, rect, - btn->palette.color(QPalette::Mid), - btn->palette.color(QPalette::Button)); - } else if (isDefault) { - drawPrimitive(PE_FrameDefaultButton, option, painter, widget); - } - break; - } - case PE_FrameDefaultButton: { - painter->setPen(option->palette.color(QPalette::Mid)); - QRect rect = option->rect.adjusted(0, 0, -1, -1); - painter->drawRect(rect); - painter->drawRect(rect.adjusted(1, 1, -1, -1)); - break; - } -//! [0] - case PE_IndicatorCheckBox: { - painter->save(); - drawButtonBackground(option, painter, true); - - if (option->state & State_Enabled && - option->state & State_MouseOver && - !(option->state & State_Sunken)) { - painter->setPen(option->palette.color(QPalette::Button)); - QRect rect = option->rect.adjusted(1, 1, -2, -2); - painter->drawRect(rect); - rect = rect.adjusted(1, 1, -1, -1); - painter->drawRect(rect); - } - - if (option->state & State_On) { - QImage image(":/images/checkboxchecked.png"); - painter->drawImage(option->rect.topLeft(), image); - } - painter->restore(); - break; -//! [0] - } - case PE_IndicatorRadioButton: { - painter->save(); - QBrush radioBrush = option->palette.button(); - - if (!(option->state & State_Sunken) && - option->state & State_Enabled) - radioBrush = gradientBrush(option->rect); - - painter->setBrush(radioBrush); - if (option->state & State_Enabled) - painter->setPen(option->palette.color(QPalette::Mid)); - else - painter->setPen(option->palette.color(QPalette::Disabled, - QPalette::WindowText)); - painter->drawEllipse(option->rect.adjusted(0, 0, -1, -1)); - - if (option->state & State_MouseOver && - option->state & State_Enabled && - !(option->state & State_Sunken)) { - gradientBrush(option->rect); - painter->setPen(option->palette.color(QPalette::Button)); - painter->setBrush(Qt::NoBrush); - QRect rect = option->rect.adjusted(1, 1, -2, -2); - painter->drawEllipse(rect); - rect = rect.adjusted(1, 1, -1, -1); - painter->drawEllipse(rect); - } - - if (option->state & State_On) { - painter->setBrush(option->palette.color(QPalette::Text)); - painter->setPen(Qt::NoPen); - painter->drawEllipse(option->rect.adjusted(3, 3, -3, -3)); - } - if (option->state & State_Sunken && - option->state & State_Enabled) { - painter->setPen(option->palette.color(QPalette::Mid)); - painter->drawArc(option->rect.adjusted(1, 1, -2, -2), 80 * 16, - 100 * 16); - } - painter->restore(); - break; - } - case PE_FrameTabWidget: { - painter->setPen(option->palette.color(QPalette::Midlight)); - painter->drawRect(option->rect.adjusted(0, 0, -1, -1)); - painter->setPen(Qt::white); - painter->drawRect(option->rect.adjusted(1, 1, -2, -2)); - break; - } - case PE_Frame: - case PE_FrameLineEdit: { - const QStyleOptionFrame *frame = - qstyleoption_cast(option); - const QStyleOptionFrameV2 frameV2(*frame); - - painter->setPen(frame->palette.color(QPalette::Mid)); - painter->drawRect(frameV2.rect.adjusted(0, 0, -2, -2)); - painter->setPen(Qt::white); - painter->drawRect(frameV2.rect.adjusted(1, 1, -1, -1)); - painter->setPen(frameV2.palette.color(QPalette::Active, - QPalette::Background)); - painter->drawLine(frameV2.rect.bottomLeft(), - frameV2.rect.bottomLeft() + QPoint(1, -1)); - painter->drawLine(frameV2.rect.topRight(), - frameV2.rect.topRight() + QPoint(-1, 1)); - break; - } - case PE_FrameFocusRect: { - painter->setPen(option->palette.color(QPalette::Light)); - painter->setBrush(Qt::NoBrush); - QRect rect = option->rect; - rect = rect.adjusted(0,0, -1, -1); - painter->drawRect(rect); - break; - } - default: - QWindowsStyle::drawPrimitive(element, option, painter, widget); - } - painter->restore(); -} - -//! [1] -void JavaStyle::drawButtonBackground(const QStyleOption *option, - QPainter *painter, bool isCheckbox) const -{ - QBrush buttonBrush = option->palette.button(); - bool sunken = option->state & State_Sunken; - bool disabled = !(option->state & State_Enabled); - bool on = option->state & State_On; - - if (!sunken && !disabled && (!on || isCheckbox)) - buttonBrush = gradientBrush(option->rect); - - painter->fillRect(option->rect, buttonBrush); - - QRect rect = option->rect.adjusted(0, 0, -1, -1); - - if (disabled) - painter->setPen(option->palette.color(QPalette::Disabled, - QPalette::WindowText)); - else - painter->setPen(option->palette.color(QPalette::Mid)); - - painter->drawRect(rect); - - if (sunken && !disabled) { - drawSunkenButtonShadow(painter, rect, - option->palette.color(QPalette::Mid), - option->direction == Qt::RightToLeft); - } -} -//! [1] - -QBrush JavaStyle::gradientBrush(const QRect &rect) const -{ - QLinearGradient gradient(rect.topLeft(), rect.bottomLeft()); - gradient.setColorAt(1.0, QColor(188, 210, 230)); - gradient.setColorAt(0.3, Qt::white); - gradient.setColorAt(0.0, QColor(223, 233, 243)); - - return QBrush(gradient); -} - -QRect JavaStyle::subElementRect(SubElement element, - const QStyleOption *option, - const QWidget *widget) const -{ - QRect rect; - - switch (element) { - case SE_ToolBoxTabContents: { - const QStyleOptionToolBox *box = - qstyleoption_cast(option); - - rect.moveTopLeft(box->rect.topLeft() + QPoint(0, 2)); - rect.setHeight(box->rect.height() - 4); - rect.setWidth(box->fontMetrics.width(box->text) + 15); - break; - } - case SE_ProgressBarLabel: - case SE_ProgressBarGroove: - case SE_ProgressBarContents: { - rect = option->rect.adjusted(1, 1, -1, -1); - break; - } - case SE_PushButtonFocusRect: { - const QStyleOptionButton *btn = - qstyleoption_cast(option); - - rect = btn->fontMetrics.boundingRect(btn->text); - rect = QRect(0, 0, btn->fontMetrics.width(btn->text), - rect.height()); - - if (!btn->icon.isNull()) { - rect.adjust(0, 0, btn->iconSize.width(), btn->iconSize.height() - > rect.height() ? btn->iconSize.height() - rect.height() : 0); - rect.translate(-btn->iconSize.width(), 0); - rect.adjust(-1, -1, 1, 1); - } - rect = QRect(int(ceil((btn->rect.width() - rect.width()) / 2.0)), - int(ceil((btn->rect.height() - rect.height()) / 2.0)), - rect.width() - 1, rect.height()); - rect.adjust(-1, 0, 1, 0); - - break; - } - default: - rect = QWindowsStyle::subElementRect(element, option, widget); - } - return rect; -} - -int JavaStyle::pixelMetric(PixelMetric metric, - const QStyleOption* /* option */, - const QWidget* /*widget*/) const -{ - int value = 0; - - switch (metric) { - case PM_ButtonShiftHorizontal: - case PM_ButtonShiftVertical: - case PM_TabBarTabShiftHorizontal: - case PM_ButtonDefaultIndicator: - case PM_TabBarTabShiftVertical: - value = 0; - break; - case PM_TabBarBaseOverlap: - case PM_DefaultFrameWidth: - value = 2; - break; - case PM_TabBarTabVSpace: - value = 4; - break; - case PM_ScrollBarExtent: - value = 16; - break; - case PM_ScrollBarSliderMin: - value = 26; - break; - case PM_SplitterWidth: - value = 8; - break; - case PM_SliderThickness: - value = 16; - break; - case PM_SliderControlThickness: - value = 16; - break; - case PM_SliderTickmarkOffset: - value = 10; - break; - case PM_SliderSpaceAvailable: - break; - case PM_MenuPanelWidth: - value = 1; - break; - case PM_MenuVMargin: - value = 2; - break; - case PM_MenuBarPanelWidth: - value = 1; - break; - case PM_MenuBarItemSpacing: - value = 0; - break; - case PM_MenuBarHMargin: - value = 3; - break; - case PM_MenuBarVMargin: - value = 0; - break; - case PM_ComboBoxFrameWidth: - value = 1; - break; - case PM_MenuButtonIndicator: - value = 15; - break; - case PM_ToolBarItemMargin: - value = 3; - break; - case PM_ToolBarHandleExtent: - value = 13; - break; - case PM_SpinBoxFrameWidth: - value = 2; - break; - case PM_TitleBarHeight: { - value = 21; - break; - case PM_MDIFrameWidth: - value = 6; - break; - } - case PM_DockWidgetFrameWidth: { - value = 5; - break; - } - default: - value = QWindowsStyle::pixelMetric(metric); - } - return value; -} - - -int JavaStyle::styleHint(StyleHint hint, const QStyleOption *option, - const QWidget *widget, - QStyleHintReturn *returnData) const -{ - int ret; - - switch (hint) { - case SH_Table_GridLineColor: { - ret = static_cast(option->palette.color(QPalette::Mid).rgb()); - break; - } - case QStyle::SH_Menu_Scrollable: - ret = 1; - break; - default: - ret = QWindowsStyle::styleHint(hint, option, widget, returnData); - } - return ret; -} - -QPixmap JavaStyle::standardPixmap(StandardPixmap standardPixmap, - const QStyleOption *option, - const QWidget *widget) const -{ - QPixmap pixmap = QWindowsStyle::standardPixmap(standardPixmap, option, - widget); - - 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"); - QPixmap dirOpenPixmap(":/images/open24.png"); - QPixmap filePixmap(":/images/file.png"); - - switch (standardPixmap) { - case SP_DirLinkIcon: - case SP_DirClosedIcon: - case SP_DirIcon: - case SP_DirOpenIcon: { - pixmap = closePixmap; - break; - } - case SP_FileIcon: { - pixmap = filePixmap; - break; - } - case SP_FileDialogBack: { - pixmap = QPixmap(":/images/fileback.png"); - break; - } - case SP_FileDialogToParent: { - pixmap = QPixmap(":/images/fileparent.png"); - break; - } - case SP_FileDialogNewFolder: { - pixmap = QPixmap(":/images/open24.png"); - break; - } - case SP_FileDialogListView: { - pixmap = QPixmap(":/images/filelist.png"); - break; - } - case SP_FileDialogDetailedView: { - pixmap = QPixmap(":/images/filedetail.png"); - break; - } - case SP_MessageBoxInformation: { - pixmap = QPixmap(":/images/information.png"); - break; - } - case SP_MessageBoxWarning: { - pixmap = QPixmap(":/images/warning.png"); - } - case SP_MessageBoxCritical: { - pixmap = QPixmap(":/images/critical.png"); - break; - } - case SP_MessageBoxQuestion: { - pixmap = QPixmap(":/images/question.png"); - break; - } - case SP_TitleBarNormalButton: - pixmap = maximizePixmap; - break; - case SP_TitleBarCloseButton: - pixmap = closePixmap; - break; - default: - ; - } - - return pixmap; -} - -QSize JavaStyle::sizeFromContents(ContentsType type, - const QStyleOption *option, - const QSize &contentsSize, - const QWidget *widget) const -{ - switch (type) { - case CT_ComboBox: { - return QSize(contentsSize.width() + 27, contentsSize.height()); - } - case CT_Slider: { - const QStyleOptionSlider *slider = - qstyleoption_cast(option); - if (slider->tickPosition == QSlider::TicksBelow) { - return QSize(contentsSize.width(), contentsSize.height() + 15); - } else { - return contentsSize; - } - } - case CT_MenuBarItem: { - const QStyleOptionMenuItem *menuItem = - qstyleoption_cast(option); - QFontMetrics metrics(menuItem->font); - QRect boundingRect = metrics.boundingRect(menuItem->text); - int width = boundingRect.width() + 14; - int height = boundingRect.height() + 3; - if (height < 20) - height = 20; - - return QSize(width, height); - } - case CT_MenuItem: { - const QStyleOptionMenuItem *menuItem = - qstyleoption_cast(option); - QSize defaultSize = QWindowsStyle::sizeFromContents(type, option, - contentsSize, widget); - - if (menuItem->menuItemType == QStyleOptionMenuItem::Separator) - return defaultSize; - - int width = 30; - int height = 0; - - if (!menuItem->icon.isNull()) { - width += 20; - height += 20; - } - if (!menuItem->text.isEmpty()) { - QFontMetrics metrics(menuItem->font); - QString text = menuItem->text; - text.remove(QLatin1Char('\t')); - QRect textRect = metrics.boundingRect(text); - width += textRect.width(); - if (height < textRect.height()) - height += textRect.height(); - } - if (menuItem->checkType != QStyleOptionMenuItem::NotCheckable) { - width += 10; - if (height < 10) - height = 10; - } - return QSize(width, height); - } - default: - return QWindowsStyle::sizeFromContents(type, option, contentsSize, - widget); - } -} diff --git a/doc/src/snippets/layouts/layouts.cpp b/doc/src/snippets/layouts/layouts.cpp deleted file mode 100644 index 49c341c048..0000000000 --- a/doc/src/snippets/layouts/layouts.cpp +++ /dev/null @@ -1,165 +0,0 @@ -/**************************************************************************** -** -** 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 - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - { -//! [0] - QWidget *window = new QWidget; -//! [0] //! [1] - QPushButton *button1 = new QPushButton("One"); -//! [1] //! [2] - QPushButton *button2 = new QPushButton("Two"); - QPushButton *button3 = new QPushButton("Three"); - QPushButton *button4 = new QPushButton("Four"); - QPushButton *button5 = new QPushButton("Five"); -//! [2] - -//! [3] - QHBoxLayout *layout = new QHBoxLayout; -//! [3] //! [4] - layout->addWidget(button1); - layout->addWidget(button2); - layout->addWidget(button3); - layout->addWidget(button4); - layout->addWidget(button5); - - window->setLayout(layout); -//! [4] - window->setWindowTitle("QHBoxLayout"); -//! [5] - window->show(); -//! [5] - } - - { -//! [6] - QWidget *window = new QWidget; -//! [6] //! [7] - QPushButton *button1 = new QPushButton("One"); -//! [7] //! [8] - QPushButton *button2 = new QPushButton("Two"); - QPushButton *button3 = new QPushButton("Three"); - QPushButton *button4 = new QPushButton("Four"); - QPushButton *button5 = new QPushButton("Five"); -//! [8] - -//! [9] - QVBoxLayout *layout = new QVBoxLayout; -//! [9] //! [10] - layout->addWidget(button1); - layout->addWidget(button2); - layout->addWidget(button3); - layout->addWidget(button4); - layout->addWidget(button5); - - window->setLayout(layout); -//! [10] - window->setWindowTitle("QVBoxLayout"); -//! [11] - window->show(); -//! [11] - } - - { -//! [12] - QWidget *window = new QWidget; -//! [12] //! [13] - QPushButton *button1 = new QPushButton("One"); -//! [13] //! [14] - QPushButton *button2 = new QPushButton("Two"); - QPushButton *button3 = new QPushButton("Three"); - QPushButton *button4 = new QPushButton("Four"); - QPushButton *button5 = new QPushButton("Five"); -//! [14] - -//! [15] - QGridLayout *layout = new QGridLayout; -//! [15] //! [16] - layout->addWidget(button1, 0, 0); - layout->addWidget(button2, 0, 1); - layout->addWidget(button3, 1, 0, 1, 2); - layout->addWidget(button4, 2, 0); - layout->addWidget(button5, 2, 1); - - window->setLayout(layout); -//! [16] - window->setWindowTitle("QGridLayout"); -//! [17] - window->show(); -//! [17] - } - - { -//! [18] - QWidget *window = new QWidget; -//! [18] -//! [19] - QPushButton *button1 = new QPushButton("One"); - QLineEdit *lineEdit1 = new QLineEdit(); -//! [19] -//! [20] - QPushButton *button2 = new QPushButton("Two"); - QLineEdit *lineEdit2 = new QLineEdit(); - QPushButton *button3 = new QPushButton("Three"); - QLineEdit *lineEdit3 = new QLineEdit(); -//! [20] -//! [21] - QFormLayout *layout = new QFormLayout; -//! [21] -//! [22] - layout->addRow(button1, lineEdit1); - layout->addRow(button2, lineEdit2); - layout->addRow(button3, lineEdit3); - - window->setLayout(layout); -//! [22] - window->setWindowTitle("QFormLayout"); -//! [23] - window->show(); -//! [23] - } - - return app.exec(); -} diff --git a/doc/src/snippets/mainwindowsnippet.cpp b/doc/src/snippets/mainwindowsnippet.cpp deleted file mode 100644 index 76305e9ce2..0000000000 --- a/doc/src/snippets/mainwindowsnippet.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** -** -** 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 - -#include "mainwindow.h" - -MainWindow::MainWindow() -{ - createMenus(); - createToolBars(); - createDockWidgets(); - //setMenuWidget(new QPushButton("Hello")); -} - -void MainWindow::createMenus() -{ - //setMenuWidget(new QPushButton("Hello")); - QMenu *menu = new QMenu("File"); - menu->addAction("Save &As"); - - QMenuBar *bar = new QMenuBar; - bar->addMenu(menu); - - setMenuWidget(new QWidget()); -} - -void MainWindow::createToolBars() -{ - setToolButtonStyle(Qt::ToolButtonTextOnly); - QToolBar *t1 = new QToolBar; - t1->addAction(new QAction("t1", this)); - - QToolBar *t2 = new QToolBar; - t2->addAction(new QAction("t2", this)); - - addToolBar(Qt::LeftToolBarArea, t1); - addToolBar(Qt::LeftToolBarArea, t2); -} - -void MainWindow::createDockWidgets() -{ - QWidget *dockWidgetContents = new QWidget; - QVBoxLayout *layout = new QVBoxLayout; - layout->addWidget(new QPushButton("My Button.")); - dockWidgetContents->setLayout(layout); - -//! [0] - QDockWidget *dockWidget = new QDockWidget(tr("Dock Widget"), this); - dockWidget->setAllowedAreas(Qt::LeftDockWidgetArea | - Qt::RightDockWidgetArea); - dockWidget->setWidget(dockWidgetContents); - addDockWidget(Qt::LeftDockWidgetArea, dockWidget); -//! [0] -} diff --git a/doc/src/snippets/mdiareasnippets.cpp b/doc/src/snippets/mdiareasnippets.cpp deleted file mode 100644 index 711f25bd83..0000000000 --- a/doc/src/snippets/mdiareasnippets.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** -** -** 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 - -void mainWindowExample() -{ - QMdiArea *mdiArea = new QMdiArea; -//! [0] - QMainWindow *mainWindow = new QMainWindow; - mainWindow->setCentralWidget(mdiArea); -//! [0] - - mdiArea->addSubWindow(new QPushButton("Push Me Now!")); - - mainWindow->show(); -} - -void addingSubWindowsExample() -{ - QWidget *internalWidget1 = new QWidget; - QWidget *internalWidget2 = new QWidget; - -//! [1] - QMdiArea mdiArea; - QMdiSubWindow *subWindow1 = new QMdiSubWindow; - subWindow1->setWidget(internalWidget1); - subWindow1->setAttribute(Qt::WA_DeleteOnClose); - mdiArea.addSubWindow(subWindow1); - - QMdiSubWindow *subWindow2 = - mdiArea.addSubWindow(internalWidget2); - -//! [1] - subWindow1->show(); - subWindow2->show(); - - mdiArea.show(); -} - -int main(int argv, char **args) -{ - QApplication app(argv, args); - - mainWindowExample(); - //addingSubWindowsExample(); - - QAction *act = new QAction(qApp); - act->setShortcut(Qt::ALT + Qt::Key_S); - act->setShortcutContext( Qt::ApplicationShortcut ); - QObject::connect(act, SIGNAL(triggered()), qApp, SLOT(aboutQt())); - - QWidget widget5; - widget5.show(); - widget5.addAction(act); - - return app.exec(); -} - - diff --git a/doc/src/snippets/myscrollarea.cpp b/doc/src/snippets/myscrollarea.cpp deleted file mode 100644 index a6a575f922..0000000000 --- a/doc/src/snippets/myscrollarea.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/**************************************************************************** -** -** 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 - -class MyScrollArea : public QAbstractScrollArea -{ -public: - MyScrollArea(QWidget *w); - void setWidget(QWidget *w); - -protected: - void scrollContentsBy(int dx, int dy); - void resizeEvent(QResizeEvent *event); - -private: - void updateWidgetPosition(); - void updateArea(); - - QWidget *widget; -}; - -MyScrollArea::MyScrollArea(QWidget *widget) - : QAbstractScrollArea() -{ - setWidget(widget); -} - -void MyScrollArea::setWidget(QWidget *w) -{ - widget = w; - widget->setParent(viewport()); - if (!widget->testAttribute(Qt::WA_Resized)) - widget->resize(widget->sizeHint()); - - verticalScrollBar()->setValue(0); - verticalScrollBar()->setValue(0); - - updateArea(); -} - -void MyScrollArea::updateWidgetPosition() -{ -//! [0] - int hvalue = horizontalScrollBar()->value(); - int vvalue = verticalScrollBar()->value(); - QPoint topLeft = viewport()->rect().topLeft(); - - widget->move(topLeft.x() - hvalue, topLeft.y() - vvalue); -//! [0] -} - -void MyScrollArea::scrollContentsBy(int /*dx*/, int /*dy*/) -{ - updateWidgetPosition(); -} - -void MyScrollArea::updateArea() -{ -//! [1] - QSize areaSize = viewport()->size(); - QSize widgetSize = widget->size(); - - verticalScrollBar()->setPageStep(areaSize.height()); - horizontalScrollBar()->setPageStep(areaSize.width()); - verticalScrollBar()->setRange(0, widgetSize.height() - areaSize.height()); - horizontalScrollBar()->setRange(0, widgetSize.width() - areaSize.width()); - updateWidgetPosition(); -//! [1] -} - -void MyScrollArea::resizeEvent(QResizeEvent *event) -{ - updateArea(); -} - -int main(int argv, char **args) -{ - QApplication app(argv, args); - - QPixmap pixmap("mypixmap.png"); - QLabel label; - label.setPixmap(pixmap); - MyScrollArea area(&label); - area.resize(300, 300); - area.show(); - - area.setWidget(&label); - - return app.exec(); -} diff --git a/doc/src/snippets/qlistwidget-using/mainwindow.cpp b/doc/src/snippets/qlistwidget-using/mainwindow.cpp deleted file mode 100644 index 8e30f7979b..0000000000 --- a/doc/src/snippets/qlistwidget-using/mainwindow.cpp +++ /dev/null @@ -1,158 +0,0 @@ -/**************************************************************************** -** -** 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 - -#include "mainwindow.h" - -MainWindow::MainWindow() -{ - QMenu *fileMenu = new QMenu(tr("&File")); - - QAction *quitAction = fileMenu->addAction(tr("E&xit")); - quitAction->setShortcut(tr("Ctrl+Q")); - - QMenu *itemsMenu = new QMenu(tr("&Items")); - - insertAction = itemsMenu->addAction(tr("&Insert Item")); - removeAction = itemsMenu->addAction(tr("&Remove Item")); - QAction *ascendingAction = itemsMenu->addAction(tr("Sort in &Ascending Order")); - QAction *descendingAction = itemsMenu->addAction(tr("Sort in &Descending Order")); - - menuBar()->addMenu(fileMenu); - menuBar()->addMenu(itemsMenu); - -/* For convenient quoting: -//! [0] - QListWidget *listWidget = new QListWidget(this); -//! [0] -*/ - listWidget = new QListWidget(this); - listWidget->setSelectionMode(QAbstractItemView::SingleSelection); - - connect(quitAction, SIGNAL(triggered()), this, SLOT(close())); - connect(ascendingAction, SIGNAL(triggered()), this, SLOT(sortAscending())); - connect(descendingAction, SIGNAL(triggered()), this, SLOT(sortDescending())); - connect(insertAction, SIGNAL(triggered()), this, SLOT(insertItem())); - connect(removeAction, SIGNAL(triggered()), this, SLOT(removeItem())); - connect(listWidget, - SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)), - this, SLOT(updateMenus(QListWidgetItem *))); - - setupListItems(); - updateMenus(listWidget->currentItem()); - - setCentralWidget(listWidget); - setWindowTitle(tr("List Widget")); -} - -void MainWindow::setupListItems() -{ -//! [1] - new QListWidgetItem(tr("Oak"), listWidget); - new QListWidgetItem(tr("Fir"), listWidget); - new QListWidgetItem(tr("Pine"), listWidget); -//! [1] - new QListWidgetItem(tr("Birch"), listWidget); -//! [2] - new QListWidgetItem(tr("Hazel"), listWidget); -//! [2] - new QListWidgetItem(tr("Redwood"), listWidget); -//! [3] - new QListWidgetItem(tr("Sycamore"), listWidget); - new QListWidgetItem(tr("Chestnut"), listWidget); - new QListWidgetItem(tr("Mahogany"), listWidget); -//! [3] -} - -void MainWindow::sortAscending() -{ -//! [4] - listWidget->sortItems(Qt::AscendingOrder); -//! [4] -} - -void MainWindow::sortDescending() -{ -//! [5] - listWidget->sortItems(Qt::DescendingOrder); -//! [5] -} - -void MainWindow::insertItem() -{ - if (!listWidget->currentItem()) - return; - - QString itemText = QInputDialog::getText(this, tr("Insert Item"), - tr("Input text for the new item:")); - - if (itemText.isNull()) - return; - -//! [6] - QListWidgetItem *newItem = new QListWidgetItem; - newItem->setText(itemText); -//! [6] - int row = listWidget->row(listWidget->currentItem()); -//! [7] - listWidget->insertItem(row, newItem); -//! [7] - - QString toolTipText = tr("Tooltip:") + itemText; - QString statusTipText = tr("Status tip:") + itemText; - QString whatsThisText = tr("What's This?:") + itemText; -//! [8] - newItem->setToolTip(toolTipText); - newItem->setStatusTip(toolTipText); - newItem->setWhatsThis(whatsThisText); -//! [8] -} - -void MainWindow::removeItem() -{ - listWidget->takeItem(listWidget->row(listWidget->currentItem())); -} - -void MainWindow::updateMenus(QListWidgetItem *current) -{ - insertAction->setEnabled(current != 0); - removeAction->setEnabled(current != 0); -} diff --git a/doc/src/snippets/qmacnativewidget/main.mm b/doc/src/snippets/qmacnativewidget/main.mm deleted file mode 100644 index 2c5c49769a..0000000000 --- a/doc/src/snippets/qmacnativewidget/main.mm +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** 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 -#include -#import - -int main(int argc, char **argv) -{ - QApplication app(argc, argv); -//![0] - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - NSWindow *window = [[NSWindow alloc] initWithContentRect:NSMakeRect(200, app.desktop()->height() - 200, 239, 200) - styleMask:NSTitledWindowMask | NSClosableWindowMask - | NSMiniaturizableWindowMask | NSResizableWindowMask - backing:NSBackingStoreBuffered defer:NO]; - - QMacNativeWidget *nativeWidget = new QMacNativeWidget(); - nativeWidget->move(0, 0); - nativeWidget->setPalette(QPalette(Qt::red)); - nativeWidget->setAutoFillBackground(true); - QVBoxLayout *layout = new QVBoxLayout(); - QPushButton *pushButton = new QPushButton("An Embedded Qt Button!", nativeWidget); - pushButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // Don't use the layout rect calculated from QMacStyle. - layout->addWidget(pushButton); - nativeWidget->setLayout(layout); - - // Adjust Cocoa layouts - NSView *nativeWidgetView = reinterpret_cast(nativeWidget->winId()); - NSView *contentView = [window contentView]; - [contentView setAutoresizesSubviews:YES]; - [nativeWidgetView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; - [nativeWidgetView setAutoresizesSubviews:YES]; - NSView *pushButtonView = reinterpret_cast(pushButton->winId()); - [pushButtonView setAutoresizingMask:NSViewWidthSizable]; - - // Add the nativeWidget to the window. - [contentView addSubview:nativeWidgetView positioned:NSWindowAbove relativeTo:nil]; - nativeWidget->show(); - pushButton->show(); - - // Show the window. - [window makeKeyAndOrderFront:window]; - [pool release]; -//![0] - return app.exec(); // gives us the same behavior in both -} diff --git a/doc/src/snippets/qsplashscreen/main.cpp b/doc/src/snippets/qsplashscreen/main.cpp deleted file mode 100644 index 49bc084412..0000000000 --- a/doc/src/snippets/qsplashscreen/main.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the 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 -#include - -#include "mainwindow.h" - -//! [0] -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - QPixmap pixmap(":/splash.png"); - QSplashScreen splash(pixmap); - splash.show(); - app.processEvents(); -//! [0] - - sleep(5); -//! [1] - QMainWindow window; - window.show(); - splash.finish(&window); - return app.exec(); -} -//! [1] diff --git a/doc/src/snippets/qstackedlayout/main.cpp b/doc/src/snippets/qstackedlayout/main.cpp deleted file mode 100644 index 771c36c721..0000000000 --- a/doc/src/snippets/qstackedlayout/main.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -** -** 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 -#include - -class Widget : public QWidget -{ -public: - Widget(QWidget *parent = 0); -}; - -Widget::Widget(QWidget *parent) - : QWidget(parent) -{ -//! [0] - QWidget *firstPageWidget = new QWidget; - QWidget *secondPageWidget = new QWidget; - QWidget *thirdPageWidget = new QWidget; - - QStackedLayout *stackedLayout = new QStackedLayout; - stackedLayout->addWidget(firstPageWidget); - stackedLayout->addWidget(secondPageWidget); - stackedLayout->addWidget(thirdPageWidget); - -//! [0] //! [1] - QComboBox *pageComboBox = new QComboBox; - pageComboBox->addItem(tr("Page 1")); - pageComboBox->addItem(tr("Page 2")); - pageComboBox->addItem(tr("Page 3")); - connect(pageComboBox, SIGNAL(activated(int)), - stackedLayout, SLOT(setCurrentIndex(int))); -//! [1] - -//! [2] - QVBoxLayout *mainLayout = new QVBoxLayout; -//! [2] - mainLayout->addWidget(pageComboBox); -//! [3] - mainLayout->addLayout(stackedLayout); - setLayout(mainLayout); -//! [3] -} - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - Widget widget; - widget.show(); - return app.exec(); -} - diff --git a/doc/src/snippets/qstackedwidget/main.cpp b/doc/src/snippets/qstackedwidget/main.cpp deleted file mode 100644 index 9a29d773e6..0000000000 --- a/doc/src/snippets/qstackedwidget/main.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -** -** 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 -#include - -class Widget : public QWidget -{ -public: - Widget(QWidget *parent = 0); -}; - -Widget::Widget(QWidget *parent) - : QWidget(parent) -{ -//! [0] - QWidget *firstPageWidget = new QWidget; - QWidget *secondPageWidget = new QWidget; - QWidget *thirdPageWidget = new QWidget; - - QStackedWidget *stackedWidget = new QStackedWidget; - stackedWidget->addWidget(firstPageWidget); - stackedWidget->addWidget(secondPageWidget); - stackedWidget->addWidget(thirdPageWidget); - -//! [0] //! [1] - QComboBox *pageComboBox = new QComboBox; - pageComboBox->addItem(tr("Page 1")); - pageComboBox->addItem(tr("Page 2")); - pageComboBox->addItem(tr("Page 3")); - connect(pageComboBox, SIGNAL(activated(int)), - stackedWidget, SLOT(setCurrentIndex(int))); - -//! [1] //! [2] - QVBoxLayout *layout = new QVBoxLayout; -//! [2] - layout->addWidget(pageComboBox); -//! [3] - layout->addWidget(stackedWidget); - setLayout(layout); -//! [3] -} - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - Widget widget; - widget.show(); - return app.exec(); -} diff --git a/doc/src/snippets/qstyleoption/main.cpp b/doc/src/snippets/qstyleoption/main.cpp deleted file mode 100644 index 78f663012c..0000000000 --- a/doc/src/snippets/qstyleoption/main.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/**************************************************************************** -** -** 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 -#include - -class MyPushButton : public QPushButton -{ -public: - MyPushButton(QWidget *parent = 0); - - void paintEvent(QPaintEvent *); -}; - -MyPushButton::MyPushButton(QWidget *parent) - : QPushButton(parent) -{ -} - -//! [0] -void MyPushButton::paintEvent(QPaintEvent *) -{ - QStyleOptionButton option; - option.initFrom(this); - option.state = isDown() ? QStyle::State_Sunken : QStyle::State_Raised; - if (isDefault()) - option.features |= QStyleOptionButton::DefaultButton; - option.text = text(); - option.icon = icon(); - - QPainter painter(this); - style()->drawControl(QStyle::CE_PushButton, &option, &painter, this); -} -//! [0] - - - -class MyStyle : public QStyle -{ -public: - MyStyle(); - - void drawPrimitive(PrimitiveElement element, const QStyleOption *option, - QPainter *painter, const QWidget *widget); -}; - -MyStyle::MyStyle() -{ -//! [1] - QStyleOptionFrame *option; - - if (const QStyleOptionFrame *frameOption = - qstyleoption_cast(option)) { - QStyleOptionFrameV2 frameOptionV2(*frameOption); - - // draw the frame using frameOptionV2 - } -//! [1] - -//! [2] - if (const QStyleOptionProgressBar *progressBarOption = - qstyleoption_cast(option)) { - QStyleOptionProgressBarV2 progressBarV2(*progressBarOption); - - // draw the progress bar using progressBarV2 - } -//! [2] - -//! [3] - if (const QStyleOptionTab *tabOption = - qstyleoption_cast(option)) { - QStyleOptionTabV2 tabV2(*tabOption); - - // draw the tab using tabV2 - } -//! [3] -} - -//! [4] -void MyStyle::drawPrimitive(PrimitiveElement element, - const QStyleOption *option, - QPainter *painter, - const QWidget *widget) -{ - if (element == PE_FrameFocusRect) { - const QStyleOptionFocusRect *focusRectOption = - qstyleoption_cast(option); - if (focusRectOption) { - // ... - } - } - // ... -} -//! [4] - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - MyPushButton button; - button.show(); - return app.exec(); -} diff --git a/doc/src/snippets/qstyleplugin/main.cpp b/doc/src/snippets/qstyleplugin/main.cpp deleted file mode 100644 index 10a122016f..0000000000 --- a/doc/src/snippets/qstyleplugin/main.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** -** -** 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 -#include - -class MyStylePlugin : public QStylePlugin -{ -public: - MyStylePlugin(QObject *parent = 0); - - QStyle *create(const QString &key); - QStringList keys() const; -}; - -class RocketStyle : public QCommonStyle -{ -public: - RocketStyle() {}; - -}; - -class StarBusterStyle : public QCommonStyle -{ -public: - StarBusterStyle() {}; -}; - -MyStylePlugin::MyStylePlugin(QObject *parent) - : QStylePlugin(parent) -{ -} - -//! [0] -QStringList MyStylePlugin::keys() const -{ - return QStringList() << "Rocket" << "StarBuster"; -} -//! [0] - -//! [1] -QStyle *MyStylePlugin::create(const QString &key) -{ - QString lcKey = key; - if (lcKey == "rocket") { - return new RocketStyle; - } else if (lcKey == "starbuster") { - return new StarBusterStyle; - } - return 0; -//! [1] //! [2] -} -//! [2] - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - MyStylePlugin plugin; - return app.exec(); -} diff --git a/doc/src/snippets/qtablewidget-resizing/mainwindow.cpp b/doc/src/snippets/qtablewidget-resizing/mainwindow.cpp deleted file mode 100644 index f3ab01784e..0000000000 --- a/doc/src/snippets/qtablewidget-resizing/mainwindow.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/**************************************************************************** -** -** 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 - -#include "mainwindow.h" - -MainWindow::MainWindow() -{ - QMenu *fileMenu = new QMenu(tr("&File")); - - QAction *quitAction = fileMenu->addAction(tr("E&xit")); - quitAction->setShortcut(tr("Ctrl+Q")); - - QMenu *tableMenu = new QMenu(tr("&Table")); - - QAction *tableWidthAction = tableMenu->addAction(tr("Change Table &Width")); - QAction *tableHeightAction = tableMenu->addAction(tr("Change Table &Height")); - - menuBar()->addMenu(fileMenu); - menuBar()->addMenu(tableMenu); - -//! [0] - tableWidget = new QTableWidget(this); -//! [0] - tableWidget->setSelectionMode(QAbstractItemView::ExtendedSelection); - - connect(quitAction, SIGNAL(triggered()), this, SLOT(close())); - connect(tableWidthAction, SIGNAL(triggered()), this, SLOT(changeWidth())); - connect(tableHeightAction, SIGNAL(triggered()), this, SLOT(changeHeight())); - - setupTableItems(); - - setCentralWidget(tableWidget); - setWindowTitle(tr("Table Widget Resizing")); -} - -void MainWindow::setupTableItems() -{ -//! [1] - tableWidget->setRowCount(10); - tableWidget->setColumnCount(5); -//! [1] - - for (int row = 0; row < tableWidget->rowCount(); ++row) { - for (int column = 0; column < tableWidget->columnCount(); ++column) { -//! [2] - QTableWidgetItem *newItem = new QTableWidgetItem(tr("%1").arg( - (row+1)*(column+1))); - tableWidget->setItem(row, column, newItem); -//! [2] - } - } -} - -void MainWindow::changeWidth() -{ - bool ok; - - int newWidth = QInputDialog::getInteger(this, tr("Change table width"), - tr("Input the number of columns required (1-20):"), - tableWidget->columnCount(), 1, 20, 1, &ok); - - if (ok) - tableWidget->setColumnCount(newWidth); -} - -void MainWindow::changeHeight() -{ - bool ok; - - int newHeight = QInputDialog::getInteger(this, tr("Change table height"), - tr("Input the number of rows required (1-20):"), - tableWidget->rowCount(), 1, 20, 1, &ok); - - if (ok) - tableWidget->setRowCount(newHeight); -} diff --git a/doc/src/snippets/qtablewidget-using/mainwindow.cpp b/doc/src/snippets/qtablewidget-using/mainwindow.cpp deleted file mode 100644 index b03a5e4999..0000000000 --- a/doc/src/snippets/qtablewidget-using/mainwindow.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/**************************************************************************** -** -** 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 -#include "math.h" - -#include "mainwindow.h" - -MainWindow::MainWindow() -{ - QMenu *fileMenu = new QMenu(tr("&File")); - - QAction *quitAction = fileMenu->addAction(tr("E&xit")); - quitAction->setShortcut(tr("Ctrl+Q")); - - QMenu *itemsMenu = new QMenu(tr("&Items")); - - QAction *sumItemsAction = itemsMenu->addAction(tr("&Sum Items")); - QAction *averageItemsAction = itemsMenu->addAction(tr("&Average Items")); - - menuBar()->addMenu(fileMenu); - menuBar()->addMenu(itemsMenu); - -//! [0] - tableWidget = new QTableWidget(12, 3, this); -//! [0] - tableWidget->setSelectionMode(QAbstractItemView::ExtendedSelection); - -//! [1] - QTableWidgetItem *valuesHeaderItem = new QTableWidgetItem(tr("Values")); - tableWidget->setHorizontalHeaderItem(0, valuesHeaderItem); -//! [1] - valuesHeaderItem->setTextAlignment(Qt::AlignVCenter); - QTableWidgetItem *squaresHeaderItem = new QTableWidgetItem(tr("Squares")); - squaresHeaderItem->setIcon(QIcon(QPixmap(":/Images/squared.png"))); - squaresHeaderItem->setTextAlignment(Qt::AlignVCenter); -//! [2] - QTableWidgetItem *cubesHeaderItem = new QTableWidgetItem(tr("Cubes")); - cubesHeaderItem->setIcon(QIcon(QPixmap(":/Images/cubed.png"))); - cubesHeaderItem->setTextAlignment(Qt::AlignVCenter); -//! [2] - tableWidget->setHorizontalHeaderItem(1, squaresHeaderItem); - tableWidget->setHorizontalHeaderItem(2, cubesHeaderItem); - - connect(quitAction, SIGNAL(triggered()), this, SLOT(close())); - connect(sumItemsAction, SIGNAL(triggered()), this, SLOT(sumItems())); - connect(averageItemsAction, SIGNAL(triggered()), this, SLOT(averageItems())); - - setupTableItems(); - - setCentralWidget(tableWidget); - setWindowTitle(tr("Table Widget")); -} - -void MainWindow::setupTableItems() -{ - for (int row = 0; row < tableWidget->rowCount()-1; ++row) { - for (int column = 0; column < tableWidget->columnCount(); ++column) { -//! [3] - QTableWidgetItem *newItem = new QTableWidgetItem(tr("%1").arg( - pow(row, column+1))); - tableWidget->setItem(row, column, newItem); -//! [3] - } - } - for (int column = 0; column < tableWidget->columnCount(); ++column) { - QTableWidgetItem *newItem = new QTableWidgetItem; - newItem->setFlags(Qt::ItemIsEnabled); - tableWidget->setItem(tableWidget->rowCount()-1, column, newItem); - } -} - -void MainWindow::averageItems() -{ - QList selected = tableWidget->selectedItems(); - QTableWidgetItem *item; - int number = 0; - double total = 0; - - foreach (item, selected) { - bool ok; - double value = item->text().toDouble(&ok); - - if (ok && !item->text().isEmpty()) { - total += value; - number++; - } - } - if (number > 0) - tableWidget->currentItem()->setText(QString::number(total/number)); -} - -void MainWindow::sumItems() -{ -//! [4] - QList selected = tableWidget->selectedItems(); - QTableWidgetItem *item; - int number = 0; - double total = 0; - - foreach (item, selected) { - bool ok; - double value = item->text().toDouble(&ok); - - if (ok && !item->text().isEmpty()) { - total += value; - number++; - } - } -//! [4] - if (number > 0) - tableWidget->currentItem()->setText(QString::number(total)); -} diff --git a/doc/src/snippets/qtreewidget-using/mainwindow.cpp b/doc/src/snippets/qtreewidget-using/mainwindow.cpp deleted file mode 100644 index 2a62c3e5f8..0000000000 --- a/doc/src/snippets/qtreewidget-using/mainwindow.cpp +++ /dev/null @@ -1,230 +0,0 @@ -/**************************************************************************** -** -** 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 - -#include "mainwindow.h" - -MainWindow::MainWindow() -{ - QMenu *fileMenu = new QMenu(tr("&File")); - - QAction *quitAction = fileMenu->addAction(tr("E&xit")); - quitAction->setShortcut(tr("Ctrl+Q")); - - QMenu *itemsMenu = new QMenu(tr("&Items")); - - insertAction = itemsMenu->addAction(tr("&Insert Item")); - removeAction = itemsMenu->addAction(tr("&Remove Item")); - removeAction->setEnabled(false); - itemsMenu->addSeparator(); - ascendingAction = itemsMenu->addAction(tr("Sort in &Ascending Order")); - descendingAction = itemsMenu->addAction(tr("Sort in &Descending Order")); - autoSortAction = itemsMenu->addAction(tr("&Automatically Sort Items")); - autoSortAction->setCheckable(true); - itemsMenu->addSeparator(); - QAction *findItemsAction = itemsMenu->addAction(tr("&Find Items")); - findItemsAction->setShortcut(tr("Ctrl+F")); - - menuBar()->addMenu(fileMenu); - menuBar()->addMenu(itemsMenu); - -/* For convenient quoting: -//! [0] - QTreeWidget *treeWidget = new QTreeWidget(this); -//! [0] -*/ - treeWidget = new QTreeWidget(this); -//! [1] - treeWidget->setColumnCount(2); -//! [1] //! [2] - QStringList headers; - headers << tr("Subject") << tr("Default"); - treeWidget->setHeaderLabels(headers); -//! [2] - - connect(quitAction, SIGNAL(triggered()), this, SLOT(close())); - connect(ascendingAction, SIGNAL(triggered()), this, SLOT(sortAscending())); - connect(autoSortAction, SIGNAL(triggered()), this, SLOT(updateSortItems())); - connect(descendingAction, SIGNAL(triggered()), this, SLOT(sortDescending())); - connect(findItemsAction, SIGNAL(triggered()), this, SLOT(findItems())); - connect(insertAction, SIGNAL(triggered()), this, SLOT(insertItem())); - connect(removeAction, SIGNAL(triggered()), this, SLOT(removeItem())); - connect(treeWidget, - SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), - this, SLOT(updateMenus(QTreeWidgetItem *))); - - setupTreeItems(); - updateMenus(treeWidget->currentItem()); - - setCentralWidget(treeWidget); - setWindowTitle(tr("Tree Widget")); -} - -void MainWindow::setupTreeItems() -{ -//! [3] - QTreeWidgetItem *cities = new QTreeWidgetItem(treeWidget); - cities->setText(0, tr("Cities")); - QTreeWidgetItem *osloItem = new QTreeWidgetItem(cities); - osloItem->setText(0, tr("Oslo")); - osloItem->setText(1, tr("Yes")); -//! [3] - - (new QTreeWidgetItem(cities))->setText(0, tr("Stockholm")); - (new QTreeWidgetItem(cities))->setText(0, tr("Helsinki")); - (new QTreeWidgetItem(cities))->setText(0, tr("Copenhagen")); - -//! [4] //! [5] - QTreeWidgetItem *planets = new QTreeWidgetItem(treeWidget, cities); -//! [4] - planets->setText(0, tr("Planets")); -//! [5] - (new QTreeWidgetItem(planets))->setText(0, tr("Mercury")); - (new QTreeWidgetItem(planets))->setText(0, tr("Venus")); - - QTreeWidgetItem *earthItem = new QTreeWidgetItem(planets); - earthItem->setText(0, tr("Earth")); - earthItem->setText(1, tr("Yes")); - - (new QTreeWidgetItem(planets))->setText(0, tr("Mars")); - (new QTreeWidgetItem(planets))->setText(0, tr("Jupiter")); - (new QTreeWidgetItem(planets))->setText(0, tr("Saturn")); - (new QTreeWidgetItem(planets))->setText(0, tr("Uranus")); - (new QTreeWidgetItem(planets))->setText(0, tr("Neptune")); - (new QTreeWidgetItem(planets))->setText(0, tr("Pluto")); -} - -void MainWindow::findItems() -{ - QString itemText = QInputDialog::getText(this, tr("Find Items"), - tr("Text to find (including wildcards):")); - - if (itemText.isEmpty()) - return; - -//! [6] - QTreeWidgetItem *item; -//! [6] - foreach (item, treeWidget->selectedItems()) - treeWidget->setItemSelected(item, false); - -//! [7] - QList found = treeWidget->findItems( - itemText, Qt::MatchWildcard); - - foreach (item, found) { - treeWidget->setItemSelected(item, true); - // Show the item->text(0) for each item. - } -//! [7] -} - -void MainWindow::insertItem() -{ - QTreeWidgetItem *currentItem = treeWidget->currentItem(); - - if (!currentItem) - return; - - QString itemText = QInputDialog::getText(this, tr("Insert Item"), - tr("Input text for the new item:")); - - if (itemText.isEmpty()) - return; - -//! [8] - QTreeWidgetItem *parent = currentItem->parent(); - QTreeWidgetItem *newItem; - if (parent) - newItem = new QTreeWidgetItem(parent, treeWidget->currentItem()); - else -//! [8] //! [9] - newItem = new QTreeWidgetItem(treeWidget, treeWidget->currentItem()); -//! [9] - - newItem->setText(0, itemText); -} - -void MainWindow::removeItem() -{ - QTreeWidgetItem *currentItem = treeWidget->currentItem(); - - if (!currentItem) - return; - -//! [10] - QTreeWidgetItem *parent = currentItem->parent(); - int index; - - if (parent) { - index = parent->indexOfChild(treeWidget->currentItem()); - delete parent->takeChild(index); - } else { - index = treeWidget->indexOfTopLevelItem(treeWidget->currentItem()); - delete treeWidget->takeTopLevelItem(index); -//! [10] //! [11] - } -//! [11] -} - -void MainWindow::sortAscending() -{ - treeWidget->sortItems(0, Qt::AscendingOrder); -} - -void MainWindow::sortDescending() -{ - treeWidget->sortItems(0, Qt::DescendingOrder); -} - -void MainWindow::updateMenus(QTreeWidgetItem *current) -{ - insertAction->setEnabled(current != 0); - removeAction->setEnabled(current != 0); -} - -void MainWindow::updateSortItems() -{ - ascendingAction->setEnabled(!autoSortAction->isChecked()); - descendingAction->setEnabled(!autoSortAction->isChecked()); - - treeWidget->setSortingEnabled(autoSortAction->isChecked()); -} diff --git a/doc/src/snippets/qtreewidgetitemiterator-using/mainwindow.cpp b/doc/src/snippets/qtreewidgetitemiterator-using/mainwindow.cpp deleted file mode 100644 index a0648b18c5..0000000000 --- a/doc/src/snippets/qtreewidgetitemiterator-using/mainwindow.cpp +++ /dev/null @@ -1,197 +0,0 @@ -/**************************************************************************** -** -** 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 - -#include "mainwindow.h" - -MainWindow::MainWindow() -{ - QMenu *fileMenu = new QMenu(tr("&File")); - - QAction *quitAction = fileMenu->addAction(tr("E&xit")); - quitAction->setShortcut(tr("Ctrl+Q")); - - QMenu *itemsMenu = new QMenu(tr("&Items")); - - insertAction = itemsMenu->addAction(tr("&Insert Item")); - removeAction = itemsMenu->addAction(tr("&Remove Item")); - removeAction->setEnabled(false); - itemsMenu->addSeparator(); - ascendingAction = itemsMenu->addAction(tr("Sort in &Ascending Order")); - descendingAction = itemsMenu->addAction(tr("Sort in &Descending Order")); - autoSortAction = itemsMenu->addAction(tr("&Automatically Sort Items")); - autoSortAction->setCheckable(true); - itemsMenu->addSeparator(); - QAction *findItemsAction = itemsMenu->addAction(tr("&Find Items")); - findItemsAction->setShortcut(tr("Ctrl+F")); - - menuBar()->addMenu(fileMenu); - menuBar()->addMenu(itemsMenu); - -/* For convenient quoting: - QTreeWidget *treeWidget = new QTreeWidget(this); -*/ - treeWidget = new QTreeWidget(this); - treeWidget->setColumnCount(2); - QStringList headers; - headers << tr("Subject") << tr("Default"); - treeWidget->setHeaderLabels(headers); - - connect(quitAction, SIGNAL(triggered()), this, SLOT(close())); - connect(ascendingAction, SIGNAL(triggered()), this, SLOT(sortAscending())); - connect(autoSortAction, SIGNAL(triggered()), this, SLOT(updateSortItems())); - connect(descendingAction, SIGNAL(triggered()), this, SLOT(sortDescending())); - connect(findItemsAction, SIGNAL(triggered()), this, SLOT(findItems())); - connect(insertAction, SIGNAL(triggered()), this, SLOT(insertItem())); - connect(removeAction, SIGNAL(triggered()), this, SLOT(removeItem())); - connect(treeWidget, - SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), - this, SLOT(updateMenus(QTreeWidgetItem *))); - - setupTreeItems(); - updateMenus(treeWidget->currentItem()); - - setCentralWidget(treeWidget); - setWindowTitle(tr("Tree Widget")); -} - -void MainWindow::setupTreeItems() -{ - QTreeWidgetItem *planets = new QTreeWidgetItem(treeWidget); - planets->setText(0, tr("Planets")); - (new QTreeWidgetItem(planets))->setText(0, tr("Mercury")); - (new QTreeWidgetItem(planets))->setText(0, tr("Venus")); - - QTreeWidgetItem *earthItem = new QTreeWidgetItem(planets); - earthItem->setText(0, tr("Earth")); - earthItem->setText(1, tr("Yes")); - - (new QTreeWidgetItem(planets))->setText(0, tr("Mars")); - (new QTreeWidgetItem(planets))->setText(0, tr("Jupiter")); - (new QTreeWidgetItem(planets))->setText(0, tr("Saturn")); - (new QTreeWidgetItem(planets))->setText(0, tr("Uranus")); - (new QTreeWidgetItem(planets))->setText(0, tr("Neptune")); - (new QTreeWidgetItem(planets))->setText(0, tr("Pluto")); -} - -void MainWindow::findItems() -{ - QString itemText = QInputDialog::getText(this, tr("Find Items"), - tr("Text to find:")); - - if (itemText.isEmpty()) - return; - -//! [0] - QTreeWidgetItemIterator it(treeWidget); - while (*it) { - if ((*it)->text(0) == itemText) - (*it)->setSelected(true); - ++it; - } -//! [0] -} - -void MainWindow::insertItem() -{ - QTreeWidgetItem *currentItem = treeWidget->currentItem(); - - if (!currentItem) - return; - - QString itemText = QInputDialog::getText(this, tr("Insert Item"), - tr("Input text for the new item:")); - - if (itemText.isEmpty()) - return; - - QTreeWidgetItem *parent = currentItem->parent(); - QTreeWidgetItem *newItem; - if (parent) - newItem = new QTreeWidgetItem(parent, treeWidget->currentItem()); - else - newItem = new QTreeWidgetItem(treeWidget, treeWidget->currentItem()); - - newItem->setText(0, itemText); -} - -void MainWindow::removeItem() -{ - QTreeWidgetItem *currentItem = treeWidget->currentItem(); - - if (!currentItem) - return; - - QTreeWidgetItem *parent = currentItem->parent(); - int index; - - if (parent) { - index = parent->indexOfChild(treeWidget->currentItem()); - delete parent->takeChild(index); - } else { - index = treeWidget->indexOfTopLevelItem(treeWidget->currentItem()); - delete treeWidget->takeTopLevelItem(index); - } -} - -void MainWindow::sortAscending() -{ - treeWidget->sortItems(0, Qt::AscendingOrder); -} - -void MainWindow::sortDescending() -{ - treeWidget->sortItems(0, Qt::DescendingOrder); -} - -void MainWindow::updateMenus(QTreeWidgetItem *current) -{ - insertAction->setEnabled(current != 0); - removeAction->setEnabled(current != 0); -} - -void MainWindow::updateSortItems() -{ - ascendingAction->setEnabled(!autoSortAction->isChecked()); - descendingAction->setEnabled(!autoSortAction->isChecked()); - - treeWidget->setSortingEnabled(autoSortAction->isChecked()); -} diff --git a/doc/src/snippets/shareddirmodel/main.cpp b/doc/src/snippets/shareddirmodel/main.cpp deleted file mode 100644 index 78d439b752..0000000000 --- a/doc/src/snippets/shareddirmodel/main.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ - -/* - main.cpp - - A simple example of how to view a model in several views, and share a - selection model. -*/ - -#include - -//! [0] //! [1] -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - QSplitter *splitter = new QSplitter; - -//! [2] //! [3] - QFileSystemModel *model = new QFileSystemModel; - model->setRootPath(QDir::currentPath()); -//! [0] //! [2] //! [4] //! [5] - QTreeView *tree = new QTreeView(splitter); -//! [3] //! [6] - tree->setModel(model); -//! [4] //! [6] //! [7] - tree->setRootIndex(model->index(QDir::currentPath())); -//! [7] - - QListView *list = new QListView(splitter); - list->setModel(model); - list->setRootIndex(model->index(QDir::currentPath())); - -//! [5] - QItemSelectionModel *selection = new QItemSelectionModel(model); - tree->setSelectionModel(selection); - list->setSelectionModel(selection); - -//! [8] - splitter->setWindowTitle("Two views onto the same file system model"); - splitter->show(); - return app.exec(); -} -//! [1] //! [8] diff --git a/doc/src/snippets/splitter/splitter.cpp b/doc/src/snippets/splitter/splitter.cpp deleted file mode 100644 index 3908f1b0e3..0000000000 --- a/doc/src/snippets/splitter/splitter.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** 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 - -void processSize(int) -{ -} - -int main() -{ - QWidget *parent = 0; - -//! [0] - QSplitter *splitter = new QSplitter(parent); - QListView *listview = new QListView; - QTreeView *treeview = new QTreeView; - QTextEdit *textedit = new QTextEdit; - splitter->addWidget(listview); - splitter->addWidget(treeview); - splitter->addWidget(textedit); -//! [0] - - { - // SAVE STATE -//! [1] - QSettings settings; - settings.setValue("splitterSizes", splitter->saveState()); -//! [1] - } - - { - // RESTORE STATE -//! [2] - QSettings settings; - splitter->restoreState(settings.value("splitterSizes").toByteArray()); -//! [2] - } - -//! [3] - QListIterator it(splitter->sizes()); - while (it.hasNext()) - processSize(it.next()); -//! [3] - - return 0; -} diff --git a/doc/src/snippets/splitterhandle/splitter.cpp b/doc/src/snippets/splitterhandle/splitter.cpp deleted file mode 100644 index b8b729bb91..0000000000 --- a/doc/src/snippets/splitterhandle/splitter.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** 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 - -#include "splitter.h" - -SplitterHandle::SplitterHandle(Qt::Orientation orientation, QSplitter *parent) - : QSplitterHandle(orientation, parent) -{ - gradient.setColorAt(0.0, Qt::darkGreen); - gradient.setColorAt(0.25, Qt::white); - gradient.setColorAt(1.0, Qt::darkGreen); -} - -//! [0] -void SplitterHandle::paintEvent(QPaintEvent *event) -{ - QPainter painter(this); - if (orientation() == Qt::Horizontal) { - gradient.setStart(rect().left(), rect().height()/2); - gradient.setFinalStop(rect().right(), rect().height()/2); - } else { - gradient.setStart(rect().width()/2, rect().top()); - gradient.setFinalStop(rect().width()/2, rect().bottom()); - } - painter.fillRect(event->rect(), QBrush(gradient)); -} -//! [0] - -Splitter::Splitter(Qt::Orientation orientation, QWidget *parent) - : QSplitter(orientation, parent) -{ -} - -//! [1] -QSplitterHandle *Splitter::createHandle() -{ - return new SplitterHandle(orientation(), this); -} -//! [1] diff --git a/doc/src/snippets/splitterhandle/splitter.h b/doc/src/snippets/splitterhandle/splitter.h deleted file mode 100644 index ba310b9e8d..0000000000 --- a/doc/src/snippets/splitterhandle/splitter.h +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** 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 SPLITTER_H -#define SPLITTER_H - -#include -#include -#include - -class QPaintEvent; - -//! [0] -class Splitter : public QSplitter -{ -public: - Splitter(Qt::Orientation orientation, QWidget *parent = 0); - -protected: - QSplitterHandle *createHandle(); -}; -//! [0] - -class SplitterHandle : public QSplitterHandle -{ -public: - SplitterHandle(Qt::Orientation orientation, QSplitter *parent); - -protected: - void paintEvent(QPaintEvent *event); - -private: - QLinearGradient gradient; -}; - -#endif diff --git a/doc/src/snippets/styles/styles.cpp b/doc/src/snippets/styles/styles.cpp deleted file mode 100644 index 1109669bcb..0000000000 --- a/doc/src/snippets/styles/styles.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -** -** 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 -#include -#include - -class MyWidget : public QWidget -{ -protected: - void paintEvent(QPaintEvent *event); - void paintEvent2(QPaintEvent *event); - -}; - -//! [0] //! [1] -void MyWidget::paintEvent(QPaintEvent * /* event */) -//! [0] -{ -//! [2] - QPainter painter(this); -//! [2] - - QStyleOptionFocusRect option; - option.initFrom(this); - option.backgroundColor = palette().color(QPalette::Background); - -//! [3] - style()->drawPrimitive(QStyle::PE_FrameFocusRect, &option, &painter, this); -//! [3] -} -//! [1] - -void MyWidget::paintEvent2(QPaintEvent * /* event */) -//! [4] -{ -//! [4] //! [5] //! [6] - QStylePainter painter(this); -//! [5] - - QStyleOptionFocusRect option; - option.initFrom(this); - option.backgroundColor = palette().color(QPalette::Background); - -//! [7] - painter.drawPrimitive(QStyle::PE_FrameFocusRect, option); -//! [7] -} -//! [6] - -int main() -{ - return 0; -} diff --git a/doc/src/snippets/stylesheet/common-mistakes.cpp b/doc/src/snippets/stylesheet/common-mistakes.cpp deleted file mode 100644 index d4552fcf1d..0000000000 --- a/doc/src/snippets/stylesheet/common-mistakes.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** 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] - QPushButton { - color: grey; - border-image: url(/home/kamlie/code/button.png) 3 10 3 10; - border-top: 3px transparent; - border-bottom: 3px transparent; - border-right: 10px transparent; - border-left: 10px transparent; - } -//! [1] - - diff --git a/doc/src/snippets/textdocument-imagedrop/textedit.cpp b/doc/src/snippets/textdocument-imagedrop/textedit.cpp deleted file mode 100644 index fbb6f73ddc..0000000000 --- a/doc/src/snippets/textdocument-imagedrop/textedit.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** 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 "textedit.h" -#include - -TextEdit::TextEdit(QWidget *parent) - : QTextEdit(parent) -{ -} - -//! [0] -bool TextEdit::canInsertFromMimeData( const QMimeData *source ) const -{ - if (source->hasImage()) - return true; - else - return QTextEdit::canInsertFromMimeData(source); -} -//! [0] - -//! [1] -void TextEdit::insertFromMimeData( const QMimeData *source ) -{ - if (source->hasImage()) - { - QImage image = qvariant_cast(source->imageData()); - QTextCursor cursor = this->textCursor(); - QTextDocument *document = this->document(); - document->addResource(QTextDocument::ImageResource, QUrl("image"), image); - cursor.insertImage("image"); - } -} -//! [1] diff --git a/doc/src/snippets/timeline/main.cpp b/doc/src/snippets/timeline/main.cpp deleted file mode 100644 index f4be7f3c5b..0000000000 --- a/doc/src/snippets/timeline/main.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** 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 -#include - -int main(int argv, char *args[]) -{ - QApplication app(argv, args); - -//! [0] - QGraphicsItem *ball = new QGraphicsEllipseItem(0, 0, 20, 20); - - QTimeLine *timer = new QTimeLine(5000); - timer->setFrameRange(0, 100); - - QGraphicsItemAnimation *animation = new QGraphicsItemAnimation; - animation->setItem(ball); - animation->setTimeLine(timer); - - for (int i = 0; i < 200; ++i) - animation->setPosAt(i / 200.0, QPointF(i, i)); - - QGraphicsScene *scene = new QGraphicsScene(); - scene->setSceneRect(0, 0, 250, 250); - scene->addItem(ball); - - QGraphicsView *view = new QGraphicsView(scene); - view->show(); - - timer->start(); -//! [0] - - return app.exec(); -} diff --git a/doc/src/snippets/whatsthis/whatsthis.cpp b/doc/src/snippets/whatsthis/whatsthis.cpp deleted file mode 100644 index 3d3f65d317..0000000000 --- a/doc/src/snippets/whatsthis/whatsthis.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** 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 - -class MainWindow : public QMainWindow -{ -public: - MainWindow(); - - QAction *newAct; -}; - -MainWindow() -{ -//! [0] - newAct = new QAction(tr("&New"), this); - newAct->setShortcut(tr("Ctrl+N")); - newAct->setStatusTip(tr("Create a new file")); - newAct->setWhatsThis(tr("Click this option to create a new file.")); -//! [0] -} - -int main() -{ - return 0; -} diff --git a/doc/src/snippets/widget-mask/main.cpp b/doc/src/snippets/widget-mask/main.cpp deleted file mode 100644 index 18653deb4c..0000000000 --- a/doc/src/snippets/widget-mask/main.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** 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 - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); -//! [0] - QLabel topLevelLabel; - QPixmap pixmap(":/images/tux.png"); - topLevelLabel.setPixmap(pixmap); - topLevelLabel.setMask(pixmap.mask()); -//! [0] - topLevelLabel.show(); - return app.exec(); -} diff --git a/doc/src/snippets/widgetdelegate.cpp b/doc/src/snippets/widgetdelegate.cpp deleted file mode 100644 index 4d2a6559a5..0000000000 --- a/doc/src/snippets/widgetdelegate.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** 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 - -#include "widgetdelegate.h" - -//![0] -void WidgetDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, - const QModelIndex &index) const -{ - if (index.column() == 1) { - int progress = index.data().toInt(); - - QStyleOptionProgressBar progressBarOption; - progressBarOption.rect = option.rect; - progressBarOption.minimum = 0; - progressBarOption.maximum = 100; - progressBarOption.progress = progress; - progressBarOption.text = QString::number(progress) + "%"; - progressBarOption.textVisible = true; - - QApplication::style()->drawControl(QStyle::CE_ProgressBar, - &progressBarOption, painter); - } else - QStyledItemDelegate::paint(painter, option, index); - -//![0] -} diff --git a/doc/src/widgets/qtwidgets.qdoc b/doc/src/widgets/qtwidgets.qdoc deleted file mode 100644 index 4be460a2ab..0000000000 --- a/doc/src/widgets/qtwidgets.qdoc +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** -** 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:FDL$ -** GNU Free Documentation License -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms -** and conditions contained in a signed written agreement between you -** and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \module QtWidgets - \title QtWidgets Module - \ingroup modules - - \brief The QtWidgets module extends QtGui with C++ widget functionality. - - To include the definitions of the module's classes, use the - following directive: - - \snippet doc/src/snippets/code/doc_src_qtwidgets.cpp 1 - - To link against the module, add this line to your \l qmake \c - .pro file: - - \snippet doc/src/snippets/code/doc_src_qtwidgets.pro 0 -*/ - diff --git a/doc/src/widgets/widgets-and-layouts/focus.qdoc b/doc/src/widgets/widgets-and-layouts/focus.qdoc deleted file mode 100644 index 60f05948b4..0000000000 --- a/doc/src/widgets/widgets-and-layouts/focus.qdoc +++ /dev/null @@ -1,186 +0,0 @@ -/**************************************************************************** -** -** 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:FDL$ -** GNU Free Documentation License -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms -** and conditions contained in a signed written agreement between you -** and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \page focus.html - \title Keyboard Focus - \brief Keyboard focus management and handling. - \ingroup frameworks-technologies - - \keyword keyboard focus - - Qt's widgets handle keyboard focus in the ways that have become - customary in GUIs. - - The basic issue is that the user's key strokes can be directed at any - of several windows on the screen, and any of several widgets inside - the intended window. When the user presses a key, they expect it to go - to the right place, and the software must try to meet this - expectation. The system must determine which application the key stroke - is directed at, which window within that application, and which widget - within that window. - - \section1 Focus Motion - - The customs which have evolved for directing keyboard focus to a - particular widget are these: - - \list 1 - - \li The user presses \key Tab (or \key Shift+Tab). - \li The user clicks a widget. - \li The user presses a keyboard shortcut. - \li The user uses the mouse wheel. - \li The user moves the focus to a window, and the application must - determine which widget within the window should get the focus. - \endlist - - Each of these motion mechanisms is different, and different types of - widgets receive focus in only some of them. We'll cover each of them - in turn. - - \section2 Tab or Shift+Tab - - Pressing \key Tab is by far the most common way to move focus - using the keyboard. (Sometimes in data-entry applications Enter - does the same as \key{Tab}; this can easily be achieved in Qt by - implementing an \l{The Event System}{event filter}.) - - Pressing \key Tab, in all window systems in common use today, - moves the keyboard focus to the next widget in a circular - per-window list. \key Tab moves focus along the circular list in - one direction, \key Shift+Tab in the other. The order in which - \key Tab presses move from widget to widget is called the tab order. - - You can customize the tab order using QWidget::setTabOrder(). (If - you don't, \key Tab generally moves focus in the order of widget - construction.) \l{Qt Designer} provides a means of visually - changing the tab order. - - Since pressing \key Tab is so common, most widgets that can have focus - should support tab focus. The major exception is widgets that are - rarely used, and where there is some keyboard accelerator or error - handler that moves the focus. - - For example, in a data entry dialog, there might be a field that - is only necessary in one per cent of all cases. In such a dialog, - \key Tab could skip this field, and the dialog could use one of - these mechanisms: - - \list 1 - - \li If the program can determine whether the field is needed, it can - move focus there when the user finishes entry and presses \gui OK, or when - the user presses Enter after finishing the other fields. Alternately, - include the field in the tab order but disable it. Enable it if it - becomes appropriate in view of what the user has set in the other - fields. - - \li The label for the field can include a keyboard shortcut that moves - focus to this field. - - \endlist - - Another exception to \key Tab support is text-entry widgets that - must support the insertion of tabs; almost all text editors fall - into this class. Qt treats \key Ctrl+Tab as \key Tab and \key - Ctrl+Shift+Tab as \key Shift+Tab, and such widgets can - reimplement QWidget::event() and handle Tab before calling - QWidget::event() to get normal processing of all other keys. - However, since some systems use \key Ctrl+Tab for other purposes, - and many users aren't aware of \key Ctrl+Tab anyway, this isn't a - complete solution. - - \section2 The User Clicks a Widget - - This is perhaps even more common than pressing \key Tab on - computers with a mouse or other pointing device. - - Clicking to move the focus is slightly more powerful than \key - Tab. While it moves the focus \e to a widget, for editor widgets - it also moves the text cursor (the widget's internal focus) to - the spot where the mouse is clicked. - - Since it is so common and people are used to it, it's a good idea to - support it for most widgets. However, there is also an important - reason to avoid it: you may not want to remove focus from the widget - where it was. - - For example, in a word processor, when the user clicks the 'B' (bold) - tool button, what should happen to the keyboard focus? Should it - remain where it was, almost certainly in the editing widget, or should - it move to the 'B' button? - - We advise supporting click-to-focus for widgets that support text - entry, and to avoid it for most widgets where a mouse click has a - different effect. (For buttons, we also recommend adding a keyboard - shortcut: QAbstractButton and its subclasses make this very easy.) - - In Qt, only the QWidget::setFocusPolicy() function affects - click-to-focus. - - \section2 The User Presses a Keyboard Shortcut - - It's not unusual for keyboard shortcuts to move the focus. This - can happen implicitly by opening modal dialogs, but also - explicitly using focus accelerators such as those provided by - QLabel::setBuddy(), QGroupBox, and QTabBar. - - We advise supporting shortcut focus for all widgets that the user - may want to jump to. For example, a tab dialog can have keyboard - shortcuts for each of its pages, so the user can press e.g. \key - Alt+P to step to the \underline{P}rinting page. It is easy to - overdo this: there are only a few keys, and it's also important - to provide keyboard shortcuts for commands. \key Alt+P is also - used for Paste, Play, Print, and Print Here in the \l{Standard - Accelerator Keys} list, for example. - - \section2 The User Rotates the Mouse Wheel - - On Microsoft Windows, mouse wheel usage is always handled by the - widget that has keyboard focus. On Mac OS X and X11, it's handled by - the widget that gets other mouse events. - - The way Qt handles this platform difference is by letting widgets move - the keyboard focus when the wheel is used. With the right focus policy - on each widget, applications can work idiomatically correctly on - Windows, Mac OS X, and X11. - - \section2 The User Moves the Focus to This Window - - In this situation the application must determine which widget within - the window should receive the focus. - - This can be simple: If the focus has been in this window before, - then the last widget to have focus should regain it. Qt does this - automatically. - - If focus has never been in this window before and you know where - focus should start out, call QWidget::setFocus() on the widget - which should receive focus before you call QWidget::show() it. If - you don't, Qt will pick a suitable widget. -*/ diff --git a/doc/src/widgets/widgets-and-layouts/gallery-cde.qdoc b/doc/src/widgets/widgets-and-layouts/gallery-cde.qdoc deleted file mode 100644 index a74cab0509..0000000000 --- a/doc/src/widgets/widgets-and-layouts/gallery-cde.qdoc +++ /dev/null @@ -1,133 +0,0 @@ -/**************************************************************************** -** -** 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:FDL$ -** GNU Free Documentation License -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms -** and conditions contained in a signed written agreement between you -** and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \page gallery-cde.html - - \title CDE Style Widget Gallery - \ingroup gallery - - This page shows some of the widgets available in Qt - when configured to use the "cde" style. - -\section2 Buttons - -\table 100% -\row -\li \image cde-checkbox.png - \caption The QCheckBox widget provides a checkbox with a text label. -\li \image cde-radiobutton.png - \caption The QRadioButton widget provides a radio button with a text or pixmap label. -\li \image cde-pushbutton.png - \image cde-toolbutton.png - \caption The QPushButton widget provides a command button. -\endtable - -\section2 Containers - -\table 100% -\row -\li \image cde-groupbox.png - The The QGroupBox widget provides a group box frame with a title. -\li \image cde-tabwidget.png - The QTabWidget class provides a stack of tabbed widgets. -\li \image cde-frame.png - The QFrame widget provides a simple decorated container for other widgets. -\li \image cde-toolbox.png - The QToolBox class provides a column of tabbed widget items. -\endtable - -\section2 Item Views - -\table 100% -\row -\li \image cde-listview.png - The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view. -\li \image cde-treeview.png - The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view. -\li \image cde-tableview.png - The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\li -\li -\endtable - -\section2 Display Widgets - -\table 100% -\row -\li \image cde-progressbar.png - The QProgressBar widget provides a horizontal progress bar. -\li \image cde-label.png - The QLabel widget provides a text or image display. -\li \image cde-lcdnumber.png - The QLCDNumber widget displays a number with LCD-like digits. -\endtable - -\section2 Input Widgets - -\table 100% -\row -\li \image cde-lineedit.png - The QLineEdit widget is a one-line text editor. -\li \image cde-dateedit.png - The QDateEdit class provides a widget for editing dates. -\li \image cde-timeedit.png - The QTimeEdit class provides a widget for editing times. -\li \image cde-datetimeedit.png - The QDateTimeEdit class provides a widget for editing dates and times. -\endtable - -\table 100% -\row -\li \image cde-slider.png - The QSlider widget provides a vertical or horizontal slider. -\li \image cde-combobox.png - The QComboBox widget is a combined button and pop-up list. -\li \image cde-spinbox.png - The QSpinBox class provides a spin box widget. -\endtable - -\table 100% -\row -\li \image cde-fontcombobox.png - The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts. -\li \image cde-doublespinbox.png - The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered. -\li \image cde-horizontalscrollbar.png - The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation. -\endtable - -\table 100% -\row -\li \image cde-dial.png - The QDial class provides a rounded range control (like a speedometer or potentiometer). -\li \image cde-textedit.png - The QTextEdit class provides a widget that is used to edit and display both plain and rich text. -\li \image cde-calendarwidget.png - The QCalendarWidget class provides a monthly calendar widget that can be used to select dates. -\endtable - -*/ diff --git a/doc/src/widgets/widgets-and-layouts/gallery-cleanlooks.qdoc b/doc/src/widgets/widgets-and-layouts/gallery-cleanlooks.qdoc deleted file mode 100644 index bed6d0ca40..0000000000 --- a/doc/src/widgets/widgets-and-layouts/gallery-cleanlooks.qdoc +++ /dev/null @@ -1,138 +0,0 @@ -/**************************************************************************** -** -** 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:FDL$ -** GNU Free Documentation License -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms -** and conditions contained in a signed written agreement between you -** and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \page gallery-cleanlooks.html - - \title Cleanlooks Style Widget Gallery - \ingroup gallery - - This page shows some of the widgets available in Qt - when configured to use the "cleanlooks" style. - -\section2 Buttons - -\table 100% -\row -\li \image cleanlooks-pushbutton.png - \caption The QPushButton widget provides a command button. -\li \image cleanlooks-toolbutton.png - \caption The QToolButton class provides a quick-access button to commands - or options, usually used inside a QToolBar. -\endtable - -\table 100% -\row -\li \image cleanlooks-checkbox.png - \caption The QCheckBox widget provides a checkbox with a text label. -\li \image cleanlooks-radiobutton.png - \caption The QRadioButton widget provides a radio button with a text or pixmap label. -\endtable - -\section2 Containers - -\table 100% -\row -\li \image cleanlooks-groupbox.png - The The QGroupBox widget provides a group box frame with a title. -\li \image cleanlooks-tabwidget.png - The QTabWidget class provides a stack of tabbed widgets. -\li \image cleanlooks-frame.png - The QFrame widget provides a simple decorated container for other widgets. -\li \image cleanlooks-toolbox.png - The QToolBox class provides a column of tabbed widget items. -\endtable - -\section2 Item Views - -\table 100% -\row -\li \image cleanlooks-listview.png - The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view. -\li \image cleanlooks-treeview.png - The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view. -\li \image cleanlooks-tableview.png - The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\li -\li -\endtable - -\section2 Display Widgets - -\table 100% -\row -\li \image cleanlooks-progressbar.png - The QProgressBar widget provides a horizontal progress bar. -\li \image cleanlooks-label.png - The QLabel widget provides a text or image display. -\li \image cleanlooks-lcdnumber.png - The QLCDNumber widget displays a number with LCD-like digits. -\endtable - -\section2 Input Widgets - -\table 100% -\row -\li \image cleanlooks-lineedit.png - The QLineEdit widget is a one-line text editor. -\li \image cleanlooks-dateedit.png - The QDateEdit class provides a widget for editing dates. -\li \image cleanlooks-timeedit.png - The QTimeEdit class provides a widget for editing times. -\li \image cleanlooks-datetimeedit.png - The QDateTimeEdit class provides a widget for editing dates and times. -\endtable - -\table 100% -\row -\li \image cleanlooks-slider.png - The QSlider widget provides a vertical or horizontal slider. -\li \image cleanlooks-combobox.png - The QComboBox widget is a combined button and pop-up list. -\li \image cleanlooks-spinbox.png - The QSpinBox class provides a spin box widget. -\endtable - -\table 100% -\row -\li \image cleanlooks-fontcombobox.png - The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts. -\li \image cleanlooks-doublespinbox.png - The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered. -\li \image cleanlooks-horizontalscrollbar.png - The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation. -\endtable - -\table 100% -\row -\li \image cleanlooks-dial.png - The QDial class provides a rounded range control (like a speedometer or potentiometer). -\li \image cleanlooks-textedit.png - The QTextEdit class provides a widget that is used to edit and display both plain and rich text. -\li \image cleanlooks-calendarwidget.png - The QCalendarWidget class provides a monthly calendar widget that can be used to select dates. -\endtable -*/ diff --git a/doc/src/widgets/widgets-and-layouts/gallery-gtk.qdoc b/doc/src/widgets/widgets-and-layouts/gallery-gtk.qdoc deleted file mode 100644 index 820f0b4140..0000000000 --- a/doc/src/widgets/widgets-and-layouts/gallery-gtk.qdoc +++ /dev/null @@ -1,141 +0,0 @@ -/**************************************************************************** -** -** 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:FDL$ -** GNU Free Documentation License -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms -** and conditions contained in a signed written agreement between you -** and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \page gallery-gtk.html - - \title GTK Style Widget Gallery - \ingroup gallery - - This page shows some of the widgets available in Qt - when configured to use the "gtk" style. - - Take a look at the \l{Qt Widget Gallery} to see how Qt - applications appear in other styles. - -\section2 Buttons - -\table 100% -\row -\li \image gtk-pushbutton.png - \caption The QPushButton widget provides a command button. -\li \image gtk-toolbutton.png - \caption The QToolButton class provides a quick-access button to commands - or options, usually used inside a QToolBar. -\endtable - -\table 100% -\row -\li \image gtk-checkbox.png - \caption The QCheckBox widget provides a checkbox with a text label. -\li \image gtk-radiobutton.png - \caption The QRadioButton widget provides a radio button with a text or pixmap label. -\endtable - -\section2 Containers - -\table 100% -\row -\li \image gtk-groupbox.png - The The QGroupBox widget provides a group box frame with a title. -\li \image gtk-tabwidget.png - The QTabWidget class provides a stack of tabbed widgets. -\li \image gtk-frame.png - The QFrame widget provides a simple decorated container for other widgets. -\li \image gtk-toolbox.png - The QToolBox class provides a column of tabbed widget items. -\endtable - -\section2 Item Views - -\table 100% -\row -\li \image gtk-listview.png - The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view. -\li \image gtk-treeview.png - The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view. -\li \image gtk-tableview.png - The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\li -\li -\endtable - -\section2 Display Widgets - -\table 100% -\row -\li \image gtk-progressbar.png - The QProgressBar widget provides a horizontal progress bar. -\li \image gtk-label.png - The QLabel widget provides a text or image display. -\li \image gtk-lcdnumber.png - The QLCDNumber widget displays a number with LCD-like digits. -\endtable - -\section2 Input Widgets - -\table 100% -\row -\li \image gtk-lineedit.png - The QLineEdit widget is a one-line text editor. -\li \image gtk-dateedit.png - The QDateEdit class provides a widget for editing dates. -\li \image gtk-timeedit.png - The QTimeEdit class provides a widget for editing times. -\li \image gtk-datetimeedit.png - The QDateTimeEdit class provides a widget for editing dates and times. -\endtable - -\table 100% -\row -\li \image gtk-slider.png - The QSlider widget provides a vertical or horizontal slider. -\li \image gtk-combobox.png - The QComboBox widget is a combined button and pop-up list. -\li \image gtk-spinbox.png - The QSpinBox class provides a spin box widget. -\endtable - -\table 100% -\row -\li \image gtk-fontcombobox.png - The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts. -\li \image gtk-doublespinbox.png - The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered. -\li \image gtk-horizontalscrollbar.png - The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation. -\endtable - -\table 100% -\row -\li \image gtk-dial.png - The QDial class provides a rounded range control (like a speedometer or potentiometer). -\li \image gtk-textedit.png - The QTextEdit class provides a widget that is used to edit and display both plain and rich text. -\li \image gtk-calendarwidget.png - The QCalendarWidget class provides a monthly calendar widget that can be used to select dates. -\endtable -*/ diff --git a/doc/src/widgets/widgets-and-layouts/gallery-macintosh.qdoc b/doc/src/widgets/widgets-and-layouts/gallery-macintosh.qdoc deleted file mode 100644 index 488a3f7665..0000000000 --- a/doc/src/widgets/widgets-and-layouts/gallery-macintosh.qdoc +++ /dev/null @@ -1,138 +0,0 @@ -/**************************************************************************** -** -** 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:FDL$ -** GNU Free Documentation License -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms -** and conditions contained in a signed written agreement between you -** and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \page gallery-macintosh.html - - \title Macintosh Style Widget Gallery - \ingroup gallery - - This page shows some of the widgets available in Qt - when configured to use the "macintosh" style. - -\section2 Buttons - -\table 100% -\row -\li \image macintosh-pushbutton.png - \caption The QPushButton widget provides a command button. -\li \image macintosh-toolbutton.png - \caption The QToolButton class provides a quick-access button to commands - or options, usually used inside a QToolBar. -\endtable - -\table 100% -\row -\li \image macintosh-checkbox.png - \caption The QCheckBox widget provides a checkbox with a text label. -\li \image macintosh-radiobutton.png - \caption The QRadioButton widget provides a radio button with a text or pixmap label. -\endtable - -\section2 Containers - -\table 100% -\row -\li \image macintosh-groupbox.png - The The QGroupBox widget provides a group box frame with a title. -\li \image macintosh-tabwidget.png - The QTabWidget class provides a stack of tabbed widgets. -\li \image macintosh-frame.png - The QFrame widget provides a simple decorated container for other widgets. -\li \image macintosh-toolbox.png - The QToolBox class provides a column of tabbed widget items. -\endtable - -\section2 Item Views - -\table 100% -\row -\li \image macintosh-listview.png - The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view. -\li \image macintosh-treeview.png - The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view. -\li \image macintosh-tableview.png - The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\li -\li -\endtable - -\section2 Display Widgets - -\table 100% -\row -\li \image macintosh-progressbar.png - The QProgressBar widget provides a horizontal progress bar. -\li \image macintosh-label.png - The QLabel widget provides a text or image display. -\li \image macintosh-lcdnumber.png - The QLCDNumber widget displays a number with LCD-like digits. -\endtable - -\section2 Input Widgets - -\table 100% -\row -\li \image macintosh-lineedit.png - The QLineEdit widget is a one-line text editor. -\li \image macintosh-dateedit.png - The QDateEdit class provides a widget for editing dates. -\li \image macintosh-timeedit.png - The QTimeEdit class provides a widget for editing times. -\li \image macintosh-datetimeedit.png - The QDateTimeEdit class provides a widget for editing dates and times. -\endtable - -\table 100% -\row -\li \image macintosh-slider.png - The QSlider widget provides a vertical or horizontal slider. -\li \image macintosh-combobox.png - The QComboBox widget is a combined button and pop-up list. -\li \image macintosh-spinbox.png - The QSpinBox class provides a spin box widget. -\endtable - -\table 100% -\row -\li \image macintosh-fontcombobox.png - The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts. -\li \image macintosh-doublespinbox.png - The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered. -\li \image macintosh-horizontalscrollbar.png - The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation. -\endtable - -\table 100% -\row -\li \image macintosh-dial.png - The QDial class provides a rounded range control (like a speedometer or potentiometer). -\li \image macintosh-textedit.png - The QTextEdit class provides a widget that is used to edit and display both plain and rich text. -\li \image macintosh-calendarwidget.png - The QCalendarWidget class provides a monthly calendar widget that can be used to select dates. -\endtable -*/ diff --git a/doc/src/widgets/widgets-and-layouts/gallery-motif.qdoc b/doc/src/widgets/widgets-and-layouts/gallery-motif.qdoc deleted file mode 100644 index 5cbffc5516..0000000000 --- a/doc/src/widgets/widgets-and-layouts/gallery-motif.qdoc +++ /dev/null @@ -1,138 +0,0 @@ -/**************************************************************************** -** -** 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:FDL$ -** GNU Free Documentation License -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms -** and conditions contained in a signed written agreement between you -** and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \page gallery-motif.html - - \title Motif Style Widget Gallery - \ingroup gallery - - This page shows some of the widgets available in Qt - when configured to use the "motif" style. - -\section2 Buttons - -\table 100% -\row -\li \image motif-pushbutton.png - \caption The QPushButton widget provides a command button. -\li \image motif-toolbutton.png - \caption The QToolButton class provides a quick-access button to commands - or options, usually used inside a QToolBar. -\endtable - -\table 100% -\row -\li \image motif-checkbox.png - \caption The QCheckBox widget provides a checkbox with a text label. -\li \image motif-radiobutton.png - \caption The QRadioButton widget provides a radio button with a text or pixmap label. -\endtable - -\section2 Containers - -\table 100% -\row -\li \image motif-groupbox.png - The The QGroupBox widget provides a group box frame with a title. -\li \image motif-tabwidget.png - The QTabWidget class provides a stack of tabbed widgets. -\li \image motif-frame.png - The QFrame widget provides a simple decorated container for other widgets. -\li \image motif-toolbox.png - The QToolBox class provides a column of tabbed widget items. -\endtable - -\section2 Item Views - -\table 100% -\row -\li \image motif-listview.png - The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view. -\li \image motif-treeview.png - The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view. -\li \image motif-tableview.png - The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\li -\li -\endtable - -\section2 Display Widgets - -\table 100% -\row -\li \image motif-progressbar.png - The QProgressBar widget provides a horizontal progress bar. -\li \image motif-label.png - The QLabel widget provides a text or image display. -\li \image motif-lcdnumber.png - The QLCDNumber widget displays a number with LCD-like digits. -\endtable - -\section2 Input Widgets - -\table 100% -\row -\li \image motif-lineedit.png - The QLineEdit widget is a one-line text editor. -\li \image motif-dateedit.png - The QDateEdit class provides a widget for editing dates. -\li \image motif-timeedit.png - The QTimeEdit class provides a widget for editing times. -\li \image motif-datetimeedit.png - The QDateTimeEdit class provides a widget for editing dates and times. -\endtable - -\table 100% -\row -\li \image motif-slider.png - The QSlider widget provides a vertical or horizontal slider. -\li \image motif-combobox.png - The QComboBox widget is a combined button and pop-up list. -\li \image motif-spinbox.png - The QSpinBox class provides a spin box widget. -\endtable - -\table 100% -\row -\li \image motif-fontcombobox.png - The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts. -\li \image motif-doublespinbox.png - The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered. -\li \image motif-horizontalscrollbar.png - The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation. -\endtable - -\table 100% -\row -\li \image motif-dial.png - The QDial class provides a rounded range control (like a speedometer or potentiometer). -\li \image motif-textedit.png - The QTextEdit class provides a widget that is used to edit and display both plain and rich text. -\li \image motif-calendarwidget.png - The QCalendarWidget class provides a monthly calendar widget that can be used to select dates. -\endtable -*/ diff --git a/doc/src/widgets/widgets-and-layouts/gallery-plastique.qdoc b/doc/src/widgets/widgets-and-layouts/gallery-plastique.qdoc deleted file mode 100644 index 359fac8018..0000000000 --- a/doc/src/widgets/widgets-and-layouts/gallery-plastique.qdoc +++ /dev/null @@ -1,138 +0,0 @@ -/**************************************************************************** -** -** 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:FDL$ -** GNU Free Documentation License -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms -** and conditions contained in a signed written agreement between you -** and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \page gallery-plastique.html - - \title Plastique Style Widget Gallery - \ingroup gallery - - This page shows some of the widgets available in Qt - when configured to use the "plastique" style. - -\section2 Buttons - -\table 100% -\row -\li \image plastique-pushbutton.png - \caption The QPushButton widget provides a command button. -\li \image plastique-toolbutton.png - \caption The QToolButton class provides a quick-access button to commands - or options, usually used inside a QToolBar. -\endtable - -\table 100% -\row -\li \image plastique-checkbox.png - \caption The QCheckBox widget provides a checkbox with a text label. -\li \image plastique-radiobutton.png - \caption The QRadioButton widget provides a radio button with a text or pixmap label. -\endtable - -\section2 Containers - -\table 100% -\row -\li \image plastique-groupbox.png - The The QGroupBox widget provides a group box frame with a title. -\li \image plastique-tabwidget.png - The QTabWidget class provides a stack of tabbed widgets. -\li \image plastique-frame.png - The QFrame widget provides a simple decorated container for other widgets. -\li \image plastique-toolbox.png - The QToolBox class provides a column of tabbed widget items. -\endtable - -\section2 Item Views - -\table 100% -\row -\li \image plastique-listview.png - The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view. -\li \image plastique-treeview.png - The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view. -\li \image plastique-tableview.png - The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\li -\li -\endtable - -\section2 Display Widgets - -\table 100% -\row -\li \image plastique-progressbar.png - The QProgressBar widget provides a horizontal progress bar. -\li \image plastique-label.png - The QLabel widget provides a text or image display. -\li \image plastique-lcdnumber.png - The QLCDNumber widget displays a number with LCD-like digits. -\endtable - -\section2 Input Widgets - -\table 100% -\row -\li \image plastique-lineedit.png - The QLineEdit widget is a one-line text editor. -\li \image plastique-dateedit.png - The QDateEdit class provides a widget for editing dates. -\li \image plastique-timeedit.png - The QTimeEdit class provides a widget for editing times. -\li \image plastique-datetimeedit.png - The QDateTimeEdit class provides a widget for editing dates and times. -\endtable - -\table 100% -\row -\li \image plastique-slider.png - The QSlider widget provides a vertical or horizontal slider. -\li \image plastique-combobox.png - The QComboBox widget is a combined button and pop-up list. -\li \image plastique-spinbox.png - The QSpinBox class provides a spin box widget. -\endtable - -\table 100% -\row -\li \image plastique-fontcombobox.png - The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts. -\li \image plastique-doublespinbox.png - The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered. -\li \image plastique-horizontalscrollbar.png - The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation. -\endtable - -\table 100% -\row -\li \image plastique-dial.png - The QDial class provides a rounded range control (like a speedometer or potentiometer). -\li \image plastique-textedit.png - The QTextEdit class provides a widget that is used to edit and display both plain and rich text. -\li \image plastique-calendarwidget.png - The QCalendarWidget class provides a monthly calendar widget that can be used to select dates. -\endtable -*/ diff --git a/doc/src/widgets/widgets-and-layouts/gallery-windows.qdoc b/doc/src/widgets/widgets-and-layouts/gallery-windows.qdoc deleted file mode 100644 index b118c845c6..0000000000 --- a/doc/src/widgets/widgets-and-layouts/gallery-windows.qdoc +++ /dev/null @@ -1,138 +0,0 @@ -/**************************************************************************** -** -** 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:FDL$ -** GNU Free Documentation License -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms -** and conditions contained in a signed written agreement between you -** and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \page gallery-windows.html - - \title Windows Style Widget Gallery - \ingroup gallery - - This page shows some of the widgets available in Qt - when configured to use the "windows" style. - -\section2 Buttons - -\table 100% -\row -\li \image windows-pushbutton.png - \caption The QPushButton widget provides a command button. -\li \image windows-toolbutton.png - \caption The QToolButton class provides a quick-access button to commands - or options, usually used inside a QToolBar. -\endtable - -\table 100% -\row -\li \image windows-checkbox.png - \caption The QCheckBox widget provides a checkbox with a text label. -\li \image windows-radiobutton.png - \caption The QRadioButton widget provides a radio button with a text or pixmap label. -\endtable - -\section2 Containers - -\table 100% -\row -\li \image windows-groupbox.png - The The QGroupBox widget provides a group box frame with a title. -\li \image windows-tabwidget.png - The QTabWidget class provides a stack of tabbed widgets. -\li \image windows-frame.png - The QFrame widget provides a simple decorated container for other widgets. -\li \image windows-toolbox.png - The QToolBox class provides a column of tabbed widget items. -\endtable - -\section2 Item Views - -\table 100% -\row -\li \image windows-listview.png - The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view. -\li \image windows-treeview.png - The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view. -\li \image windows-tableview.png - The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\li -\li -\endtable - -\section2 Display Widgets - -\table 100% -\row -\li \image windows-progressbar.png - The QProgressBar widget provides a horizontal progress bar. -\li \image windows-label.png - The QLabel widget provides a text or image display. -\li \image windows-lcdnumber.png - The QLCDNumber widget displays a number with LCD-like digits. -\endtable - -\section2 Input Widgets - -\table 100% -\row -\li \image windows-lineedit.png - The QLineEdit widget is a one-line text editor. -\li \image windows-dateedit.png - The QDateEdit class provides a widget for editing dates. -\li \image windows-timeedit.png - The QTimeEdit class provides a widget for editing times. -\li \image windows-datetimeedit.png - The QDateTimeEdit class provides a widget for editing dates and times. -\endtable - -\table 100% -\row -\li \image windows-slider.png - The QSlider widget provides a vertical or horizontal slider. -\li \image windows-combobox.png - The QComboBox widget is a combined button and pop-up list. -\li \image windows-spinbox.png - The QSpinBox class provides a spin box widget. -\endtable - -\table 100% -\row -\li \image windows-fontcombobox.png - The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts. -\li \image windows-doublespinbox.png - The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered. -\li \image windows-horizontalscrollbar.png - The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation. -\endtable - -\table 100% -\row -\li \image windows-dial.png - The QDial class provides a rounded range control (like a speedometer or potentiometer). -\li \image windows-textedit.png - The QTextEdit class provides a widget that is used to edit and display both plain and rich text. -\li \image windows-calendarwidget.png - The QCalendarWidget class provides a monthly calendar widget that can be used to select dates. -\endtable -*/ diff --git a/doc/src/widgets/widgets-and-layouts/gallery-windowsvista.qdoc b/doc/src/widgets/widgets-and-layouts/gallery-windowsvista.qdoc deleted file mode 100644 index db1a7cee90..0000000000 --- a/doc/src/widgets/widgets-and-layouts/gallery-windowsvista.qdoc +++ /dev/null @@ -1,138 +0,0 @@ -/**************************************************************************** -** -** 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:FDL$ -** GNU Free Documentation License -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms -** and conditions contained in a signed written agreement between you -** and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \page gallery-windowsvista.html - - \title Windows Vista Style Widget Gallery - \ingroup gallery - - This page shows some of the widgets available in Qt - when configured to use the "windowsvista" style. - -\section2 Buttons - -\table 100% -\row -\li \image windowsvista-pushbutton.png - \caption The QPushButton widget provides a command button. -\li \image windowsvista-toolbutton.png - \caption The QToolButton class provides a quick-access button to commands - or options, usually used inside a QToolBar. -\endtable - -\table 100% -\row -\li \image windowsvista-checkbox.png - \caption The QCheckBox widget provides a checkbox with a text label. -\li \image windowsvista-radiobutton.png - \caption The QRadioButton widget provides a radio button with a text or pixmap label. -\endtable - -\section2 Containers - -\table 100% -\row -\li \image windowsvista-groupbox.png - The The QGroupBox widget provides a group box frame with a title. -\li \image windowsvista-tabwidget.png - The QTabWidget class provides a stack of tabbed widgets. -\li \image windowsvista-frame.png - The QFrame widget provides a simple decorated container for other widgets. -\li \image windowsvista-toolbox.png - The QToolBox class provides a column of tabbed widget items. -\endtable - -\section2 Item Views - -\table 100% -\row -\li \image windowsvista-listview.png - The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view. -\li \image windowsvista-treeview.png - The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view. -\li \image windowsvista-tableview.png - The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\li -\li -\endtable - -\section2 Display Widgets - -\table 100% -\row -\li \image windowsvista-progressbar.png - The QProgressBar widget provides a horizontal progress bar. -\li \image windowsvista-label.png - The QLabel widget provides a text or image display. -\li \image windowsvista-lcdnumber.png - The QLCDNumber widget displays a number with LCD-like digits. -\endtable - -\section2 Input Widgets - -\table 100% -\row -\li \image windowsvista-lineedit.png - The QLineEdit widget is a one-line text editor. -\li \image windowsvista-dateedit.png - The QDateEdit class provides a widget for editing dates. -\li \image windowsvista-timeedit.png - The QTimeEdit class provides a widget for editing times. -\li \image windowsvista-datetimeedit.png - The QDateTimeEdit class provides a widget for editing dates and times. -\endtable - -\table 100% -\row -\li \image windowsvista-slider.png - The QSlider widget provides a vertical or horizontal slider. -\li \image windowsvista-combobox.png - The QComboBox widget is a combined button and pop-up list. -\li \image windowsvista-spinbox.png - The QSpinBox class provides a spin box widget. -\endtable - -\table 100% -\row -\li \image windowsvista-fontcombobox.png - The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts. -\li \image windowsvista-doublespinbox.png - The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered. -\li \image windowsvista-horizontalscrollbar.png - The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation. -\endtable - -\table 100% -\row -\li \image windowsvista-dial.png - The QDial class provides a rounded range control (like a speedometer or potentiometer). -\li \image windowsvista-textedit.png - The QTextEdit class provides a widget that is used to edit and display both plain and rich text. -\li \image windowsvista-calendarwidget.png - The QCalendarWidget class provides a monthly calendar widget that can be used to select dates. -\endtable -*/ diff --git a/doc/src/widgets/widgets-and-layouts/gallery-windowsxp.qdoc b/doc/src/widgets/widgets-and-layouts/gallery-windowsxp.qdoc deleted file mode 100644 index 2ade5681e2..0000000000 --- a/doc/src/widgets/widgets-and-layouts/gallery-windowsxp.qdoc +++ /dev/null @@ -1,138 +0,0 @@ -/**************************************************************************** -** -** 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:FDL$ -** GNU Free Documentation License -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms -** and conditions contained in a signed written agreement between you -** and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \page gallery-windowsxp.html - - \title Windows XP Style Widget Gallery - \ingroup gallery - - This page shows some of the widgets available in Qt - when configured to use the "windowsxp" style. - -\section2 Buttons - -\table 100% -\row -\li \image windowsxp-pushbutton.png - \caption The QPushButton widget provides a command button. -\li \image windowsxp-toolbutton.png - \caption The QToolButton class provides a quick-access button to commands - or options, usually used inside a QToolBar. -\endtable - -\table 100% -\row -\li \image windowsxp-checkbox.png - \caption The QCheckBox widget provides a checkbox with a text label. -\li \image windowsxp-radiobutton.png - \caption The QRadioButton widget provides a radio button with a text or pixmap label. -\endtable - -\section2 Containers - -\table 100% -\row -\li \image windowsxp-groupbox.png - The The QGroupBox widget provides a group box frame with a title. -\li \image windowsxp-tabwidget.png - The QTabWidget class provides a stack of tabbed widgets. -\li \image windowsxp-frame.png - The QFrame widget provides a simple decorated container for other widgets. -\li \image windowsxp-toolbox.png - The QToolBox class provides a column of tabbed widget items. -\endtable - -\section2 Item Views - -\table 100% -\row -\li \image windowsxp-listview.png - The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view. -\li \image windowsxp-treeview.png - The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view. -\li \image windowsxp-tableview.png - The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\li -\li -\endtable - -\section2 Display Widgets - -\table 100% -\row -\li \image windowsxp-progressbar.png - The QProgressBar widget provides a horizontal progress bar. -\li \image windowsxp-label.png - The QLabel widget provides a text or image display. -\li \image windowsxp-lcdnumber.png - The QLCDNumber widget displays a number with LCD-like digits. -\endtable - -\section2 Input Widgets - -\table 100% -\row -\li \image windowsxp-lineedit.png - The QLineEdit widget is a one-line text editor. -\li \image windowsxp-dateedit.png - The QDateEdit class provides a widget for editing dates. -\li \image windowsxp-timeedit.png - The QTimeEdit class provides a widget for editing times. -\li \image windowsxp-datetimeedit.png - The QDateTimeEdit class provides a widget for editing dates and times. -\endtable - -\table 100% -\row -\li \image windowsxp-slider.png - The QSlider widget provides a vertical or horizontal slider. -\li \image windowsxp-combobox.png - The QComboBox widget is a combined button and pop-up list. -\li \image windowsxp-spinbox.png - The QSpinBox class provides a spin box widget. -\endtable - -\table 100% -\row -\li \image windowsxp-fontcombobox.png - The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts. -\li \image windowsxp-doublespinbox.png - The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered. -\li \image windowsxp-horizontalscrollbar.png - The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation. -\endtable - -\table 100% -\row -\li \image windowsxp-dial.png - The QDial class provides a rounded range control (like a speedometer or potentiometer). -\li \image windowsxp-textedit.png - The QTextEdit class provides a widget that is used to edit and display both plain and rich text. -\li \image windowsxp-calendarwidget.png - The QCalendarWidget class provides a monthly calendar widget that can be used to select dates. -\endtable -*/ diff --git a/doc/src/widgets/widgets-and-layouts/gallery.qdoc b/doc/src/widgets/widgets-and-layouts/gallery.qdoc deleted file mode 100644 index a2f4db5a7b..0000000000 --- a/doc/src/widgets/widgets-and-layouts/gallery.qdoc +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** 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:FDL$ -** GNU Free Documentation License -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms -** and conditions contained in a signed written agreement between you -** and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \group gallery - \title Qt Widget Gallery - \brief Qt widgets shown in different styles on various platforms. - - Qt's support for widget styles and themes enables your application to fit in - with the native desktop environment. Below, you can find links to the various - widget styles that are supplied with Qt 4. - - \table - \row - \li \image plastique-tabwidget.png Plastique Style Widget Gallery - \caption \l{Plastique Style Widget Gallery} - - The Plastique style is provided by QPlastiqueStyle. - \li \image windowsxp-tabwidget.png Windows XP Style Widget Gallery - \caption \l{Windows XP Style Widget Gallery} - - The Windows XP style is provided by QWindowsXPStyle. - \li \image windows-tabwidget.png Windows Style Widget Gallery - \caption \l{Windows Style Widget Gallery} - - The Windows style is provided by QWindowsStyle. - \endtable - - \table - \row - \li \image macintosh-tabwidget.png Macintosh Style Widget Gallery - \caption \l{Macintosh Style Widget Gallery} - - The Macintosh style is provided by QMacStyle. - \li \image cleanlooks-tabwidget.png Cleanlooks Style Widget Gallery - \caption \l{Cleanlooks Style Widget Gallery} - - The Cleanlooks style is provided by QCleanlooksStyle. - \li \image windowsvista-tabwidget.png Windows Vista Style Widget Gallery - \caption \l{Windows Vista Style Widget Gallery} - - The Windows Vista style is provided by QWindowsVistaStyle. - \endtable - - \table - \row - \li \image gtk-tabwidget.png GTK Style Widget Gallery - \caption \l{GTK Style Widget Gallery} - - The GTK style is provided by QGtkStyle. - \li \image motif-tabwidget.png Motif Style Widget Gallery - \caption \l{Motif Style Widget Gallery} - - The Motif style is provided by QMotifStyle. - \li \image cde-tabwidget.png CDE Style Widget Gallery - \caption \l{CDE Style Widget Gallery} - - The Common Desktop Environment style is provided by QCDEStyle. - \endtable -*/ diff --git a/doc/src/widgets/widgets-and-layouts/layout.qdoc b/doc/src/widgets/widgets-and-layouts/layout.qdoc deleted file mode 100644 index 6e1a5f70e1..0000000000 --- a/doc/src/widgets/widgets-and-layouts/layout.qdoc +++ /dev/null @@ -1,396 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** GNU Free Documentation License -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms -** and conditions contained in a signed written agreement between you -** and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \group geomanagement - \title Layout Classes -*/ - -/*! - \page layout.html - \title Layout Management - \ingroup qt-basic-concepts - \ingroup qt-gui-concepts - \brief A tour of the standard layout managers and an introduction to custom - layouts. - - \previouspage Widgets and Layouts - \contentspage Widgets and Layouts - \nextpage {Styles and Style Aware Widgets}{Styles} - - \ingroup frameworks-technologies - - The Qt layout system provides a simple and powerful way of automatically - arranging child widgets within a widget to ensure that they make good use - of the available space. - - \tableofcontents - - \section1 Introduction - - Qt includes a set of layout management classes that are used to describe - how widgets are laid out in an application's user interface. These layouts - automatically position and resize widgets when the amount of space - available for them changes, ensuring that they are consistently arranged - and that the user interface as a whole remains usable. - - All QWidget subclasses can use layouts to manage their children. The - QWidget::setLayout() function applies a layout to a widget. When a layout - is set on a widget in this way, it takes charge of the following tasks: - - \list - \li Positioning of child widgets. - \li Sensible default sizes for windows. - \li Sensible minimum sizes for windows. - \li Resize handling. - \li Automatic updates when contents change: - \list - \li Font size, text or other contents of child widgets. - \li Hiding or showing a child widget. - \li Removal of child widgets. - \endlist - \endlist - - \section1 Qt's Layout Classes - - Qt's layout classes were designed for hand-written C++ code, allowing - measurements to be specified in pixels for simplicity, so they are easy to - understand and use. The code generated for forms created using \QD also - uses the layout classes. \QD is useful to use when experimenting with the - design of a form since it avoids the compile, link and run cycle usually - involved in user interface development. - - \annotatedlist geomanagement - - \section1 Horizontal, Vertical, Grid, and Form Layouts - - The easiest way to give your widgets a good layout is to use the built-in - layout managers: QHBoxLayout, QVBoxLayout, QGridLayout, and QFormLayout. - These classes inherit from QLayout, which in turn derives from QObject (not - QWidget). They take care of geometry management for a set of widgets. To - create more complex layouts, you can nest layout managers inside each other. - - \list - \li A QHBoxLayout lays out widgets in a horizontal row, from left to - right (or right to left for right-to-left languages). - \image qhboxlayout-with-5-children.png - - \li A QVBoxLayout lays out widgets in a vertical column, from top to - bottom. - \image qvboxlayout-with-5-children.png - - \li A QGridLayout lays out widgets in a two-dimensional grid. Widgets - can occupy multiple cells. - \image qgridlayout-with-5-children.png - - \li A QFormLayout lays out widgets in a 2-column descriptive label- - field style. - \image qformlayout-with-6-children.png - \endlist - - - \section2 Laying Out Widgets in Code - - The following code creates a QHBoxLayout that manages the geometry of five - \l{QPushButton}{QPushButtons}, as shown on the first screenshot above: - - \snippet doc/src/snippets/layouts/layouts.cpp 0 - \snippet doc/src/snippets/layouts/layouts.cpp 1 - \snippet doc/src/snippets/layouts/layouts.cpp 2 - \codeline - \snippet doc/src/snippets/layouts/layouts.cpp 3 - \snippet doc/src/snippets/layouts/layouts.cpp 4 - \snippet doc/src/snippets/layouts/layouts.cpp 5 - - The code for QVBoxLayout is identical, except the line where the layout is - created. The code for QGridLayout is a bit different, because we need to - specify the row and column position of the child widget: - - \snippet doc/src/snippets/layouts/layouts.cpp 12 - \snippet doc/src/snippets/layouts/layouts.cpp 13 - \snippet doc/src/snippets/layouts/layouts.cpp 14 - \codeline - \snippet doc/src/snippets/layouts/layouts.cpp 15 - \snippet doc/src/snippets/layouts/layouts.cpp 16 - \snippet doc/src/snippets/layouts/layouts.cpp 17 - - The third QPushButton spans 2 columns. This is possible by specifying 2 as - the fifth argument to QGridLayout::addWidget(). - - QFormLayout will add two widgets on a row, commonly a QLabel and a QLineEdit - to create forms. Adding a QLabel and a QLineEdit on the same row will set - the QLineEdit as the QLabel's buddy. The following code will use the - QFormLayout to place three \l{QPushButton}{QPushButtons} and a corresponding - QLineEdit on a row. - - \snippet doc/src/snippets/layouts/layouts.cpp 18 - \snippet doc/src/snippets/layouts/layouts.cpp 19 - \snippet doc/src/snippets/layouts/layouts.cpp 20 - \codeline - \snippet doc/src/snippets/layouts/layouts.cpp 21 - \snippet doc/src/snippets/layouts/layouts.cpp 22 - \snippet doc/src/snippets/layouts/layouts.cpp 23 - - - \section2 Tips for Using Layouts - - When you use a layout, you do not need to pass a parent when constructing - the child widgets. The layout will automatically reparent the widgets - (using QWidget::setParent()) so that they are children of the widget on - which the layout is installed. - - \note Widgets in a layout are children of the widget on which the layout - is installed, \e not of the layout itself. Widgets can only have other - widgets as parent, not layouts. - - You can nest layouts using \c addLayout() on a layout; the inner layout - then becomes a child of the layout it is inserted into. - - - \section1 Adding Widgets to a Layout - - When you add widgets to a layout, the layout process works as follows: - - \list 1 - \li All the widgets will initially be allocated an amount of space in - accordance with their QWidget::sizePolicy() and - QWidget::sizeHint(). - - \li If any of the widgets have stretch factors set, with a value - greater than zero, then they are allocated space in proportion to - their stretch factor (explained below). - - \li If any of the widgets have stretch factors set to zero they will - only get more space if no other widgets want the space. Of these, - space is allocated to widgets with an - \l{QSizePolicy::Expanding}{Expanding} size policy first. - - \li Any widgets that are allocated less space than their minimum size - (or minimum size hint if no minimum size is specified) are - allocated this minimum size they require. (Widgets don't have to - have a minimum size or minimum size hint in which case the stretch - factor is their determining factor.) - - \li Any widgets that are allocated more space than their maximum size - are allocated the maximum size space they require. (Widgets do not - have to have a maximum size in which case the stretch factor is - their determining factor.) - \endlist - - - \section2 Stretch Factors - \keyword stretch factor - - Widgets are normally created without any stretch factor set. When they are - laid out in a layout the widgets are given a share of space in accordance - with their QWidget::sizePolicy() or their minimum size hint whichever is - the greater. Stretch factors are used to change how much space widgets are - given in proportion to one another. - - If we have three widgets laid out using a QHBoxLayout with no stretch - factors set we will get a layout like this: - - \img layout1.png Three widgets in a row - - If we apply stretch factors to each widget, they will be laid out in - proportion (but never less than their minimum size hint), e.g. - - \img layout2.png Three widgets with different stretch factors in a row - - - \section1 Custom Widgets in Layouts - - When you make your own widget class, you should also communicate its layout - properties. If the widget has a one of Qt's layouts, this is already taken - care of. If the widget does not have any child widgets, or uses manual - layout, you can change the behavior of the widget using any or all of the - following mechanisms: - - \list - \li Reimplement QWidget::sizeHint() to return the preferred size of the - widget. - \li Reimplement QWidget::minimumSizeHint() to return the smallest size - the widget can have. - \li Call QWidget::setSizePolicy() to specify the space requirements of - the widget. - \endlist - - Call QWidget::updateGeometry() whenever the size hint, minimum size hint or - size policy changes. This will cause a layout recalculation. Multiple - consecutive calls to QWidget::updateGeometry() will only cause one layout - recalculation. - - If the preferred height of your widget depends on its actual width (e.g., - a label with automatic word-breaking), set the - \l{QSizePolicy::hasHeightForWidth()}{height-for-width} flag in the - widget's \l{QWidget::sizePolicy}{size policy} and reimplement - QWidget::heightForWidth(). - - Even if you implement QWidget::heightForWidth(), it is still a good idea to - provide a reasonable sizeHint(). - - For further guidance when implementing these functions, see the - \e{Qt Quarterly} article - \l{http://doc.qt.nokia.com/qq/qq04-height-for-width.html} - {Trading Height for Width}. - - - \section1 Layout Issues - - The use of rich text in a label widget can introduce some problems to the - layout of its parent widget. Problems occur due to the way rich text is - handled by Qt's layout managers when the label is word wrapped. - - In certain cases the parent layout is put into QLayout::FreeResize mode, - meaning that it will not adapt the layout of its contents to fit inside - small sized windows, or even prevent the user from making the window too - small to be usable. This can be overcome by subclassing the problematic - widgets, and implementing suitable \l{QWidget::}{sizeHint()} and - \l{QWidget::}{minimumSizeHint()} functions. - - In some cases, it is relevant when a layout is added to a widget. When - you set the widget of a QDockWidget or a QScrollArea (with - QDockWidget::setWidget() and QScrollArea::setWidget()), the layout must - already have been set on the widget. If not, the widget will not be - visible. - - - \section1 Manual Layout - - If you are making a one-of-a-kind special layout, you can also make a - custom widget as described above. Reimplement QWidget::resizeEvent() to - calculate the required distribution of sizes and call - \l{QWidget::}{setGeometry()} on each child. - - The widget will get an event of type QEvent::LayoutRequest when the - layout needs to be recalculated. Reimplement QWidget::event() to handle - QEvent::LayoutRequest events. - - - \section1 How to Write A Custom Layout Manager - - An alternative to manual layout is to write your own layout manager by - subclassing QLayout. The \l{layouts/borderlayout}{Border Layout} and - \l{layouts/flowlayout}{Flow Layout} examples show how to do this. - - Here we present an example in detail. The \c CardLayout class is inspired - by the Java layout manager of the same name. It lays out the items (widgets - or nested layouts) on top of each other, each item offset by - QLayout::spacing(). - - To write your own layout class, you must define the following: - \list - \li A data structure to store the items handled by the layout. Each - item is a \link QLayoutItem QLayoutItem\endlink. We will use a - QList in this example. - \li \l{QLayout::}{addItem()}, how to add items to the layout. - \li \l{QLayout::}{setGeometry()}, how to perform the layout. - \li \l{QLayout::}{sizeHint()}, the preferred size of the layout. - \li \l{QLayout::}{itemAt()}, how to iterate over the layout. - \li \l{QLayout::}{takeAt()}, how to remove items from the layout. - \endlist - - In most cases, you will also implement \l{QLayout::}{minimumSize()}. - - - \section2 The Header File (\c card.h) - - \snippet doc/src/snippets/code/doc_src_layout.cpp 0 - - - \section2 The Implementation File (\c card.cpp) - - \snippet doc/src/snippets/code/doc_src_layout.cpp 1 - - First we define \c{count()} to fetch the number of items in the list. - - \snippet doc/src/snippets/code/doc_src_layout.cpp 2 - - Then we define two functions that iterate over the layout: \c{itemAt()} - and \c{takeAt()}. These functions are used internally by the layout system - to handle deletion of widgets. They are also available for application - programmers. - - \c{itemAt()} returns the item at the given index. \c{takeAt()} removes the - item at the given index, and returns it. In this case we use the list index - as the layout index. In other cases where we have a more complex data - structure, we may have to spend more effort defining a linear order for the - items. - - \snippet doc/src/snippets/code/doc_src_layout.cpp 3 - - \c{addItem()} implements the default placement strategy for layout items. - This function must be implemented. It is used by QLayout::add(), by the - QLayout constructor that takes a layout as parent. If your layout has - advanced placement options that require parameters, you must provide extra - access functions such as the row and column spanning overloads of - QGridLayout::addItem(), QGridLayout::addWidget(), and - QGridLayout::addLayout(). - - \snippet doc/src/snippets/code/doc_src_layout.cpp 4 - - The layout takes over responsibility of the items added. Since QLayoutItem - does not inherit QObject, we must delete the items manually. In the - destructor, we remove each item from the list using \c{takeAt()}, and - then delete it. - - \snippet doc/src/snippets/code/doc_src_layout.cpp 5 - - The \c{setGeometry()} function actually performs the layout. The rectangle - supplied as an argument does not include \c{margin()}. If relevant, use - \c{spacing()} as the distance between items. - - \snippet doc/src/snippets/code/doc_src_layout.cpp 6 - - \c{sizeHint()} and \c{minimumSize()} are normally very similar in - implementation. The sizes returned by both functions should include - \c{spacing()}, but not \c{margin()}. - - \snippet doc/src/snippets/code/doc_src_layout.cpp 7 - - - \section2 Further Notes - - \list - \li This custom layout does not handle height for width. - \li We ignore QLayoutItem::isEmpty(); this means that the layout will - treat hidden widgets as visible. - \li For complex layouts, speed can be greatly increased by caching - calculated values. In that case, implement - QLayoutItem::invalidate() to mark the cached data is dirty. - \li Calling QLayoutItem::sizeHint(), etc. may be expensive. So, you - should store the value in a local variable if you need it again - later within in the same function. - \li You should not call QLayoutItem::setGeometry() twice on the same - item in the same function. This call can be very expensive if the - item has several child widgets, because the layout manager must do - a complete layout every time. Instead, calculate the geometry and - then set it. (This does not only apply to layouts, you should do - the same if you implement your own resizeEvent(), for example.) - \endlist -*/ - diff --git a/doc/src/widgets/widgets-and-layouts/styles.qdoc b/doc/src/widgets/widgets-and-layouts/styles.qdoc deleted file mode 100644 index b9e3a30333..0000000000 --- a/doc/src/widgets/widgets-and-layouts/styles.qdoc +++ /dev/null @@ -1,2102 +0,0 @@ -/**************************************************************************** -** -** 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:FDL$ -** GNU Free Documentation License -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms -** and conditions contained in a signed written agreement between you -** and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \group appearance - \title Widget Appearance and Style - \brief Classes used for customizing UI appearance and style. -*/ - -/*! - \page style-reference.html - \title Styles and Style Aware Widgets - \ingroup qt-gui-concepts - \brief Styles and the styling of widgets. - - Styles (classes that inherit QStyle) draw on behalf of widgets - and encapsulate the look and feel of a GUI. The QStyle class is - an abstract base class that encapsulates the look and feel of a - GUI. Qt's built-in widgets use it to perform nearly all of their - drawing, ensuring that they look exactly like the equivalent - native widgets. - - Several styles are built into Qt (e.g., windows style and motif style). - Other styles are only available on specific platforms (such as - the windows XP style). Custom styles are made available as plugins - or by creating an instance of the style class in an application and - setting it with QApplication::setStyle(). - - To implement a new style, you inherit one of Qt's existing styles - - the one most resembling the style you want to create - and - reimplement a few virtual functions. This process is somewhat - involved, and we therefore provide this overview. We give a - step-by-step walkthrough of how to style individual Qt widgets. - We will examine the QStyle virtual functions, member variables, - and enumerations. - - The part of this document that does not concern the styling of - individual widgets is meant to be read sequentially because later - sections tend to depend on earlier ones. The description of the - widgets can be used for reference while implementing a style. - However, you may need to consult the Qt source code in some cases. - The sequence in the styling process should become clear after - reading this document, which will aid you in locating relevant code. - - To develop style aware widgets (i.e., widgets that conform to - the style in which they are drawn), you need to draw them using the - current style. This document shows how widgets draw themselves - and which possibilities the style gives them. - - \section1 Classes for Widget Styling - - These classes are used to customize an application's appearance and - style. - - \annotatedlist appearance - - \section1 The QStyle implementation - - The API of QStyle contains functions that draw the widgets, static - helper functions to do common and difficult tasks (e.g., - calculating the position of slider handles) and functions to do - the various calculations necessary while drawing (e.g., for the - widgets to calculate their size hints). The style also help some - widgets with the layout of their contents. In addition, it creates - a QPalette that contains \l{QBrush}es to draw with. - - QStyle draws graphical elements; an element is a widget or a - widget part like a push button bevel, a window frame, or a scroll - bar. Most draw functions now take four arguments: - - \list - \li an enum value specifying which graphical element to draw - \li a QStyleOption specifying how and where to render that element - \li a QPainter that should be used to draw the element - \li a QWidget on which the drawing is performed (optional) - \endlist - - When a widget asks a style to draw an element, it provides the style - with a QStyleOption, which is a class that contains the information - necessary for drawing. Thanks to QStyleOption, it is possible to make - QStyle draw widgets without linking in any code for the widget. This - makes it possible to use \l{QStyle}'s draw functions on any paint - device, i.e., you can draw a combobox on any widget, not just on a - QComboBox. - - The widget is passed as the last argument in case the style needs - it to perform special effects (such as animated default buttons on - Mac OS X), but it isn't mandatory. - - We will in the course of this section look at the style elements, - the style options, and the functions of QStyle. Finally, we describe - how the palette is used. - - Items in item views is drawn by \l{Delegate Classes}{delegates} in - Qt. The item view headers are still drawn by the style. Qt's - default delegate, QStyledItemDelegate, draws its items partially - through the current style; it draws the check box indicators and - calculate bounding rectangles for the elements of which the item - consists. In this document, we only describe how to implement a - QStyle subclass. If you wish to add support for other datatypes - than those supported by the QStyledItemDelegate, you need to - implement a custom delegate. Note that delegates must be set - programmatically for each individual widget (i.e., default - delegates cannot be provided as plugins). - - \section2 The Style Elements - - A style element is a graphical part of a GUI. A widget consists - of a hierarchy (or tree) of style elements. For instance, when a - style receives a request to draw a push button (from QPushButton, - for example), it draws a label (text and icon), a button bevel, - and a focus frame. The button bevel, in turn, consists of a frame - around the bevel and two other elements, which we will look at - later. Below is a conceptual illustration of the push button - element tree. We will see the actual tree for QPushButton when we - go through the individual widgets. - - \image javastyle/conceptualpushbuttontree.png - - Widgets are not necessarily drawn by asking the style to draw - only one element. Widgets can make several calls to the style to - draw different elements. An example is QTabWidget, which draws its - tabs and frame individually. - - There are three element types: primitive elements, control - elements, and complex control elements. The elements are defined - by the \l{QStyle::}{ComplexControl}, \l{QStyle::}{ControlElement}, - and \l{QStyle::}{PrimitiveElement} enums. The values of - each element enum has a prefix to identify their type: \c{CC_} for - complex elements, \c{CE_} for control elements, and \c{PE_} for - primitive elements. We will in the following three sections see what - defines the different elements and see examples of widgets that use - them. - - The QStyle class description contains a list of these elements and - their roles in styling widgets. We will see how they are used when - we style individual widgets. - - \section3 Primitive Elements - - Primitive elements are GUI elements that are common and often used - by several widgets. Examples of these are frames, button bevels, - and arrows for spin boxes, scroll bars, and combo boxes. - Primitive elements cannot exist on their own: they are always part - of a larger construct. They take no part in the interaction with - the user, but are passive decorations in the GUI. - - \section3 Control Elements - - A control element performs an action or displays information - to the user. Examples of control elements are push buttons, check - boxes, and header sections in tables and tree views. Control - elements are not necessarily complete widgets such as push - buttons, but can also be widget parts such as tab bar tabs and - scroll bar sliders. They differ from primitive elements in that - they are not passive, but fill a function in the interaction with - the user. Controls that consist of several elements often use the - style to calculate the bounding rectangles of the elements. The - available sub elements are defined by the \l{QStyle::}{SubElement} - enum. This enum is only used for calculating bounding rectangles, - and sub elements are as such not graphical elements to be drawn - like primitive, control, and complex elements. - - \section3 Complex Control Elements - - Complex control elements contain sub controls. Complex controls - behave differently depending on where the user handles them with - the mouse and which keyboard keys are pressed. This is dependent - on which sub control (if any) that the mouse is over or received a - mouse press. Examples of complex controls are scroll bars and - combo boxes. With a scroll bar, you can use the mouse to move the - slider and press the line up and line down buttons. The available - sub controls are defined by the \l{QStyle}{SubControl} enum. - - In addition to drawing, the style needs to provide the widgets - with information on which sub control (if any) a mouse press was - made on. For instance, a QScrollBar needs to know if the user - pressed the slider, the slider groove, or one of the buttons. - - Note that sub controls are not the same as the control elements - described in the previous section. You cannot use the style to - draw a sub control; the style will only calculate the bounding - rectangle in which the sub control should be drawn. It is common, - though, that complex elements use control and primitive elements - to draw their sub controls, which is an approach that is - frequently used by the built-in styles in Qt and also the Java - style. For instance, the Java style uses PE_IndicatorCheckBox to - draw the check box in group boxes (which is a sub control of - CC_GroupBox). Some sub controls have an equivalent control element, - e.g., the scroll bar slider (SC_SCrollBarSlider and - CE_ScrollBarSlider). - - \section3 Other QStyle Tasks - - The style elements and widgets, as mentioned, use the style to - calculate bounding rectangles of sub elements and sub controls, - and pixel metrics, which is a style dependent size in screen - pixels, for measures when drawing. The available rectangles and - pixel metrics are represented by three enums in QStyle: - \l{QStyle::}{SubElement}, \l{QStyle::}{SubControl}, and - \l{QStyle::}{PixelMetric}. Values of the enums can easily by - identified as they start with SE_, SC_ and PM_. - - The style also contain a set of style hints, which is - represented as values in the \l{QStyle::}{StyleHint} enum. All - widgets do not have the same functionality and look in the - different styles. For instance, when the menu items in a menu do not - fit in a single column on the screen, some styles support - scrolling while others draw more than one column to fit all items. - - A style usually has a set of standard images (such as a warning, a - question, and an error image) for message boxes, file dialogs, - etc. QStyle provides the \l{QStyle::}{StandardPixmap} enum. Its - values represent the standard images. Qt's widgets use these, so - when you implement a custom style you should supply the images - used by the style that is being implemented. - - The style calculates the spacing between widgets in layouts. There - are two ways the style can handle these calculations. You can set - the PM_LayoutHorizontalSpacing and PM_LayoutVerticalSpacing, which - is the way the java style does it (through QCommonStyle). - Alternatively, you can implement QStyle::layoutSpacing() and - QStyle::layoutSpacingImplementation() if you need more control over - this part of the layout. In these functions you can calculate the - spacing based on control types (QSizePolicy::ControlType) for - different size policies (QSizePolicy::Policy) and also the style - option for the widget in question. - - \section2 Style Options - - The sub-classes of QStyleOption contain all information necessary - to style the individual elements. Style options are instantiated - - usually on the stack - and filled out by the caller of the QStyle - function. Depending on what is drawn the style will expect - different a different style option class. For example, the - QStyle::PE_FrameFocusRect element expects a QStyleOptionFocusRect - argument, and it's possible to create custom subclasses that a - custom style can use. The style options keep public variables - for performance reasons. - - The widgets can be in a number of different states, which are - defined by the \l{QStyle::}{State} enum. Some of the state flags have - different meanings depending on the widget, but others are common - for all widgets like State_Disabled. It is QStyleOption that sets - the common states with QStyleOption::initFrom(); the rest of the - states are set by the individual widgets. - - Most notably, the style options contain the palette and bounding - rectangles of the widgets to be drawn. Most widgets have - specialized style options. QPushButton and QCheckBox, for - instance, use QStyleOptionButton as style option, which contain - the text, icon, and the size of their icon. The exact contents of - all options are described when we go through individual widgets. - - When reimplementing QStyle functions that take a - QStyleOption parameter, you often need to cast the - QStyleOption to a subclass (e.g., QStyleOptionFocusRect). For - safety, you can use qstyleoption_cast() to ensure that the - pointer type is correct. If the object isn't of the right type, - qstyleoption_cast() returns 0. For example: - - \snippet doc/src/snippets/code/doc_src_qt4-styles.cpp 0 - - The following code snippet illustrates how to use QStyle to - draw the focus rectangle from a custom widget's paintEvent(): - - \snippet doc/src/snippets/code/doc_src_qt4-styles.cpp 1 - - The next example shows how to derive from an existing style to - customize the look of a graphical element: - - \snippet doc/src/snippets/customstyle/customstyle.h 0 - \codeline - \snippet doc/src/snippets/customstyle/customstyle.cpp 2 - \snippet doc/src/snippets/customstyle/customstyle.cpp 3 - \snippet doc/src/snippets/customstyle/customstyle.cpp 4 - - \section2 QStyle Functions - - The QStyle class defines three functions for drawing the primitive, - control, and complex elements: - \l{QStyle::}{drawPrimitive()}, - \l{QStyle::}{drawControl()}, and - \l{QStyle::}{drawComplexControl()}. The functions takes the - following parameters: - - \list - \li the enum value of the element to draw - \li a QStyleOption which contains the information needed to - draw the element. - \li a QPainter with which to draw the element. - \li a pointer to a QWidget, typically the widget - that the element is painted on. - \endlist - - Not all widgets send a pointer to themselves. If the style - option sent to the function does not contain the information you - need, you should check the widget implementation to see if it - sends a pointer to itself. - - The QStyle class also provides helper functions that are used - when drawing the elements. The \l{QStyle::}{drawItemText()} - function draws text within a specified rectangle and taking a - QPalette as a parameter. The \l{QStyle::}{drawItemPixmap()} - function helps to align a pixmap within a specified bounding - rectangle. - - Other QStyle functions do various calculations for the - functions that draw. The widgets also use these functions for - calculating size hints and also for bounding rectangle - calculations if they draw several style elements themselves. - As with the functions that draw elements the helper functions - typically takes the same arguments. - - \list - \li The \l{QStyle::}{subElementRect()} function takes a - \l{QStyle::}{SubElement} enum value, and calculates a bounding - rectangle for a sub element. The style uses this function to - know where to draw the different parts of an element. This is - mainly done for reuse. If you create a new style, you can use - the same location of sub elements as the super class. - - \li The \l{QStyle::}{subControlRect()} function is used to - calculate bounding rectangles for sub controls in complex - controls. When you implement a new style, you reimplement \c - subControlRect() and calculate the rectangles that are different - from the super class. - - \li The \l{QStyle::}{pixelMetric()} function returns a pixel - metric, which is a style dependent size given in screen - pixels. It takes a value of the \l{QStyle::}{PixelMetric} enum - and returns the correct measure. Note that pixel metrics do - not necessarily have to be static measures, but can be - calculated with, for example, the style option. - - \li The \l{QStyle::}{hitTestComplexControl()} function returns the - sub control that the mouse pointer is over in a complex control. - Usually, this is simply a matter of using - \l{QStyle::}{subControlRect()} to get the bounding rectangles of - the sub controls, and see which rectangle contains the position of - the cursor. - \endlist - - QStyle also have the functions \l{QStyle::}{polish()} and - \l{QStyle::}{unpolish()}. All widgets are sent to the \c polish() - function before being shown and to \c unpolish() when they - are hidden. You can use these functions to set attributes on the - widgets or do other work that is required by your style. For - instance, if you need to know when the mouse is hovering over the - widget, you need to set the \l{Qt::}{WA_Hover} widget attribute. - The State_MouseOver state flag will then be set in the widget's - style options. - - QStyle has a few static helper functions that do some common and - difficult tasks. They can calculate the position of a slider - handle from the value of the slider and transform rectangles - and draw text considering reverse layouts; see the QStyle - class documentation for more details. - - The usual approach when one reimplements QStyle virtual - functions is to do work on elements that are different from the - super class; for all other elements, you can simply use the super - class implementation. - - \section2 The Palette - - Each style provides a color - that is, QBrush - palette that - should be used for drawing the widgets. There is one set of colors - for the different widget states (QPalette::ColorGroup): active - (widgets in the window that has keyboard focus), inactive (widgets - used for other windows), and disabled (widgets that are set - disabled). The states can be found by querying the State_Active - and State_Enabled state flags. Each set contains color certain - roles given by the QPalette::ColorRole enum. The roles describe in - which situations the colors should be used (e.g., for painting - widget backgrounds, text, or buttons). - - How the color roles are used is up to the style. For instance, if - the style uses gradients, one can use a palette color and make it - darker or lighter with QColor::darker() and QColor::lighter() to - create the gradient. In general, if you need a brush that is not - provided by the palette, you should try to derive it from one. - - QPalette, which provides the palette, stores colors for - different widget states and color roles. The palette for a style - is returned by \l{QStyle::}{standardPalette()}. The standard - palette is not installed automatically when a new style is set - on the application (QApplication::setStyle()) or widget - (QWidget::setStyle()), so you must set the palette yourself - with (QApplication::setPalette()) or (QWidget::setPalette()). - - It is not recommended to hard code colors as applications and - individual widgets can set their own palette and also use the - styles palette for drawing. Note that none of Qt's widgets set - their own palette. The java style does hard code some colors, but - its author looks past this in silence. Of course, it is not - intended that the style should look good with any palette. - - \section2 Implementation Issues - - When you implement styles, there are several issues to - consider. We will give some hints and advice on implementation - here. - - When implementing styles, it is necessary to look through the - code of the widgets and code of the base class and its ancestors. - This is because the widgets use the style differently, because the - implementation in the different styles virtual functions can - affect the state of the drawing (e.g., by altering the QPainter - state without restoring it and drawing some elements without using - the appropriate pixel metrics and sub elements). - - It is recommended that the styles do not alter the proposed size - of widgets with the QStyle::sizeFromContents() function but let - the QCommonStyle implementation handle it. If changes need to be - made, you should try to keep them small; application development - may be difficult if the layout of widgets looks considerably - different in the various styles. - - We recommend using the QPainter directly for drawing, i.e., not - use pixmaps or images. This makes it easier for the style conform - to the palette (although you can set your own color table on a - QImage with \l{QImage::}{setColorTable()}). - - It is, naturally, possible to draw elements without using the - style to draw the sub elements as intended by Qt. This is - discouraged as custom widgets may depend on these sub elements to - be implemented correctly. The widget walkthrough shows how Qt - uses the sub elements. - - \section1 Java Style - - We have implemented a style that resembles the Java default look - and feel (previously known as Metal). We have done this as it is - relatively simple to implement and we wanted to build a style for - this overview document. To keep it simple and not to extensive, we - have simplified the style somewhat, but Qt is perfectly able to - make an exact copy of the style. However, there are no concrete - plans to implement the style as a part of Qt. - - In this section we will have a look at some implementation - issues. Finally, we will see a complete example on the styling of - a Java widget. We will continue to use the java style - throughout the document for examples and widget images. The - implementation itself is somewhat involved, and it is not - intended that you should read through it. - - \section2 Design and Implementation - - The first step in designing the style was to select the base - class. We chose to subclass QWindowsStyle. This class implements - most of the functionality we need other than performing the actual - drawing. Also, windows and java share layout of sub controls for - several of the complex controls (which reduces the amount of code - required considerably). - - The style is implemented in one class. We have done this - because we find it convenient to keep all code in one file. Also, - it is an advantage with regards to optimization as we instantiate - less objects. We also keep the number of functions at a minimum by - using switches to identify which element to draw in the functions. - This results in large functions, but since we divide the code for - each element in the switches, the code should still be easy to - read. - - \section2 Limitations and Differences from Java - - We have not fully implemented every element in the Java style. - This way, we have reduced the amount and complexity of the code. - In general, the style was intended as a practical example for - this style overview document, and not to be a part of Qt - itself. - - Not all widgets have every state implemented. This goes for - states that are common, e.g., State_Disabled. Each state is, - however, implemented for at least one widget. - - We have only implemented ticks below the slider. Flat push - buttons are also left out. We do not handle the case where the - title bars and dock window titles grows to small for their - contents, but simply draw sub controls over each other. - - We have not tried to emulate the Java fonts. Java and Qt use very - different font engines, so we don't consider it worth the effort - as we only use the style as an example for this overview. - - We have hardcoded the colors (we don't use the QPalette) for - the linear gradients, which are used, for example, for button - bevels, tool bars, and check boxes. This is because the Java - palette cannot produce these colors. Java does not change these - colors based on widget color group or role anyway (they are not - dependent on the palette), so it does not present a problem in any - case. - - It is Qt's widgets that are styled. Some widgets do not exist - at all in Java, e.g., QToolBox. Others contain elements that the - Java widgets don't. The tree widget is an example of the latter in - which Java's JTree does not have a header. - - The style does not handle reverse layouts. We assume that the - layout direction is left to right. QWindowsStyle handles reverse - widgets; if we implemented reverse layouts, widgets that we change - the position of sub elements, or handle text alignment in labels - our selves would need to be updated. - - \section2 Styling Java Check Boxes - - As an example, we will examine the styling of check boxes in the - java style. We describe the complete process and print all code in - both the java style and Qt classes involved. In the rest of this - document, we will not examine the source code of the individual - widgets. Hopefully, this will give you an idea on how to search - through the code if you need to check specific implementation - details; most widgets follow the same structure as the check - boxes. We have edited the QCommonStyle code somewhat to remove - code that is not directly relevant for check box styling. - - We start with a look at how QCheckBox builds it style option, - which is QStyleOptionButton for checkboxes: - - \snippet doc/src/snippets/code/doc_src_styles.cpp 0 - - First we let QStyleOption set up the option with the information - that is common for all widgets with \c initFrom(). We will look at - this shortly. - - The down boolean is true when the user press the box down; this is - true whether the box is checked or not of the checkbox. The - State_NoChange state is set when we have a tristate checkbox and - it is partially checked. It has State_On if the box is checked and - State_Off if it is unchecked. State_MouseOver is set if the mouse - hovers over the checkbox and the widget has attribute Qt::WA_Hover - set - you set this in QStyle::polish(). In addition, the style - option also contains the text, icon, and icon size of the button. - - \l{QStyleOption::}{initFrom()} sets up the style option with the - attributes that are common for all widgets. We print its - implementation here: - - \snippet doc/src/snippets/code/doc_src_styles.cpp 1 - - The State_Enabled is set when the widget is enabled. When the - widget has focus the State_HasFocus flag is set. Equally, the - State_Active flag is set when the widget is a child of the active - window. The State_MouseOver will only be set if the widget has - the WA_HoverEnabled windows flag set. Notice that keypad - navigation must be enabled in Qt for the State_HasEditFocus to - be included; it is not included by default. - - In addition to setting state flags the QStyleOption contains - other information about the widget: \c direction is the layout - direction of the layout, \c rect is the bounding rectangle of the - widget (the area in which to draw), \c palette is the QPalette - that should be used for drawing the widget, and \c fontMetrics is - the metrics of the font that is used by the widget. - - We give an image of a checkbox and the style option to match - it. - - \image javastyle/checkboxexample.png A java style checkbox - - The above checkbox will have the following state flags in its - style option: - - \table 90% - \header - \li State flag - \li Set - \row - \li State_Sunken - \li Yes - \row - \li State_NoChange - \li No - \row - \li State_On - \li Yes - \row - \li State_Off - \li No - \row - \li State_MouseOver - \li Yes - \row - \li State_Enabled - \li Yes - \row - \li State_HasFocus - \li Yes - \row - \li State_KeyboardFocusChange - \li No - \row - \li State_Active - \li Yes - \endtable - - The QCheckBox paints itself in QWidget::paintEvent() with - style option \c opt and QStylePainter \c p. The QStylePainter - class is a convenience class to draw style elements. Most - notably, it wraps the methods in QStyle used for painting. The - QCheckBox draws itself as follows: - - \snippet doc/src/snippets/code/doc_src_styles.cpp 2 - - QCommonStyle handles the CE_CheckBox element. The QCheckBox - has two sub elements: SE_CheckBoxIndicator (the checked indicator) - and SE_CheckBoxContents (the contents, which is used for the - checkbox label). QCommonStyle also implements these sub element - bounding rectangles. We have a look at the QCommonStyle code: - - \snippet doc/src/snippets/code/doc_src_styles.cpp 3 - - As can be seen from the code extract, the common style gets - the bounding rectangles of the two sub elements of - CE_CheckBox, and then draws them. If the checkbox has focus, - the focus frame is also drawn. - - The java style draws CE_CheckBoxIndicator, while QCommonStyle - handles CE_CheckboxLabel. We will examine each implementation and - start with CE_CheckBoxLabel: - - \snippet doc/src/snippets/code/doc_src_styles.cpp 4 - - \l{QStyle::}{visualAlignment()} adjusts the alignment of text - according to the layout direction. We then draw an icon if it - exists, and adjust the space left for the text. - \l{QStyle::}{drawItemText()} draws the text taking alignment, - layout direction, and the mnemonic into account. It also uses the - palette to draw the text in the right color. - - The drawing of labels often get somewhat involved. Luckily, it - can usually be handled by the base class. The java style - implements its own push button label since Java-contrary to - windows-center button contents also when the button has an icon. - You can examine that implementation if you need an example of - reimplementing label drawing. - - We take a look at the java implementation - of CE_CheckBoxIndicator in \c drawControl(): - - \snippet doc/src/snippets/javastyle.cpp 0 - - We first save the state of the painter. This is not always - necessary but in this case the QWindowsStyle needs the painter in - the same state as it was when PE_IndicatorCheckBox was called (We - could also set the state with function calls, of course). We then - use \c drawButtonBackground() to draw the background of the check - box indicator. This is a helper function that draws the background - and also the frame of push buttons and check boxes. We take a look - at that function below. We then check if the mouse is hovering - over the checkbox. If it is, we draw the frame java checkboxes - have when the box is not pressed down and the mouse is over it. - You may note that java does not handle tristate boxes, so we have - not implemented it. - - Here we use a png image for our indicator. We could also check - here if the widget is disabled. We would then have to use - another image with the indicator in the disabled color. - - \snippet doc/src/snippets/javastyle.cpp 1 - - We have seen how check boxes are styled in the java style from the - widget gets a paint request to the style is finished painting. To - learn in detail how each widget is painted, you need to go through - the code step-by-step as we have done here. However, it is - usually enough to know which style elements the widgets draw. The - widget builds a style option and calls on the style one or more - times to draw the style elements of which it consists. Usually, - it is also sufficient to know the states a widget can be in and the - other contents of the style option, i.e., what we list in the next - section. - - \section1 Widget Walkthrough - - In this section, we will examine how most of Qt's widgets are - styled. Hopefully, this will save you some time and effort while - developing your own styles and widgets. You will not find - information here that is not attainable elsewhere (i.e., by - examining the source code or the class descriptions for the style - related classes). - - We mostly use java style widgets as examples. The java style does not - draw every element in the element trees. This is because they are - not visible for that widget in the java style. We still make sure - that all elements are implemented in a way that conforms with the - java style as custom widgets might need them (this does not - exclude leaving implementations to QWindowsStyle though). - - The following is given for each widget: - - \list - \li A table with the members (variables, etc.) of its style option. - \li A table over the state flags (QStyle::StateFlag) that - can be set on the widget and when the states are set. - \li Its element tree (see section \l{The Style Elements}). - \li An image of the widget in which the elements are outlined. - \omit This is not written yet - probably never will be - either - \li List of style hints that should be checked for the - widget. - \li List of standard pixmaps that could be used by the - elements. - \endomit - \endlist - - The element tree contains the primitive, control, and complex - style elements. By doing a top-down traversal of the element tree, - you get the sequence in which the elements should be drawn. In the - nodes, we have written the sub element rectangles, sub control - elements, and pixel metrics that should be considered when drawing - the element of the node. - - Our approach on styling center on the drawing of the widgets. The - calculations of sub elements rectangles, sub controls, and pixel - metrics used \b during drawing is only listed as contents in - the element trees. Note that there are rectangles and pixel - metrics that are only used by widgets. This leaves these - calculations untreated in the walkthrough. For instance, the - \l{QStyle::}{subControlRect()} and - \l{QStyle::}{sizeFromContents()} functions often call - \l{QStyle::}{subElementRect()} to calculate their bounding - rectangles. We could draw trees for this as well. However, how - these calculations are done is completely up to the individual - styles, and they do not have to follow a specific structure (Qt - does not impose a specific structure). You should still make sure - that you use the appropriate pixel metrics, though. To limit the - size of the document, we have therefore chosen not to include - trees or describe the calculations made by the Java (or any other) - style. - - You may be confused about how the different pixel metrics, sub - element rectangles, and sub control rectangles should be used when - examining the trees. If you are in doubt after reading the QStyle - enum descriptions, we suggest that you examine the QCommonStyle - and QWindowsStyle implementations. - - Some of the bounding rectangles that we outline in the widget - images are equal. Reasons for this are that some elements draw - backgrounds while others draw frames and labels. If in doubt, - check the description of each element in QStyle. Also, some - elements are there to layout, i.e., decide where to draw, other - elements. - - \section2 Common Widget Properties - - Some states and variables are common for all widgets. These are - set with QStyleOption::initFrom(). Not all elements use this function; - it is the widgets that create the style options, and for some - elements the information from \l{QStyleOption::}{initFrom()} is not - necessary. - - A table with the common states follows: - - \table 90% - \header - \li State - \li State Set When - \row - \li State_Enabled - \li Set if the widget is not disabled (see - QWidget::setEnabled()) - \row - \li State_Focus - \li Set if the widget has focus (see - QWidget::hasFocus()) - \row - \li State_KeyobordFocusChange - \li Set when the user changes focus with the keyboard - (see Qt::WA_KeyboardFocusChange) - \row - \li State_MouseOver - \li Set if the mouse cursor is over the widget - \row - \li State_Active - \li Set if the widget is a child of the active window. - \row - \li State_HasEditFocus - \li Set if the widget has the edit focus - \endtable - - The other common members for widgets are: - - \table 90% - \header - \li Member - \li Content - \row - \li rect - \li The bounding rectangle of the element to draw. This - is set to the widget bounding rectangle - (QWidget::rect()). - \row - \li direction - \li The layout direction; a value of the - Qt::LayoutDirection enum. - \row - \li palette - \li The QPalette to use when drawing the element. This - is set to the widgets palette (QWidget::palette()). - \row - \li fontMetrics - \li The QFontMetrics to use when drawing text on the - widget. - \endtable - - The complex style options (classes that inherit - QStyleOptionComplex) used for complex style elements share two - variables: \l{QStyleOptionComplex::}{subControls} and - \l{QStyleOptionComplex::}{activeSubControls}. Both variables are - an OR'ed combination of QStyle::SubControl enum values. They - indicate which sub controls the complex control consists of and - which of these controls are currently active. - - As mentioned, the style calculates the size of the widgets - contents, which the widgets calculate their size hints from. In - addition, complex controls also use the style to test which - sub-controls the mouse is over. - - \section2 Widget Reference - - Without further delay, we present the widget walkthrough; each - widget has its own sub-section. - - \section3 Push Buttons - - The style structure for push buttons is shown below. By doing a - top-down traversal of the tree, you get the sequence in which the - elements should be drawn. - - \image javastyle/pushbutton.png The style structure for push buttons - - The layout of the buttons, with regard element bounds, varies from - style to style. This makes it difficult to show conceptual images - of this. Also, elements may - even be intended to - have the same - bounds; the PE_PushButtonBevel, for instance, is used in - QCommonStyle to draw the elements that contains it: - PE_FrameDefaultButton, PE_FrameButtonBevel, and - PE_PanelButtonCommand, all of which have the same bounds in common - and windows style. PE_PushButtonBevel is also responsible for - drawing the menu indicator (QCommonStyle draws - PE_IndicatorArrowDown). - - An image of a push button in the java style that show the bounding - rectangles of the elements is given below. Colors are used to - separate the bounding rectangles in the image; they do not fill - any other purpose. This is also true for similar images for the - other widgets. - - \image javastyle/button.png - - The java style, as well as all other styles implemented in Qt, - does not use PE_FrameButtonBevel. It is usual that a button - with a PE_DefaultFrame adjusts the PE_PanelButtonCommand's - rectangle by PM_ButtonDefaultIndicator. The CE_PushButtonLabel - is found by adjusting the rect by PM_DefaultFrameWidth. - - We will now examine the style option for push - buttons - QStyleOptionButton. A table for the states that - QPushButton can set on the style option follows: - - \table 90% - \header - \li State - \li State Set When - \row - \li State_Sunken - \li Button is down or menu is pressed shown - \row - \li State_On - \li Button is checked - \row - \li State_Raised - \li Button is not flat and not pressed down - \endtable - - Other members of QStyleOptionButton is: - - \table 90% - \header - \li Member - \li Content - \row - \li features - \li Flags of the QStyleOptionButton::ButtonFeatures enum, - which describes various button properties (see enum) - \row - \li icon - \li The buttons QIcon (if any) - \row - \li iconSize - \li The QSize of the icon - \row - \li text - \li a QString with the buttons text - \endtable - - \section3 Check and Radio Buttons - - The structures for radio and check buttons are identical. - We show the structure using QCheckBox element and pixel - metric names: - - \image javastyle/checkbox.png - - QStyleOptionButton is used as the style option for both check - and radio buttons. We first give a table of the states that - can be set in the option: - - \table 90% - \header - \li State - \li State Set When - \row - \li State_sunken - \li The box is pressed down - \row - \li State_NoChange - \li The box is partially checked (for tristate - checkboxes.) - \row - \li State_On - \li The box is checked - \row - \li State_Off - \li The box is unchecked - \endtable - - See \l{Push Buttons} for a table over other members in the - QStyleOptionButtonClass. - - \section3 Tabs - - In Qt, QTabBar uses the style to draw its tabs. Tabs exist either - in a QTabWidget, which contains a QTabBar, or as a separate bar. - If the bar is not part of a tab widget, it draws its own base. - - QTabBar lays out the tabs, so the style does not have control over - tab placement. However, while laying out its tabs, the bar asks - the style for PM_TabBarTabHSpace and PM_TabBarTabVSpace, which is - extra width and height over the minimum size of the tab bar tab - label (icon and text). The style can also further influence the - tab size before it is laid out, as the tab bar asks for - CT_TabBarTab. The bounding rectangle of the bar is decided by the - tab widget when it is part of the widget (still considering - CT_TabBarTab). - - The tab bar is responsible for drawing the buttons that appear on - the tab bar when all tabs do not fit. Their placement is not - controlled by the style, but the buttons are \l{QToolButton}s - and are therefore drawn by the style. - - Here is the style structure for QTabWidget and QTabBar: - - \image javastyle/tab.png - - The dotted lines indicate that the QTabWidget contains a tab bar, - but does not draw it itself, that QTabBar only draws its base line - when not part of a tab widget, and that the tab bar keeps two tool - buttons that scroll the bar when all tabs do not fit; see \l{Tool - Buttons} for their element tree. Also note that since the buttons - are children of the tab bar, they are drawn after the bar. The - tabs bounding rectangles overlap the base by PM_TabBarBaseOverlap. - - Here is a tab widget in the java style: - - \image javastyle/tabwidget.png - - In the java style (and also windows), the tab bar shape and label - have the same bounding rectangle as CE_TabBarTab. Notice that the - tabs overlap with the tab widget frame. The base of the tab bar - (if drawn) is the area where the tabs and frame overlap. - - The style option for tabs (QStyleOptionTab) contains the necessary - information for drawing tabs. The option contains the position of - the tab in the tab bar, the position of the selected tab, the - shape of the tab, the text, and icon. After Qt 4.1 the option - should be cast to a QStyleOptionTabV2, which also contains the - icons size. - - As the java style tabs don't overlap, we also present an image of - a tab widget in the windows style. Note that if you want the tabs - to overlap horizontally, you do that when drawing the tabs in - CE_TabBarTabShape; the tabs bounding rectangles will not be - altered by the tab bar. The tabs are drawn from left to right in a - north tab bar shape, top to bottom in an east tab bar shape, etc. - The selected tab is drawn last, so that it is easy to draw it over - the other tabs (if it is to be bigger). - - \image javastyle/windowstabimage.png - - A table of the states a tab bar can set on its tabs follows: - - \table 90% - \header - \li State - \li State Set When - \row - \li State_Sunken - \li The tab is pressed on with the mouse. - \row - \li State_Selected - \li If it is the current tab. - \row - \li State_HasFocus - \li The tab bar has focus and the tab is selected - \endtable - - Note that individual tabs may be disabled even if the tab bar - is not. The tab will be active if the tab bar is active. - - Here follows a table of QStyleOptionTabV2's members: - - \table 90% - \header - \li Member - \li Content - \row - \li cornerWidgets - \li Is flags of the CornerWidget enum, which indicate - if and which corner widgets the tab bar has. - \row - \li icon - \li The QIcon of the tab - \row - \li iconSize - \li The QSize of the icon - \row - \li position - \li A TabPosition enum value that indicates the tabs - position on the bar relative to the other tabs. - \row - \li row - \li holds which row the tab is in - \row - \li selectedPosition - \li A value of the SelectedPosition enum that indicates - whether the selected tab is adjacent to or is the - tab. - \row - \li shape - \li A value of the QTabBar::Shape enum indication - whether the tab has rounded or triangular corners - and the orientation of the tab. - \row - \li text - \li The tab text - \endtable - - The frame for tab widgets use QStyleOptionTabWidgetFrame as - style option. We list its members here. It does not have - states set besides the common flags. - - \table 90% - \header - \li Member - \li content - \row - \li leftCornerWidgetSize - \li The QSize of the left corner widget (if any). - \row - \li rightCornerWidgetSize - \li The QSize of the right corner widget (if any). - \row - \li lineWidth - \li holds the line with for drawing the panel. - \row - \li midLineWith - \li this value is currently always 0. - \row - \li shape - \li The shape of the tabs on the tab bar. - \row - \li tabBarSize - \li The QSize of the tab bar. - \endtable - - \section3 Scroll Bars - - Here is the style structure for scrollBars: - - \image javastyle/scrollbar.png - - QScrollBar simply creates its style option and then draws - CC_ScrollBar. Some styles draw the background of add page and sub - page with PE_PanelButtonBevel and also use indicator arrows to - draw the arrows in the nest and previous line indicators; we have - not included these in the tree as their use is up to the - individual style. The style's PM_MaximumDragDistance is the - maximum distance in pixels the mouse can move from the bounds - of the scroll bar and still move the handle. - - Here is an image of a scrollbar in the java style: - - \image javastyle/scrollbarimage.png - - You may notice that the scrollbar is slightly different from - Java's as it has two line up indicators. We have done this to show - how that you can have two separate bounding rectangles for a - single sub control. The scroll bar is an example of a widget that - is entirely implemented by the java style - neither QWindowsStyle - nor QCommonStyle are involved in the drawing. - - We have a look at the different states a scroll bar can set on - the style option: - - \table 90% - \header - \li State - \li State Set When - \row - \li State_Horizontal - \li The scroll bar is horizontal - \endtable - - The style option of QScrollBar is QStyleOptionSlider. Its - members are listed in the following table. The option is used - by all \l{QAbstractSlider}s; we only describe the members - relevant for scroll bars here. - - \table 90% - \header - \li Member - \li Content - \row - \li maximum - \li the maximum value of the scroll bar - \row - \li minimum - \li the minimum value of the scroll bar - \row - \li notchTarget - \li the number of pixels between notches - \row - \li orientation - \li a value of the Qt::Orientation enum that specifies - whether the scroll bar is vertical or horizontal - \row - \li pageStep - \li the number to increase or decrease the sliders - value (relative to the size of the slider and its value - range) on page steps. - \row - \li singleStep - \li the number to increase or decrease the sliders - value on single (or line) steps - \row - \li sliderValue - \li The value of the slider - \row - \li sliderPosition - \li the position of the slider handle. This is the same - as \c sliderValue if the scroll bar is - QAbstractSlider::tracking. If not, the scroll - bar does not update its value before the mouse - releases the handle. - \row - \li upsideDown - \li holds the direction in which the scroll bar - increases its value. This is used instead of - QStyleOption::direction for all abstract sliders. - \endtable - - \section3 Sliders - - When calculating the sliders size hint, PM_SliderTickness and - PM_SliderLength is queried from the style. As with scroll bars, - the QSlider only lets the user move the handle if the mouse is - within PM_MaximumDragDistance from the slider bounds. When it - draws itself it creates the style option and calls \c - drawComplexControl() with CC_Slider: - - \image javastyle/slider.png - - We also show a picture of a slider in the java style. We show - the bounding rectangles of the sub elements as all drawing is done - in CC_Slider. - - \image javastyle/sliderimage.png - - QSlider uses QStyleOptionSlider as all \l{QAbstractSlider}s do. We - present a table with the members that affect QSlider: - - \table 90% - \header - \li Member - \li Content - \row - \li maximum - \li the maximum value of the slider - \row - \li minimum - \li the minimum value of the slider - \row - \li notchTarget - \li this is the number of pixels between each notch - \row - \li orientation - \li a Qt::Orientation enum value that gives whether the - slider is vertical or horizontal. - \row - \li pageStep - \li a number in slider value to increase or decrease - for page steps - \row - \li singleStep - \li the number to increase or decrease the sliders - value on single (or line) steps. - \row - \li sliderValue - \li the value of the slider. - \row - \li sliderPosition - \li the position of the slider given as a slider value. - This will be equal to the \c sliderValue if the - slider is \l{QAbstractSlider::}{tracking}; if - not, the sliders value will not change until the handle is - released with the mouse. - \row - \li upsideDown - \li this member is used instead of QStyleOption::direction - for all abstract sliders. - \endtable - - You should note that the slider does not use direction for - reverse layouts; it uses \c upsideDown. - - \section3 Spin Boxes - - When QSpinBox paints itself it creates a QStyleOptionSpinBox and - asks the style to draw CC_SpinBox. The edit field is a line - edit that is a child of the spin box. The dimensions of the - field is calculated by the style with SC_SpinBoxEditField. - - Here follows the style tree for spin boxes. It is not - required that a style uses the button panel primitive to paint - the indicator backgrounds. You can see an image below the tree - showing the sub elements in QSpinBox in the java style. - - \image javastyle/spinbox.png - - \image javastyle/spinboximage.png - - The QStyleOptionSpinBox, which is the style option for spin - boxes. It can set the following states on the spin box.: - - \table 90% - \header - \li State - \li State Set When - \row - \li State_Sunken - \li Is set if one of the sub controls CC_SpinUp or - CC_SpinDown is pressed on with the mouse. - \endtable - - The rest of the members in the spin boxes style options are: - - \table 90% - \header - \li Property - \li Function - \row - \li frame - \li boolean that is true if the spin box is to draw a - frame. - \row - \li buttonSymbols - \li Value of the ButtonSymbols enum that decides the - symbol on the up/down buttons. - \row - \li stepEnabled - \li A value of the StepEnabled indication which of the - spin box buttons are pressed down. - \endtable - - \section3 Title Bar - - The title bar complex control, CC_TitleBar, is used to draw - the title bars of internal windows in QMdiArea. It typically - consists of a window title and close, minimize, system menu, and - maximize buttons. Some styles also provide buttons for shading - the window, and a button for context sensitive help. - - The bar is drawn in CC_TitleBar without using any sub elements. - How the individual styles draw their buttons is individual, but - there are standard pixmaps for the buttons that the style should - provide. - - \image javastyle/titlebar.png - - In an image over a title bar in the java style, we show the - bounding rectangles of the sub elements supported by the java style - (all of which are drawn with standard pixmaps). It is usual to - draw the button backgrounds using PE_PanelButtonTool, but it's no - rule. - - \image javastyle/titlebarimage.png - - The style option for title bars is QStyleOptionTitleBar. It's - members are: - - \table 90% - \header - \li Member - \li Content - \row - \li icon - \li The title bars icon - \row - \li text - \li the text for the title bar's label - \row - \li windowFlags - \li flags of the Qt::WindowFlag enum. The window flags - used by QMdiArea for window management. - \row - \li titleBarState - \li this is the QWidget::windowState() of the window - that contains the title bar. - \endtable - - \section3 Combo Box - - A QComboBox uses the style to draw the button and label of - non-editable boxes with CC_ComboBox and CE_ComboBoxLabel. - - The list that pops up when the user clicks on the combo box is - drawn by a \l{Delegate Classes}{delegate}, which we do not cover - in this overview. You can, however, use the style to control the - list's size and position with the sub element - SC_ComboBoxListBoxPopup. The style also decides where the edit - field for editable boxes should be with SC_ComboBoxEditField; the - field itself is a QLineEdit that is a child of the combo box. - - \image javastyle/combobox.png - - We show an image over a java style combo box in which we have - outlined its sub elements and sub element rectangles: - - \image javastyle/comboboximage.png - - Java combo boxes do not use the focus rect; it changes its - background color when it has focus. The SC_ComboBoxEdit field is - used both by QComboBox to calculate the size of the edit field and - the style for calculating the size of the combo box label. - - The style option for combo boxes is QStyleOptionComboBox. It - can set the following states: - - \table 90% - \header - \li State - \li Set When - \row - \li State_Selected - \li The box is not editable and has focus - \row - \li State_Sunken - \li SC_ComboBoxArrow is active - \row - \li State_on - \li The container (list) of the box is visible - \endtable - - The style options other members are: - - \table - \header - \li Member - \li Content - \row - \li currentIcon - \li the icon of the current (selected) item of the - combo box. - \row - \li currentText - \li the text of the current item in the box. - \row - \li editable - \li holds whether the combo box is editable or not - \row - \li frame - \li holds whether the combo box has a frame or not - \row - \li iconSize - \li the size of the current items icon. - \row - \li popupRect - \li the bounding rectangle of the combo box's popup - list. - \endtable - - \section3 Group Boxes - - When calculating the size hint, QGroupBox fetches three pixel - metrics from the style: PM_IndicatorWidth, - PM_CheckBoxLabelSpacing, and PM_IndicatorHeight. QGroupBox has - the following style element tree: - - \image javastyle/groupbox.png - - Qt does not impose restrictions on how the check box is drawn; the - java style draws it with CE_IndicatorCheckBox. See \l{Check and - Radio Buttons} for the complete tree. - - We also give an image of the widget with the sub controls and - sub control rectangles drawn: - - \image javastyle/groupboximage.png - - The style option for group boxes are QStyleOptionGroupBox. The - following states can be set on it: - - \table 90% - \header - \li State - \li Set When - \row - \li State_On - \li The check box is checked - \row - \li State_Sunken - \li The checkbox is pressed down - \row - \li State_Off - \li The check box is unchecked (or there is no check box) - \endtable - - The remaining members of QStyleOptionGroupBox are: - - \table - \header - \li Member - \li Content - \row - \li features - \li flags of the QStyleOptionFrameV2::FrameFeatures - enum describing the frame of the group box. - \row - \li lineWidth - \li the line width with which to draw the panel. This - is always 1. - \row - \li text - \li the text of the group box. - \row - \li textAlignment - \li the alignment of the group box title - \row - \li textColor - \li the QColor of the text - \endtable - - \section3 Splitters - - As the structure of splitters are simple and do not contain any - sub elements, we do not include image of splitters. CE_Splitter - does not use any other elements or metrics. - - For its style option, Splitters uses the base class QStyleOption. - It can set the following state flags on it: - - \table 90% - \header - \li State - \li Set When - \row - \li State_Horizontal - \li Set if it is a horizontal splitter - \endtable - - QSplitter does not use \l{QStyleOption::}{initFrom()} to set up its - option; it sets the State_MouseOver and State_Disabled flags - itself. - - \section3 Progress Bar - - The CE_ProgressBar element is used by QProgressBar, and it is the - only element used by this widget. We start with looking at the - style structure: - - \image javastyle/progressbar.png - - Here is a progress bar in the windows style (the java style - bounding rectangles are equal): - - \image javastyle/progressbarimage.png - - The style option for QProgressBar is QStyleOptionProgressBarV2. - The bar does not set any state flags, but the other members of the - option are: - - \table 90% - \header - \li Member - \li Content - \row - \li minimum - \li The minimum value of the bar - \row - \li maximum - \li The maximum value of the bar - \row - \li progress - \li The current value of the bar - \row - \li textAlignment - \li How the text is aligned in the label - \row - \li textVisible - \li Whether the label is drawn - \row - \li text - \li The label text - \row - \li orientation - \li Progress bars can be vertical or horizontal - \row - \li invertedAppearance - \li The progress is inverted (i.e., right to left in a - horizontal bar) - \row - \li bottomToTop - \li Boolean that if true, turns the label of vertical - progress bars 90 degrees. - \endtable - - \section3 Tool Buttons - - Tool buttons exist either independently or as part of tool bars. - They are drawn equally either way. The QToolButton draws only one - style element: CC_ToolButton. - - As you must be used to by now (at least if you have read this - document sequentially), we have a tree of the widget's style - structure: - - \image javastyle/toolbutton.png - - Note that PE_FrameButtonTool and PE_IndicatorArrowDown are - included in the tree as the java style draws them, but they can - safely be omitted if you prefer it. The structure may also be - different. QWindowsStyle, for instance, draws both - PE_IndicatorButtonDropDown and PE_IndicatorArrowDown in - CE_ToolButton. - - We also have an image of a tool button where we have outlined - the sub element bounding rectangles and sub controls. - - \image javastyle/toolbuttonimage.png - - Here is the states table for tool buttons: - - \table 90% - \header - \li State - \li Set When - \row - \li State_AutoRise - \li the tool button has the autoRise property set - \row - \li State_raised - \li the button is not sunken (i.e., by being checked or - pressed on with the mouse). - \row - \li State_Sunken - \li the button is down - \row - \li State_On - \li the button is checkable and checked. - \endtable - - QStyleOptionToolButton also contains the following members: - - \table - \header - \li Member - \li Content - \row - \li arrowType - \li a Qt::ArrowType enum value, which contains the - direction of the buttons arrow (if an arrow is to - be used in place of an icon) - \row - \li features - \li flags of the QStyleOptionToolButton::ButtonFeature - enum describing if the button has an arrow, a menu, - and/or has a popup-delay. - \row - \li font - \li the QFont of the buttons label - \row - \li icon - \li the QIcon of the tool button - \row - \li iconSize - \li the icon size of the button's icon - \row - \li pos - \li the position of the button, as given by - QWidget::pos() - \row - \li text - \li the text of the button - \row - \li toolButtonStyle - \li a Qt::ToolButtonStyle enum value which decides - whether the button shows the icon, the text, or both. - \endtable - - \section3 Toolbars - - Toolbars are part of the \l{QMainWindow}{main window framework} - and cooperates with the QMainWindow to which it belongs while it - builds its style option. A main window has 4 areas that toolbars - can be placed in. They are positioned next to the four sides of - the window (i.e., north, south, west, and east). Within each area - there can be more than one line of toolbars; a line consists of - toolbars with equal orientation (vertical or horizontal) placed - next to each other. - - \l{QToolbar}{QToolbar}s in Qt consists of three elements - CE_ToolBar, PE_IndicatorToolBarHandle, and - PE_IndicatorToolBarSeparator. It is QMainWindowLayout that - calculates the bounding rectangles (i.e., position and size of the - toolbars and their contents. The main window also uses the \c - sizeHint() of the items in the toolbars when calculating the size - of the bars. - - Here is the element tree for QToolBar: - - \image javastyle/toolbar.png - - The dotted lines indicate that the QToolBar keeps an instance of - QToolBarLayout and that QToolBarSeparators are kept by - QToolBarLayout. When the toolbar is floating (i.e., has its own - window) the PE_FrameMenu element is drawn, else QToolbar draws - CE_ToolBar. - - Here is an image of a toolbar in the java style: - - \image javastyle/toolbarimage.png - - QToolBarSaparator uses QStyleOption for their style option. It - sets the State_horizontal flag if the toolbar they live in is - horizontal. Other than that, they use \l{QStyleOption::}{initFrom()}. - - The style option for QToolBar is QStyleOptionToolBar. The only - state flag set (besides the common flags) is State_Horizontal - if the bar is horizontal (i.e., in the north or south toolbar area). - The member variables of the style option are: - - \table 90% - \header - \li Member - \li Content - \row - \li features - \li Holds whether the bar is movable in a value of the - ToolBarFeature, which is either Movable or None. - \row - \li lineWidth - \li The width of the tool bar frame. - \row - \li midLineWidth - \li This variable is currently not used and is always - 0. - \row - \li positionOfLine - \li The position of the toolbar line within the toolbar - area to which it belongs. - \row - \li positionWithinLine - \li The position of the toolbar within the toolbar line. - \row - \li toolBarArea - \li The toolbar area in which the toolbar lives. - \endtable - - \section3 Menus - - Menus in Qt are implemented in QMenu. The QMenu keeps a list of - action, which it draws as menu items. When QMenu receives paint - events ,it calculates the size of each menu item and draws them - individually with CE_MenuItem. (Menu items do not have a separate - element for their label (contents), so all drawing is done in - CE_MenuItem. The menu also draws the frame of the menu with - PE_FrameMenu. It also draws CE_MenuScroller if the style supports - scrolling. CE_MenuTearOff is drawn if the menu is to large for its - bounding rectangle. - - In the style structure tree, we also include QMenu as it also does - styling related work. The bounding rectangles of menu items are - calculated for the menus size hint and when the menu is displayed - or resized. - - \image javastyle/menu.png - - The CE_MenuScroller and CE_MenuTearOff elements are handled by - QCommonStyle and are not shown unless the menu is to large to fit - on the screen. PE_FrameMenu is only drawn for pop-up menus. - - QMenu calculates rectangles based on its actions and calls - CE_MenuItem and CE_MenuScroller if the style supports that. - - It is also usual to use PE_IndicatorCheckBox (instead of using - PE_IndicatorMenuCheckMark) and PE_IndicatorRadioButton for drawing - checkable menu items; we have not included them in the style tree - as this is optional and varies from style to style. - - \image javastyle/menuimage.png - - The style option for menu items is QStyleOptionMenuItem. The - following tables describe its state flags and other members. - - \table 90% - \header - \li State - \li Set When - \row - \li State_Selected - \li The mouse is over the action and the action is not - a separator. - \row - \li State_Sunken - \li The mouse is pressed down on the menu item. - \row - \li State_DownArrow - \li Set if the menu item is a menu scroller and it scrolls - the menu downwards. - \endtable - - \table 90% - \header - \li Member - \li Content - \row - \li checkType - \li A value of the \l{QStyleOptionMenuItem::}{CheckType} enum, - which is either NotCheckable, Exclusive, or - NonExclusive. - \row - \li checked - \li Boolean that is true if the menu item is checked. - \row - \li font - \li The QFont to use for the menu item's text. - \row - \li icon - \li the QIcon of the menu item. - \row - \li maxIconWidth - \li The maximum width allowed for the icon - \row - \li menuHasChecableItem - \li Boolean which is true if at least one item in the - menu is checkable. - \row - \li menuItemType - \li The type of the menu item. This a value of the - \l{QStyleOptionMenuItem::}{MenuItemType}. - \row - \li menuRect - \li The bounding rectangle for the QMenu that the menu - item lives in. - \row - \li tabWidth - \li This is the distance between the text of the menu - item and the shortcut. - \row - \li text - \li The text of the menu item. - \endtable - - The setup of the style option for CE_MenuTearOff and - CE_MenuScroller also uses QStyleOptionMenuItem; they only set the - \c menuRect variable in addition to the common settings with - QStyleOption's \l{QStyleOption::}{initFrom()}. - - \section3 Menu Bar - - QMenuBar uses the style to draw each menu bar item and the empty - area of the menu bar. The pull-down menus themselves are - \l{QMenu}s (see \l{Menus}). The style element tree for the menu - bar follows: - - \image javastyle/menubar.png - - The panel and empty area is drawn after the menu items. The - QPainter that the QMenuBar sends to the style has the bounding - rectangles of the items clipped out (i.e., clip region), so you - don't need to worry about drawing over the items. The pixel - metrics in QMenuBar is used when the bounding rectangles of the - menu bar items are calculated. - - \image javastyle/menubarimage.png - - QStyleOptionMenuItem is used for menu bar items. The members that - are used by QMenuBar is described in the following table: - - \table - \header - \li Member - \li Content - \row - \li menuRect - \li the bounding rectangle of the entire menu bar to - which the item belongs. - \row - \li text - \li the text of the item - \row - \li icon - \li the icon of the menu item (it is not common that - styles draw this icon) - \endtable - - QStyleOptionMenuItem is also used for drawing CE_EmptyMenuBarArea. - - QStyleOptionFrame is used for drawing the panel frame The - \l{QStyleOptionFrame::}{lineWidth} is set to PM_MenuBarPanelWidth. - The \l{QStyleOptionFrame::}{midLineWidth} is currently always set - to 0. - - \section3 Item View Headers - - It is the style that draws the headers of Qt's item views. The - item views keeps the dimensions on individual sections. Also - note that the delegates may use the style to paint decorations - and frames around items. QItemDelegate, for instance, draws - PE_FrameFocusRect and PE_IndicatorViewItemCheck. - - \image javastyle/header.png - - Here is a QTableWidget showing the bounding rects of a Java - header: - - \image javastyle/headerimage.png - - The QHeaderView uses CT_HeaderSection, PM_HeaderMargin and - PM_HeaderGripMargin for size and hit test calculations. The - PM_HeaderMarkSize is currently not used by Qt. QTableView draws - the button in the top-left corner (i.e., the area where the - vertical and horizontal headers intersect) as a CE_Header. - - The style option for header views is QStyleOptionHeader. The view - paints one header section at a time, so the data is for the - section being drawn. Its contents are: - - \table 90% - \header - \li Member - \li Content - \row - \li icon - \li the icon of the header (for section that is being - drawn). - \row - \li iconAlignment - \li the alignment (Qt::Alignment) of the icon in the header. - \row - \li orientation - \li a Qt::Orientation value deciding whether the header - is the horizontal header above the view or the - vertical header on the left. - \row - \li position - \li a QStyleOptionHeader::SectionPosition value - giving the header section's position relative to - the other sections. - \row - \li section - \li holds the section that is being drawn. - \row - \li selectedPosition - \li a QStyleOptionHeader::SelectedPosition value giving - the selected section's position relative to the - section that is being painted. - \row - \li sortIndicator - \li a QStyleOptionHeader::SortIndicator value that - describes the direction in which the section's sort - indicator should be drawn. - \row - \li text - \li the text of the currently drawn section. - \row - \li textAlignment - \li the Qt::Alignment of the text within the - headersection. - \endtable - - \section3 Tree Branch Indicators - - The branch indicators in a tree view is drawn by the style with - PE_IndicatorBranch. We think of indicators here as the indicators - that describe the relationship of the nodes in the tree. The - generic QStyleOption is sent to the style for drawing this - elements. The various branch types are described by states. Since - there are no specific style option, we simply present the states - table: - - \table 90% - \header - \li State - \li Set When - \row - \li State_Sibling - \li the node in the tree has a sibling (i.e., there is - another node in the same column). - \row - \li State_Item - \li this branch indicator has an item. - \row - \li State_Children - \li the branch has children (i.e., a new sub-tree can - be opened at the branch). - \row - \li State_Open - \li the branch indicator has an opened sub-tree. - \endtable - - The tree view (and tree widget) use the style to draw the branches - (or nodes if you will) of the tree. - - QStyleOption is used as the style for PE_IndicatorBranch has state - flags set depending on what type of branch it is. - - Since there is no tree structure for branch indicators, we only - present an image of a tree in the java style. Each state is marked - in the image with a rectangle in a specific color (i.e., these - rectangles are not bounding rectangles). All combinations of - states you must be aware of are represented in the image. - - \image javastyle/branchindicatorimage.png - - \section3 Tool Boxes - - PM_SmallIconSize for sizeHints. - - QToolBox is a container that keeps a collection of widgets. It has - one tab for each widget and display one of them at a time. The - tool box lays the components it displays (the tool box buttons - and selected widget) in a QVBoxLayout. The style tree for tool - boxes looks like this: - - \image javastyle/toolbox.png - - We show an image of a tool box in the Plastique style: - - \image javastyle/toolboximage.png - - All elements have the same bounding rectangles in the - Plastique as well as the other Qt built-in styles. - - The style option for tool boxes is QStyleOptionToolBox. It - contains the text and icon of the tool box contents. The only - state set by QToolBox is State_Sunken, which is set when the user - presses a tab down with the mouse. The rest of the - QStyleOptionToolBox members are: - - \table 90% - \header - \li Member - \li Content - \row - \li icon - \li the icon on the toolbox tab - \row - \li text - \li the text on the toolbox tab - \endtable - - \section3 Size Grip - - The size grip calculates its size hint with CT_SizeGrip. The pixel - metric PM_SizeGripSize is currently unused by Qt. The element tree - for and an image in the Plastique style of QSizeGrip follows: - - \image javastyle/sizegrip.png - - \image javastyle/sizegripimage.png - - We show the size grip in a \l{QMainWindow}'s bottom right - corner. - - The size grip style option, QStyleOptionSizeGrip, have one - member except the common members from QStyleOption: - - \table 90% - \header - \li Member - \li Content - \row - \li corner - \li a Qt::Corner value that describe which corner in a - window (or equivalent) the grip is located. - \endtable - - \section3 Rubber Band - - The \l{QRubberBand}'s style tree consists of two nodes. - - \image javastyle/rubberband.png - - We present an image of a Java style window being moved in a - QMdiArea with a rubber band: - - \image javastyle/rubberbandimage.png - - The style option for rubber bands is QStyleOptionRubberBand. - Its members are: - - \table - \header - \li Member - \li Content - \row - \li opaque - \li boolean that is true if the rubber band must be - drawn in an opaque style (i.e., color) - \row - \li shape - \li a QRubberBand::Shape enum value that holds the - shape of the band (which is either a rectangle or a - line) - \endtable - - \section3 Dock Widgets - - When the dock widget lays out its contents it asks the style for - these pixel metrics: PM_DockWidgetSeparatorExtent, - PM_DockWidgetTitleBarButtonMargin, PM_DockWidgetFrameWidth, and - PM_DockWidgetTitleMargin. It also calculates the bounding - rectangles of the float and close buttons with - SE_DockWidgetCloseButton and SE_DockWidgetFloatButton. - - \image javastyle/dockwidget.png - - The dotted lines indicate that the sender keeps instances of the - recipient of the arrow (i.e., it is not a style element to draw). - The dock widget only draws PE_frameDockWidget when it is detached - from its main window (i.e., it is a top level window). If it is - docked it draws the indicator dock widget resize handle. We show a - dock widget in both docked and floating state in the plastique - style: - - \image javastyle/dockwidgetimage.png - - The style option is QStyleOptionDockWidget: - - \table 90% - \header - \li Member - \li Content - \row - \li closeable - \li boolean that holds whether the dock window can be - closed - \row - \li floatable - \li boolean that holds whether the dock window can - float (i.e., detach from the main window in which - it lives) - \row - \li movable - \li boolean that holds whether the window is movable - (i.e., can move to other dock widget areas) - \row - \li title - \li the title text of the dock window - \endtable - - For the buttons, QStyleOptionButton is used (see \l{Tool Buttons} - for content description). The dock widget resize handle has a - plain QStyleOption. -*/ diff --git a/doc/src/widgets/widgets-and-layouts/stylesheet.qdoc b/doc/src/widgets/widgets-and-layouts/stylesheet.qdoc deleted file mode 100644 index eaedb847c8..0000000000 --- a/doc/src/widgets/widgets-and-layouts/stylesheet.qdoc +++ /dev/null @@ -1,3963 +0,0 @@ -/**************************************************************************** -** -** 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:FDL$ -** GNU Free Documentation License -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms -** and conditions contained in a signed written agreement between you -** and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \page stylesheet.html - \title Qt Style Sheets - \brief How to use style sheets to customize the appearance of widgets. - - \ingroup frameworks-technologies - \ingroup qt-basic-concepts - \ingroup qt-gui-concepts - - \previouspage {Styles and Style Aware Widgets}{Styles} - \contentspage Widgets and Layouts - \nextpage The Style Sheet Syntax - - \keyword style sheet - \keyword stylesheet - - Qt Style Sheets are a powerful mechanism that allows you to - customize the appearance of widgets, in addition to what is - already possible by subclassing QStyle. The concepts, - terminology, and syntax of Qt Style Sheets are heavily inspired - by HTML \l{http://www.w3.org/Style/CSS/}{Cascading Style Sheets - (CSS)} but adapted to the world of widgets. - - Topics: - - \list - \li \l{Overview} - \li \l{The Style Sheet Syntax} - \li \l{Qt Designer Integration} - \li \l{Customizing Qt Widgets Using Style Sheets} - \li \l{Qt Style Sheets Reference} - \li \l{Qt Style Sheets Examples} - \endlist - - \target overview - \section1 Overview - - Styles sheets are textual specifications that can be set on the - whole application using QApplication::setStyleSheet() or on a - specific widget (and its children) using - QWidget::setStyleSheet(). If several style sheets are set at - different levels, Qt derives the effective style sheet from all - of those that are set. This is called cascading. - - For example, the following style sheet specifies that all - \l{QLineEdit}s should use yellow as their background color, and - all \l{QCheckBox}es should use red as the text color: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 0 - - For this kind of customization, style sheets are much more - powerful than QPalette. For example, it might be tempting to set - the QPalette::Button role to red for a QPushButton to obtain a - red push button. However, this wasn't guaranteed to work for all - styles, because style authors are restricted by the different - platforms' guidelines and (on Windows XP and Mac OS X) by the - native theme engine. - - Style sheets let you perform all kinds of customizations that are - difficult or impossible to perform using QPalette alone. If you - want yellow backgrounds for mandatory fields, red text for - potentially destructive push buttons, or fancy check boxes, style - sheets are the answer. - - Style sheets are applied on top of the current \l{QStyle}{widget - style}, meaning that your applications will look as native as - possible, but any style sheet constraints will be taken into - consideration. Unlike palette fiddling, style sheets offer - guarantees: If you set the background color of a QPushButton to be - red, you can be assured that the button will have a red background - in all styles, on all platforms. In addition, \l{Qt Designer} - provides style sheet integration, making it easy to view the effects - of a style sheet in different \l{QStyle}{widget styles}. - - In addition, style sheets can be used to provide a distinctive - look and feel for your application, without having to subclass - QStyle. For example, you can specify arbitrary images for radio - buttons and check boxes to make them stand out. Using this - technique, you can also achieve minor customizations that would - normally require subclassing several style classes, such as - specifying a \l{QStyle::styleHint()}{style hint}. The - \l{widgets/stylesheet}{Style Sheet} example depicted below defines - two distinctive style sheets that you can try out and modify at - will. - - \table - \row \li \inlineimage stylesheet-coffee-xp.png - \li \inlineimage stylesheet-pagefold.png - \row \li Coffee theme running on Windows XP - \li Pagefold theme running on Windows XP - \endtable - - \table - \row \li \inlineimage stylesheet-coffee-cleanlooks.png - \li \inlineimage stylesheet-pagefold-mac.png - \row \li Coffee theme running on Ubuntu Linux - \li Pagefold theme running on Mac OS X - \endtable - - When a style sheet is active, the QStyle returned by QWidget::style() - is a wrapper "style sheet" style, \e not the platform-specific style. The - wrapper style ensures that any active style sheet is respected and - otherwise forwards the drawing operations to the underlying, - platform-specific style (e.g., QWindowsXPStyle on Windows XP). - - Since Qt 4.5, Qt style sheets fully supports Mac OS X. - - \warning Qt style sheets are currently not supported for custom QStyle - subclasses. We plan to address this in some future release. -*/ - -/*! - \page stylesheet-syntax.html - \contentspage {Qt Style Sheet}{Contents} - \previouspage Qt Style Sheet - \nextpage Qt Designer Integration - \title The Style Sheet Syntax - - Qt Style Sheet terminology and syntactic rules are almost - identical to those of HTML CSS. If you already know CSS, you can - probably skim quickly through this section. - - \tableofcontents - - \section1 Style Rules - - Style sheets consist of a sequence of style rules. A \e{style - rule} is made up of a selector and a declaration. The - \e{selector} specifies which widgets are affected by the rule; - the \e{declaration} specifies which properties should be set on - the widget. For example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 1 - - In the above style rule, \c QPushButton is the selector and \c{{ - color: red }} is the declaration. The rule specifies that - QPushButton and its subclasses (e.g., \c MyPushButton) should use - red as their foreground color. - - Qt Style Sheet is generally case insensitive (i.e., \c color, - \c Color, \c COLOR, and \c cOloR refer to the same property). - The only exceptions are class names, - \l{QObject::setObjectName()}{object names}, and Qt property - names, which are case sensitive. - - Several selectors can be specified for the same declaration, - using commas (\c{,}) to separate the selectors. For example, - the rule - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 2 - - is equivalent to this sequence of three rules: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 3 - - The declaration part of a style rule is a list of - \tt{\e{property}: \e{value}} pairs, enclosed in braces (\c{{}}) - and separated with semicolons. For example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 4 - - See the \l{List of Properties} section below for the list of - properties provided by Qt widgets. - - \section1 Selector Types - - All the examples so far used the simplest type of selector, the - Type Selector. Qt Style Sheets support all the - \l{http://www.w3.org/TR/REC-CSS2/selector.html#q1}{selectors - defined in CSS2}. The table below summarizes the most useful - types of selectors. - - \table 100% - \header - \li Selector - \li Example - \li Explanation - - \row - \li Universal Selector - \li \c * - \li Matches all widgets. - - \row - \li Type Selector - \li \c QPushButton - \li Matches instances of QPushButton and of its subclasses. - - \row - \li Property Selector - \li \c{QPushButton[flat="false"]} - \li Matches instances of QPushButton that are not - \l{QPushButton::}{flat}. You may use this selector to test - for any Qt \l{Qt's Property System}{property} that supports - QVariant::toString() (see the \l{QVariant::}{toString()} - function documentation for details). In addition, the - special \c class property is supported, for the name of the - class. - - This selector may also be used to test dynamic properties. - For more information on customization using dynamic properties, - refer to \l{Customizing Using Dynamic Properties}. - - Instead of \c =, you can also use \c ~= to test whether a - Qt property of type QStringList contains a given QString. - - \warning If the value of the Qt property changes after the - style sheet has been set, it might be necessary to force a - style sheet recomputation. One way to achieve this is to - unset the style sheet and set it again. - - \row - \li Class Selector - \li \c .QPushButton - \li Matches instances of QPushButton, but not of its subclasses. - - This is equivalent to \c{*[class~="QPushButton"]}. - - \row - \li ID \target ID Selector - Selector - \li \c{QPushButton#okButton} - \li Matches all QPushButton instances whose - \l{QObject::objectName}{object name} is \c okButton. - - \row - \li Descendant Selector - \li \c{QDialog QPushButton} - \li Matches all instances of QPushButton that are descendants - (children, grandchildren, etc.) of a QDialog. - - \row - \li Child Selector - \li \c{QDialog > QPushButton} - \li Matches all instances of QPushButton that are direct - children of a QDialog. - \endtable - - \section1 Sub-Controls - - For styling complex widgets, it is necessary to access subcontrols of the - widget, such as the drop-down button of a QComboBox or the up and down - arrows of a QSpinBox. Selectors may contain \e{subcontrols} that make it - possible to restrict the application of a rule to specific widget - subcontrols. For example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 5 - - The above rule styles the drop-down button of all \l{QComboBox}es. - Although the double-colon (\c{::}) syntax is reminiscent of CSS3 - Pseudo-Elements, Qt Sub-Controls differ conceptually from these and have - different cascading semantics. - - Sub-controls are always positioned with respect to another element - a - reference element. This reference element could be the widget or another - Sub-control. For example, the \l{Qt Style Sheets Reference#drop-down-sub} - {::drop-down} of a QComboBox is placed, by default, in the top right corner - of the Padding rectangle of the QComboBox. The - \l{Qt Style Sheets Reference#drop-down-sub}{::drop-down} is placed, - by default, in the Center of the Contents rectangle of the - \l{Qt Style Sheets Reference#drop-down-sub}{::drop-down} Sub-control. See - the \l{List of Stylable Widgets} below for the Sub-controls to use to - style a widget and their default positions. - - The origin rectangle to be used can be changed using the - \l{Qt Style Sheets Reference#subcontrol-origin-prop}{subcontrol-origin} - property. For example, if we want to place the drop-down in the margin - rectangle of the QComboBox instead of the default Padding rectangle, we - can specify: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 6 - - The alignment of the drop-down within the Margin rectangle is changed - using \l{Qt Style Sheets Reference#subcontrol-position-prop} - {subcontrol-position} property. - - The \l{Qt Style Sheets Reference#width-prop}{width} and - \l{Qt Style Sheets Reference#height-prop}{height} properties can be used - to control the size of the Sub-control. Note that setting a - \l{Qt Style Sheets Reference#image-prop}{image} implicitly sets the size - of a Sub-control. - - The relative positioning scheme - (\l{Qt Style Sheets Reference#position-prop}{position} : relative), - allows the position of the Sub-Control to be offset from its initial - position. For example, when the QComboBox's drop-down button is - pressed, we might like the arrow inside to be offset to give a - "pressed" effect. To achieve this, we can specify: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 7 - - The absolute positioning scheme - (\l{Qt Style Sheets Reference#position-prop}{position} : absolute), - allows the position and size of the Sub-control to be changed with - respect to the reference element. - - Once positioned, they are treated the same as widgets and can be styled - using the \l{box model}. - - See the \l{List of Sub-Controls} below for a list of supported - sub-controls, and \l{Customizing the QPushButton's Menu Indicator - Sub-Control} for a realistic example. - - \note With complex widgets such as QComboBox and QScrollBar, if one - property or sub-control is customized, \b{all} the other properties or - sub-controls must be customized as well. - - \section1 Pseudo-States - - Selectors may contain \e{pseudo-states} that denote that restrict - the application of the rule based on the widget's state. - Pseudo-states appear at the end of the selector, with a colon - (\c{:}) in between. For example, the following rule applies when - the mouse hovers over a QPushButton: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 8 - - Pseudo-states can be negated using the exclamation operator. For - example, the following rule applies when the mouse does not hover - over a QRadioButton: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 9 - - Pseudo-states can be chained, in which case a logical AND is - implied. For example, the following rule applies to when the - mouse hovers over a checked QCheckBox: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 10 - - Negated Pseudo-states may appear in Pseudo-state chains. For example, - the following rule applies when the mouse hovers over a QPushButton - that is not pressed: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 11 - - If needed, logical OR can be expressed using the comma operator: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 12 - - Pseudo-states can appear in combination with subcontrols. For - example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 13 - - See the \l{List of Pseudo-States} section below for the list of - pseudo-states provided by Qt widgets. - - \section1 Conflict Resolution - - Conflicts arise when several style rules specify the same - properties with different values. Consider the following style - sheet: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 14 - - Both rules match QPushButton instances called \c okButton and - there is a conflict for the \c color property. To resolve this - conflict, we must take into account the \e specificity of the - selectors. In the above example, \c{QPushButton#okButton} is - considered more specific than \c QPushButton, because it - (usually) refers to a single object, not to all instances of a - class. - - Similarly, selectors with pseudo-states are more specific than - ones that do not specify pseudo-states. Thus, the following style - sheet specifies that a \l{QPushButton} should have white text - when the mouse is hovering over it, otherwise red text: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 15 - - Here's a tricky one: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 16 - - Here, both selectors have the same specificity, so if the mouse - hovers over the button while it is enabled, the second rule takes - precedence. If we want the text to be white in that case, we can - reorder the rules like this: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 17 - - Alternatively, we can make the first rule more specific: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 18 - - A similar issue arises in conjunction with Type Selectors. - Consider the following example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 19 - - Both rules apply to QPushButton instances (since QPushButton - inherits QAbstractButton) and there is a conflict for the - \l{Qt Style Sheets Reference#color-prop}{color} property. Because QPushButton - inherits QAbstractButton, it might be tempting to assume that - \c QPushButton is more specific than \c QAbstractButton. However, - for style sheet computations, all Type Selectors have the same - specificity, and the rule that appears last takes precedence. In - other words, \l{Qt Style Sheets Reference#color-prop}{color} is set to \c gray - for all \l{QAbstractButton}s, including \l{QPushButton}s. If we really - want \l{QPushButton}s to have red text, we can always reorder the - rules. - - For determining the specificity of a rule, Qt Style Sheets follow - the - \l{http://www.w3.org/TR/REC-CSS2/cascade.html#specificity}{CSS2 - Specification}: - - \quotation - \e{A selector's specificity is calculated as follows:} - - \list - \li \e{count the number of ID attributes in the selector (= a)} - \li \e{count the number of other attributes and pseudo-classes in the selector (= b)} - \li \e{count the number of element names in the selector (= c)} - \li \e{ignore pseudo-elements [i.e., \l{subcontrols}].} - \endlist - - \e{Concatenating the three numbers a-b-c (in a number system with a - large base) gives the specificity.} - - \e{Some examples:} - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 20 - \endquotation - - \section1 Cascading - - Style sheets can be set on the QApplication, on parent widgets, - and on child widgets. An arbitrary widget's effective style sheet - is obtained by merging the style sheets set on the widget's - ancestors (parent, grandparent, etc.), as well as any style sheet - set on the QApplication. - - When conflicts arise, the widget's own style sheet is always - preferred to any inherited style sheet, irrespective of the - specificity of the conflicting rules. Likewise, the parent - widget's style sheet is preferred to the grandparent's, etc. - - One consequence of this is that setting a style rule on a widget - automatically gives it precedence over other rules specified in - the ancestor widgets' style sheets or the QApplication style - sheet. Consider the following example. First, we set a style - sheet on the QApplication: - - \snippet doc/src/snippets/code/doc_src_stylesheet.cpp 21 - - Then we set a style sheet on a QPushButton object: - - \snippet doc/src/snippets/code/doc_src_stylesheet.cpp 22 - - The style sheet on the QPushButton forces the QPushButton (and - any child widget) to have blue text, in spite of the more - specific rule set provided by the application-wide style sheet. - - The result would have been the same if we had written - - \snippet doc/src/snippets/code/doc_src_stylesheet.cpp 23 - - except that if the QPushButton had children (which is unlikely), - the style sheet would have no impact on them. - - Style sheet cascading is a complex topic. Refer to the - \l{http://www.w3.org/TR/CSS2/cascade.html#cascade}{CSS2 - Specification} for the gory details. Be aware that Qt currently - doesn't implement \c{!important}. - - \section1 Inheritance - - In classic CSS, when font and color of an item is not explicitly set, - it gets automatically inherited from the parent. When using Qt Style Sheets, - a widget does \b{not} automatically inherit its font and color setting - from its parent widget. - - For example, consider a QPushButton inside a QGroupBox: - - \snippet doc/src/snippets/code/doc_src_stylesheet.cpp 24 - - The QPushButton does not have an explicit color set. Hence, instead - of inheriting color of its parent QGroupBox, it has the system color. - If we want to set the color on a QGroupBox and its children, - we can write: - - \snippet doc/src/snippets/code/doc_src_stylesheet.cpp 25 - - In contrast, setting a font and propagate using QWidget::setFont() and - QWidget::setPalette() propagates to child widgets. - - \section1 Widgets inside C++ namespaces - - The Type Selector can be used to style widgets of a particular type. For - example, - - \snippet doc/src/snippets/code/doc_src_stylesheet.cpp 26 - - Qt Style Sheet uses QObject::className() of the widget to determine - when to apply the Type Selector. When custom widgets are inside namespaces, - the QObject::className() returns ::. This conflicts - with the syntax for \l{Sub-Controls}. To overcome this problem, - when using the Type Selector for widgets inside namespaces, we must - replace the "::" with "--". For example, - - \snippet doc/src/snippets/code/doc_src_stylesheet.cpp 27 - - \section1 Setting QObject properties - - From 4.3 and above, any designable Q_PROPERTY - can be set using the qproperty- syntax. - - For example, - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 28 - - If the property references an enum declared with Q_ENUMS, you should - reference its constants by name, i.e., not their numeric value. - -*/ - -/*! - \page stylesheet-designer.html - \contentspage {Qt Style Sheet}{Contents} - \previouspage The Style Sheet Syntax - \nextpage Customizing Qt Widgets Using Style Sheets - \title Qt Designer Integration - - \l{Qt Designer}{Qt Designer} is an excellent tool - to preview style sheets. You can right-click on any widget in Designer - and select \gui{Change styleSheet...} to set the style sheet. - - \image designer-stylesheet-options.png - - In Qt 4.2 and later, \l{Qt Designer}{Qt Designer} also includes a - style sheet syntax highlighter and validator. The validator indicates - if the syntax is valid or invalid, at the bottom left of the \gui{Edit - Style Sheet} dialog. - - \image designer-validator-highlighter.png - - When you click \gui{OK} or \gui{Apply}, \QD will automatically display - the widget with its new stylesheet. - - \image designer-stylesheet-usage.png - */ - -/*! - \page stylesheet-customizing.html - \contentspage {Qt Style Sheet}{Contents} - \previouspage Qt Designer Integration - \nextpage Qt Style Sheets Reference - \title Customizing Qt Widgets Using Style Sheets - - When using style sheets, every widget is treated as a box with four - concentric rectangles: the margin rectangle, the border rectangle, the - padding rectangle, and the content rectangle. The box model describes - this in further detail. - - \tableofcontents - - \target box model - \section1 The Box Model - - The four concentric rectangles appear conceptually as below: - - \image stylesheet-boxmodel.png - - \list - \li The margin falls outside the border. - \li The border is drawn between the margin and the padding. - \li The padding falls inside the border, between the border and - the actual contents. - \li The content is what is left from the original widget or - subcontrol once we have removed the margin, the border, and - the padding. - \endlist - - The \l{Qt Style Sheets Reference#margin-prop}{margin}, - \l{Qt Style Sheets Reference#border-width-prop} - {border-width}, and - \l{Qt Style Sheets Reference#padding-prop}{padding} - properties all default to zero. In that case, all four rectangles - (\c margin, \c border, \c padding, and \c content) coincide exactly. - - You can specify a background for the widget using the - \l{Qt Style Sheets Reference#background-image-prop}{background-image} - property. By default, the background-image is drawn only for the area - inside the border. This can be changed using the - \l{Qt Style Sheets Reference#background-clip-prop}{background-clip} - property. You can use - \l{Qt Style Sheets Reference#background-repeat-prop}{background-repeat} - and - \l{Qt Style Sheets Reference#background-origin-prop}{background-origin} - to control the repetition and origin of the background image. - - A background-image does not scale with the size of the widget. To provide - a "skin" or background that scales along with the widget size, one must - use - \l{Qt Style Sheets Reference#border-image-prop}{border-image}. Since the - border-image property provides an alternate background, it is not required - to specify a background-image when border-image is specified. In the case, - when both of them are specified, the border-image draws over the - background-image. - - In addition, the \l{Qt Style Sheets Reference#image-prop}{image} property - may be used to draw an image over the border-image. The image specified does - not tile or stretch and when its size does not match the size of the widget, - its alignment is specified using the - \l{Qt Style Sheets Reference#image-position-prop}{image-position} - property. Unlike background-image and border-image, one may specify a - SVG in the image property, in which case the image is scaled automatically - according to the widget size. - - The steps to render a rule are as follows: - \list - \li Set clip for entire rendering operation (border-radius) - \li Draw the background (background-image) - \li Draw the border (border-image, border) - \li Draw overlay image (image) - \endlist - - \target sub controls - \section1 Sub-controls - - A widget is considered as a hierarchy (tree) of subcontrols drawn on top - of each other. For example, the QComboBox draws the drop-down sub-control - followed by the down-arrow sub-control. A QComboBox is thus rendered as - follows: - \list - \li Render the QComboBox { } rule - \li Render the QComboBox::drop-down { } rule - \li Render the QComboBox::down-arrow { } rule - \endlist - - Sub-controls share a parent-child relationship. In the case of QComboBox, - the parent of down-arrow is the drop-down and the parent of drop-down is - the widget itself. Sub-controls are positioned within their parent using - the \l{Qt Style Sheets Reference#subcontrol-position-prop} - {subcontrol-position} and - \l{Qt Style Sheets Reference#subcontrol-origin-prop}{subcontrol-origin} - properties. - - Once positioned, sub-controls can be styled using the \l{box model}. - - \note With complex widgets such as QComboBox and QScrollBar, if one - property or sub-control is customized, \b{all} the other properties or - sub-controls must be customized as well. - -*/ - -/*! - \page stylesheet-reference.html - \contentspage {Qt Style Sheet}{Contents} - \previouspage Customizing Qt Widgets Using Style Sheets - \nextpage Qt Style Sheets Examples - \title Qt Style Sheets Reference - - Qt Style Sheets support various properties, pseudo-states, and - subcontrols that make it possible to customize the look of - widgets. - - \tableofcontents - - \section1 List of Stylable Widgets - - The following table lists the Qt widgets that can be customized - using style sheets: - - \table 100% - \header - \li Widget - \li How to Style - - \row - \li QAbstractScrollArea \target qabstractscrollarea-widget - \li Supports the \l{box model}. - - All derivatives of QAbstractScrollArea, including QTextEdit, - and QAbstractItemView (all item view classes), support - scrollable backgrounds using - \l{Qt Style Sheets Reference#background-attachment-prop} - {background-attachment}. Setting the background-attachment to - \c{fixed} provides a background-image that does not scroll with the - viewport. Setting the background-attachment to \c{scroll}, scrolls - the background-image when the scroll bars move. - - See \l{Qt Style Sheets Examples#Customizing QAbstractScrollArea} - {Customizing QAbstractScrollArea} for an example. - - \row - \li QCheckBox \target qcheckbox-widget - \li Supports the \l{box model}. The check indicator can be - styled using the \l{#indicator-sub}{::indicator} - subcontrol. By default, the indicator is placed in the Top - Left corner of the Contents rectangle of the widget. - - The \l{#spacing-prop}{spacing} property - specifies the spacing between the check indicator and - the text. - - See \l{Qt Style Sheets Examples#Customizing QCheckBox} - {Customizing QCheckBox} for an example. - - \row - \li QColumnView \target qcolumnview-widget - \li The grip can be styled be using the \l{image-prop}{image} property. - The arrow indicators can by styled using the - \l{left-arrow-sub}{::left-arrow} subcontrol and the - \l{right-arrow-sub}{::right-arrow} subcontrol. - - \row - \li QComboBox \target qcombobox-widget - \li The frame around the combobox can be styled using the - \l{box model}. The drop-down button can be styled using - the \l{#drop-down-sub}{::drop-down} subcontrol. By default, the - drop-down button is placed in the top right corner of the padding - rectangle of the widget. The arrow mark inside the drop-down button - can be styled using the \l{#down-arrow-sub}{::down-arrow} - subcontrol. By default, the arrow is placed in the center of the - contents rectangle of the drop-down subcontrol. - - See \l{Qt Style Sheets Examples#Customizing QComboBox}{Customizing QComboBox} - for an example. - - \row - \li QDateEdit \target qdateedit-widget - \li See \l{#qspinbox-widget}{QSpinBox}. - - \row - \li QDateTimeEdit \target qdatetimeedit-widget - \li See \l{#qspinbox-widget}{QSpinBox}. - - \row - \li QDialog \target qdialog-widget - \li Supports only the \l{Qt Style Sheets Reference#background-prop}{background}, - \l{#background-clip-prop}{background-clip} and - \l{#background-origin-prop}{background-origin} properties. - - \warning Make sure you define the Q_OBJECT macro for your custom - widget. - - \row - \li QDialogButtonBox \target qdialogbuttonbox-widget - \li The layout of buttons can be altered using the - \l{#button-layout-prop}{button-layout} property. - - \row - \li QDockWidget \target qdockwidget-widget - \li Supports styling of the title bar and the title bar buttons when docked. - - The dock widget border can be styled using the \l{#border-prop}{border} - property. The \l{#title-sub}{::title} subcontrol can be used to customize - the title bar. The close and float buttons are positioned with respect - to the \l{title-sub}{::title} subcontrol using the - \l{#close-button-sub}{::close-button} and - \l{#float-button-sub}{::float-button} respectively. - - When the title bar is vertical, the \l{#vertical-ps}{:vertical} pseudo - class is set. In addition, depending on QDockWidget::DockWidgetFeature, - the \l{#closable-ps}{:closable}, \l{#floatable-ps}{:floatable} and - \l{#movable-ps}{:movable} pseudo states are set. - - \note Use QMainWindow::separator to style the resize handle. - - \warning The style sheet has no effect when the QDockWidget is undocked - as Qt uses native top level windows when undocked. - - See \l{Qt Style Sheets Examples#Customizing QDockWidget} - {Customizing QDockWidget} for an example. - - \row - \li QDoubleSpinBox \target qdoublespinbox-widget - \li See \l{#qspinbox-widget}{QSpinBox}. - - \row - \li QFrame \target qframe-widget - \li Supports the \l{box model}. - - Since 4.3, setting a stylesheet on a QLabel automatically - sets the QFrame::frameStyle property to QFrame::StyledPanel. - - See \l{Qt Style Sheets Examples#Customizing QFrame}{Customizing QFrame} - for an example. - - \row - \li QGroupBox \target qgroupbox-widget - \li Supports the \l{box model}. The title can be styled using the - \l{#title-sub}{::title} subcontrol. By default, the title is placed - depending on QGroupBox::textAlignment. - - In the case of a checkable QGroupBox, the title includes the - check indicator. The indicator is styled using the - the \l{#indicator-sub}{::indicator} subcontrol. The - \l{#spacing-prop}{spacing} property can be used to control - the spacing between the text and indicator. - - See \l{Qt Style Sheets Examples#Customizing QGroupBox}{Customizing QGroupBox} - for an example. - - \row - \li QHeaderView \target qheaderview-widget - \li Supports the \l{box model}. The sections of the header view are - styled using the \l{#section-sub}{::section} sub control. The - \c{section} Sub-control supports the \l{#middle-ps}{:middle}, - \l{#first-ps}{:first}, \l{#last-ps}{:last}, - \l{#only-one-ps}{:only-one}, \l{#next-selected-ps}{:next-selected}, - \l{#previous-selected-ps}{:previous-selected}, - \l{#selected-ps}{:selected}, - and \l{#checked-ps}{:checked} pseudo states. - - Sort indicator in can be styled using the - \l{#up-arrow-sub}{::up-arrow} and the - \l{#down-arrow-sub}{::down-arrow} Sub-control. - - See \l{Qt Style Sheets Examples#Customizing QHeaderView}{Customizing QHeaderView} - for an example. - - \row - \li QLabel \target qlabel-widget - \li Supports the \l{box model}. Does not support the - \l{#hover-ps}{:hover} pseudo-state. - - Since 4.3, setting a stylesheet on a QLabel automatically - sets the QFrame::frameStyle property to QFrame::StyledPanel. - - See \l{Qt Style Sheets Examples#Customizing QFrame}{Customizing QFrame} for an - example (a QLabel derives from QFrame). - - \row - \li QLineEdit \target qlineedit-widget - \li Support the \l{box model}. - - The color and background of the selected item is styled using - \l{#selection-color-prop}{selection-color} and - \l{#selection-background-color-prop}{selection-background-color} - respectively. - - The password character can be styled using the - \l{#lineedit-password-character-prop}{lineedit-password-character} - property. - - See \l{Qt Style Sheets Examples#Customizing QLineEdit}{Customizing QLineEdit} - for an example. - - \row - \li QListView \target qlistview-widget - \li Supports the \l{box model}. When - \l{QAbstractItemView::alternatingRowColors}{alternating row colors} - is enabled, the alternating colors can be styled using the - \l{#alternate-background-color-prop}{alternate-background-color} - property. - - The color and background of the selected item is styled using - \l{#selection-color-prop}{selection-color} and - \l{#selection-background-color-prop}{selection-background-color} - respectively. - - The selection behavior is controlled by the - \l{#show-decoration-selected-prop}{show-decoration-selected} property. - - Use the \l{#item-sub}{::item} subcontrol for more fine grained - control over the items in the QListView. - - See \l{qabstractscrollarea-widget}{QAbsractScrollArea} to - style scrollable backgrounds. - - See \l{Qt Style Sheets Examples#Customizing QListView} - {Customzing QListView} for an example. - - \row - \li QListWidget \target qlistwidget-widget - \li See \l{#qlistview-widget}{QListView}. - - \row - \li QMainWindow \target qmainwindow-widget - \li Supports styling of the separator - - The separator in a QMainWindow when using QDockWidget is styled - using the \l{#separator-sub}{::separator} subcontrol. - - See \l{Qt Style Sheets Examples#Customizing QMainWindow}{Customizing QMainWindow} - for an example. - - \row - \li QMenu \target qmenu-widget - \li Supports the \l{box model}. - - Individual items are styled using the \l{#item-sub}{::item} - subcontrol. In addition to the usually supported pseudo states, - \c{item} subcontrol supports the - \l{#selected-ps}{:selected}, \l{#default-ps}{:default}, - \l{#exclusive-ps}{:exclusive} and the - \l{#non-exclusive-ps}{non-exclusive} pseudo states. - - The indicator of checkable menu items is styled using the - \l{#indicator-sub}{::indicator} subcontrol. - - The separator is styled using the \l{#separator-sub}{::separator} - subcontrol. - - For items with a sub menu, the arrow marks are styled using the - \l{right-arrow-sub}{right-arrow} and - \l{left-arrow-sub}{left-arrow}. - - The scroller is styled using the \l{#scroller-sub}{::scroller}. - - The tear-off is styled using the \l{#tearoff-sub}{::tearoff}. - - See \l{Qt Style Sheets Examples#Customizing QMenu}{Customizing QMenu} - for an example. - - \row - \li QMenuBar \target qmenubar-widget - \li Supports the \l{box model}. The \l{#spacing-prop}{spacing} - property specifies the spacing between menu items. - Individual items are styled using the \l{#item-sub}{::item} - subcontrol. - - \warning When running on Qt/Mac, the menu bar is usually embedded into the - system-wide menu bar. In this case, the style sheet will have no effect. - - See \l{Qt Style Sheets Examples#Customizing QMenuBar}{Customizing QMenuBar} - for an example. - - \row - \li QMessageBox \target qmessagebox-widget - \li The \l{#messagebox-text-interaction-flags-prop} - {messagebox-text-interaction-flags} property can be used to alter - the interaction with text in the message box. - - \row - \li QProgressBar \target qprogressbar-widget - \li Supports the \l{box model}. The chunks of the progress bar - can be styled using the \l{#chunk-sub}{::chunk} subcontrol. - The chunk is displayed on the Contents rectangle of the widget. - - If the progress bar displays text, use the \l{text-align-prop}{text-align} - property to position the text. - - Indeterminate progress bars have the - \l{#indeterminate-ps}{:indeterminate} pseudo state set. - - See \l{Qt Style Sheets Examples#Customizing QProgressBar}{Customizing QProgressBar} - for an example. - - \row - \li QPushButton \target qpushbutton-widget - \li Supports the \l{box model}. Supports the \l{#default-ps}{:default}, - \l{#flat-ps}{:flat}, \l{#checked-ps}{:checked} pseudo states. - - For QPushButton with a menu, the menu indicator is styled - using the \l{#menu-indicator-sub}{::menu-indicator} - subcontrol. Appearance of checkable push buttons can be - customized using the \l{#open-ps}{:open} and - \l{#closed-ps}{:closed} pseudo-states. - - \warning If you only set a background-color on a QPushButton, the background - may not appear unless you set the border property to some value. This is - because, by default, the QPushButton draws a native border which completely - overlaps the background-color. For example, - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 30 - - See \l{Qt Style Sheets Examples#Customizing QPushButton}{Customizing QPushButton} - for an example. - - \row - \li QRadioButton \target qradiobutton-widget - \li Supports the \l{box model}. The check indicator can be - styled using the \l{#indicator-sub}{::indicator} - subcontrol. By default, the indicator is placed in the Top - Left corner of the Contents rectangle of the widget. - - The \l{#spacing-prop}{spacing} property - specifies the spacing between the check indicator and - the text. - - See \l{Qt Style Sheets Examples#Customizing QRadioButton} - {Customizing QRadioButton} for an example. - - \row - \li QScrollBar \target qscrollbar-widget - \li Supports the \l{box model}. The Contents rectangle of the widget - is considered to be the groove over which the slider moves. The extent - of the QScrollBar (i.e the width or the height depending on the orientation) - is set using the \l{#width-prop}{width} or \l{#height-prop}{height} property - respectively. To determine the orientation, use the - \l{#horizontal-ps}{:horizontal} and the \l{vertical-ps}{:vertical} - pseudo states. - - The slider can be styled using the \l{#handle-sub}{::handle} subcontrol. - Setting the \l{#min-width-prop}{min-width} or \l{#min-height-prop}{min-height} - provides size contraints for the slider depending on the orientation. - - The \l{add-line-sub}{::add-line} subcontrol can be used to style the - button to add a line. By default, the add-line subcontrol is placed in - top right corner of the Border rectangle of the widget. Depending on the - orientation the \l{#right-arrow-sub}{::right-arrow} or - \l{#down-arrow-sub}{::down-arrow}. By default, the arrows are placed in - the center of the Contents rectangle of the add-line subcontrol. - - The \l{sub-line-sub}{::sub-line} subcontrol can be used to style the - button to subtract a line. By default, the sub-line subcontrol is placed in - bottom right corner of the Border rectangle of the widget. Depending on the - orientation the \l{#left-arrow-sub}{::left-arrow} or - \l{#up-arrow-sub}{::up-arrow}. By default, the arrows are placed in - the center of the Contents rectangle of the sub-line subcontrol. - - The \l{sub-page-sub}{::sub-page} subcontrol can be used to style the - region of the slider that subtracts a page. The \l{add-page-sub}{::add-page} - subcontrol can be used to style the region of the slider that adds a page. - - See \l{Qt Style Sheets Examples#Customizing QScrollBar}{Customizing QScrollBar} - for an example. - - \row - \li QSizeGrip \target qsizegrip-widget - \li Supports the \l{#width-prop}{width}, - \l{#height-prop}{height}, and \l{#image-prop}{image} - properties. - - See \l{Qt Style Sheets Examples#Customizing QSizeGrip}{Customizing QSizeGrip} - for an example. - - \row - \li QSlider \target qslider-widget - \li Supports the \l{box model}. For horizontal slides, the - \l{min-width-prop}{min-width} and \l{height-prop}{height} - properties must be provided. For vertical sliders, the - \l{min-height-prop}{min-height} and \l{width-prop}{width} - properties must be provided. - - The groove of the slider is styled - using the \l{#groove-sub}{::groove}. The groove is - positioned by default in the Contents rectangle of the widget. - The thumb of the slider is styled using \l{#handle-sub}{::handle} - subcontrol. The subcontrol moves in the Contents rectangle of - the groove subcontrol. - - See \l{Qt Style Sheets Examples#Customizing QSlider}{Customizing QSlider} - for an example. - - \row - \li QSpinBox \target qspinbox-widget - \li The frame of the spin box can be styled using the \l{box - model}. - - The up button and arrow can be styled using the - \l{#up-button-sub}{::up-button} and - \l{#up-arrow-sub}{::up-arrow} subcontrols. By default, - the up-button is placed in the top right corner in the - Padding rectangle of the widget. Without an explicit size, - it occupies half the height of its reference rectangle. - The up-arrow is placed in the center of the Contents - rectangle of the up-button. - - The down button and arrow can be styled using the - \l{#down-button-sub}{::down-button} and - \l{#down-arrow-sub}{::down-arrow} subcontrols. By default, - the down-button is placed in the bottom right corner in the - Padding rectangle of the widget. Without an explicit size, - it occupies half the height of its reference rectangle. - The bottom-arrow is placed in the center of the Contents - rectangle of the bottom-button. - - See \l{Qt Style Sheets Examples#Customizing QSpinBox}{Customizing QSpinBox} - for an example. - - \row - \li QSplitter \target qsplitter-widget - \li Supports the \l{box model}. The handle of the splitter - is styled using the \l{#handle-sub}{::handle} subcontrol. - - See \l{Qt Style Sheets Examples#Customizing QSplitter}{Customizing QSplitter} - for an example. - - \row - \li QStatusBar \target qstatusbar-widget - \li Supports only the \l{Qt Style Sheets Reference#background-prop} - {background} property. - The frame for individual items can be style using the - \l{#item-sub}{::item} subcontrol. - - See \l{Qt Style Sheets Examples#Customizing QStatusBar}{Customizing QStatusBar} - for an example. - - \row - \li QTabBar \target qtabbar-widget - \li Individual tabs may be styled using the \l{#tab-sub}{::tab} subcontrol. - Close buttons using the \l{#close-button-sub}{::close-button} - The tabs support the - \l{#only-one-ps}{:only-one}, \l{#first-ps}{:first}, - \l{#last-ps}{:last}, \l{#middle-ps}{:middle}, - \l{#previous-selected-ps}{:previous--selected}, - \l{#next-selected-ps}{:next-selected}, - \l{#selected-ps}{:selected} pseudo states. - - The \l{#top-ps}{:top}, \l{#left-ps}{:left}, \l{#right-ps}{:right}, - \l{#bottom-ps}{:bottom} pseudo states depending on the orientation - of the tabs. - - Overlapping tabs for the selected state are created by using - negative margins or using the \c{absolute} position scheme. - - The tear indicator of the QTabBar is styled using the - \l{#tear-sub}{::tear} subcontrol. - - QTabBar used two QToolButtons for its scrollers that can be styled - using the \c{QTabBar QToolButton} selector. To specify the width - of the scroll button use the \l{#scroller-sub}{::scroller} - subcontrol. - - The alignment of the tabs within the QTabBar is styled - using the \l{#Alignment}{alignment} property. \warning - - To change the position of the QTabBar within a QTabWidget, use the - \l{#tab-bar-sub}{tab-bar} subcontrol (and set subcontrol-position). - - See \l{Qt Style Sheets Examples#Customizing QTabWidget and QTabBar}{Customizing QTabBar} - for an example. - - \row - \li QTabWidget \target qtabwidget-widget - \li The frame of the tab widget is styled using the - \l{#pane-sub}{::pane} subcontrol. The left and right - corners are styled using the \l{#left-corner-sub}{::left-corner} - and \l{#right-corner-sub}{::right-corner} respectively. - The position of the tab bar is controlled using the - \l{#tab-bar-sub}{::tab-bar} subcontrol. - - By default, the subcontrols have positions of a QTabWidget in - the QWindowsStyle. To place the QTabBar in the center, set the - subcontrol-position of the tab-bar subcontrol. - - The \l{#top-ps}{:top}, \l{#left-ps}{:left}, \l{#right-ps}{:right}, - \l{#bottom-ps}{:bottom} pseudo states depending on the orientation - of the tabs. - - See \l{Qt Style Sheets Examples#Customizing QTabWidget and QTabBar} - {Customizing QTabWidget} for an example. - - \row - \li QTableView \target qtableview-widget - \li Supports the \l{box model}. When - \l{QAbstractItemView::alternatingRowColors}{alternating row colors} - is enabled, the alternating colors can be styled using the - \l{#alternate-background-color-prop}{alternate-background-color} - property. - - The color and background of the selected item is styled using - \l{#selection-color-prop}{selection-color} and - \l{#selection-background-color-prop}{selection-background-color} - respectively. - - The corner widget in a QTableView is implemented as a QAbstractButton - and can be styled using the "QTableView QTableCornerButton::section" - selector. - - \warning If you only set a background-color on a QTableCornerButton, - the background may not appear unless you set the border property to - some value. This is because, by default, the QTableCornerButton draws a - native border which completely overlaps the background-color. - - The color of the grid can be specified using the - \l{#gridline-color-prop}{gridline-color} property. - - See \l{qabstractscrollarea-widget}{QAbsractScrollArea} to - style scrollable backgrounds. - - See \l{Qt Style Sheets Examples#Customizing QTableView} - {Customzing QTableView} for an example. - - \row - \li QTableWidget \target qtablewidget-widget - \li See \l{#qtableview-widget}{QTableView}. - - \row - \li QTextEdit \target qtextedit-widget - \li Supports the \l{box model}. - - The color and background of selected text is styled using - \l{#selection-color-prop}{selection-color} and - \l{#selection-background-color-prop}{selection-background-color} - respectively. - - See \l{qabstractscrollarea-widget}{QAbsractScrollArea} to - style scrollable backgrounds. - - \row - \li QTimeEdit \target qtimeedit-widget - \li See \l{#qspinbox-widget}{QSpinBox}. - - \row - \li QToolBar \target qtoolbar-widget - \li Supports the \l{box model}. - - The \l{#top-ps}{:top}, \l{#left-ps}{:left}, \l{#right-ps}{:right}, - \l{#bottom-ps}{:bottom} pseudo states depending on the area in - which the tool bar is grouped. - - The \l{#first-ps}{:first}, \l{#last-ps}{:last}, \l{#middle-ps}{:middle}, - \l{#only-one-ps}{:only-one} pseudo states indicator the position - of the tool bar within a line group (See - QStyleOptionToolBar::positionWithinLine). - - The separator of a QToolBar is styled using the - \l{#separator-sub}{::separator} subcontrol. - - The handle (to move the toolbar) is styled using the - \l{#handle-sub}{::handle} subcontrol. - - See \l{Qt Style Sheets Examples#Customizing QToolBar}{Customizing QToolBar} - for an example. - - \row - \li QToolButton \target qtoolbutton-widget - \li Supports the \l{box model}. - - If the QToolButton has a menu, is - \l{#menu-indicator-sub}{::menu-indicator} subcontrol can be used to - style the indicator. By default, the menu-indicator is positioned - at the bottom right of the Padding rectangle of the widget. - - If the QToolButton is in QToolButton::MenuButtonPopup mode, - the \l{#menu-button-sub}{::menu-button} subcontrol is used to draw the - menu button. \l{#menu-arrow-sub}{::menu-arrow} subcontrol is used to - draw the menu arrow inside the menu-button. By default, it is - positioned in the center of the Contents rectangle of the - menu-button subcontrol. - - When the QToolButton displays arrows, the \l{#up-arrow-sub}{::up-arrow}, - \l{#down-arrow-sub}{::down-arrow}, \l{#left-arrow-sub}{::left-arrow} - and \l{#right-arrow-sub}{::right-arrow} subcontrols are used. - - \warning If you only set a background-color on a QToolButton, the background - will not appear unless you set the border property to some value. This is - because, by default, the QToolButton draws a native border which completely - overlaps the background-color. For example, - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 31 - - See \l{Qt Style Sheets Examples#Customizing QToolButton}{Customizing QToolButton} - for an example. - - \row - \li QToolBox \target qtoolbox-widget - \li Supports the \l{box model}. - - The individual tabs can by styled using the - \l{#tab-sub}{::tab} subcontrol. The tabs support the - \l{#only-one-ps}{:only-one}, \l{#first-ps}{:first}, - \l{#last-ps}{:last}, \l{#middle-ps}{:middle}, - \l{#previous-selected-ps}{:previous-selected}, - \l{#next-selected-ps}{:next-selected}, - \l{#selected-ps}{:selected} pseudo states. - - \row - \li QToolTip \target qtooltip-widget - \li Supports the \l{box model}. The \l{#opacity-prop}{opacity} - property controls the opacity of the tooltip. - - See \l{Qt Style Sheets Examples#Customizing QFrame}{Customizing QFrame} - for an example (a QToolTip is a QFrame). - - \row - \li QTreeView \target qtreeview-widget - \li Supports the \l{box model}. When - \l{QAbstractItemView::alternatingRowColors}{alternating row colors} - is enabled, the alternating colors can be styled using the - \l{#alternate-background-color-prop}{alternate-background-color} - property. - - The color and background of the selected item is styled using - \l{#selection-color-prop}{selection-color} and - \l{#selection-background-color-prop}{selection-background-color} - respectively. - - The selection behavior is controlled by the - \l{#show-decoration-selected-prop}{show-decoration-selected} property. - - The branches of the tree view can be styled using the - \l{#branch-sub}{::branch} subcontrol. The - ::branch Sub-control supports the \l{open-ps}{:open}, - \l{closed-ps}{:closed}, \l{has-siblings-ps}{:has-sibling} and - \l{has-children-ps}{:has-children} pseudo states. - - Use the \l{#item-sub}{::item} subcontrol for more fine grained - control over the items in the QTreeView. - - See \l{qabstractscrollarea-widget}{QAbsractScrollArea} to - style scrollable backgrounds. - - See \l{Qt Style Sheets Examples#Customizing QTreeView}{Customizing QTreeView} - for an example to style the branches. - - \row - \li QTreeWidget \target qtreewidget-widget - \li See \l{#qtreeview-widget}{QTreeView}. - - \row - \li QWidget \target qwidget-widget - \li Supports only the \l{Qt Style Sheets Reference#background-prop}{background}, - \l{#background-clip-prop}{background-clip} and - \l{#background-origin-prop}{background-origin} properties. - - If you subclass from QWidget, you need to provide a paintEvent for your - custom QWidget as below: - \snippet doc/src/snippets/code/doc_src_stylesheet.cpp 32 - - The above code is a no-operation if there is no stylesheet set. - - \warning Make sure you define the Q_OBJECT macro for your custom - widget. - - \endtable - - \section1 List of Properties - - The table below lists all the properties supported by Qt Style - Sheets. Which values can be given to an property depend on the - \l{List of Property Types}{property's type}. Unless otherwise - specified, properties below apply to all widgets. Properties - marked with an asterisk * are specific to Qt and have no equivalent - in CSS2 or CSS3. - - \table 100% - \header - \li Property - \li Type - \li Description - - \row - \li \b{\c alternate-background-color} \target alternate-background-color-prop - \li \l{#Brush}{Brush} \BR - \li The \l{QAbstractItemView::alternatingRowColors} - {alternate background color} used in QAbstractItemView subclasses. - - If this property is not set, the default value is - whatever is set for the palette's - \l{QPalette::}{AlternateBase} role. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 33 - - See also \l{Qt Style Sheets Reference#background-prop}{background} and - \l{#selection-background-color-prop}{selection-background-color}. - - \row - \li \b{\c background} \target background-prop - \li \l{#Background}{Background} - \li Shorthand notation for setting the background. Equivalent - to specifying \c background-color, \c background-image, \c - background-repeat, and/or \c background-position. - - This property is supported by QAbstractItemView - subclasses, QAbstractSpinBox subclasses, QCheckBox, - QComboBox, QDialog, QFrame, QGroupBox, QLabel, QLineEdit, - QMenu, QMenuBar, QPushButton, QRadioButton, QSplitter, - QTextEdit, QToolTip, and plain \l{QWidget}s. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 34 - - - Often, it is required to set a fill pattern similar to the styles - in Qt::BrushStyle. You can use the background-color property for - Qt::SolidPattern, Qt::RadialGradientPattern, Qt::LinearGradientPattern - and Qt::ConicalGradientPattern. The other patterns are easily achieved - by creating a background image that contains the pattern. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 35 - - See also \l{#background-origin-prop}{background-origin}, - \l{#selection-background-color-prop}{selection-background-color}, - \l{#background-clip-prop}{background-clip}, - \l{#background-attachment-prop}{background-attachment} - and \l{#alternate-background-color-prop}{alternate-background-color}. - - \row - \li \c background-color \target background-color-prop - \li \l{#Brush}{Brush} \BR - \li The background color used for the widget. - - Examples: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 36 - - \row - \li \c background-image \target background-image-prop - \li \l{#Url}{Url} - \li The background image used for the widget. Semi-transparent - parts of the image let the \c background-color shine - through. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 37 - - \row - \li \c background-repeat \target background-repeat-prop - \li \l{#Repeat}{Repeat} - \li Whether and how the background image is repeated to fill - the \c background-origin rectangle. - - If this property is not specified, the background image - is repeated in both directions (\c repeat). - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 38 - - \row - \li \c background-position - \li \l{#Alignment}{Alignment} - \li The alignment of the background image within the \c - background-origin rectangle. - - If this property is not specified, the alignment is \c - top \c left. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 39 - - \row - \li \b{\c background-attachment} \target background-attachment-prop - \li \l{#Attachment}{Attachment} - \li Determines whether the background-image in a QAbstractScrollArea - is scrolled or fixed with respect to the viewport. - By default, the background-image scrolls with the viewport. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 40 - - See also \l{Qt Style Sheets Reference#background-prop}{background} - - \row - \li \b{\c background-clip} \target background-clip-prop - \li \l{#Origin}{Origin} - \li The widget's rectangle, in which the \c background is drawn. - - This property specifies the rectangle to which the \c background-color - and \c background-image are clipped. - - This property is supported by QAbstractItemView - subclasses, QAbstractSpinBox subclasses, QCheckBox, - QComboBox, QDialog, QFrame, QGroupBox, QLabel, - QPushButton, QRadioButton, QSplitter, QTextEdit, QToolTip, - and plain \l{QWidget}s. - - If this property is not specified, the default is \c - border. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 41 - - See also \l{Qt Style Sheets Reference#background-prop}{background}, - \l{#background-origin-prop}{background-origin} and \l{The Box Model}. - - \row - \li \b{\c background-origin} \target background-origin-prop - \li \l{#Origin}{Origin} - \li The widget's background rectangle, to use in conjunction - with \c background-position and \c background-image. - - This property is supported by QAbstractItemView - subclasses, QAbstractSpinBox subclasses, QCheckBox, - QComboBox, QDialog, QFrame, QGroupBox, QLabel, - QPushButton, QRadioButton, QSplitter, QTextEdit, QToolTip, - and plain \l{QWidget}s. - - If this property is not specified, the default is \c - padding. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 42 - - See also \l{Qt Style Sheets Reference#background-prop}{background} and - \l{The Box Model}. - - \row - \li \b{\c border} \target border-prop - \li \l{#Border}{Border} - \li Shorthand notation for setting the widget's border. Equivalent - to specifying \c border-color, \c border-style, and/or - \c border-width. - - This property is supported by QAbstractItemView - subclasses, QAbstractSpinBox subclasses, QCheckBox, - QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, - QMenu, QMenuBar, QPushButton, QRadioButton, QSplitter, - QTextEdit, QToolTip, and plain \l{QWidget}s. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 43 - - \row - \li \c border-top - \li \l{#Border}{Border} - \li Shorthand notation for setting the widget's top border. - Equivalent to specifying \c border-top-color, \c - border-top-style, and/or \c border-top-width. - - \row - \li \c border-right - \li \l{#Border}{Border} - \li Shorthand notation for setting the widget's right border. - Equivalent to specifying \c border-right-color, \c - border-right-style, and/or \c border-right-width. - - \row - \li \c border-bottom - \li \l{#Border}{Border} - \li Shorthand notation for setting the widget's bottom border. - Equivalent to specifying \c border-bottom-color, \c - border-bottom-style, and/or \c border-bottom-width. - - \row - \li \c border-left - \li \l{#Border}{Border} - \li Shorthand notation for setting the widget's left border. - Equivalent to specifying \c border-left-color, \c - border-left-style, and/or \c border-left-width. - - \row - \li \b{\c border-color} \target border-attrs - \target border-color-prop - \li \l{#Box Colors}{Box Colors} - \li The color of all the border's edges. Equivalent to - specifying \c border-top-color, \c border-right-color, \c - border-bottom-color, and \c border-left-color. - - This property is supported by QAbstractItemView - subclasses, QAbstractSpinBox subclasses, QCheckBox, - QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, - QMenu, QMenuBar, QPushButton, QRadioButton, QSplitter, - QTextEdit, QToolTip, and plain \l{QWidget}s. - - If this property is not specified, it defaults to - \l{#color-prop}{color} (i.e., the widget's foreground - color). - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 44 - - See also \l{Qt Style Sheets Reference#border-style-prop}{border-style}, - \l{Qt Style Sheets Reference#border-width-prop}{border-width}, - \l{#border-image-prop}{border-image}, and \l{The Box Model}. - - \row - \li \c border-top-color - \li \l{#Brush}{Brush} \BR - \li The color of the border's top edge. - - \row - \li \c border-right-color - \li \l{#Brush}{Brush} \BR - \li The color of the border's right edge. - - \row - \li \c border-bottom-color - \li \l{#Brush}{Brush} \BR - \li The color of the border's bottom edge. - - \row - \li \c border-left-color - \li \l{#Brush}{Brush} \BR - \li The color of the border's left edge. - - \row - \li \b{\c border-image} \target border-image-prop - \li \l{#Border Image}{Border Image} - \li The image used to fill the border. The image is cut into - nine parts and stretched appropriately if necessary. See - \l{#Border Image}{Border Image} for details. - - This property is supported by QAbstractItemView - subclasses, QAbstractSpinBox subclasses, QCheckBox, - QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, - QMenu, QMenuBar, QPushButton, QRadioButton, QSplitter, - QTextEdit and QToolTip. - - See also \l{#border-color-prop}{border-color}, - \l{Qt Style Sheets Reference#border-style-prop}{border-style}, - \l{Qt Style Sheets Reference#border-width-prop}{border-width}, and - \l{The Box Model}. - - \row - \li \b{\c border-radius} \target border-radius-prop - \li \l{#Radius}{Radius} - \li The radius of the border's corners. Equivalent to - specifying \c border-top-left-radius, \c - border-top-right-radius, \c border-bottom-right-radius, - and \c border-bottom-left-radius. - - The border-radius clips the element's - \l{Qt Style Sheets Reference#background-prop}{background}. - - This property is supported by QAbstractItemView - subclasses, QAbstractSpinBox subclasses, QCheckBox, - QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, QMenu, - QMenuBar, QPushButton, QRadioButton, QSplitter, QTextEdit, - and QToolTip. - - If this property is not specified, it defaults to 0. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 45 - - See also \l{Qt Style Sheets Reference#border-width-prop}{border-width} and - \l{The Box Model}. - - \row - \li \c border-top-left-radius - \li \l{#Radius}{Radius} - \li The radius of the border's top-left corner. - - \row - \li \c border-top-right-radius - \li \l{#Radius}{Radius} - \li The radius of the border's top-right corner. - - \row - \li \c border-bottom-right-radius - \li \l{#Radius}{Radius} - \li The radius of the border's bottom-right corner. Setting - this property to a positive value results in a rounded - corner. - - \row - \li \c border-bottom-left-radius - \li \l{#Radius}{Radius} - \li The radius of the border's bottom-left corner. Setting this - property to a positive value results in a rounded corner. - - \row - \li \b{\c border-style} \target border-style-prop - \li \l {Border Style} - \li The style of all the border's edges. - - This property is supported by QAbstractItemView - subclasses, QAbstractSpinBox subclasses, QCheckBox, - QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, QMenu, - QMenuBar, QPushButton, QRadioButton, QSplitter, QTextEdit, - and QToolTip. - - If this property is not specified, it defaults to \c none. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 46 - - See also \l{#border-color-prop}{border-color}, - \l{Qt Style Sheets Reference#border-style-prop}{border-style}, - \l{#border-image-prop}{border-image}, and \l{The Box Model}. - - \row - \li \c border-top-style - \li \l{#Border Style}{Border Style} - \li The style of the border's top edge. - - \row - \li \c border-right-style - \li \l{#Border Style}{Border Style} - \li The style of the border's right edge/ - - \row - \li \c border-bottom-style - \li \l{#Border Style}{Border Style} - \li The style of the border's bottom edge. - - \row - \li \c border-left-style - \li \l{#Border Style}{Border Style} - \li The style of the border's left edge. - - \row - \li \b{\c border-width} \target border-width-prop - \li \l{#Box Lengths}{Box Lengths} - \li The width of the border. Equivalent to setting \c - border-top-width, \c border-right-width, \c - border-bottom-width, and \c border-left-width. - - This property is supported by QAbstractItemView - subclasses, QAbstractSpinBox subclasses, QCheckBox, - QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, QMenu, - QMenuBar, QPushButton, QRadioButton, QSplitter, QTextEdit, - and QToolTip. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 47 - - See also \l{#border-color-prop}{border-color}, - \l{#border-radius-prop}{border-radius}, - \l{Qt Style Sheets Reference#border-style-prop}{border-style}, - \l{#border-image-prop}{border-image}, and - \l{The Box Model}. - - \row - \li \c border-top-width - \li \l{#Length}{Length} - \li The width of the border's top edge. - - \row - \li \c border-right-width - \li \l{#Length}{Length} - \li The width of the border's right edge. - - \row - \li \c border-bottom-width - \li \l{#Length}{Length} - \li The width of the border's bottom edge. - - \row - \li \c border-left-width - \li \l{#Length}{Length} - \li The width of the border's left edge. - - \row - \li \b{\c bottom} \target bottom-prop - \li \l{#Length}{Length} - \li If \l{#position-prop}{position} is \c relative (the - default), moves a \l{subcontrol} by a certain offset up; - specifying \tt{bottom: \e{y}} is then equivalent to - specifying \tt{\l{Qt Style Sheets Reference#top-prop}{top}: -\e{y}}. - - If \l{#position-prop}{position} is \c absolute, the \c - bottom property specifies the subcontrol's bottom edge - in relation to the parent's bottom edge (see also - \l{Qt Style Sheets Reference#subcontrol-origin-prop} - {subcontrol-origin}). - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 48 - - See also \l{Qt Style Sheets Reference#left-prop}{left}, \l{#right-prop}{right}, and - \l{Qt Style Sheets Reference#top-prop}{top}. - - \row - \li \b{\c button-layout} \target button-layout-prop - \li \l{#Number}{Number} - \li The layout of buttons in a QDialogButtonBox or - a QMessageBox. The possible values are 0 - (\l{QDialogButtonBox::}{WinLayout}), 1 - (\l{QDialogButtonBox::}{MacLayout}), 2 - (\l{QDialogButtonBox::}{KdeLayout}), and 3 - (\l{QDialogButtonBox::}{GnomeLayout}). - - If this property is not specified, it defaults to the - value specified by the current style for the - \l{QStyle::}{SH_DialogButtonLayout} style hint. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 49 - - \row - \li \b{\c color} \target color-prop - \li \l{#Brush}{Brush} \BR - \li The color used to render text. - - This property is supported by all widgets that respect - the \l QWidget::palette. - - If this property is not set, the default is whatever is - set for in the widget's palette for the - QWidget::foregroundRole (typically black). - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 50 - - See also \l{Qt Style Sheets Reference#background-prop}{background} and - \l{#selection-color-prop}{selection-color}. - - \row - \li \b{\c dialogbuttonbox-buttons-have-icons} - \li \l{#Boolean}{Boolean} - \li Whether the buttons in a QDialogButtonBox show icons - - If this property is set to 1, the buttons of a QDialogButtonBox - show icons; if it is set to 0, the icons are not shown. - - See the \l{Qt Style Sheets Reference#list of icons}{List of Icons} - section for information on how to set icons. - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 51 - - \note Styles defining this property must be applied before the - QDialogButtonBox is created; this means that you must apply the - style to the parent widget or to the application itself. - - \omit - \row - \li \b{\c etch-disabled-text}* - \li \l{#Boolean}{Boolean} - \li Whether disabled text is drawn etched. - - If this property is not specified, it defaults to the - value specified by the current style for the - \l{QStyle::}{SH_EtchDisabledText} style hint. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 52 - \endomit - - \row - \li \b{\c font} \target font-prop - \li \l{#Font}{Font} - \li Shorthand notation for setting the text's font. Equivalent - to specifying \c font-family, \c font-size, \c font-style, - and/or \c font-weight. - - This property is supported by all widgets that respect - the \l QWidget::font. - - If this property is not set, the default is the - QWidget::font. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 53 - - \row - \li \c font-family - \li String - \li The font family. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 54 - - \row - \li \c font-size - \li \l{#Font Size}{Font Size} - \li The font size. In this version of Qt, only pt and px metrics are - supported. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 55 - - \row - \li \c font-style - \li \l {Font Style} - \li The font style. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 56 - - \row - \li \c font-weight - \li \l{#Font Weight}{Font Weight} - \li The weight of the font. - - \row - \li \b{\c gridline-color}* \target gridline-color-prop - \li \l{#Color}{Color} \BR - \li The color of the grid line in a QTableView. - - If this property is not specified, it defaults to the - value specified by the current style for the - \l{QStyle::}{SH_Table_GridLineColor} style hint. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 57 - - \row - \li \b{\c height} \target height-prop - \li \l{#Length}{Length} - \li The height of a \l{subcontrol} (or in some case, a widget). - - If this property is not specified, it defaults to a value - that depends on the subcontrol/widget and on the current style. - - \warning Unless otherwise specified, this property has no effect - when set on widgets. If you want a widget with a fixed height, set - the \l{#min-width-prop}{min-height} and - \l{#max-width-prop}{max-height} to the same value. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 58 - - See also \l{#width-prop}{width}. - - \row - \li \b{\c icon-size} \target icon-size-prop - \li \l{#Length}{Length} - \li The width and height of the icon in a widget. - - The icon size of the following widgets can be set using this - property. - \list - \li QCheckBox - \li QListView - \li QPushButton - \li QRadioButton - \li QTabBar - \li QToolBar - \li QToolBox - \li QTreeView - \endlist - - \row - \li \b{\c image}* \target image-prop - \li \l{#Url}{Url}+ - \li The image that is drawn in the contents rectangle of a - \l{subcontrol}. - - The image property accepts a list of \l{#Url}{Url}s or - an \c{svg}. The actual image that is drawn is determined - using the same algorithm as QIcon (i.e) the image is never scaled - up but always scaled down if necessary. If a \c{svg} is specified, - the image is scaled to the size of the contents rectangle. - - Setting the image property on sub controls implicitly sets the - width and height of the sub-control (unless the image in a SVG). - - In Qt 4.3 and later, the alignment of the - image within the rectangle can be specified using - \l{image-position-prop}{image-position}. - - This property is for \l{subcontrol}s only--we don't support it for - other elements. - - \warning The QIcon SVG plugin is needed to render SVG images. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 59 - - \row - \li \b{\c image-position} \target image-position-prop - \li \l{#Alignment}{alignment} - \li In Qt 4.3 and later, the alignment of the image image's position can be specified - using relative or absolute position. - - \row - \li \b{\c left} \target left-prop - \li \l{#Length}{Length} - \li If \l{#position-prop}{position} is \c relative (the - default), moves a \l{subcontrol} by a certain offset to - the right. - - If \l{#position-prop}{position} is \c absolute, the \c - left property specifies the subcontrol's left edge in - relation to the parent's left edge (see also - \l{Qt Style Sheets Reference#subcontrol-origin-prop}{subcontrol-origin}). - - If this property is not specified, it defaults to \c 0. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 60 - - See also \l{#right-prop}{right}, \l{Qt Style Sheets Reference#top-prop}{top}, and - \l{#bottom-prop}{bottom}. - - \row - \li \b{\c lineedit-password-character*} \target lineedit-password-character-prop - \li \l{#Number}{Number} - \li The QLineEdit password character as a Unicode number. - - If this property is not specified, it defaults to the - value specified by the current style for the - \l{QStyle::}{SH_LineEdit_PasswordCharacter} style hint. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 61 - - \row - \li \b{\c margin} \target margin-prop - \li \l {Box Lengths} - \li The widget's margins. Equivalent to specifying \c - margin-top, \c margin-right, \c margin-bottom, and \c - margin-left. - - This property is supported by QAbstractItemView - subclasses, QAbstractSpinBox subclasses, QCheckBox, - QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, QMenu, - QMenuBar, QPushButton, QRadioButton, QSplitter, QTextEdit, - and QToolTip. - - If this property is not specified, it defaults to \c 0. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 62 - - See also \l{Qt Style Sheets Reference#padding-prop}{padding}, - \l{#spacing-prop}{spacing}, and \l{The Box Model}. - - \row - \li \c margin-top - \li \l{#Length}{Length} - \li The widget's top margin. - - \row - \li \c margin-right - \li \l{#Length}{Length} - \li The widget's right margin. - - \row - \li \c margin-bottom - \li \l{#Length}{Length} - \li The widget's bottom margin. - - \row - \li \c margin-left - \li \l{#Length}{Length} - \li The widget's left margin. - - \row - \li \b{\c max-height} \target max-height-prop - \li \l{#Length}{Length} - \li The widget's or a subcontrol's maximum height. - - This property is supported by QAbstractItemView - subclasses, QAbstractSpinBox subclasses, QCheckBox, - QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, QMenu, - QMenuBar, QPushButton, QRadioButton, QSizeGrip, QSpinBox, - QSplitter, QStatusBar, QTextEdit, and QToolTip. - - The value is relative to the contents rect in the \l{The - Box Model}{box model}. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 63 - - See also \l{#max-width-prop}{max-width}. - - \row - \li \b{\c max-width} \target max-width-prop - \li \l{#Length}{Length} - \li The widget's or a subcontrol's maximum width. - - This property is supported by QAbstractItemView - subclasses, QAbstractSpinBox subclasses, QCheckBox, - QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, QMenu, - QMenuBar, QPushButton, QRadioButton, QSizeGrip, QSpinBox, - QSplitter, QStatusBar, QTextEdit, and QToolTip. - - The value is relative to the contents rect in the \l{The - Box Model}{box model}. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 64 - - See also \l{#max-height-prop}{max-height}. - - - \row - \li \b{\c messagebox-text-interaction-flags*} \target messagebox-text-interaction-flags-prop - \li \l{#Number}{Number} - \li The interaction behavior for text in a message box. - Possible values are based on Qt::TextInteractionFlags. - - If this property is not specified, it defaults to the - value specified by the current style for the - \l{QStyle::}{SH_MessageBox_TextInteractionFlags} style - hint. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 65 - - \row - \li \b{\c min-height} \target min-height-prop - \li \l{#Length}{Length} - \li The widget's or a subcontrol's minimum height. - - This property is supported by QAbstractItemView - subclasses, QAbstractSpinBox subclasses, QCheckBox, - QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, QMenu, - QMenuBar, QPushButton, QRadioButton, QSizeGrip, QSpinBox, - QSplitter, QStatusBar, QTextEdit, and QToolTip. - - If this property is not specified, the minimum height is - derived based on the widget's contents and the style. - - The value is relative to the contents rect in the \l{The - Box Model}{box model}. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 66 - - See also \l{#min-width-prop}{min-width}. - - \row - \li \b{\c min-width} \target min-width-prop - \li \l{#Length}{Length} - \li The widget's or a subcontrol's minimum width. - - This property is supported by QAbstractItemView - subclasses, QAbstractSpinBox subclasses, QCheckBox, - QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, QMenu, - QMenuBar, QPushButton, QRadioButton, QSizeGrip, QSpinBox, - QSplitter, QStatusBar, QTextEdit, and QToolTip. - - If this property is not specified, the minimum width is - derived based on the widget's contents and the style. - - The value is relative to the contents rect in the \l{The - Box Model}{box model}. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 67 - - See also \l{#min-height-prop}{min-height}. - - \row - \li \b{\c opacity*} \target opacity-prop - \li \l{#Number}{Number} - \li The opacity for a widget. Possible values are from 0 - (transparent) to 255 (opaque). For the moment, this is - only supported for \l{QToolTip}{tooltips}. - - If this property is not specified, it defaults to the - value specified by the current style for the - \l{QStyle::}{SH_ToolTipLabel_Opacity} style hint. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 68 - - \row - \li \b{\c padding} \target padding-prop - \li \l{#Box Lengths}{Box Lengths} - \li The widget's padding. Equivalent to specifying \c - padding-top, \c padding-right, \c padding-bottom, and \c - padding-left. - - This property is supported by QAbstractItemView - subclasses, QAbstractSpinBox subclasses, QCheckBox, - QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, QMenu, - QMenuBar, QPushButton, QRadioButton, QSplitter, QTextEdit, - and QToolTip. - - If this property is not specified, it defaults to \c 0. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 69 - - See also \l{#margin-prop}{margin}, - \l{#spacing-prop}{spacing}, and \l{The Box Model}. - - \row - \li \c padding-top - \li \l{#Length}{Length} - \li The widget's top padding. - - \row - \li \c padding-right - \li \l{#Length}{Length} - \li The widget's right padding. - - \row - \li \c padding-bottom - \li \l{#Length}{Length} - \li The widget's bottom padding. - - \row - \li \c padding-left - \li \l{#Length}{Length} - \li The widget's left padding. - - \row - \li \b{\c paint-alternating-row-colors-for-empty-area} - \target paint-alternating-row-colors-for-empty-area-prop - \li \c bool - \li Whether the QTreeView paints alternating row colors for the empty - area (i.e the area where there are no items) - - \row - \li \b{\c position} \target position-prop - \li \c relative \BR - | \c absolute - \li Whether offsets specified using \l{Qt Style Sheets Reference#left-prop}{left}, - \l{#right-prop}{right}, \l{Qt Style Sheets Reference#top-prop}{top}, and - \l{#bottom-prop}{bottom} are relative or absolute - coordinates. - - If this property is not specified, it defaults to \c - relative. - - \row - \li \b{\c right} \target right-prop - \li \l{#Length}{Length} - \li If \l{#position-prop}{position} is \c relative (the - default), moves a \l{subcontrol} by a certain offset to - the left; specifying \tt{right: \e{x}} is then equivalent - to specifying \tt{\l{Qt Style Sheets Reference#left-prop}{left}: -\e{x}}. - - If \l{#position-prop}{position} is \c absolute, the \c - right property specifies the subcontrol's right edge in - relation to the parent's right edge (see also - \l{Qt Style Sheets Reference#subcontrol-origin-prop}{subcontrol-origin}). - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 70 - - See also \l{Qt Style Sheets Reference#left-prop}{left}, \l{Qt Style Sheets Reference#top-prop}{top}, and - \l{#bottom-prop}{bottom}. - - \row - \li \b{\c selection-background-color*} \target selection-background-color-prop - \li \l{#Brush}{Brush} \BR - \li The background of selected text or items. - - This property is supported by all widgets that respect - the \l QWidget::palette and that show selection text. - - If this property is not set, the default value is - whatever is set for the palette's - \l{QPalette::}{Highlight} role. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 71 - - See also \l{#selection-color-prop}{selection-color} and - \l{Qt Style Sheets Reference#background-prop}{background}. - - \row - \li \b{\c selection-color*} \target selection-color-prop - \li \l{#Brush}{Brush} \BR - \li The foreground of selected text or items. - - This property is supported by all widgets that respect - the \l QWidget::palette and that show selection text. - - If this property is not set, the default value is - whatever is set for the palette's - \l{QPalette::}{HighlightedText} role. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 72 - - See also - \l{#selection-background-color-prop}{selection-background-color} - and \l{#color-prop}{color}. - - \row - \li \b{\c show-decoration-selected*} \target show-decoration-selected-prop - \li \l{#Boolean}{Boolean} - \li Controls whether selections in a QListView cover the - entire row or just the extent of the text. - - If this property is not specified, it defaults to the - value specified by the current style for the - \l{QStyle::}{SH_ItemView_ShowDecorationSelected} style - hint. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 73 - - \row - \li \b{\c spacing*} \target spacing-prop - \li \l{#Length}{Length} - \li Internal spacing in the widget. - - This property is supported by QCheckBox, checkable - \l{QGroupBox}es, QMenuBar, and QRadioButton. - - If this property is not specified, the default value - depends on the widget and on the current style. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 74 - - See also \l{Qt Style Sheets Reference#padding-prop}{padding} and - \l{#margin-prop}{margin}. - - \row - \li \b{\c subcontrol-origin*} \target subcontrol-origin-prop - \li \l{#Origin}{Origin} - \li The origin rectangle of the \l subcontrol within the - parent element. - - If this property is not specified, the default is \c - padding. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 75 - - See also - \l{Qt Style Sheets Reference#subcontrol-position-prop}{subcontrol-position}. - - \row - \li \b{\c subcontrol-position*} \target subcontrol-position-prop - \li \l{#Alignment}{Alignment} - \li The alignment of the \l subcontrol within the origin - rectangle specified by \l{Qt Style Sheets Reference#subcontrol-origin-prop} - {subcontrol-origin}. - - If this property is not specified, it defaults to a value - that depends on the subcontrol. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 76 - - See also - \l{Qt Style Sheets Reference#subcontrol-origin-prop}{subcontrol-origin}. - - \row - \li \b{\c text-align} \target text-align-prop - \li \l{#Alignment}{Alignment} - \li The alignment of text and icon within the contents of the widget. - - If this value is not specified, it defaults to the value - that depends on the native style. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 77 - - This property is currently supported only by QPushButton - and QProgressBar. - - \row - \li \b{\c text-decoration} - \li \c none \BR - \c underline \BR - \c overline \BR - \c line-through - \li Additional text effects - - \row - \li \b{\c top} \target top-prop - \li \l{#Length}{Length} - \li If \l{#position-prop}{position} is \c relative (the - default), moves a \l{subcontrol} by a certain offset - down. - - If \l{#position-prop}{position} is \c absolute, the \c top - property specifies the subcontrol's top edge in relation - to the parent's top edge (see also - \l{Qt Style Sheets Reference#subcontrol-origin-prop}{subcontrol-origin}). - - If this property is not specified, it defaults to \c 0. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 78 - - See also \l{Qt Style Sheets Reference#left-prop}{left}, \l{#right-prop}{right}, and - \l{#bottom-prop}{bottom}. - - \row - \li \b{\c width} \target width-prop - \li \l{#Length}{Length} - \li The width of a \l{subcontrol} (or a widget in some cases). - - If this property is not specified, it defaults to a value - that depends on the subcontrol/widget and on the current style. - - \warning Unless otherwise specified, this property has no effect - when set on widgets. If you want a widget with a fixed width, set - the \l{#min-width-prop}{min-width} and - \l{#max-width-prop}{max-width} to the same value. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 79 - - See also \l{#height-prop}{height}. - - \endtable - - \target list of icons - \section1 List of Icons - - Icons used in Qt can be customized using the following properties. Each of - the properties listed in this section have the type \l{#Icon}{Icon}. - - Note that for icons to appear in buttons in a QDialogButtonBox, you need to - set the dialogbuttonbox-buttons-have-icons property to true. Also, to - customize the size of the icons, use the icon-size property. - - \table 100% - \header - \li Name - \li QStyle::StandardPixmap - - \row - \li backward-icon - \li QStyle::SP_ArrowBack - - \row - \li cd-icon - \li QStyle::SP_DriveCDIcon - - \row - \li computer-icon - \li QStyle::SP_ComputerIcon - - \row - \li desktop-icon - \li QStyle::SP_DesktopIcon - - \row - \li dialog-apply-icon - \li QStyle::SP_DialogApplyButton - - \row - \li dialog-cancel-icon - \li QStyle::SP_DialogCancelButton - - \row - \li dialog-close-icon - \li QStyle::SP_DialogCloseButton - - \row - \li dialog-discard-icon - \li QStyle::SP_DialogDiscardButton - - \row - \li dialog-help-icon - \li QStyle::SP_DialogHelpButton - - \row - \li dialog-no-icon - \li QStyle::SP_DialogNoButton - - \row - \li dialog-ok-icon - \li QStyle::SP_DialogOkButton - - \row - \li dialog-open-icon - \li QStyle::SP_DialogOpenButton - - \row - \li dialog-reset-icon - \li QStyle::SP_DialogResetButton - - \row - \li dialog-save-icon - \li QStyle::SP_DialogSaveButton - - \row - \li dialog-yes-icon - \li QStyle::SP_DialogYesButton - - \row - \li directory-closed-icon - \li QStyle::SP_DirClosedIcon - - \row - \li directory-icon - \li QStyle::SP_DirIcon - - \row - \li directory-link-icon - \li QStyle::SP_DirLinkIcon - - \row - \li directory-open-icon - \li QStyle::SP_DirOpenIcon - - \row - \li dockwidget-close-icon - \li QStyle::SP_DockWidgetCloseButton - - \row - \li downarrow-icon - \li QStyle::SP_ArrowDown - - \row - \li dvd-icon - \li QStyle::SP_DriveDVDIcon - - \row - \li file-icon - \li QStyle::SP_FileIcon - - \row - \li file-link-icon - \li QStyle::SP_FileLinkIcon - - \omit - \row - \li filedialog-backward-icon - \li QStyle::SP_FileDialogBack - \endomit - - \row - \li filedialog-contentsview-icon - \li QStyle::SP_FileDialogContentsView - - \row - \li filedialog-detailedview-icon - \li QStyle::SP_FileDialogDetailedView - - \row - \li filedialog-end-icon - \li QStyle::SP_FileDialogEnd - - \row - \li filedialog-infoview-icon - \li QStyle::SP_FileDialogInfoView - - \row - \li filedialog-listview-icon - \li QStyle::SP_FileDialogListView - - \row - \li filedialog-new-directory-icon - \li QStyle::SP_FileDialogNewFolder - - \row - \li filedialog-parent-directory-icon - \li QStyle::SP_FileDialogToParent - - \row - \li filedialog-start-icon - \li QStyle::SP_FileDialogStart - - \row - \li floppy-icon - \li QStyle::SP_DriveFDIcon - - \row - \li forward-icon - \li QStyle::SP_ArrowForward - - \row - \li harddisk-icon - \li QStyle::SP_DriveHDIcon - - \row - \li home-icon - \li QStyle::SP_DirHomeIcon - - \row - \li leftarrow-icon - \li QStyle::SP_ArrowLeft - - \row - \li messagebox-critical-icon - \li QStyle::SP_MessageBoxCritical - - \row - \li messagebox-information-icon - \li QStyle::SP_MessageBoxInformation - - \row - \li messagebox-question-icon - \li QStyle::SP_MessageBoxQuestion - - \row - \li messagebox-warning-icon - \li QStyle::SP_MessageBoxWarning - - \row - \li network-icon - \li QStyle::SP_DriveNetIcon - - \row - \li rightarrow-icon - \li QStyle::SP_ArrowRight - - \row - \li titlebar-contexthelp-icon - \li QStyle::SP_TitleBarContextHelpButton - - \row - \li titlebar-maximize-icon - \li QStyle::SP_TitleBarMaxButton - - \row - \li titlebar-menu-icon - \li QStyle::SP_TitleBarMenuButton - - \row - \li titlebar-minimize-icon - \li QStyle::SP_TitleBarMinButton - - \row - \li titlebar-normal-icon - \li QStyle::SP_TitleBarNormalButton - - \row - \li titlebar-shade-icon - \li QStyle::SP_TitleBarShadeButton - - \row - \li titlebar-unshade-icon - \li QStyle::SP_TitleBarUnshadeButton - - \row - \li trash-icon - \li QStyle::SP_TrashIcon - - \row - \li uparrow-icon - \li QStyle::SP_ArrowUp - - \endtable - - \section1 List of Property Types - - The following table summarizes the syntax and meaning of the - different property types. - - \table 100% - \header - \li Type - \li Syntax - \li Description - - \row - \li \b Alignment \target Alignment - \li \{ \c top \BR - | \c bottom \BR - | \c left \BR - | \c right \BR - | \c center \}* - \li Horizontal and/or vertical alignment. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 80 - - \row - \li \b Attachment \target Attachment - \li \{ \c scroll \BR - | \c fixed \}* - \li Scroll or fixed attachment. - - \row - \li \b Background \target Background - \li \{ \l{#Brush}{Brush} \BR - | \l{#Url}{Url} \BR - | \l{#Repeat}{Repeat} \BR - | \l{#Alignment}{Alignment} \}* - \li A sequence of \l{#Brush}{Brush}, \l{#Url}{Url}, - \l{#Repeat}{Repeat}, and \l{#Alignment}{Alignment}. - - \row - \li \b Boolean \target Boolean - \li 0 | 1 - \li True (\c 1) or false (\c 0). - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 81 - - \row - \li \b Border \target Border - \li \{ \l{#Border Style}{Border Style} \BR - | \l{#Length}{Length} \BR - | \l{#Brush}{Brush} \}* - \li Shorthand border property. - - \row - \li \b{Border Image} \target Border Image - \li \c none \BR - | \l{Url} \l{Number}\{4\} \BR (\c stretch | \c repeat){0,2} - \li A border image is an image that is composed of nine parts - (top left, top center, top right, center left, center, - center right, bottom left, bottom center, and bottom - right). When a border of a certain size is required, the - corner parts are used as is, and the top, right, bottom, - and left parts are stretched or repeated to produce a - border with the desired size. - - See the - \l{http://www.w3.org/TR/css3-background/#the-border-image} - {CSS3 Draft Specification} for details. - - \row - \li \b{Border Style} \target Border Style - \li \c dashed \BR - | \c dot-dash \BR - | \c dot-dot-dash \BR - | \c dotted \BR - | \c double \BR - | \c groove \BR - | \c inset \BR - | \c outset \BR - | \c ridge \BR - | \c solid \BR - | \c none - \li Specifies the pattern used to draw a border. - See the \l{http://www.w3.org/TR/css3-background/#border-style} - {CSS3 Draft Specification} for details. - - \row - \li \b{Box Colors} \target Box Colors - \li \l{#Brush}{Brush}\{1,4\} - \li One to four occurrences of \l{#Brush}{Brush}, specifying the top, - right, bottom, and left edges of a box, respectively. If - the left color is not specified, it is taken to be the - same as the right color. If the bottom color is not - specified, it is taken to be the same as the top color. If - the right color is not specified, it is taken to be the - same as the top color. - - Example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 82 - - \row - \li \b{Box Lengths} \target Box Lengths - \li \l{#Length}{Length}\{1,4\} - \li One to four occurrences of \l{#Length}{Length}, specifying the - top, right, bottom, and left edges of a box, - respectively. If the left length is not specified, it is - taken to be the same as the right length. If the bottom - length is not specified, is it taken to be the same as the - top length. If the right length is not specified, it is - taken to be the same as the top length. - - Examples: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 83 - - \row - \li \b{Brush} \target Brush - \li \l{#Color}{Color} \BR - | \l{Gradient} \BR - | \l{PaletteRole} - \li Specifies a Color or a Gradient or an entry in the Palette. - - \row - \li \b{Color} \target Color - \li \tt{rgb(\e{r}, \e{g}, \e{b})} \BR - | \tt{rgba(\e{r}, \e{g}, \e{b}, \e{a})} \BR - | \tt{hsv(\e{h}, \e{s}, \e{v})} \BR - | \tt{hsva(\e{h}, \e{s}, \e{v}, \e{a})} \BR - | \tt{#\e{rrggbb}} \BR - | \l{QColor::setNamedColor()}{Color Name} \BR - \li Specifies a color as RGB (red, green, blue) or RGBA - (red, green, blue, alpha) or HSV (hue, saturation, value) or HSVA - (hue, saturation, value, alpha) or a named color. The \c rgb() or \c rgba() - syntax can be used with integer values between 0 and 255, or with - percentages. The value of s, v, and a in \c hsv() or \c hsva() must all - be in the range 0-255; the value of h must be in the range 0-359. - - Examples: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 84 - - \note The RGB colors allowed are the same as those allowed with - CSS 2.1, as listed - \l{http://www.w3.org/TR/CSS21/syndata.html#color-units}{here}. - - \row - \li \b{Font} \target Font - \li (\l{#Font Style}{Font Style} | \l{#Font Weight}{Font Weight}){0,2} \l{#Font Size}{Font Size} String - \li Shorthand font property. - - \row - \li \b{Font Size} \target Font Size - \li \l{Length} - \li The size of a font. - - \row - \li \b{Font Style} \target Font Style - \li \c normal \BR - | \c italic \BR - | \c oblique - \li The style of a font. - - \row - \li \b{Font Weight} \target Font Weight - \li \c normal \BR - | \c bold \BR - | \c 100 \BR - | \c 200 \BR - ... \BR - | \c 900 - \li The weight of a font. - - \row - \li \b{Gradient} \target Gradient - \li \c qlineargradient \BR - | \c qradialgradient \BR - | \c qconicalgradient - \li Specifies gradient fills. There are three types of gradient fills: - - \list - \li \e{Linear} gradients interpolate colors between start and - end points. - \li \e{Radial} gradients interpolate colors between a focal - point and end points on a circle surrounding it. - \li \e{Conical} gradients interpolate colors around a center - point. - \endlist - - Gradients are specified in Object Bounding Mode. Imagine the box - in which the gradient is rendered, to have its top left corner at (0, 0) - and its bottom right corner at (1, 1). Gradient parameters are - then specified as percentages from 0 to 1. These values are - extrapolated to actual box coordinates at runtime. It is possible - specify values that lie outside the bounding box (-0.6 or 1.8, for - instance). - - \warning The stops have to appear sorted in ascending order. - - Examples: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 85 - - \row - \li \b{Icon} \target Icon - \li (\l{#Url}{Url} (\c disabled | \c active | \c normal | \c selected)? - (\c on | \c off)? )* - \li A list of url, QIcon::Mode and QIcon::State. - - Example: - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 86 - - \row - \li \b{Length} \target Length - \li \l{#Number}{Number} (\c px | \c pt | \c em | \c ex)? - \li A number followed by a measurement unit. The CSS standard recommends - that user agents must - \l{http://www.w3.org/TR/CSS21/syndata.html#illegalvalues}{ignore} - a declaration with an illegal value. In Qt, it is mandatory to - specify measurement units. For compatibility with earlier versions - of Qt, numbers without measurement units are treated as pixels - in most contexts. The supported units are: - - \list - \li \c px: pixels - \li \c pt: the size of one point (i.e., 1/72 of an inch) - \li \c em: the em width of the font (i.e., the width of 'M') - \li \c ex: the ex width of the font (i.e., the height of 'x') - \endlist - - \row - \li \b{Number} \target Number - \li A decimal integer or a real number - \li Examples: \c 0, \c 18, \c +127, \c -255, \c 12.34, \c -.5, - \c 0009. - - \row - \li \b{Origin} \target Origin - \li \c margin \BR - | \c border \BR - | \c padding \BR - | \c content - \li Indicates which of four rectangles to use. - - \list - \li \c margin: The margin rectangle. The margin falls outside the border. - \li \c border: The border rectangle. This is where any border is drawn. - \li \c padding: The padding rectangle. Unlike the margins, - padding is located inside the border. - \li \c content: The content rectangle. This specifies where - the actual contents go, excluding any - padding, border, or margin. - \endlist - - See also \l{The Box Model}. - - \row - \li \b{PaletteRole} \target PaletteRole - \li \c alternate-base \BR - | \c base \BR - | \c bright-text \BR - | \c button \BR - | \c button-text \BR - | \c dark \BR - | \c highlight \BR - | \c highlighted-text \BR - | \c light \BR - | \c link \BR - | \c link-visited \BR - | \c mid \BR - | \c midlight \BR - | \c shadow \BR - | \c text \BR - | \c window \BR - | \c window-text \BR - \li These values correspond the \l{QPalette::ColorRole}{Color roles} - in the widget's QPalette. - - For example, - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 87 - - \row - \li \b{Radius} \target Radius - \li \l{#Length}{Length}\{1, 2\} - \li One or two occurrences of \l{#Length}{Length}. If only one length is - specified, it is used as the radius of the quarter circle - defining the corner. If two lengths are specified, the - first length is the horizontal radius of a quarter - ellipse, whereas the second length is the vertical radius. - - \row - \li \b{Repeat} \target Repeat - \li \c repeat-x \BR - | \c repeat-y \BR - | \c repeat \BR - | \c no-repeat - \li A value indicating the nature of repetition. - - \list - \li \c repeat-x: Repeat horizontally. - \li \c repeat-y: Repeat vertically. - \li \c repeat: Repeat horizontally and vertically. - \li \c no-repeat: Don't repeat. - \endlist - - \row - \li \b{Url} \target Url - \li \tt{url(\e{filename})} - \li \tt{\e{filename}} is the name of a file on the local disk - or stored using \l{the Qt Resource System}. Setting an - image implicitly sets the width and height of the element. - - \endtable - - \section1 List of Pseudo-States - - The following pseudo-states are supported: - - \table 100% - \header - \li Pseudo-State - \li Description - - \row \li \c :active \target active - \li This state is set when the widget resides in an active window. - - \row - \li \c :adjoins-item \target adjoins-item-ps - \li This state is set when the \l{#branch-sub}{::branch} of a QTreeView - is adjacent to an item. - - \row - \li \c :alternate \target alternate-ps - \li This state is set for every alternate row whe painting the row of - a QAbstractItemView when QAbstractItemView::alternatingRowColors() - is set to true. - - \row - \li \c :bottom \target bottom-ps - \li The item is positioned at the bottom. For example, a QTabBar - that has its tabs positioned at the bottom. - - \row - \li \c :checked \target checked-ps - \li The item is checked. For example, the - \l{QAbstractButton::checked}{checked} state of QAbstractButton. - - \row - \li \c :closable \target closable-ps - \li The items can be closed. For example, the QDockWidget has the - QDockWidget::DockWidgetClosable feature turned on. - - \row - \li \c :closed \target closed-ps - \li The item is in the closed state. For example, an non-expanded - item in a QTreeView - - \row - \li \c :default \target default-ps - \li The item is the default. For example, a - \l{QPushButton::default}{default} QPushButton or a default action - in a QMenu. - - \row - \li \c :disabled \target disabled-ps - \li The item is \l{QWidget::enabled}{disabled}. - - \row - \li \c :editable \target editable-ps - \li The QComboBox is editable. - - \row - \li \c :edit-focus \target edit-focus-ps - \li The item has edit focus (See QStyle::State_HasEditFocus). This state - is available only for Qt Extended applications. - - \row - \li \c :enabled \target enabled-ps - \li The item is \l{QWidget::enabled}{enabled}. - - \row - \li \c :exclusive \target exclusive-ps - \li The item is part of an exclusive item group. For example, a menu - item in a exclusive QActionGroup. - - \row - \li \c :first \target first-ps - \li The item is the first (in a list). For example, the first - tab in a QTabBar. - - \row - \li \c :flat \target flat-ps - \li The item is flat. For example, a - \l{QPushButton::flat}{flat} QPushButton. - - \row - \li \c :floatable \target floatable-ps - \li The items can be floated. For example, the QDockWidget has the - QDockWidget::DockWidgetFloatable feature turned on. - - \row - \li \c :focus \target focus-ps - \li The item has \l{QWidget::hasFocus()}{input focus}. - - \row - \li \c :has-children \target has-children-ps - \li The item has children. For example, an item in a - QTreeView that has child items. - - \row - \li \c :has-siblings \target has-siblings-ps - \li The item has siblings. For example, an item in a - QTreeView that siblings. - - \row - \li \c :horizontal \target horizontal-ps - \li The item has horizontal orientation - - \row - \li \c :hover \target hover-ps - \li The mouse is hovering over the item. - - \row - \li \c :indeterminate \target indeterminate-ps - \li The item has indeterminate state. For example, a QCheckBox - or QRadioButton is \l{Qt::PartiallyChecked}{partially checked}. - - \row - \li \c :last \target last-ps - \li The item is the last (in a list). For example, the last - tab in a QTabBar. - - \row - \li \c :left \target left-ps - \li The item is positioned at the left. For example, a QTabBar - that has its tabs positioned at the left. - - \row - \li \c :maximized \target maximized-ps - \li The item is maximized. For example, a maximized QMdiSubWindow. - - \row - \li \c :middle \target middle-ps - \li The item is in the middle (in a list). For example, a tab - that is not in the beginning or the end in a QTabBar. - - \row - \li \c :minimized \target minimized-ps - \li The item is minimized. For example, a minimized QMdiSubWindow. - - \row - \li \c :movable \target movable-ps - \li The item can be moved around. For example, the QDockWidget has the - QDockWidget::DockWidgetMovable feature turned on. - - \row - \li \c :no-frame \target no-frame-ps - \li The item has no frame. For example, a frameless QSpinBox - or QLineEdit. - - \row - \li \c :non-exclusive \target non-exclusive-ps - \li The item is part of a non-exclusive item group. For example, a menu - item in a non-exclusive QActionGroup. - - \row - \li \c :off \target off-ps - \li For items that can be toggled, this applies to items - in the "off" state. - - \row - \li \c :on \target on-ps - \li For items that can be toggled, this applies to widgets - in the "on" state. - - \row - \li \c :only-one \target only-one-ps - \li The item is the only one (in a list). For example, a lone tab - in a QTabBar. - - \row - \li \c :open \target open-ps - \li The item is in the open state. For example, an expanded - item in a QTreeView, or a QComboBox or QPushButton with - an open menu. - - \row - \li \c :next-selected \target next-selected-ps - \li The next item (in a list) is selected. For example, the - selected tab of a QTabBar is next to this item. - - \row - \li \c :pressed \target pressed-ps - \li The item is being pressed using the mouse. - - \row - \li \c :previous-selected \target previous-selected-ps - \li The previous item (in a list) is selected. For example, a - tab in a QTabBar that is next to the selected tab. - - \row - \li \c :read-only \target read-only-ps - \li The item is marked read only or non-editable. For example, - a read only QLineEdit or a non-editable QComboBox. - - \row - \li \c :right \target right-ps - \li The item is positioned at the right. For example, a QTabBar - that has its tabs positioned at the right. - - \row - \li \c :selected \target selected-ps - \li The item is selected. For example, the selected tab in - a QTabBar or the selected item in a QMenu. - - \row - \li \c :top \target top-ps - \li The item is positioned at the top. For example, a QTabBar - that has its tabs positioned at the top. - - \row - \li \c :unchecked \target unchecked-ps - \li The item is - \l{QAbstractButton::checked}{unchecked}. - - \row - \li \c :vertical \target vertical-ps - \li The item has vertical orientation. - - \row - \li \c :window \target window-ps - \li The widget is a window (i.e top level widget) - - \endtable - - \target subcontrols - \section1 List of Sub-Controls - - The following subcontrols are available: - - \table 100% - \header - \li Sub-Control - \li Description - - \row - \li \c ::add-line \target add-line-sub - \li The button to add a line of a QScrollBar. - - \row - \li \c ::add-page \target add-page-sub - \li The region between the handle (slider) and the \l{#add-line-sub}{add-line} - of a QScrollBar. - - \row - \li \c ::branch \target branch-sub - \li The branch indicator of a QTreeView. - - \row - \li \c ::chunk \target chunk-sub - \li The progress chunk of a QProgressBar. - - \row - \li \c ::close-button \target close-button-sub - \li The close button of a QDockWidget or tabs of QTabBar - - \row - \li \c ::corner \target corner-sub - \li The corner between two scrollbars in a QAbstractScrollArea - - \row - \li \c ::down-arrow \target down-arrow-sub - \li The down arrow of a QComboBox, QHeaderView (sort indicator), - QScrollBar or QSpinBox. - - \row - \li \c ::down-button \target down-button-sub - \li The down button of a QScrollBar or a QSpinBox. - - \row - \li \c ::drop-down \target drop-down-sub - \li The drop-down button of a QComboBox. - - \row - \li \c ::float-button \target float-button-sub - \li The float button of a QDockWidget - - \row - \li \c ::groove \target groove-sub - \li The groove of a QSlider. - - \row - \li \c ::indicator \target indicator-sub - \li The indicator of a QAbstractItemView, a QCheckBox, a QRadioButton, - a checkable QMenu item or a checkable QGroupBox. - - \row - \li \c ::handle \target handle-sub - \li The handle (slider) of a QScrollBar, a QSplitter, or a QSlider. - - \row - \li \c ::icon \target icon-sub - \li The icon of a QAbstractItemView or a QMenu. - - \row - \li \c ::item \target item-sub - \li An item of a QAbstractItemView, a QMenuBar, a QMenu, or - a QStatusBar. - - \row - \li \c ::left-arrow \target left-arrow-sub - \li The left arrow of a QScrollBar. - - \row - \li \c ::left-corner \target left-corner-sub - \li The left corner of a QTabWidget. For example, this control can be - used to control position the left corner widget in a QTabWidget. - - \row - \li \c ::menu-arrow \target menu-arrow-sub - \li The arrow of a QToolButton with a menu. - - \row - \li \c ::menu-button \target menu-button-sub - \li The menu button of a QToolButton. - - \row - \li \c ::menu-indicator \target menu-indicator-sub - \li The menu indicator of a QPushButton. - - \row - \li \c ::right-arrow \target right-arrow-sub - \li The right arrow of a QMenu or a QScrollBar. - - \row - \li \c ::pane \target pane-sub - \li The pane (frame) of a QTabWidget. - - \row - \li \c ::right-corner \target right-corner-sub - \li The right corner of a QTabWidget. For example, this control can be - used to control the position the right corner widget in a QTabWidget. - - \row - \li \c ::scroller \target scroller-sub - \li The scroller of a QMenu or QTabBar. - - \row - \li \c ::section \target section-sub - \li The section of a QHeaderView. - - \row - \li \c ::separator \target separator-sub - \li The separator of a QMenu or in a QMainWindow. - - \row - \li \c ::sub-line \target sub-line-sub - \li The button to subtract a line of a QScrollBar. - - \row - \li \c ::sub-page \target sub-page-sub - \li The region between the handle (slider) and the \l{#sub-line-sub}{sub-line} - of a QScrollBar. - - \row - \li \c ::tab \target tab-sub - \li The tab of a QTabBar or QToolBox. - - \row - \li \c ::tab-bar \target tab-bar-sub - \li The tab bar of a QTabWidget. This subcontrol exists only to - control the position of the QTabBar inside the QTabWidget. To - style the tabs using the \l{#tab-sub}{::tab} subcontrol. - - \row - \li \c ::tear \target tear-sub - \li The tear indicator of a QTabBar. - - \row - \li \c ::tearoff \target tearoff-sub - \li The tear-off indicator of a QMenu. - - \row - \li \c ::text \target text-ps - \li The text of a QAbstractItemView. - - \row - \li \c ::title \target title-sub - \li The title of a QGroupBox or a QDockWidget. - - \row - \li \c ::up-arrow \target up-arrow-sub - \li The up arrow of a QHeaderView (sort indicator), QScrollBar - or a QSpinBox. - - \row - \li \c ::up-button \target up-button-sub - \li The up button of a QSpinBox. - - \endtable - - See \l{Customizing the QPushButton's Menu Indicator Sub-Control} - for an example of how to customize a subcontrol. - */ - -/*! - \page stylesheet-examples.html - \contentspage {Qt Style Sheet}{Contents} - \previouspage Qt Style Sheets Reference - \title Qt Style Sheets Examples - - We will now see a few examples to get started with using Qt Style Sheets. - - \tableofcontents - \section1 Style Sheet Usage - - \section2 Customizing the Foreground and Background Colors - - Let's start by setting yellow as the background color of all - \l{QLineEdit}s in an application. This could be achieved like - this: - - \snippet doc/src/snippets/code/doc_src_stylesheet.cpp 88 - - If we want the property to apply only to the \l{QLineEdit}s that are - children (or grandchildren or grand-grandchildren) of a specific dialog, - we would rather do this: - - \snippet doc/src/snippets/code/doc_src_stylesheet.cpp 89 - - If we want the property to apply only to one specific QLineEdit, - we can give it a name using QObject::setObjectName() and use an - ID Selector to refer to it: - - \snippet doc/src/snippets/code/doc_src_stylesheet.cpp 90 - - Alternatively, we can set the - \l{Qt Style Sheets Reference#background-prop}{background-color} property directly on the - QLineEdit, omitting the selector: - - \snippet doc/src/snippets/code/doc_src_stylesheet.cpp 91 - - To ensure a good contrast, we should also specify a suitable - color for the text: - - \snippet doc/src/snippets/code/doc_src_stylesheet.cpp 92 - - It might be a good idea to change the colors used for selected - text as well: - - \snippet doc/src/snippets/code/doc_src_stylesheet.cpp 93 - - - \section2 Customizing Using Dynamic Properties - - There are many situations where we need to present a form that - has mandatory fields. To indicate to the user that the field is - mandatory, one effective (albeit esthetically dubious) solution - is to use yellow as the background color for those fields. It - turns out this is very easy to implement using Qt Style Sheets. - First, we would use the following application-wide style sheet: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 94 - - This means that every widget whose \c mandatoryField Qt property - is set to true would have a yellow background. - - Then, for each mandatory field widget, we would simply create a - \c mandatoryField property on the fly and set it to true. For - example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.cpp 95 - - \section2 Customizing a QPushButton Using the Box Model - - This time, we will show how to create a red QPushButton. This - QPushButton would presumably be connected to a very destructive - piece of code. - - First, we are tempted to use this style sheet: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 96 - - However, the result is a boring, flat button with no borders: - - \image stylesheet-redbutton1.png A flat red button - - What happened is this: - - \list - \li We have made a request that cannot be satisfied using the - native styles alone (e.g., the Windows XP theme engine doesn't - let us specify the background color of a button). - \li Therefore, the button is rendered using style sheets. - \li We haven't specified any values for - \l{Qt Style Sheets Reference#border-width-prop}{border-width} and - \l{Qt Style Sheets Reference#border-style-prop}{border-style}, so by default we obtain - a 0-pixel wide border of style \c none. - \endlist - - Let's improve the situation by specifying a border: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 97 - - \image stylesheet-redbutton2.png A red button with a beige border - - Things look already a lot better. But the button looks a bit - cramped. Let's specify some spacing between the border and the - text using the \l{Qt Style Sheets Reference#padding-prop}{padding}. Additionally, we will - enforce a minimum width, round the corners, and specify a larger - font to make the button look nicer: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 98 - - \image stylesheet-redbutton3.png A red button with a round beige border and big, bold text - - The only issue remaining is that the button doesn't react when we - press it. We can fix this by specifying a slightly different - background color and use a different border style. - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 99 - - \section2 Customizing the QPushButton's Menu Indicator Sub-Control - - Subcontrols give access to the sub-elements of a widget. For - example, a QPushButton associated with a menu (using - QPushButton::setMenu()) has a menu indicator. Let's customize - the menu indicator for the red push button: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 100 - - By default, the menu indicator is located at the bottom-right - corner of the padding rectangle. We can change this by specifying - \l{Qt Style Sheets Reference#subcontrol-position-prop}{subcontrol-position} and - \l{Qt Style Sheets Reference#subcontrol-origin-prop}{subcontrol-origin} to anchor the - indicator differently. We can also use \l{Qt Style Sheets Reference#top-prop}{top} and - \l{Qt Style Sheets Reference#left-prop}{left} to move the indicator by a few pixels. For - example: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 101 - - This positions the \c myindicator.png to the center right of the - QPushButton's \l{Qt Style Sheets Reference#padding-prop}{padding} rectangle (see - \l{Qt Style Sheets Reference#subcontrol-origin-prop}{subcontrol-origin} for more - information). - - \section2 Complex Selector Example - - Since red seems to be our favorite color, let's make the text in - QLineEdit red by setting the following application-wide - stylesheet: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 102 - - However, we would like to give a visual indication that a - QLineEdit is read-only by making it appear gray: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 103 - - At some point, our design team comes with the requirement that - all \l{QLineEdit}s in the registration form (with the - \l{QObject::objectName}{object name} \c registrationDialog) to be - brown: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 104 - - A few UI design meetings later, we decide that all our - \l{QDialog}s should have brown colored \l{QLineEdit}s: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 105 - - Quiz: What happens if we have a read-only QLineEdit in a QDialog? - [Hint: The \l{The Style Sheet Syntax#Conflict Resolution}{Conflict Resolution} section above explains - what happens in cases like this.] - - \section1 Customizing specific widgets - - This section provides examples to customize specific widgets using Style Sheets. - - \section2 Customizing QAbstractScrollArea - - The background of any QAbstractScrollArea (Item views, QTextEdit - and QTextBrowser) can be set using the background properties. For example, - to set a background-image that scrolls with the scroll bar: - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 106 - - If the background-image is to be fixed with the viewport: - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 107 - - \section2 Customizing QCheckBox - - Styling of a QCheckBox is almost identical to styling a QRadioButton. The - main difference is that a tristate QCheckBox has an indeterminate state. - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 108 - - \section2 Customizing QComboBox - - We will look at an example where the drop down button of a QComboBox - appears "merged" with the combo box frame. - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 109 - - The pop-up of the QComboBox is a QAbstractItemView and is styled using - the descendant selector: - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 110 - - \section2 Customizing QDockWidget - - The title bar and the buttons of a QDockWidget can be customized as - follows: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 111 - - If one desires to move the dock widget buttons to the left, the following - style sheet can be used: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 112 - - \note To customize the separator (resize handle) of a QDockWidget, - use QMainWindow::separator. - - \section2 Customizing QFrame - - A QFrame is styled using the \l{The Box Model}. - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 113 - - \section2 Customizing QGroupBox - - Let us look at an example that moves the QGroupBox's title to - the center. - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 114 - - For a checkable QGroupBox, use the \{#indicator-sub}{::indicator} subcontrol - and style it exactly like a QCheckBox (i.e) - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 115 - - \section2 Customizing QHeaderView - - QHeaderView is customized as follows: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 116 - - \section2 Customizing QLineEdit - - The frame of a QLineEdit is styled using the \l{The Box Model}. To - create a line edit with rounded corners, we can set: - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 117 - - The password character of line edits that have QLineEdit::Password - echo mode can be set using: - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 118 - - The background of a read only QLineEdit can be modified as below: - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 119 - - \section2 Customizing QListView - - The background color of alternating rows can be customized using the following - style sheet: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 120 - - To provide a special background when you hover over items, we can use the - \l{item-sub}{::item} subcontrol. For example, - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 121 - - \section2 Customizing QMainWindow - - The separator of a QMainWindow can be styled as follows: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 122 - - \section2 Customizing QMenu - - Individual items of a QMenu are styled using the 'item' subcontrol as - follows: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 123 - - For a more advanced customization, use a style sheet as follows: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 124 - - \section2 Customizing QMenuBar - - QMenuBar is styled as follows: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 125 - - \section2 Customizing QProgressBar - - The QProgressBar's \l{stylesheet-reference.html#border-prop}{border}, - \l{stylesheet-reference.html#chunk-sub}{chunk}, and - \l{stylesheet-reference.html#text-align-prop}{text-align} can be customized using - style sheets. However, if one property or sub-control is customized, - all the other properties or sub-controls must be customized as well. - - \image progressBar-stylesheet.png - - For example, we change the \l{stylesheet-reference.html#border-prop} - {border} to grey and the \l{stylesheet-reference.html#chunk-sub}{chunk} - to cerulean. - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 126 - - This leaves the \l{stylesheet-reference.html#text-align-prop} - {text-align}, which we customize by positioning the text in the center of - the progress bar. - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 127 - - A \l{stylesheet-reference.html#margin-prop}{margin} can be included to - obtain more visible chunks. - - \image progressBar2-stylesheet.png - - In the screenshot above, we use a - \l{stylesheet-reference.html#margin-prop}{margin} of 0.5 pixels. - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 128 - - \section2 Customizing QPushButton - - A QPushButton is styled as follows: - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 129 - - For a QPushButton with a menu, use the - \l{Qt Style Sheets Reference#menu-indicator-sub}{::menu-indicator} - subcontrol. - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 130 - - Checkable QPushButton have the \l{Qt Style Sheets Reference#checked-ps} - {:checked} pseudo state set. - - \section2 Customizing QRadioButton - - The indicator of a QRadioButton can be changed using: - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 131 - - \section2 Customizing QScrollBar - - The QScrollBar can be styled using its subcontrols like - \l{stylesheet-reference.html#handle-sub}{handle}, - \l{stylesheet-reference.html#add-line-sub}{add-line}, - \l{stylesheet-reference.html#sub-line-sub}{sub-line}, and so on. Note that - if one property or sub-control is customized, all the other properties or - sub-controls must be customized as well. - - \image stylesheet-scrollbar1.png - - The scroll bar above has been styled in aquamarine with a solid grey - border. - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 132 - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 133 - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 134 - - The \l{stylesheet-reference.html#left-arrow-sub}{left-arrow} and - \l{stylesheet-reference.html#right-arrow-sub}{right-arrow} have a solid grey - border with a white background. As an alternative, you could also embed the - image of an arrow. - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 135 - - If you want the scroll buttons of the scroll bar to be placed together - (instead of the edges) like on Mac OS X, you can use the following - stylesheet: - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 136 - - The scroll bar using the above stylesheet looks like this: - \image stylesheet-scrollbar2.png - - - To customize a vertical scroll bar use a style sheet similar to the following: - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 137 - - \section2 Customizing QSizeGrip - - QSizeGrip is usually styled by just setting an image. - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 138 - - \section2 Customizing QSlider - - You can style horizontal slider as below: - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 139 - - If you want to change the color of the slider parts before and after the handle, you can use the add-page - and sub-page subcontrols. For example, for a vertical slider: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 140 - - \section2 Customizing QSpinBox - - QSpinBox can be completely customized as below (the style sheet has commentary inline): - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 141 - - - \section2 Customizing QSplitter - - A QSplitter derives from a QFrame and hence can be styled like a QFrame. - The grip or the handle is customized using the - \l{Qt Style Sheets Reference#handle-sub}{::handle} subcontrol. - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 142 - - \section2 Customizing QStatusBar - - We can provide a background for the status bar and a border for items - inside the status bar as follows: - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 143 - - Note that widgets that have been added to the QStatusBar can be styled - using the descendant declaration (i.e) - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 144 - - \section2 Customizing QTabWidget and QTabBar - - \image tabWidget-stylesheet1.png - - For the screenshot above, we need a stylesheet as follows: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 145 - - Often we require the tabs to overlap to look like below: - \image tabWidget-stylesheet2.png - - For a tab widget that looks like above, we make use of - \l{http://www.communitymx.com/content/article.cfm?cid=B0029} - {negative margins}. The resulting stylesheet looks like this: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 146 - - To move the tab bar to the center (as below), we require the following stylesheet: - \image tabWidget-stylesheet3.png - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 147 - - The tear indicator and the scroll buttons can be further customized as follows: - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 148 - - Since Qt 4.6 the close button can be customized as follow: - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 159 - - \section2 Customizing QTableView - - Suppose we'd like our selected item in QTableView to have bubblegum pink - fade to white as its background. - - \image tableWidget-stylesheet.png - - This is possible with the - \l{stylesheet-reference.html#selection-background-color-prop} - {selection-background-color} property and the syntax required is: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 149 - - The corner widget can be customized using the following style sheet - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 150 - - \section2 Customizing QToolBar - - The background and the handle of a QToolBar is customized as below: - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 151 - - \section2 Customizing QToolBox - - The tabs of the QToolBox are customized using the 'tab' subcontrol. - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 152 - - \section2 Customizing QToolButton - - There are three types of QToolButtons. - \list - \li The QToolButton has no menu. In this case, the QToolButton is styled - exactly like QPushButton. See - \l{#Customizing QPushButton}{Customizing QPushButton} for an - example. - - \li The QToolButton has a menu and has the QToolButton::popupMode set to - QToolButton::DelayedPopup or QToolButton::InstantPopup. In this case, - the QToolButton is styled exactly like a QPushButton with a menu. - See \l{#Customizing QPushButton}{Customizing QPushButton} for an - example of the usage of the menu-indicator pseudo state. - - \li The QToolButton has its QToolButton::popupMode set to - QToolButton::MenuButtonPopup. In this case, we style it as follows: - \endlist - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 153 - - - \section2 Customizing QToolTip - - QToolTip is customized exactly like a QLabel. In addition, for platforms - that support it, the opacity property may be set to adjust the opacity. - - For example, - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 154 - - \section2 Customizing QTreeView - - The background color of alternating rows can be customized using the following - style sheet: - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 155 - - To provide a special background when you hover over items, we can use the - \l{item-sub}{::item} subcontrol. For example, - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 156 - - The branches of a QTreeView are styled using the - \l{Qt Style Sheets Reference#branch-sub}{::branch} subcontrol. The - following stylesheet color codes the various states when drawing - a branch. - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 157 - - Colorful, though it is, a more useful example can be made using the - following images: - - \table - \row - \li \inlineimage stylesheet-vline.png - \li \inlineimage stylesheet-branch-more.png - \li \inlineimage stylesheet-branch-end.png - \li \inlineimage stylesheet-branch-closed.png - \li \inlineimage stylesheet-branch-open.png - \row - \li vline.png - \li branch-more.png - \li branch-end.png - \li branch-closed.png - \li branch-open.png - \endtable - - \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 158 - - The resulting tree view looks like this: - - \image stylesheet-treeview.png - - \sa {Style Sheet Example}, {Supported HTML Subset}, QStyle - - - \section1 Common mistakes - - This section lists some common mistakes when using stylesheets. - - \section2 QPushButton and images - - When styling a QPushButton, it is often desirable to use an image as the - button graphic. It is common to try the - \l{Qt Style Sheets Reference#background-image-prop}{background-image} - property, - but this has a number of drawbacks: For instance, the background will - often appear hidden behind the button decoration, because it is not - considered a background. In addition, if the button is resized, the - entire background will be stretched or tiled, which does not - always look good. - - It is better to use the - \l{Qt Style Sheets Reference#border-image-prop}{border-image} - property, as it will always display the image, - regardless of the background (you can combine it with a background if it - has alpha values in it), and it has special settings to deal with button - resizing. - - Consider the following snippet: - - \snippet doc/src/snippets/stylesheet/common-mistakes.cpp 1 - - This will produce a button looking like this: - - \image stylesheet-border-image-normal.png - - The numbers after the url gives the top, right, bottom and left number of - pixels, respectively. These numbers correspond to the border and should not - stretch when the size changes. - Whenever you resize the button, the middle part of the image will stretch - in both directions, while the pixels specified in the stylesheet - will not. This makes the borders of the button look more natural, like - this: - - \table - \row - \li \inlineimage stylesheet-border-image-stretched.png - \row - \li With borders - \endtable - - \table - \row - \li \inlineimage stylesheet-border-image-wrong.png - \row - \li Without borders - \endtable - - */ diff --git a/doc/src/widgets/widgets-and-layouts/widgets.qdoc b/doc/src/widgets/widgets-and-layouts/widgets.qdoc deleted file mode 100644 index e80b0fbec0..0000000000 --- a/doc/src/widgets/widgets-and-layouts/widgets.qdoc +++ /dev/null @@ -1,162 +0,0 @@ -/**************************************************************************** -** -** 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:FDL$ -** GNU Free Documentation License -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms -** and conditions contained in a signed written agreement between you -** and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \page widgets-and-layouts.html - \title Widgets and Layouts - \ingroup qt-gui-concepts - \brief The primary elements for designing user interfaces in Qt. - - \section1 Widgets - - Widgets are the primary elements for creating user interfaces in Qt. - \l{The Widget Classes}{Widgets} can display data and status information, - receive user input, and provide a container for other widgets that - should be grouped together. A widget that is not embedded in a - parent widget is called a \l{Window and Dialog Widgets} {window}. - - \image parent-child-widgets.png A parent widget containing various child widgets. - - The QWidget class provides the basic capability to render to the - screen, and to handle user input events. All UI elements that Qt - provides are either subclasses of QWidget, or are used in connection - with a QWidget subclass. Creating custom widgets is done by - subclassing QWidget or a suitable subclass and reimplementing the - virtual event handlers. - - \section1 Layouts - - \l{Layout Management}{Layouts} are an elegant and flexible way to - automatically arrange child widgets within their container. Each - widget reports its size requirements to the layout through the - \l{QWidget::}{sizeHint} and \l{QWidget::}{sizePolicy} properties, - and the layout distributes the available space accordingly. - - \table - \row - \li \image qgridlayout-with-5-children.png - \li \image qformlayout-with-6-children.png - \endtable - - \l{Qt Designer Manual}{\QD} is a powerful tool for interactively creating and - arranging widgets in layouts. - - \section1 Widget Styles - - \l{Styles and Style Aware Widgets}{Styles} draw on behalf of - widgets and encapsulate the look and feel of a GUI. Qt's built-in - widgets use the QStyle class to perform nearly all of their drawing, - ensuring that they look exactly like the equivalent native widgets. - - \table - \row - \li \image windowsxp-tabwidget.png - \li \image plastique-tabwidget.png - \li \image macintosh-tabwidget.png - \endtable - - \l{Qt Style Sheets} are a powerful mechanism that allows you to customize the - appearance of widgets, in addition to what is already possible by subclassing QStyle. - - \section1 The Widget Classes - - The following sections list the widget classes. See the \l{Qt Widget - Gallery} for some examples. - - \section2 Basic Widgets - - These basic widgets (controls), e.g. buttons, comboboxes and - scroll bars, are designed for direct use. - - \table - \row - \li \image windows-label.png - \li \image windowsvista-pushbutton.png - \li \image gtk-progressbar.png - \row - \li \image plastique-combobox.png - \li \image macintosh-radiobutton.png - \li \image cde-lineedit.png - \endtable - - \annotatedlist basicwidgets - - \section2 Advanced Widgets - - Advanced GUI widgets, e.g. tab widgets and progress bars, provide - more complex user interface controls. - - \table - \row - \li \image windowsxp-treeview.png - \li \image gtk-calendarwidget.png - \li \image qundoview.png - \endtable - - \annotatedlist advanced - - \table - \row - \li \image windowsvista-tabwidget.png - \li \image macintosh-groupbox.png - \endtable - - \section2 Organizer Widgets - - Classes like splitters, tab bars, button groups, etc are used for - organizing and grouping GUI primitives into more complex - applications and dialogs. - - \annotatedlist organizers - - \section2 Abstract Widget Classes - - The abstract widget classes are base classes. They are not usable as - standalone classes but provide functionality when they are subclassed. - - \annotatedlist abstractwidgets -*/ - -/*! - \group advanced - \title Advanced Widgets -*/ - -/*! - \group abstractwidgets - \title Abstract Widget Classes -*/ - -/*! - \group basicwidgets - \title Basic Widgets -*/ - -/*! - \group organizers - \title Organizers -*/ -- cgit v1.2.3