summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/dbus/complexpingpong/complexping.cpp14
-rw-r--r--examples/dbus/complexpingpong/complexping.h2
-rw-r--r--examples/dbus/complexpingpong/complexpong.cpp4
-rw-r--r--examples/embedded/digiflip/digiflip.cpp2
-rw-r--r--examples/network/http/authenticationdialog.ui6
-rw-r--r--examples/network/http/httpwindow.cpp274
-rw-r--r--examples/network/http/httpwindow.h31
-rw-r--r--examples/network/http/main.cpp5
-rw-r--r--examples/network/torrent/filemanager.cpp12
-rw-r--r--examples/network/torrent/metainfo.cpp2
-rw-r--r--examples/opengl/2dpainting/window.cpp4
-rw-r--r--examples/opengl/contextinfo/renderwindow.cpp2
-rw-r--r--examples/opengl/contextinfo/widget.cpp2
-rw-r--r--examples/opengl/hellogl2/glwidget.cpp7
-rw-r--r--examples/opengl/hellogl2/main.cpp4
-rw-r--r--examples/opengl/hellogl2/mainwindow.cpp2
-rw-r--r--examples/opengl/hellogl2/window.cpp14
-rw-r--r--examples/opengl/hellogles3/glwindow.cpp281
-rw-r--r--examples/opengl/hellogles3/glwindow.h (renamed from examples/widgets/mainwindows/recentfiles/mainwindow.h)88
-rw-r--r--examples/opengl/hellogles3/hellogles3.pro11
-rw-r--r--examples/opengl/hellogles3/hellogles3.qrc5
-rw-r--r--examples/opengl/hellogles3/main.cpp (renamed from examples/widgets/draganddrop/draggabletext/draglabel.h)46
-rw-r--r--examples/opengl/hellogles3/qtlogo.pngbin0 -> 5402 bytes
-rw-r--r--examples/opengl/hellowindow/hellowindow.cpp4
-rw-r--r--examples/opengl/hellowindow/main.cpp4
-rw-r--r--examples/opengl/opengl.pro3
-rw-r--r--examples/opengl/paintedwindow/paintedwindow.cpp8
-rw-r--r--examples/opengl/qopenglwidget/mainwindow.cpp37
-rw-r--r--examples/opengl/qopenglwindow/main.cpp8
-rw-r--r--examples/opengl/textures/window.cpp6
-rw-r--r--examples/qtconcurrent/map/main.cpp2
-rw-r--r--examples/qtconcurrent/wordcount/main.cpp8
-rw-r--r--examples/sql/books/bookdelegate.cpp2
-rw-r--r--examples/sql/books/books.pro2
-rw-r--r--examples/sql/masterdetail/dialog.cpp2
-rw-r--r--examples/sql/querymodel/customsqlmodel.cpp2
-rw-r--r--examples/webkit/webkit-guide/_copyright.txt40
-rw-r--r--examples/webkit/webkit-guide/_image_assets.htm332
-rw-r--r--examples/webkit/webkit-guide/_index.html320
-rw-r--r--examples/webkit/webkit-guide/anim_accord.htm123
-rw-r--r--examples/webkit/webkit-guide/anim_demo-rotate.htm64
-rw-r--r--examples/webkit/webkit-guide/anim_demo-scale.htm68
-rw-r--r--examples/webkit/webkit-guide/anim_demo-skew.htm62
-rw-r--r--examples/webkit/webkit-guide/anim_gallery.htm115
-rw-r--r--examples/webkit/webkit-guide/anim_panel.htm64
-rw-r--r--examples/webkit/webkit-guide/anim_pulse.htm72
-rw-r--r--examples/webkit/webkit-guide/anim_skew.htm80
-rw-r--r--examples/webkit/webkit-guide/anim_slide1.htm62
-rw-r--r--examples/webkit/webkit-guide/anim_slide2.htm62
-rw-r--r--examples/webkit/webkit-guide/anim_slide3.htm65
-rw-r--r--examples/webkit/webkit-guide/anim_tabbedSkew.htm89
-rw-r--r--examples/webkit/webkit-guide/css/anim_accord.css246
-rw-r--r--examples/webkit/webkit-guide/css/anim_demo-rotate.css95
-rw-r--r--examples/webkit/webkit-guide/css/anim_demo-scale.css112
-rw-r--r--examples/webkit/webkit-guide/css/anim_demo-skew.css98
-rw-r--r--examples/webkit/webkit-guide/css/anim_gallery.css110
-rw-r--r--examples/webkit/webkit-guide/css/anim_panel.css116
-rw-r--r--examples/webkit/webkit-guide/css/anim_pulse.css100
-rw-r--r--examples/webkit/webkit-guide/css/anim_skew.css186
-rw-r--r--examples/webkit/webkit-guide/css/anim_slide.css148
-rw-r--r--examples/webkit/webkit-guide/css/anim_tabbedSkew.css113
-rw-r--r--examples/webkit/webkit-guide/css/css3_backgrounds.css105
-rw-r--r--examples/webkit/webkit-guide/css/css3_border-img.css70
-rw-r--r--examples/webkit/webkit-guide/css/css3_grad-radial.css66
-rw-r--r--examples/webkit/webkit-guide/css/css3_gradientBack.css77
-rw-r--r--examples/webkit/webkit-guide/css/css3_gradientBackStop.css77
-rw-r--r--examples/webkit/webkit-guide/css/css3_gradientButton.css88
-rw-r--r--examples/webkit/webkit-guide/css/css3_mask-grad.css60
-rw-r--r--examples/webkit/webkit-guide/css/css3_mask-img.css58
-rw-r--r--examples/webkit/webkit-guide/css/css3_multicol.css110
-rw-r--r--examples/webkit/webkit-guide/css/css3_reflect.css127
-rw-r--r--examples/webkit/webkit-guide/css/css3_scroll.css93
-rw-r--r--examples/webkit/webkit-guide/css/css3_sel-nth.css63
-rw-r--r--examples/webkit/webkit-guide/css/css3_shadow.css145
-rw-r--r--examples/webkit/webkit-guide/css/css3_shadowBlur.css145
-rw-r--r--examples/webkit/webkit-guide/css/css3_text-overflow.css119
-rw-r--r--examples/webkit/webkit-guide/css/css3_text-shadow.css67
-rw-r--r--examples/webkit/webkit-guide/css/css3_text-stroke.css75
-rw-r--r--examples/webkit/webkit-guide/css/form_tapper.css108
-rw-r--r--examples/webkit/webkit-guide/css/form_toggler.css200
-rw-r--r--examples/webkit/webkit-guide/css/layout_link-fmt.css137
-rw-r--r--examples/webkit/webkit-guide/css/layout_tbl-keyhole.css147
-rw-r--r--examples/webkit/webkit-guide/css/mob_condjs.css55
-rw-r--r--examples/webkit/webkit-guide/css/mob_mediaquery.css49
-rw-r--r--examples/webkit/webkit-guide/css/mobile.css82
-rw-r--r--examples/webkit/webkit-guide/css/mq_desktop.css70
-rw-r--r--examples/webkit/webkit-guide/css/mq_mobile.css69
-rw-r--r--examples/webkit/webkit-guide/css/mq_touch.css69
-rw-r--r--examples/webkit/webkit-guide/css/mqlayout_desktop.css92
-rw-r--r--examples/webkit/webkit-guide/css/mqlayout_mobile.css82
-rw-r--r--examples/webkit/webkit-guide/css/mqlayout_touch.css86
-rw-r--r--examples/webkit/webkit-guide/css/storage.css156
-rw-r--r--examples/webkit/webkit-guide/css3_backgrounds.htm87
-rw-r--r--examples/webkit/webkit-guide/css3_border-img.htm78
-rw-r--r--examples/webkit/webkit-guide/css3_grad-radial.htm62
-rw-r--r--examples/webkit/webkit-guide/css3_gradientBack.htm79
-rw-r--r--examples/webkit/webkit-guide/css3_gradientBackStop.htm93
-rw-r--r--examples/webkit/webkit-guide/css3_gradientButton.htm67
-rw-r--r--examples/webkit/webkit-guide/css3_mask-grad.htm67
-rw-r--r--examples/webkit/webkit-guide/css3_mask-img.htm57
-rw-r--r--examples/webkit/webkit-guide/css3_multicol.htm92
-rw-r--r--examples/webkit/webkit-guide/css3_reflect.htm101
-rw-r--r--examples/webkit/webkit-guide/css3_scroll.htm95
-rw-r--r--examples/webkit/webkit-guide/css3_sel-nth.htm81
-rw-r--r--examples/webkit/webkit-guide/css3_shadow.htm79
-rw-r--r--examples/webkit/webkit-guide/css3_text-overflow.htm118
-rw-r--r--examples/webkit/webkit-guide/css3_text-shadow.htm75
-rw-r--r--examples/webkit/webkit-guide/css3_text-stroke.htm75
-rw-r--r--examples/webkit/webkit-guide/form_tapper.htm75
-rw-r--r--examples/webkit/webkit-guide/form_toggler.htm141
-rw-r--r--examples/webkit/webkit-guide/img/border-frame.pngbin5534 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal1.jpgbin44584 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal2.jpgbin45495 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal3.jpgbin51291 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal4.jpgbin57195 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal5.jpgbin31293 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal6.jpgbin30854 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal7.jpgbin35211 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal8.jpgbin35269 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gradient.jpgbin710 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gray_icon_close.pngbin658 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ag_016.pngbin598 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ag_032.pngbin1275 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ag_036.pngbin1803 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ag_048.pngbin1885 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_al_016.pngbin625 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_al_032.pngbin1259 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_al_036.pngbin1755 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_al_048.pngbin1795 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ar_016.pngbin608 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ar_032.pngbin1233 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ar_036.pngbin1777 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ar_048.pngbin1828 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_b_016.pngbin580 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_b_032.pngbin1166 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_b_036.pngbin1668 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_b_048.pngbin1623 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_be_016.pngbin614 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_be_032.pngbin1322 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_be_036.pngbin1811 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_be_048.pngbin1824 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_c_016.pngbin545 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_c_032.pngbin1102 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_c_036.pngbin1595 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_c_048.pngbin1622 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ca_016.pngbin606 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ca_032.pngbin1229 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ca_036.pngbin1771 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ca_048.pngbin1820 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_cl_016.pngbin602 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_cl_032.pngbin1197 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_cl_036.pngbin1731 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_cl_048.pngbin1816 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_cu_016.pngbin580 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_cu_032.pngbin1183 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_cu_036.pngbin1742 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_cu_048.pngbin1729 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_f_016.pngbin539 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_f_032.pngbin1047 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_f_036.pngbin1487 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_f_048.pngbin1488 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_fe_016.pngbin591 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_fe_032.pngbin1171 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_fe_036.pngbin1726 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_fe_048.pngbin1745 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_h_016.pngbin583 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_h_032.pngbin1135 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_h_036.pngbin1600 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_h_048.pngbin1644 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_he_016.pngbin606 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_he_032.pngbin1179 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_he_036.pngbin1746 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_he_048.pngbin1675 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_k_016.pngbin600 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_k_032.pngbin1189 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_k_036.pngbin1657 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_k_048.pngbin1706 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_li_016.pngbin584 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_li_032.pngbin1125 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_li_036.pngbin1596 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_li_048.pngbin1691 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_mg_016.pngbin628 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_mg_032.pngbin1286 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_mg_036.pngbin1832 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_mg_048.pngbin1908 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_n_016.pngbin605 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_n_032.pngbin1203 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_n_036.pngbin1728 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_n_048.pngbin1718 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_na_016.pngbin609 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_na_032.pngbin1302 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_na_036.pngbin1811 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_na_048.pngbin1879 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ne_016.pngbin619 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ne_032.pngbin1278 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ne_036.pngbin1798 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ne_048.pngbin1811 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ni_016.pngbin627 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ni_032.pngbin1248 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ni_036.pngbin1805 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ni_048.pngbin1837 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_o_016.pngbin580 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_o_032.pngbin1182 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_o_036.pngbin1668 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_o_048.pngbin1752 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_pt_016.pngbin600 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_pt_032.pngbin1212 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_pt_036.pngbin1728 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_pt_048.pngbin1675 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_si_016.pngbin588 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_si_032.pngbin1198 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_si_036.pngbin1761 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_si_048.pngbin1820 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_zn_016.pngbin572 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_zn_032.pngbin1164 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_zn_036.pngbin1689 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_zn_048.pngbin1721 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_check.pngbin678 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_check_x24green.pngbin776 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_dismiss.pngbin613 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_dismiss_x22.pngbin539 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_drill-down.pngbin605 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_drill-down_x32.pngbin3593 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_drill-up.pngbin592 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_drill-up_x32.pngbin3685 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_expand-nav.pngbin675 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_head-collapsed.pngbin285 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_head-collapsed_x13.pngbin201 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_head-expanded.pngbin295 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_head-expanded_x13.pngbin3017 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_info.pngbin512 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_info_x24.pngbin652 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_link-doc.pngbin610 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_link-email.pngbin542 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_link-external.pngbin1106 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_link-pdf.pngbin637 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_link-ppt.pngbin536 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_link-rss.pngbin684 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_link-sms.pngbin1086 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_link-tel.pngbin1205 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_link-xls.pngbin603 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_list-all.pngbin545 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_list-all_circ.pngbin665 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_nav-start.pngbin594 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_nav-top.pngbin634 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_nav-up.pngbin551 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_nav_end.pngbin643 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_question.pngbin802 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_scroll-left.pngbin660 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_scroll-right.pngbin682 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_trash.pngbin717 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land1.jpgbin40695 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land2.jpgbin38387 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land3.jpgbin27180 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land4.jpgbin45132 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land5.jpgbin85110 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land6.jpgbin38369 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land7.jpgbin38923 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land8.jpgbin54475 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/mask.pngbin5842 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal1.jpgbin44584 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal2.jpgbin45495 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal3.jpgbin51291 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal4.jpgbin57195 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal5.jpgbin31293 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal6.jpgbin30854 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal7.jpgbin35211 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal8.jpgbin35269 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land1.jpgbin40695 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land2.jpgbin38387 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land3.jpgbin27180 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land4.jpgbin45132 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land5.jpgbin85110 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land6.jpgbin38369 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land7.jpgbin38923 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land8.jpgbin54475 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal1.pngbin16437 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal2.pngbin14736 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal3.pngbin15882 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal4.pngbin18863 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal5.pngbin15854 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal6.pngbin17339 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal7.pngbin17102 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal8.pngbin17933 -> 0 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/js/anim_accord.js78
-rwxr-xr-xexamples/webkit/webkit-guide/js/anim_gallery.js79
-rwxr-xr-xexamples/webkit/webkit-guide/js/anim_panel.js53
-rwxr-xr-xexamples/webkit/webkit-guide/js/anim_skew.js97
-rwxr-xr-xexamples/webkit/webkit-guide/js/css3_backgrounds.js49
-rwxr-xr-xexamples/webkit/webkit-guide/js/css3_border-img.js44
-rwxr-xr-xexamples/webkit/webkit-guide/js/css3_grad-radial.js75
-rwxr-xr-xexamples/webkit/webkit-guide/js/css3_mask-grad.js44
-rwxr-xr-xexamples/webkit/webkit-guide/js/css3_mask-img.js44
-rwxr-xr-xexamples/webkit/webkit-guide/js/css3_text-overflow.js54
-rwxr-xr-xexamples/webkit/webkit-guide/js/form_tapper.js57
-rwxr-xr-xexamples/webkit/webkit-guide/js/mob_condjs.js79
-rwxr-xr-xexamples/webkit/webkit-guide/js/mobile.js50
-rwxr-xr-xexamples/webkit/webkit-guide/js/storage.js94
-rw-r--r--examples/webkit/webkit-guide/layout_link-fmt.htm82
-rw-r--r--examples/webkit/webkit-guide/layout_tbl-keyhole.htm142
-rw-r--r--examples/webkit/webkit-guide/mob_condjs.htm66
-rw-r--r--examples/webkit/webkit-guide/mob_layout.htm60
-rw-r--r--examples/webkit/webkit-guide/mob_mediaquery.htm60
-rw-r--r--examples/webkit/webkit-guide/storage.htm72
-rw-r--r--examples/webkit/webkit-guide/webkit-guide.pro256
-rw-r--r--examples/widgets/desktop/screenshot/main.cpp3
-rw-r--r--examples/widgets/desktop/screenshot/screenshot.cpp139
-rw-r--r--examples/widgets/desktop/screenshot/screenshot.h11
-rw-r--r--examples/widgets/desktop/systray/doc/src/systray.qdoc6
-rw-r--r--examples/widgets/desktop/systray/window.cpp30
-rw-r--r--examples/widgets/dialogs/classwizard/classwizard.cpp58
-rw-r--r--examples/widgets/dialogs/configdialog/configdialog.cpp6
-rw-r--r--examples/widgets/dialogs/extension/finddialog.cpp2
-rw-r--r--examples/widgets/dialogs/findfiles/window.cpp19
-rw-r--r--examples/widgets/dialogs/findfiles/window.h1
-rw-r--r--examples/widgets/dialogs/licensewizard/licensewizard.cpp10
-rw-r--r--examples/widgets/dialogs/sipdialog/dialog.cpp7
-rw-r--r--examples/widgets/dialogs/standarddialogs/dialog.cpp47
-rw-r--r--examples/widgets/dialogs/standarddialogs/main.cpp5
-rw-r--r--examples/widgets/dialogs/tabdialog/tabdialog.cpp4
-rw-r--r--examples/widgets/doc/images/regularexpression-example.pngbin0 -> 78860 bytes
-rw-r--r--examples/widgets/doc/images/systemtray-editor.pngbin0 -> 18147 bytes
-rw-r--r--examples/widgets/doc/images/systemtray-example.pngbin0 -> 47588 bytes
-rw-r--r--examples/widgets/doc/src/application.qdoc75
-rw-r--r--examples/widgets/doc/src/codeeditor.qdoc2
-rw-r--r--examples/widgets/doc/src/findfiles.qdoc7
-rw-r--r--examples/widgets/doc/src/icons.qdoc117
-rw-r--r--examples/widgets/doc/src/imageviewer.qdoc11
-rw-r--r--examples/widgets/doc/src/plugandpaint.qdoc6
-rw-r--r--examples/widgets/doc/src/regularexpression.qdoc (renamed from examples/widgets/doc/src/recentfiles.qdoc)23
-rw-r--r--examples/widgets/doc/src/screenshot.qdoc90
-rw-r--r--examples/widgets/doc/src/syntaxhighlighter.qdoc2
-rw-r--r--examples/widgets/doc/src/systray.qdoc179
-rw-r--r--examples/widgets/doc/src/tablet.qdoc24
-rw-r--r--examples/widgets/doc/src/tetrix.qdoc2
-rw-r--r--examples/widgets/draganddrop/draggableicons/main.cpp3
-rw-r--r--examples/widgets/draganddrop/draggabletext/draggabletext.pro6
-rw-r--r--examples/widgets/draganddrop/draggabletext/dragwidget.cpp45
-rw-r--r--examples/widgets/draganddrop/dropsite/droparea.cpp6
-rw-r--r--examples/widgets/draganddrop/dropsite/dropsitewindow.cpp27
-rw-r--r--examples/widgets/draganddrop/fridgemagnets/dragwidget.cpp19
-rw-r--r--examples/widgets/draganddrop/fridgemagnets/main.cpp2
-rw-r--r--examples/widgets/draganddrop/puzzle/main.cpp2
-rw-r--r--examples/widgets/draganddrop/puzzle/mainwindow.cpp47
-rw-r--r--examples/widgets/draganddrop/puzzle/mainwindow.h3
-rw-r--r--examples/widgets/draganddrop/puzzle/pieceslist.cpp10
-rw-r--r--examples/widgets/draganddrop/puzzle/pieceslist.h2
-rw-r--r--examples/widgets/draganddrop/puzzle/puzzle.pro2
-rw-r--r--examples/widgets/draganddrop/puzzle/puzzlewidget.cpp26
-rw-r--r--examples/widgets/draganddrop/puzzle/puzzlewidget.h1
-rw-r--r--examples/widgets/gestures/imagegestures/imagewidget.cpp11
-rw-r--r--examples/widgets/gestures/imagegestures/imagewidget.h1
-rw-r--r--examples/widgets/gestures/imagegestures/mainwidget.h2
-rw-r--r--examples/widgets/graphicsview/boxes/scene.cpp4
-rw-r--r--examples/widgets/itemviews/addressbook/adddialog.cpp4
-rw-r--r--examples/widgets/itemviews/addressbook/addresswidget.cpp10
-rw-r--r--examples/widgets/itemviews/addressbook/addresswidget.h2
-rw-r--r--examples/widgets/itemviews/addressbook/mainwindow.cpp16
-rw-r--r--examples/widgets/itemviews/addressbook/newaddresstab.cpp2
-rw-r--r--examples/widgets/itemviews/basicsortfiltermodel/window.cpp22
-rw-r--r--examples/widgets/itemviews/chart/mainwindow.cpp27
-rw-r--r--examples/widgets/itemviews/chart/mainwindow.h3
-rw-r--r--examples/widgets/itemviews/combowidgetmapper/window.cpp12
-rw-r--r--examples/widgets/itemviews/customsortfiltermodel/filterwidget.cpp6
-rw-r--r--examples/widgets/itemviews/customsortfiltermodel/window.cpp14
-rw-r--r--examples/widgets/itemviews/editabletreemodel/mainwindow.cpp30
-rw-r--r--examples/widgets/itemviews/editabletreemodel/mainwindow.h4
-rw-r--r--examples/widgets/itemviews/editabletreemodel/treemodel.cpp2
-rw-r--r--examples/widgets/itemviews/fetchmore/window.cpp12
-rw-r--r--examples/widgets/itemviews/frozencolumn/freezetablewidget.cpp18
-rw-r--r--examples/widgets/itemviews/frozencolumn/main.cpp6
-rw-r--r--examples/widgets/itemviews/interview/model.cpp2
-rw-r--r--examples/widgets/itemviews/pixelator/mainwindow.cpp17
-rw-r--r--examples/widgets/itemviews/puzzle/main.cpp2
-rw-r--r--examples/widgets/itemviews/puzzle/mainwindow.cpp45
-rw-r--r--examples/widgets/itemviews/puzzle/mainwindow.h3
-rw-r--r--examples/widgets/itemviews/simpledommodel/dommodel.cpp2
-rw-r--r--examples/widgets/itemviews/simpledommodel/mainwindow.cpp4
-rw-r--r--examples/widgets/itemviews/simpletreemodel/treemodel.cpp2
-rw-r--r--examples/widgets/itemviews/simplewidgetmapper/window.cpp6
-rw-r--r--examples/widgets/itemviews/spreadsheet/spreadsheet.cpp50
-rw-r--r--examples/widgets/itemviews/spreadsheet/spreadsheetdelegate.cpp2
-rw-r--r--examples/widgets/itemviews/stardelegate/stardelegate.cpp4
-rw-r--r--examples/widgets/mainwindows/application/main.cpp16
-rw-r--r--examples/widgets/mainwindows/application/mainwindow.cpp196
-rw-r--r--examples/widgets/mainwindows/application/mainwindow.h21
-rw-r--r--examples/widgets/mainwindows/dockwidgets/mainwindow.cpp95
-rw-r--r--examples/widgets/mainwindows/dockwidgets/mainwindow.h14
-rw-r--r--examples/widgets/mainwindows/mainwindow/colorswatch.cpp211
-rw-r--r--examples/widgets/mainwindows/mainwindow/colorswatch.h78
-rw-r--r--examples/widgets/mainwindows/mainwindow/main.cpp67
-rw-r--r--examples/widgets/mainwindows/mainwindow/mainwindow.cpp215
-rw-r--r--examples/widgets/mainwindows/mainwindow/mainwindow.h31
-rw-r--r--examples/widgets/mainwindows/mainwindow/toolbar.cpp88
-rw-r--r--examples/widgets/mainwindows/mainwindow/toolbar.h66
-rw-r--r--examples/widgets/mainwindows/mainwindows.pro1
-rw-r--r--examples/widgets/mainwindows/mdi/main.cpp2
-rw-r--r--examples/widgets/mainwindows/mdi/mainwindow.cpp334
-rw-r--r--examples/widgets/mainwindows/mdi/mainwindow.h31
-rw-r--r--examples/widgets/mainwindows/mdi/mdichild.cpp39
-rw-r--r--examples/widgets/mainwindows/menus/mainwindow.cpp44
-rw-r--r--examples/widgets/mainwindows/recentfiles/mainwindow.cpp251
-rw-r--r--examples/widgets/mainwindows/recentfiles/recentfiles.pro9
-rw-r--r--examples/widgets/mainwindows/sdi/main.cpp25
-rw-r--r--examples/widgets/mainwindows/sdi/mainwindow.cpp350
-rw-r--r--examples/widgets/mainwindows/sdi/mainwindow.h41
-rw-r--r--examples/widgets/painting/fontsampler/mainwindow.cpp2
-rw-r--r--examples/widgets/painting/shared/arthurstyle.cpp4
-rw-r--r--examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pro2
-rw-r--r--examples/widgets/richtext/textedit/main.cpp24
-rw-r--r--examples/widgets/richtext/textedit/textedit.cpp375
-rw-r--r--examples/widgets/richtext/textedit/textedit.h22
-rw-r--r--examples/widgets/tools/regexp/regexpdialog.cpp4
-rw-r--r--examples/widgets/tools/regularexpression/images/copy.pngbin0 -> 1338 bytes
-rw-r--r--examples/widgets/tools/regularexpression/main.cpp (renamed from examples/widgets/mainwindows/recentfiles/main.cpp)10
-rw-r--r--examples/widgets/tools/regularexpression/regularexpression.pro11
-rw-r--r--examples/widgets/tools/regularexpression/regularexpression.qrc5
-rw-r--r--examples/widgets/tools/regularexpression/regularexpressiondialog.cpp349
-rw-r--r--examples/widgets/tools/regularexpression/regularexpressiondialog.h (renamed from examples/widgets/draganddrop/draggabletext/draglabel.cpp)65
-rw-r--r--examples/widgets/tools/settingseditor/locationdialog.cpp50
-rw-r--r--examples/widgets/tools/settingseditor/locationdialog.h2
-rw-r--r--examples/widgets/tools/settingseditor/main.cpp3
-rw-r--r--examples/widgets/tools/settingseditor/mainwindow.cpp182
-rw-r--r--examples/widgets/tools/settingseditor/mainwindow.h18
-rw-r--r--examples/widgets/tools/settingseditor/settingstree.cpp49
-rw-r--r--examples/widgets/tools/settingseditor/settingstree.h8
-rw-r--r--examples/widgets/tools/settingseditor/variantdelegate.cpp4
-rw-r--r--examples/widgets/tools/tools.pro1
-rw-r--r--examples/widgets/tutorials/addressbook/part7/addressbook.cpp17
-rw-r--r--examples/widgets/tutorials/modelview/5_edit/mymodel.cpp2
-rw-r--r--examples/widgets/widgets/calculator/calculator.cpp2
-rw-r--r--examples/widgets/widgets/icons/iconpreviewarea.cpp134
-rw-r--r--examples/widgets/widgets/icons/iconpreviewarea.h9
-rw-r--r--examples/widgets/widgets/icons/icons.pro4
-rw-r--r--examples/widgets/widgets/icons/iconsizespinbox.cpp12
-rw-r--r--examples/widgets/widgets/icons/iconsizespinbox.h2
-rw-r--r--examples/widgets/widgets/icons/imagedelegate.cpp18
-rw-r--r--examples/widgets/widgets/icons/imagedelegate.h2
-rw-r--r--examples/widgets/widgets/icons/main.cpp26
-rw-r--r--examples/widgets/widgets/icons/mainwindow.cpp475
-rw-r--r--examples/widgets/widgets/icons/mainwindow.h49
-rw-r--r--examples/widgets/widgets/imageviewer/imageviewer.cpp214
-rw-r--r--examples/widgets/widgets/imageviewer/imageviewer.h17
-rw-r--r--examples/widgets/widgets/movie/movie.pro2
-rw-r--r--examples/widgets/widgets/stylesheet/mainwindow.cpp2
-rw-r--r--examples/widgets/widgets/tablet/images.qrc8
-rw-r--r--examples/widgets/widgets/tablet/images/cursor-airbrush.pngbin0 -> 823 bytes
-rw-r--r--examples/widgets/widgets/tablet/images/cursor-eraser.pngbin0 -> 1454 bytes
-rw-r--r--examples/widgets/widgets/tablet/images/cursor-felt-marker.pngbin0 -> 513 bytes
-rw-r--r--examples/widgets/widgets/tablet/images/cursor-pencil.pngbin0 -> 1307 bytes
-rw-r--r--examples/widgets/widgets/tablet/mainwindow.cpp11
-rw-r--r--examples/widgets/widgets/tablet/mainwindow.h1
-rw-r--r--examples/widgets/widgets/tablet/tablet.pro11
-rw-r--r--examples/widgets/widgets/tablet/tabletapplication.cpp3
-rw-r--r--examples/widgets/widgets/tablet/tabletcanvas.cpp151
-rw-r--r--examples/widgets/widgets/tablet/tabletcanvas.h15
-rw-r--r--examples/xml/dombookmarks/dombookmarks.pro2
-rw-r--r--examples/xml/htmlinfo/htmlinfo.pro2
-rw-r--r--examples/xml/htmlinfo/main.cpp2
-rw-r--r--examples/xml/saxbookmarks/saxbookmarks.pro2
-rw-r--r--examples/xml/saxbookmarks/xbelgenerator.cpp4
461 files changed, 4006 insertions, 11994 deletions
diff --git a/examples/dbus/complexpingpong/complexping.cpp b/examples/dbus/complexpingpong/complexping.cpp
index 10318fb0ed..855ef5d394 100644
--- a/examples/dbus/complexpingpong/complexping.cpp
+++ b/examples/dbus/complexpingpong/complexping.cpp
@@ -49,11 +49,9 @@
#include "ping-common.h"
#include "complexping.h"
-void Ping::start(const QString &name, const QString &oldValue, const QString &newValue)
+void Ping::start(const QString &name)
{
- Q_UNUSED(oldValue);
-
- if (name != SERVICE_NAME || newValue.isEmpty())
+ if (name != SERVICE_NAME)
return;
// open stdin for reading
@@ -105,10 +103,12 @@ int main(int argc, char **argv)
return 1;
}
+ QDBusServiceWatcher serviceWatcher(SERVICE_NAME, QDBusConnection::sessionBus(),
+ QDBusServiceWatcher::WatchForRegistration);
+
Ping ping;
- ping.connect(QDBusConnection::sessionBus().interface(),
- SIGNAL(serviceOwnerChanged(QString,QString,QString)),
- SLOT(start(QString,QString,QString)));
+ QObject::connect(&serviceWatcher, &QDBusServiceWatcher::serviceRegistered,
+ &ping, &Ping::start);
QProcess pong;
pong.start("./complexpong");
diff --git a/examples/dbus/complexpingpong/complexping.h b/examples/dbus/complexpingpong/complexping.h
index 4eb571dd2f..f6f1505507 100644
--- a/examples/dbus/complexpingpong/complexping.h
+++ b/examples/dbus/complexpingpong/complexping.h
@@ -49,7 +49,7 @@ class Ping: public QObject
{
Q_OBJECT
public slots:
- void start(const QString &, const QString &, const QString &);
+ void start(const QString &);
public:
QFile qstdin;
QDBusInterface *iface;
diff --git a/examples/dbus/complexpingpong/complexpong.cpp b/examples/dbus/complexpingpong/complexpong.cpp
index 0e0d5fed76..682e301f12 100644
--- a/examples/dbus/complexpingpong/complexpong.cpp
+++ b/examples/dbus/complexpingpong/complexpong.cpp
@@ -61,7 +61,7 @@ void Pong::setValue(const QString &newValue)
void Pong::quit()
{
- QTimer::singleShot(0, QCoreApplication::instance(), SLOT(quit()));
+ QTimer::singleShot(0, QCoreApplication::instance(), &QCoreApplication::quit);
}
QDBusVariant Pong::query(const QString &query)
@@ -88,7 +88,7 @@ int main(int argc, char **argv)
QObject obj;
Pong *pong = new Pong(&obj);
- pong->connect(&app, SIGNAL(aboutToQuit()), SIGNAL(aboutToQuit()));
+ QObject::connect(&app, &QCoreApplication::aboutToQuit, pong, &Pong::aboutToQuit);
pong->setProperty("value", "initial value");
QDBusConnection::sessionBus().registerObject("/", &obj);
diff --git a/examples/embedded/digiflip/digiflip.cpp b/examples/embedded/digiflip/digiflip.cpp
index 3bb3023caf..af4289efb3 100644
--- a/examples/embedded/digiflip/digiflip.cpp
+++ b/examples/embedded/digiflip/digiflip.cpp
@@ -112,7 +112,7 @@ protected:
QString str = QString::number(n);
if (str.length() == 1)
- str.prepend("0");
+ str.prepend('0');
QFont font;
font.setFamily("Helvetica");
diff --git a/examples/network/http/authenticationdialog.ui b/examples/network/http/authenticationdialog.ui
index 82d908cffb..5baf1bd97e 100644
--- a/examples/network/http/authenticationdialog.ui
+++ b/examples/network/http/authenticationdialog.ui
@@ -41,7 +41,11 @@
</widget>
</item>
<item row="3" column="1" >
- <widget class="QLineEdit" name="passwordEdit" />
+ <widget class="QLineEdit" name="passwordEdit">
+ <property name="echoMode">
+ <enum>QLineEdit::Password</enum>
+ </property>
+ </widget>
</item>
<item row="5" column="0" colspan="2" >
<widget class="QDialogButtonBox" name="buttonBox" >
diff --git a/examples/network/http/httpwindow.cpp b/examples/network/http/httpwindow.cpp
index 39623fd6dd..301431fd5e 100644
--- a/examples/network/http/httpwindow.cpp
+++ b/examples/network/http/httpwindow.cpp
@@ -40,85 +40,134 @@
#include <QtWidgets>
#include <QtNetwork>
+#include <QUrl>
#include "httpwindow.h"
#include "ui_authenticationdialog.h"
-HttpWindow::HttpWindow(QWidget *parent)
- : QDialog(parent)
-{
#ifndef QT_NO_SSL
- urlLineEdit = new QLineEdit("https://qt-project.org/");
+static const char defaultUrl[] = "https://qt-project.org/";
#else
- urlLineEdit = new QLineEdit("http://qt-project.org/");
+static const char defaultUrl[] = "http://qt-project.org/";
#endif
+static const char defaultFileName[] = "index.html";
- urlLabel = new QLabel(tr("&URL:"));
- urlLabel->setBuddy(urlLineEdit);
- statusLabel = new QLabel(tr("Please enter the URL of a file you want to "
- "download."));
- statusLabel->setWordWrap(true);
-
- downloadButton = new QPushButton(tr("Download"));
- downloadButton->setDefault(true);
- quitButton = new QPushButton(tr("Quit"));
- quitButton->setAutoDefault(false);
-
- buttonBox = new QDialogButtonBox;
- buttonBox->addButton(downloadButton, QDialogButtonBox::ActionRole);
- buttonBox->addButton(quitButton, QDialogButtonBox::RejectRole);
+ProgressDialog::ProgressDialog(const QUrl &url, QWidget *parent)
+ : QProgressDialog(parent)
+{
+ setWindowTitle(tr("Download Progress"));
+ setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
+ setLabelText(tr("Downloading %1.").arg(url.toDisplayString()));
+ setMinimum(0);
+ setValue(0);
+ setMinimumDuration(0);
+}
- progressDialog = new QProgressDialog(this);
+void ProgressDialog::networkReplyProgress(qint64 bytesRead, qint64 totalBytes)
+{
+ setMaximum(totalBytes);
+ setValue(bytesRead);
+}
- connect(urlLineEdit, SIGNAL(textChanged(QString)),
- this, SLOT(enableDownloadButton()));
+HttpWindow::HttpWindow(QWidget *parent)
+ : QDialog(parent)
+ , statusLabel(new QLabel(tr("Please enter the URL of a file you want to download.\n\n"), this))
+ , urlLineEdit(new QLineEdit(defaultUrl))
+ , downloadButton(new QPushButton(tr("Download")))
+ , launchCheckBox(new QCheckBox("Launch file"))
+ , defaultFileLineEdit(new QLineEdit(defaultFileName))
+ , downloadDirectoryLineEdit(new QLineEdit)
+ , reply(Q_NULLPTR)
+ , file(Q_NULLPTR)
+ , httpRequestAborted(false)
+{
+ setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
+ setWindowTitle(tr("HTTP"));
- connect(&qnam, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)),
- this, SLOT(slotAuthenticationRequired(QNetworkReply*,QAuthenticator*)));
+ connect(&qnam, &QNetworkAccessManager::authenticationRequired,
+ this, &HttpWindow::slotAuthenticationRequired);
#ifndef QT_NO_SSL
- connect(&qnam, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)),
- this, SLOT(sslErrors(QNetworkReply*,QList<QSslError>)));
+ connect(&qnam, &QNetworkAccessManager::sslErrors,
+ this, &HttpWindow::sslErrors);
#endif
- connect(progressDialog, SIGNAL(canceled()), this, SLOT(cancelDownload()));
- connect(downloadButton, SIGNAL(clicked()), this, SLOT(downloadFile()));
- connect(quitButton, SIGNAL(clicked()), this, SLOT(close()));
- QHBoxLayout *topLayout = new QHBoxLayout;
- topLayout->addWidget(urlLabel);
- topLayout->addWidget(urlLineEdit);
+ QFormLayout *formLayout = new QFormLayout;
+ urlLineEdit->setClearButtonEnabled(true);
+ connect(urlLineEdit, &QLineEdit::textChanged,
+ this, &HttpWindow::enableDownloadButton);
+ formLayout->addRow(tr("&URL:"), urlLineEdit);
+ QString downloadDirectory = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation);
+ if (downloadDirectory.isEmpty() || !QFileInfo(downloadDirectory).isDir())
+ downloadDirectory = QDir::currentPath();
+ downloadDirectoryLineEdit->setText(QDir::toNativeSeparators(downloadDirectory));
+ formLayout->addRow(tr("&Download directory:"), downloadDirectoryLineEdit);
+ formLayout->addRow(tr("Default &file:"), defaultFileLineEdit);
+ launchCheckBox->setChecked(true);
+ formLayout->addRow(launchCheckBox);
+
+ QVBoxLayout *mainLayout = new QVBoxLayout(this);
+ mainLayout->addLayout(formLayout);
+
+ mainLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding));
- QVBoxLayout *mainLayout = new QVBoxLayout;
- mainLayout->addLayout(topLayout);
+ statusLabel->setWordWrap(true);
mainLayout->addWidget(statusLabel);
+
+ downloadButton->setDefault(true);
+ connect(downloadButton, &QAbstractButton::clicked, this, &HttpWindow::downloadFile);
+ QPushButton *quitButton = new QPushButton(tr("Quit"));
+ quitButton->setAutoDefault(false);
+ connect(quitButton, &QAbstractButton::clicked, this, &QWidget::close);
+ QDialogButtonBox *buttonBox = new QDialogButtonBox;
+ buttonBox->addButton(downloadButton, QDialogButtonBox::ActionRole);
+ buttonBox->addButton(quitButton, QDialogButtonBox::RejectRole);
mainLayout->addWidget(buttonBox);
- setLayout(mainLayout);
- setWindowTitle(tr("HTTP"));
urlLineEdit->setFocus();
}
-void HttpWindow::startRequest(QUrl url)
+void HttpWindow::startRequest(const QUrl &requestedUrl)
{
+ url = requestedUrl;
+ httpRequestAborted = false;
+
reply = qnam.get(QNetworkRequest(url));
- connect(reply, SIGNAL(finished()),
- this, SLOT(httpFinished()));
- connect(reply, SIGNAL(readyRead()),
- this, SLOT(httpReadyRead()));
- connect(reply, SIGNAL(downloadProgress(qint64,qint64)),
- this, SLOT(updateDataReadProgress(qint64,qint64)));
+ connect(reply, &QNetworkReply::finished, this, &HttpWindow::httpFinished);
+ connect(reply, &QIODevice::readyRead, this, &HttpWindow::httpReadyRead);
+
+ ProgressDialog *progressDialog = new ProgressDialog(url, this);
+ progressDialog->setAttribute(Qt::WA_DeleteOnClose);
+ connect(progressDialog, &QProgressDialog::canceled, this, &HttpWindow::cancelDownload);
+ connect(reply, &QNetworkReply::downloadProgress, progressDialog, &ProgressDialog::networkReplyProgress);
+ connect(reply, &QNetworkReply::finished, progressDialog, &ProgressDialog::hide);
+ progressDialog->show();
+
+ statusLabel->setText(tr("Downloading %1...").arg(url.toString()));
}
void HttpWindow::downloadFile()
{
- url = urlLineEdit->text();
+ const QString urlSpec = urlLineEdit->text().trimmed();
+ if (urlSpec.isEmpty())
+ return;
- QFileInfo fileInfo(url.path());
- QString fileName = fileInfo.fileName();
- if (fileName.isEmpty())
- fileName = "index.html";
+ const QUrl newUrl = QUrl::fromUserInput(urlSpec);
+ if (!newUrl.isValid()) {
+ QMessageBox::information(this, tr("Error"),
+ tr("Invalid URL: %1: %2").arg(urlSpec, newUrl.errorString()));
+ return;
+ }
+ QString fileName = newUrl.fileName();
+ if (fileName.isEmpty())
+ fileName = defaultFileLineEdit->text().trimmed();
+ if (fileName.isEmpty())
+ fileName = defaultFileName;
+ QString downloadDirectory = QDir::cleanPath(downloadDirectoryLineEdit->text().trimmed());
+ if (!downloadDirectory.isEmpty() && QFileInfo(downloadDirectory).isDir())
+ fileName.prepend(downloadDirectory + '/');
if (QFile::exists(fileName)) {
- if (QMessageBox::question(this, tr("HTTP"),
+ if (QMessageBox::question(this, tr("Overwrite Existing File"),
tr("There already exists a file called %1 in "
"the current directory. Overwrite?").arg(fileName),
QMessageBox::Yes|QMessageBox::No, QMessageBox::No)
@@ -127,23 +176,27 @@ void HttpWindow::downloadFile()
QFile::remove(fileName);
}
- file = new QFile(fileName);
- if (!file->open(QIODevice::WriteOnly)) {
- QMessageBox::information(this, tr("HTTP"),
- tr("Unable to save the file %1: %2.")
- .arg(fileName).arg(file->errorString()));
- delete file;
- file = 0;
+ file = openFileForWrite(fileName);
+ if (!file)
return;
- }
- progressDialog->setWindowTitle(tr("HTTP"));
- progressDialog->setLabelText(tr("Downloading %1.").arg(fileName));
downloadButton->setEnabled(false);
// schedule the request
- httpRequestAborted = false;
- startRequest(url);
+ startRequest(newUrl);
+}
+
+QFile *HttpWindow::openFileForWrite(const QString &fileName)
+{
+ QScopedPointer<QFile> file(new QFile(fileName));
+ if (!file->open(QIODevice::WriteOnly)) {
+ QMessageBox::information(this, tr("Error"),
+ tr("Unable to save the file %1: %2.")
+ .arg(QDir::toNativeSeparators(fileName),
+ file->errorString()));
+ return Q_NULLPTR;
+ }
+ return file.take();
}
void HttpWindow::cancelDownload()
@@ -156,52 +209,56 @@ void HttpWindow::cancelDownload()
void HttpWindow::httpFinished()
{
+ QFileInfo fi;
+ if (file) {
+ fi.setFile(file->fileName());
+ file->close();
+ delete file;
+ file = Q_NULLPTR;
+ }
+
if (httpRequestAborted) {
- if (file) {
- file->close();
- file->remove();
- delete file;
- file = 0;
- }
reply->deleteLater();
- progressDialog->hide();
+ reply = Q_NULLPTR;
return;
}
- progressDialog->hide();
- file->flush();
- file->close();
-
-
- QVariant redirectionTarget = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
if (reply->error()) {
- file->remove();
- QMessageBox::information(this, tr("HTTP"),
- tr("Download failed: %1.")
- .arg(reply->errorString()));
+ QFile::remove(fi.absoluteFilePath());
+ statusLabel->setText(tr("Download failed:\n%1.").arg(reply->errorString()));
downloadButton->setEnabled(true);
- } else if (!redirectionTarget.isNull()) {
- QUrl newUrl = url.resolved(redirectionTarget.toUrl());
- if (QMessageBox::question(this, tr("HTTP"),
- tr("Redirect to %1 ?").arg(newUrl.toString()),
- QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
- url = newUrl;
- reply->deleteLater();
- file->open(QIODevice::WriteOnly);
- file->resize(0);
- startRequest(url);
+ reply->deleteLater();
+ reply = Q_NULLPTR;
+ return;
+ }
+
+ const QVariant redirectionTarget = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
+
+ reply->deleteLater();
+ reply = Q_NULLPTR;
+
+ if (!redirectionTarget.isNull()) {
+ const QUrl redirectedUrl = url.resolved(redirectionTarget.toUrl());
+ if (QMessageBox::question(this, tr("Redirect"),
+ tr("Redirect to %1 ?").arg(redirectedUrl.toString()),
+ QMessageBox::Yes | QMessageBox::No) == QMessageBox::No) {
+ downloadButton->setEnabled(true);
return;
}
- } else {
- QString fileName = QFileInfo(QUrl(urlLineEdit->text()).path()).fileName();
- statusLabel->setText(tr("Downloaded %1 to %2.").arg(fileName).arg(QDir::currentPath()));
- downloadButton->setEnabled(true);
+ file = openFileForWrite(fi.absoluteFilePath());
+ if (!file) {
+ downloadButton->setEnabled(true);
+ return;
+ }
+ startRequest(redirectedUrl);
+ return;
}
- reply->deleteLater();
- reply = 0;
- delete file;
- file = 0;
+ statusLabel->setText(tr("Downloaded %1 bytes to %2\nin\n%3")
+ .arg(fi.size()).arg(fi.fileName(), QDir::toNativeSeparators(fi.absolutePath())));
+ if (launchCheckBox->isChecked())
+ QDesktopServices::openUrl(QUrl::fromLocalFile(fi.absoluteFilePath()));
+ downloadButton->setEnabled(true);
}
void HttpWindow::httpReadyRead()
@@ -214,15 +271,6 @@ void HttpWindow::httpReadyRead()
file->write(reply->readAll());
}
-void HttpWindow::updateDataReadProgress(qint64 bytesRead, qint64 totalBytes)
-{
- if (httpRequestAborted)
- return;
-
- progressDialog->setMaximum(totalBytes);
- progressDialog->setValue(bytesRead);
-}
-
void HttpWindow::enableDownloadButton()
{
downloadButton->setEnabled(!urlLineEdit->text().isEmpty());
@@ -230,18 +278,18 @@ void HttpWindow::enableDownloadButton()
void HttpWindow::slotAuthenticationRequired(QNetworkReply*,QAuthenticator *authenticator)
{
- QDialog dlg;
+ QDialog authenticationDialog;
Ui::Dialog ui;
- ui.setupUi(&dlg);
- dlg.adjustSize();
- ui.siteDescription->setText(tr("%1 at %2").arg(authenticator->realm()).arg(url.host()));
+ ui.setupUi(&authenticationDialog);
+ authenticationDialog.adjustSize();
+ ui.siteDescription->setText(tr("%1 at %2").arg(authenticator->realm(), url.host()));
// Did the URL have information? Fill the UI
// This is only relevant if the URL-supplied credentials were wrong
ui.userEdit->setText(url.userName());
ui.passwordEdit->setText(url.password());
- if (dlg.exec() == QDialog::Accepted) {
+ if (authenticationDialog.exec() == QDialog::Accepted) {
authenticator->setUser(ui.userEdit->text());
authenticator->setPassword(ui.passwordEdit->text());
}
@@ -253,12 +301,12 @@ void HttpWindow::sslErrors(QNetworkReply*,const QList<QSslError> &errors)
QString errorString;
foreach (const QSslError &error, errors) {
if (!errorString.isEmpty())
- errorString += ", ";
+ errorString += '\n';
errorString += error.errorString();
}
- if (QMessageBox::warning(this, tr("HTTP"),
- tr("One or more SSL errors has occurred: %1").arg(errorString),
+ if (QMessageBox::warning(this, tr("SSL Errors"),
+ tr("One or more SSL errors has occurred:\n%1").arg(errorString),
QMessageBox::Ignore | QMessageBox::Abort) == QMessageBox::Ignore) {
reply->ignoreSslErrors();
}
diff --git a/examples/network/http/httpwindow.h b/examples/network/http/httpwindow.h
index f1dc2e1f80..cc632e5bab 100644
--- a/examples/network/http/httpwindow.h
+++ b/examples/network/http/httpwindow.h
@@ -41,39 +41,46 @@
#ifndef HTTPWINDOW_H
#define HTTPWINDOW_H
-#include <QDialog>
+#include <QProgressDialog>
#include <QNetworkAccessManager>
#include <QUrl>
QT_BEGIN_NAMESPACE
-class QDialogButtonBox;
class QFile;
class QLabel;
class QLineEdit;
-class QProgressDialog;
class QPushButton;
class QSslError;
class QAuthenticator;
class QNetworkReply;
-
+class QCheckBox;
QT_END_NAMESPACE
+class ProgressDialog : public QProgressDialog {
+ Q_OBJECT
+
+public:
+ explicit ProgressDialog(const QUrl &url, QWidget *parent = Q_NULLPTR);
+
+public slots:
+ void networkReplyProgress(qint64 bytesRead, qint64 totalBytes);
+};
+
class HttpWindow : public QDialog
{
Q_OBJECT
public:
- HttpWindow(QWidget *parent = 0);
+ explicit HttpWindow(QWidget *parent = Q_NULLPTR);
- void startRequest(QUrl url);
+ void startRequest(const QUrl &requestedUrl);
private slots:
void downloadFile();
void cancelDownload();
void httpFinished();
void httpReadyRead();
- void updateDataReadProgress(qint64 bytesRead, qint64 totalBytes);
void enableDownloadButton();
void slotAuthenticationRequired(QNetworkReply*,QAuthenticator *);
#ifndef QT_NO_SSL
@@ -81,19 +88,19 @@ private slots:
#endif
private:
+ QFile *openFileForWrite(const QString &fileName);
+
QLabel *statusLabel;
- QLabel *urlLabel;
QLineEdit *urlLineEdit;
- QProgressDialog *progressDialog;
QPushButton *downloadButton;
- QPushButton *quitButton;
- QDialogButtonBox *buttonBox;
+ QCheckBox *launchCheckBox;
+ QLineEdit *defaultFileLineEdit;
+ QLineEdit *downloadDirectoryLineEdit;
QUrl url;
QNetworkAccessManager qnam;
QNetworkReply *reply;
QFile *file;
- int httpGetId;
bool httpRequestAborted;
};
diff --git a/examples/network/http/main.cpp b/examples/network/http/main.cpp
index 5857af265c..b4960008ec 100644
--- a/examples/network/http/main.cpp
+++ b/examples/network/http/main.cpp
@@ -39,6 +39,7 @@
****************************************************************************/
#include <QApplication>
+#include <QDesktopWidget>
#include <QDir>
#include "httpwindow.h"
@@ -47,8 +48,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
-
HttpWindow httpWin;
+ const QRect availableSize = QApplication::desktop()->availableGeometry(&httpWin);
+ httpWin.resize(availableSize.width() / 5, availableSize.height() / 5);
+ httpWin.move((availableSize.width() - httpWin.width()) / 2, (availableSize.height() - httpWin.height()) / 2);
httpWin.show();
return app.exec();
diff --git a/examples/network/torrent/filemanager.cpp b/examples/network/torrent/filemanager.cpp
index b4e921b0a5..58330014cf 100644
--- a/examples/network/torrent/filemanager.cpp
+++ b/examples/network/torrent/filemanager.cpp
@@ -219,8 +219,8 @@ bool FileManager::generateFiles()
QString prefix;
if (!destinationPath.isEmpty()) {
prefix = destinationPath;
- if (!prefix.endsWith("/"))
- prefix += "/";
+ if (!prefix.endsWith('/'))
+ prefix += '/';
QDir dir;
if (!dir.mkpath(prefix)) {
errString = tr("Failed to create directory %1").arg(prefix);
@@ -261,13 +261,13 @@ bool FileManager::generateFiles()
if (!destinationPath.isEmpty()) {
prefix = destinationPath;
- if (!prefix.endsWith("/"))
- prefix += "/";
+ if (!prefix.endsWith('/'))
+ prefix += '/';
}
if (!metaInfo.name().isEmpty()) {
prefix += metaInfo.name();
- if (!prefix.endsWith("/"))
- prefix += "/";
+ if (!prefix.endsWith('/'))
+ prefix += '/';
}
if (!dir.mkpath(prefix)) {
errString = tr("Failed to create directory %1").arg(prefix);
diff --git a/examples/network/torrent/metainfo.cpp b/examples/network/torrent/metainfo.cpp
index cca52c7e7e..52e7afe43a 100644
--- a/examples/network/torrent/metainfo.cpp
+++ b/examples/network/torrent/metainfo.cpp
@@ -96,7 +96,7 @@ bool MetaInfo::parse(const QByteArray &data)
QByteArray path;
foreach (QVariant p, pathElements) {
if (!path.isEmpty())
- path += "/";
+ path += '/';
path += p.toByteArray();
}
diff --git a/examples/opengl/2dpainting/window.cpp b/examples/opengl/2dpainting/window.cpp
index e10d862607..4734026dfb 100644
--- a/examples/opengl/2dpainting/window.cpp
+++ b/examples/opengl/2dpainting/window.cpp
@@ -66,8 +66,8 @@ Window::Window()
setLayout(layout);
QTimer *timer = new QTimer(this);
- connect(timer, SIGNAL(timeout()), native, SLOT(animate()));
- connect(timer, SIGNAL(timeout()), openGL, SLOT(animate()));
+ connect(timer, &QTimer::timeout, native, &Widget::animate);
+ connect(timer, &QTimer::timeout, openGL, &GLWidget::animate);
timer->start(50);
}
//! [0]
diff --git a/examples/opengl/contextinfo/renderwindow.cpp b/examples/opengl/contextinfo/renderwindow.cpp
index 9d7e2c450e..fefcf0e56d 100644
--- a/examples/opengl/contextinfo/renderwindow.cpp
+++ b/examples/opengl/contextinfo/renderwindow.cpp
@@ -221,5 +221,5 @@ void RenderWindow::render()
// only here to make the UI widgets more responsive on slower machines. We
// can afford it since our rendering is so lightweight.
const int interval = 5;
- QTimer::singleShot(interval, this, SLOT(render()));
+ QTimer::singleShot(interval, this, &RenderWindow::render);
}
diff --git a/examples/opengl/contextinfo/widget.cpp b/examples/opengl/contextinfo/widget.cpp
index c318accf87..2d36fe4265 100644
--- a/examples/opengl/contextinfo/widget.cpp
+++ b/examples/opengl/contextinfo/widget.cpp
@@ -299,7 +299,7 @@ void Widget::printFormat(const QSurfaceFormat &format)
QString opts;
for (size_t i = 0; i < sizeof(options) / sizeof(Option); ++i)
if (format.testOption(options[i].option))
- opts += QString::fromLatin1(options[i].str) + QStringLiteral(" ");
+ opts += QString::fromLatin1(options[i].str) + QLatin1Char(' ');
m_output->append(tr("Options: %1").arg(opts));
for (size_t i = 0; i < sizeof(renderables) / sizeof(Renderable); ++i)
diff --git a/examples/opengl/hellogl2/glwidget.cpp b/examples/opengl/hellogl2/glwidget.cpp
index 9738dcda20..6505ad3141 100644
--- a/examples/opengl/hellogl2/glwidget.cpp
+++ b/examples/opengl/hellogl2/glwidget.cpp
@@ -55,8 +55,11 @@ GLWidget::GLWidget(QWidget *parent)
// --transparent causes the clear color to be transparent. Therefore, on systems that
// support it, the widget will become transparent apart from the logo.
m_transparent = QCoreApplication::arguments().contains(QStringLiteral("--transparent"));
- if (m_transparent)
- setAttribute(Qt::WA_TranslucentBackground);
+ if (m_transparent) {
+ QSurfaceFormat fmt = format();
+ fmt.setAlphaBufferSize(8);
+ setFormat(fmt);
+ }
}
GLWidget::~GLWidget()
diff --git a/examples/opengl/hellogl2/main.cpp b/examples/opengl/hellogl2/main.cpp
index 4dc67f6e15..554e37e19b 100644
--- a/examples/opengl/hellogl2/main.cpp
+++ b/examples/opengl/hellogl2/main.cpp
@@ -59,6 +59,10 @@ int main(int argc, char *argv[])
QSurfaceFormat::setDefaultFormat(fmt);
MainWindow mainWindow;
+ if (QCoreApplication::arguments().contains(QStringLiteral("--transparent"))) {
+ mainWindow.setAttribute(Qt::WA_TranslucentBackground);
+ mainWindow.setAttribute(Qt::WA_NoSystemBackground, false);
+ }
mainWindow.resize(mainWindow.sizeHint());
int desktopArea = QApplication::desktop()->width() *
QApplication::desktop()->height();
diff --git a/examples/opengl/hellogl2/mainwindow.cpp b/examples/opengl/hellogl2/mainwindow.cpp
index 104cf24b37..b938300349 100644
--- a/examples/opengl/hellogl2/mainwindow.cpp
+++ b/examples/opengl/hellogl2/mainwindow.cpp
@@ -51,7 +51,7 @@ MainWindow::MainWindow()
QAction *addNew = new QAction(menuWindow);
addNew->setText(tr("Add new"));
menuWindow->addAction(addNew);
- connect(addNew, SIGNAL(triggered()), this, SLOT(onAddNew()));
+ connect(addNew, &QAction::triggered, this, &MainWindow::onAddNew);
setMenuBar(menuBar);
onAddNew();
diff --git a/examples/opengl/hellogl2/window.cpp b/examples/opengl/hellogl2/window.cpp
index e60de3b05b..11a5ae68a9 100644
--- a/examples/opengl/hellogl2/window.cpp
+++ b/examples/opengl/hellogl2/window.cpp
@@ -59,12 +59,12 @@ Window::Window(MainWindow *mw)
ySlider = createSlider();
zSlider = createSlider();
- connect(xSlider, SIGNAL(valueChanged(int)), glWidget, SLOT(setXRotation(int)));
- connect(glWidget, SIGNAL(xRotationChanged(int)), xSlider, SLOT(setValue(int)));
- connect(ySlider, SIGNAL(valueChanged(int)), glWidget, SLOT(setYRotation(int)));
- connect(glWidget, SIGNAL(yRotationChanged(int)), ySlider, SLOT(setValue(int)));
- connect(zSlider, SIGNAL(valueChanged(int)), glWidget, SLOT(setZRotation(int)));
- connect(glWidget, SIGNAL(zRotationChanged(int)), zSlider, SLOT(setValue(int)));
+ connect(xSlider, &QSlider::valueChanged, glWidget, &GLWidget::setXRotation);
+ connect(glWidget, &GLWidget::xRotationChanged, xSlider, &QSlider::setValue);
+ connect(ySlider, &QSlider::valueChanged, glWidget, &GLWidget::setYRotation);
+ connect(glWidget, &GLWidget::yRotationChanged, ySlider, &QSlider::setValue);
+ connect(zSlider, &QSlider::valueChanged, glWidget, &GLWidget::setZRotation);
+ connect(glWidget, &GLWidget::zRotationChanged, zSlider, &QSlider::setValue);
QVBoxLayout *mainLayout = new QVBoxLayout;
QHBoxLayout *container = new QHBoxLayout;
@@ -77,7 +77,7 @@ Window::Window(MainWindow *mw)
w->setLayout(container);
mainLayout->addWidget(w);
dockBtn = new QPushButton(tr("Undock"), this);
- connect(dockBtn, SIGNAL(clicked()), this, SLOT(dockUndock()));
+ connect(dockBtn, &QPushButton::clicked, this, &Window::dockUndock);
mainLayout->addWidget(dockBtn);
setLayout(mainLayout);
diff --git a/examples/opengl/hellogles3/glwindow.cpp b/examples/opengl/hellogles3/glwindow.cpp
new file mode 100644
index 0000000000..a0deb8ecfb
--- /dev/null
+++ b/examples/opengl/hellogles3/glwindow.cpp
@@ -0,0 +1,281 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd 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 "glwindow.h"
+#include <QImage>
+#include <QOpenGLTexture>
+#include <QOpenGLShaderProgram>
+#include <QOpenGLBuffer>
+#include <QOpenGLContext>
+#include <QOpenGLVertexArrayObject>
+#include <QOpenGLExtraFunctions>
+#include <QPropertyAnimation>
+#include <QPauseAnimation>
+#include <QSequentialAnimationGroup>
+#include <QTimer>
+
+GLWindow::GLWindow()
+ : m_texture(0),
+ m_program(0),
+ m_vbo(0),
+ m_vao(0),
+ m_target(0, 0, -1),
+ m_uniformsDirty(true),
+ m_r(0),
+ m_r2(0)
+{
+ m_world.setToIdentity();
+ m_world.translate(0, 0, -1);
+ m_world.rotate(180, 1, 0, 0);
+
+ QSequentialAnimationGroup *animGroup = new QSequentialAnimationGroup(this);
+ animGroup->setLoopCount(-1);
+ QPropertyAnimation *zAnim0 = new QPropertyAnimation(this, QByteArrayLiteral("z"));
+ zAnim0->setStartValue(1.5f);
+ zAnim0->setEndValue(10.0f);
+ zAnim0->setDuration(2000);
+ animGroup->addAnimation(zAnim0);
+ QPropertyAnimation *zAnim1 = new QPropertyAnimation(this, QByteArrayLiteral("z"));
+ zAnim1->setStartValue(10.0f);
+ zAnim1->setEndValue(50.0f);
+ zAnim1->setDuration(4000);
+ zAnim1->setEasingCurve(QEasingCurve::OutElastic);
+ animGroup->addAnimation(zAnim1);
+ QPropertyAnimation *zAnim2 = new QPropertyAnimation(this, QByteArrayLiteral("z"));
+ zAnim2->setStartValue(50.0f);
+ zAnim2->setEndValue(1.5f);
+ zAnim2->setDuration(2000);
+ animGroup->addAnimation(zAnim2);
+ animGroup->start();
+
+ QPropertyAnimation* rAnim = new QPropertyAnimation(this, QByteArrayLiteral("r"));
+ rAnim->setStartValue(0.0f);
+ rAnim->setEndValue(360.0f);
+ rAnim->setDuration(2000);
+ rAnim->setLoopCount(-1);
+ rAnim->start();
+
+ QTimer::singleShot(4000, this, &GLWindow::startSecondStage);
+}
+
+GLWindow::~GLWindow()
+{
+ makeCurrent();
+ delete m_texture;
+ delete m_program;
+ delete m_vbo;
+ delete m_vao;
+}
+
+void GLWindow::startSecondStage()
+{
+ QPropertyAnimation* r2Anim = new QPropertyAnimation(this, QByteArrayLiteral("r2"));
+ r2Anim->setStartValue(0.0f);
+ r2Anim->setEndValue(360.0f);
+ r2Anim->setDuration(20000);
+ r2Anim->setLoopCount(-1);
+ r2Anim->start();
+}
+
+void GLWindow::setZ(float v)
+{
+ m_eye.setZ(v);
+ m_uniformsDirty = true;
+ update();
+}
+
+void GLWindow::setR(float v)
+{
+ m_r = v;
+ m_uniformsDirty = true;
+ update();
+}
+
+void GLWindow::setR2(float v)
+{
+ m_r2 = v;
+ m_uniformsDirty = true;
+ update();
+}
+
+static const char *vertexShaderSource =
+ "layout(location = 0) in vec4 vertex;\n"
+ "layout(location = 1) in vec3 normal;\n"
+ "out vec3 vert;\n"
+ "out vec3 vertNormal;\n"
+ "out vec3 color;\n"
+ "uniform mat4 projMatrix;\n"
+ "uniform mat4 camMatrix;\n"
+ "uniform mat4 worldMatrix;\n"
+ "uniform mat4 myMatrix;\n"
+ "uniform sampler2D sampler;\n"
+ "void main() {\n"
+ " ivec2 pos = ivec2(gl_InstanceID % 32, gl_InstanceID / 32);\n"
+ " vec2 t = vec2(float(-16 + pos.x) * 0.8, float(-18 + pos.y) * 0.6);\n"
+ " float val = 2.0 * length(texelFetch(sampler, pos, 0).rgb);\n"
+ " mat4 wm = myMatrix * mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, t.x, t.y, val, 1) * worldMatrix;\n"
+ " color = texelFetch(sampler, pos, 0).rgb * vec3(0.4, 1.0, 0.0);\n"
+ " vert = vec3(wm * vertex);\n"
+ " vertNormal = mat3(transpose(inverse(wm))) * normal;\n"
+ " gl_Position = projMatrix * camMatrix * wm * vertex;\n"
+ "}\n";
+
+static const char *fragmentShaderSource =
+ "in highp vec3 vert;\n"
+ "in highp vec3 vertNormal;\n"
+ "in highp vec3 color;\n"
+ "out highp vec4 fragColor;\n"
+ "uniform highp vec3 lightPos;\n"
+ "void main() {\n"
+ " highp vec3 L = normalize(lightPos - vert);\n"
+ " highp float NL = max(dot(normalize(vertNormal), L), 0.0);\n"
+ " highp vec3 col = clamp(color * 0.2 + color * 0.8 * NL, 0.0, 1.0);\n"
+ " fragColor = vec4(col, 1.0);\n"
+ "}\n";
+
+QByteArray versionedShaderCode(const char *src)
+{
+ QByteArray versionedSrc;
+
+ if (QOpenGLContext::currentContext()->isOpenGLES())
+ versionedSrc.append(QByteArrayLiteral("#version 300 es\n"));
+ else
+ versionedSrc.append(QByteArrayLiteral("#version 330\n"));
+
+ versionedSrc.append(src);
+ return versionedSrc;
+}
+
+void GLWindow::initializeGL()
+{
+ QOpenGLFunctions *f = QOpenGLContext::currentContext()->functions();
+
+ if (m_texture) {
+ delete m_texture;
+ m_texture = 0;
+ }
+ QImage img(":/qtlogo.png");
+ Q_ASSERT(!img.isNull());
+ m_texture = new QOpenGLTexture(img.scaled(32, 36).mirrored());
+
+ if (m_program) {
+ delete m_program;
+ m_program = 0;
+ }
+ m_program = new QOpenGLShaderProgram;
+ // Prepend the correct version directive to the sources. The rest is the
+ // same, thanks to the common GLSL syntax.
+ m_program->addShaderFromSourceCode(QOpenGLShader::Vertex, versionedShaderCode(vertexShaderSource));
+ m_program->addShaderFromSourceCode(QOpenGLShader::Fragment, versionedShaderCode(fragmentShaderSource));
+ m_program->link();
+
+ m_projMatrixLoc = m_program->uniformLocation("projMatrix");
+ m_camMatrixLoc = m_program->uniformLocation("camMatrix");
+ m_worldMatrixLoc = m_program->uniformLocation("worldMatrix");
+ m_myMatrixLoc = m_program->uniformLocation("myMatrix");
+ m_lightPosLoc = m_program->uniformLocation("lightPos");
+
+ // Create a VAO. Not strictly required for ES 3, but it is for plain OpenGL.
+ if (m_vao) {
+ delete m_vao;
+ m_vao = 0;
+ }
+ m_vao = new QOpenGLVertexArrayObject;
+ if (m_vao->create())
+ m_vao->bind();
+
+ if (m_vbo) {
+ delete m_vbo;
+ m_vbo = 0;
+ }
+ m_program->bind();
+ m_vbo = new QOpenGLBuffer;
+ m_vbo->create();
+ m_vbo->bind();
+ m_vbo->allocate(m_logo.constData(), m_logo.count() * sizeof(GLfloat));
+ f->glEnableVertexAttribArray(0);
+ f->glEnableVertexAttribArray(1);
+ f->glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(GLfloat), 0);
+ f->glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(GLfloat), reinterpret_cast<void *>(3 * sizeof(GLfloat)));
+ m_vbo->release();
+
+ f->glEnable(GL_DEPTH_TEST);
+ f->glEnable(GL_CULL_FACE);
+}
+
+void GLWindow::resizeGL(int w, int h)
+{
+ m_proj.setToIdentity();
+ m_proj.perspective(45.0f, GLfloat(w) / h, 0.01f, 100.0f);
+ m_uniformsDirty = true;
+}
+
+void GLWindow::paintGL()
+{
+ // Now use QOpenGLExtraFunctions instead of QOpenGLFunctions as we want to
+ // do more than what GL(ES) 2.0 offers.
+ QOpenGLExtraFunctions *f = QOpenGLContext::currentContext()->extraFunctions();
+
+ f->glClearColor(0, 0, 0, 1);
+ f->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ m_program->bind();
+ m_texture->bind();
+
+ if (m_uniformsDirty) {
+ m_uniformsDirty = false;
+ QMatrix4x4 camera;
+ camera.lookAt(m_eye, m_eye + m_target, QVector3D(0, 1, 0));
+ m_program->setUniformValue(m_projMatrixLoc, m_proj);
+ m_program->setUniformValue(m_camMatrixLoc, camera);
+ QMatrix4x4 wm = m_world;
+ wm.rotate(m_r, 1, 1, 0);
+ m_program->setUniformValue(m_worldMatrixLoc, wm);
+ QMatrix4x4 mm;
+ mm.setToIdentity();
+ mm.rotate(-m_r2, 1, 0, 0);
+ m_program->setUniformValue(m_myMatrixLoc, mm);
+ m_program->setUniformValue(m_lightPosLoc, QVector3D(0, 0, 70));
+ }
+
+ // Now call a function introduced in OpenGL 3.1 / OpenGL ES 3.0. We
+ // requested a 3.3 or ES 3.0 context, so we know this will work.
+ f->glDrawArraysInstanced(GL_TRIANGLES, 0, m_logo.vertexCount(), 32 * 36);
+}
diff --git a/examples/widgets/mainwindows/recentfiles/mainwindow.h b/examples/opengl/hellogles3/glwindow.h
index 95252ca525..8b7758d1b0 100644
--- a/examples/widgets/mainwindows/recentfiles/mainwindow.h
+++ b/examples/opengl/hellogles3/glwindow.h
@@ -38,59 +38,65 @@
**
****************************************************************************/
-#ifndef MAINWINDOW_H
-#define MAINWINDOW_H
+#ifndef GLWIDGET_H
+#define GLWIDGET_H
-#include <QList>
-#include <QMainWindow>
+#include <QOpenGLWindow>
+#include <QMatrix4x4>
+#include <QVector3D>
+#include "../hellogl2/logo.h"
QT_BEGIN_NAMESPACE
-class QAction;
-class QMenu;
-class QTextEdit;
+
+class QOpenGLTexture;
+class QOpenGLShaderProgram;
+class QOpenGLBuffer;
+class QOpenGLVertexArrayObject;
+
QT_END_NAMESPACE
-class MainWindow : public QMainWindow
+class GLWindow : public QOpenGLWindow
{
Q_OBJECT
+ Q_PROPERTY(float z READ z WRITE setZ)
+ Q_PROPERTY(float r READ r WRITE setR)
+ Q_PROPERTY(float r2 READ r2 WRITE setR2)
public:
- MainWindow();
-
-private slots:
- void newFile();
- void open();
- void save();
- void saveAs();
- void openRecentFile();
- void about();
+ GLWindow();
+ ~GLWindow();
-private:
- void createActions();
- void createMenus();
- void loadFile(const QString &fileName);
- void saveFile(const QString &fileName);
- void setCurrentFile(const QString &fileName);
- void updateRecentFileActions();
- QString strippedName(const QString &fullFileName);
-
- QString curFile;
+ void initializeGL();
+ void resizeGL(int w, int h);
+ void paintGL();
- QTextEdit *textEdit;
- QMenu *fileMenu;
- QMenu *recentFilesMenu;
- QMenu *helpMenu;
- QAction *newAct;
- QAction *openAct;
- QAction *saveAct;
- QAction *saveAsAct;
- QAction *exitAct;
- QAction *aboutAct;
- QAction *aboutQtAct;
- QAction *separatorAct;
+ float z() const { return m_eye.z(); }
+ void setZ(float v);
- enum { MaxRecentFiles = 5 };
- QAction *recentFileActs[MaxRecentFiles];
+ float r() const { return m_r; }
+ void setR(float v);
+ float r2() const { return m_r2; }
+ void setR2(float v);
+private slots:
+ void startSecondStage();
+private:
+ QOpenGLTexture *m_texture;
+ QOpenGLShaderProgram *m_program;
+ QOpenGLBuffer *m_vbo;
+ QOpenGLVertexArrayObject *m_vao;
+ Logo m_logo;
+ int m_projMatrixLoc;
+ int m_camMatrixLoc;
+ int m_worldMatrixLoc;
+ int m_myMatrixLoc;
+ int m_lightPosLoc;
+ QMatrix4x4 m_proj;
+ QMatrix4x4 m_world;
+ QVector3D m_eye;
+ QVector3D m_target;
+ bool m_uniformsDirty;
+ float m_r;
+ float m_r2;
};
#endif
diff --git a/examples/opengl/hellogles3/hellogles3.pro b/examples/opengl/hellogles3/hellogles3.pro
new file mode 100644
index 0000000000..e0d4c25ca6
--- /dev/null
+++ b/examples/opengl/hellogles3/hellogles3.pro
@@ -0,0 +1,11 @@
+HEADERS = $$PWD/glwindow.h \
+ $$PWD/../hellogl2/logo.h
+
+SOURCES = $$PWD/glwindow.cpp \
+ $$PWD/main.cpp \
+ $$PWD/../hellogl2/logo.cpp
+
+RESOURCES += hellogles3.qrc
+
+target.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogles3
+INSTALLS += target
diff --git a/examples/opengl/hellogles3/hellogles3.qrc b/examples/opengl/hellogles3/hellogles3.qrc
new file mode 100644
index 0000000000..f3a0978084
--- /dev/null
+++ b/examples/opengl/hellogles3/hellogles3.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource>
+ <file>qtlogo.png</file>
+ </qresource>
+</RCC>
diff --git a/examples/widgets/draganddrop/draggabletext/draglabel.h b/examples/opengl/hellogles3/main.cpp
index 8d2c31aa1d..f0de28bdc4 100644
--- a/examples/widgets/draganddrop/draggabletext/draglabel.h
+++ b/examples/opengl/hellogles3/main.cpp
@@ -38,21 +38,41 @@
**
****************************************************************************/
-#ifndef DRAGLABEL_H
-#define DRAGLABEL_H
+#include <QGuiApplication>
+#include <QSurfaceFormat>
+#include <QOpenGLContext>
-#include <QLabel>
+#include "glwindow.h"
-QT_BEGIN_NAMESPACE
-class QDragEnterEvent;
-class QDragMoveEvent;
-class QFrame;
-QT_END_NAMESPACE
+// This example demonstrates easy, cross-platform usage of OpenGL ES 3.0 functions via
+// QOpenGLExtraFunctions in an application that works identically on desktop platforms
+// with OpenGL 3.3 and mobile/embedded devices with OpenGL ES 3.0.
-class DragLabel : public QLabel
+// The code is always the same, with the exception of two places: (1) the OpenGL context
+// creation has to have a sufficiently high version number for the features that are in
+// use, and (2) the shader code's version directive is different.
+
+int main(int argc, char *argv[])
{
-public:
- DragLabel(const QString &text, QWidget *parent);
-};
+ QSurfaceFormat fmt;
+ fmt.setDepthBufferSize(24);
+
+ // Request OpenGL 3.3 compatibility or OpenGL ES 3.0.
+ if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) {
+ qDebug("Requesting 3.3 compatibility context");
+ fmt.setVersion(3, 3);
+ fmt.setProfile(QSurfaceFormat::CompatibilityProfile);
+ } else {
+ qDebug("Requesting 3.0 context");
+ fmt.setVersion(3, 0);
+ }
+
+ QSurfaceFormat::setDefaultFormat(fmt);
+
+ QGuiApplication app(argc, argv);
+
+ GLWindow glWindow;
+ glWindow.showMaximized();
-#endif // DRAGLABEL_H
+ return app.exec();
+}
diff --git a/examples/opengl/hellogles3/qtlogo.png b/examples/opengl/hellogles3/qtlogo.png
new file mode 100644
index 0000000000..868fcea860
--- /dev/null
+++ b/examples/opengl/hellogles3/qtlogo.png
Binary files differ
diff --git a/examples/opengl/hellowindow/hellowindow.cpp b/examples/opengl/hellowindow/hellowindow.cpp
index 7674ffaed8..bc58e1a0e4 100644
--- a/examples/opengl/hellowindow/hellowindow.cpp
+++ b/examples/opengl/hellowindow/hellowindow.cpp
@@ -119,7 +119,7 @@ void Renderer::setAnimating(HelloWindow *window, bool animating)
if (animating) {
m_windows << window;
if (m_windows.size() == 1)
- QTimer::singleShot(0, this, SLOT(render()));
+ QTimer::singleShot(0, this, &Renderer::render);
} else {
m_currentWindow = 0;
m_windows.removeOne(window);
@@ -184,7 +184,7 @@ void Renderer::render()
m_fAngle += 1.0f;
- QTimer::singleShot(0, this, SLOT(render()));
+ QTimer::singleShot(0, this, &Renderer::render);
}
Q_GLOBAL_STATIC(QMutex, initMutex)
diff --git a/examples/opengl/hellowindow/main.cpp b/examples/opengl/hellowindow/main.cpp
index 716280aa5f..f665ee6fa8 100644
--- a/examples/opengl/hellowindow/main.cpp
+++ b/examples/opengl/hellowindow/main.cpp
@@ -121,13 +121,13 @@ int main(int argc, char *argv[])
}
for (int i = 0; i < renderThreads.size(); ++i) {
- QObject::connect(qGuiApp, SIGNAL(lastWindowClosed()), renderThreads.at(i), SLOT(quit()));
+ QObject::connect(qGuiApp, &QGuiApplication::lastWindowClosed, renderThreads.at(i), &QThread::quit);
renderThreads.at(i)->start();
}
// Quit after 10 seconds. For platforms that do not have windows that are closeable.
if (QCoreApplication::arguments().contains(QStringLiteral("--timeout")))
- QTimer::singleShot(10000, qGuiApp, SLOT(quit()));
+ QTimer::singleShot(10000, qGuiApp, &QCoreApplication::quit);
const int exitValue = app.exec();
diff --git a/examples/opengl/opengl.pro b/examples/opengl/opengl.pro
index cf5329c55d..ed8134743b 100644
--- a/examples/opengl/opengl.pro
+++ b/examples/opengl/opengl.pro
@@ -13,5 +13,6 @@ qtHaveModule(widgets) {
!wince: SUBDIRS += \
qopenglwidget \
cube \
- textures
+ textures \
+ hellogles3
}
diff --git a/examples/opengl/paintedwindow/paintedwindow.cpp b/examples/opengl/paintedwindow/paintedwindow.cpp
index c67edb6f65..6b015bd2c3 100644
--- a/examples/opengl/paintedwindow/paintedwindow.cpp
+++ b/examples/opengl/paintedwindow/paintedwindow.cpp
@@ -83,9 +83,11 @@ PaintedWindow::PaintedWindow()
m_targetOrientation = contentOrientation();
m_nextTargetOrientation = Qt::PrimaryOrientation;
- connect(screen(), SIGNAL(orientationChanged(Qt::ScreenOrientation)), this, SLOT(orientationChanged(Qt::ScreenOrientation)));
- connect(m_animation, SIGNAL(finished()), this, SLOT(rotationDone()));
- connect(this, SIGNAL(rotationChanged(qreal)), this, SLOT(paint()));
+ connect(screen(), &QScreen::orientationChanged, this, &PaintedWindow::orientationChanged);
+ connect(m_animation, &QAbstractAnimation::finished, this, &PaintedWindow::rotationDone);
+ typedef void (PaintedWindow::*PaintedWindowVoidSlot)();
+ connect(this, &PaintedWindow::rotationChanged,
+ this, static_cast<PaintedWindowVoidSlot>(&PaintedWindow::paint));
}
void PaintedWindow::exposeEvent(QExposeEvent *)
diff --git a/examples/opengl/qopenglwidget/mainwindow.cpp b/examples/opengl/qopenglwidget/mainwindow.cpp
index 22111afdcb..06f35db97a 100644
--- a/examples/opengl/qopenglwidget/mainwindow.cpp
+++ b/examples/opengl/qopenglwidget/mainwindow.cpp
@@ -51,6 +51,8 @@
#include "glwidget.h"
+typedef void (QWidget::*QWidgetVoidSlot)();
+
MainWindow::MainWindow()
: m_nextX(1), m_nextY(1)
{
@@ -107,34 +109,27 @@ MainWindow::MainWindow()
groupBox->setLayout(m_layout);
+
QMenu *fileMenu = menuBar()->addMenu("&File");
+ fileMenu->addAction("E&xit", this, &QWidget::close);
QMenu *showMenu = menuBar()->addMenu("&Show");
- QMenu *helpMenu = menuBar()->addMenu("&Help");
- QAction *exit = new QAction("E&xit", fileMenu);
- QAction *aboutQt = new QAction("About Qt", helpMenu);
- QAction *showLogo = new QAction("Show 3D Logo", showMenu);
- QAction *showTexture = new QAction("Show 2D Texture", showMenu);
- QAction *showBubbles = new QAction("Show bubbles", showMenu);
+ showMenu->addAction("Show 3D Logo", glwidget, &GLWidget::setLogo);
+ showMenu->addAction("Show 2D Texture", glwidget, &GLWidget::setTexture);
+ QAction *showBubbles = showMenu->addAction("Show bubbles", glwidget, &GLWidget::setShowBubbles);
showBubbles->setCheckable(true);
showBubbles->setChecked(true);
- fileMenu->addAction(exit);
- helpMenu->addAction(aboutQt);
- showMenu->addAction(showLogo);
- showMenu->addAction(showTexture);
- showMenu->addAction(showBubbles);
-
- connect(exit, SIGNAL(triggered(bool)), this, SLOT(close()));
- connect(aboutQt, SIGNAL(triggered(bool)), qApp, SLOT(aboutQt()));
+ QMenu *helpMenu = menuBar()->addMenu("&Help");
+ helpMenu->addAction("About Qt", qApp, &QApplication::aboutQt);
- connect(m_timer, SIGNAL(timeout()), glwidget, SLOT(update()));
+ connect(m_timer, &QTimer::timeout,
+ glwidget, static_cast<QWidgetVoidSlot>(&QWidget::update));
- connect(showLogo, SIGNAL(triggered(bool)), glwidget, SLOT(setLogo()));
- connect(showTexture, SIGNAL(triggered(bool)), glwidget, SLOT(setTexture()));
- connect(showBubbles, SIGNAL(triggered(bool)), glwidget, SLOT(setShowBubbles(bool)));
- connect(slider, SIGNAL(valueChanged(int)), glwidget, SLOT(setScaling(int)));
+ connect(slider, &QAbstractSlider::valueChanged, glwidget, &GLWidget::setScaling);
connect(transparent, &QCheckBox::toggled, glwidget, &GLWidget::setTransparent);
- connect(updateInterval, SIGNAL(valueChanged(int)), this, SLOT(updateIntervalChanged(int)));
+ typedef void (QSpinBox::*QSpinBoxIntSignal)(int);
+ connect(updateInterval, static_cast<QSpinBoxIntSignal>(&QSpinBox::valueChanged),
+ this, &MainWindow::updateIntervalChanged);
connect(timerBased, &QCheckBox::toggled, this, &MainWindow::timerUsageChanged);
connect(timerBased, &QCheckBox::toggled, updateInterval, &QWidget::setEnabled);
@@ -157,7 +152,7 @@ void MainWindow::addNew()
return;
GLWidget *w = new GLWidget(this, false, qRgb(qrand() % 256, qrand() % 256, qrand() % 256));
m_glWidgets << w;
- connect(m_timer, SIGNAL(timeout()), w, SLOT(update()));
+ connect(m_timer, &QTimer::timeout, w, static_cast<QWidgetVoidSlot>(&QWidget::update));
m_layout->addWidget(w, m_nextY, m_nextX, 1, 1);
if (m_nextX == 3) {
m_nextX = 1;
diff --git a/examples/opengl/qopenglwindow/main.cpp b/examples/opengl/qopenglwindow/main.cpp
index 123bebbe2a..f444b5d7c7 100644
--- a/examples/opengl/qopenglwindow/main.cpp
+++ b/examples/opengl/qopenglwindow/main.cpp
@@ -163,16 +163,20 @@ void OpenGLWindow::keyPressEvent(QKeyEvent *e)
void OpenGLWindow::setAnimating(bool enabled)
{
+ typedef void (QPaintDeviceWindow::*QPaintDeviceWindowVoidSlot)();
+
if (enabled) {
// Animate continuously, throttled by the blocking swapBuffers() call the
// QOpenGLWindow internally executes after each paint. Once that is done
// (frameSwapped signal is emitted), we schedule a new update. This
// obviously assumes that the swap interval (see
// QSurfaceFormat::setSwapInterval()) is non-zero.
- connect(this, SIGNAL(frameSwapped()), this, SLOT(update()));
+ connect(this, &QOpenGLWindow::frameSwapped,
+ this, static_cast<QPaintDeviceWindowVoidSlot>(&QPaintDeviceWindow::update));
update();
} else {
- disconnect(this, SIGNAL(frameSwapped()), this, SLOT(update()));
+ disconnect(this, &QOpenGLWindow::frameSwapped,
+ this, static_cast<QPaintDeviceWindowVoidSlot>(&QPaintDeviceWindow::update));
}
}
diff --git a/examples/opengl/textures/window.cpp b/examples/opengl/textures/window.cpp
index e9ad8e2cc6..fddb9f9945 100644
--- a/examples/opengl/textures/window.cpp
+++ b/examples/opengl/textures/window.cpp
@@ -59,8 +59,8 @@ Window::Window()
glWidgets[i][j]->rotateBy(+42 * 16, +42 * 16, -21 * 16);
mainLayout->addWidget(glWidgets[i][j], i, j);
- connect(glWidgets[i][j], SIGNAL(clicked()),
- this, SLOT(setCurrentGlWidget()));
+ connect(glWidgets[i][j], &GLWidget::clicked,
+ this, &Window::setCurrentGlWidget);
}
}
setLayout(mainLayout);
@@ -68,7 +68,7 @@ Window::Window()
currentGlWidget = glWidgets[0][0];
QTimer *timer = new QTimer(this);
- connect(timer, SIGNAL(timeout()), this, SLOT(rotateOneStep()));
+ connect(timer, &QTimer::timeout, this, &Window::rotateOneStep);
timer->start(20);
setWindowTitle(tr("Textures"));
diff --git a/examples/qtconcurrent/map/main.cpp b/examples/qtconcurrent/map/main.cpp
index 75b1da4e6f..eaa7c911cb 100644
--- a/examples/qtconcurrent/map/main.cpp
+++ b/examples/qtconcurrent/map/main.cpp
@@ -64,7 +64,7 @@ int main(int argc, char *argv[])
// Use QtConcurrentBlocking::mapped to apply the scale function to all the
// images in the list.
- QList<QImage> thumbnails = QtConcurrent::blockingMapped<QList<QImage> >(images, scale);
+ QList<QImage> thumbnails = QtConcurrent::blockingMapped(images, scale);
return 0;
}
diff --git a/examples/qtconcurrent/wordcount/main.cpp b/examples/qtconcurrent/wordcount/main.cpp
index f45f2820c7..7f6d0f43ba 100644
--- a/examples/qtconcurrent/wordcount/main.cpp
+++ b/examples/qtconcurrent/wordcount/main.cpp
@@ -61,10 +61,10 @@ QStringList findFiles(const QString &startDir, QStringList filters)
QDir dir(startDir);
foreach (QString file, dir.entryList(filters, QDir::Files))
- names += startDir + "/" + file;
+ names += startDir + '/' + file;
foreach (QString subdir, dir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot))
- names += findFiles(startDir + "/" + subdir, filters);
+ names += findFiles(startDir + '/' + subdir, filters);
return names;
}
@@ -81,7 +81,7 @@ WordCount singleThreadedWordCount(QStringList files)
f.open(QIODevice::ReadOnly);
QTextStream textStream(&f);
while (textStream.atEnd() == false)
- foreach(QString word, textStream.readLine().split(" "))
+ foreach (const QString &word, textStream.readLine().split(' '))
wordCount[word] += 1;
}
@@ -100,7 +100,7 @@ WordCount countWords(const QString &file)
WordCount wordCount;
while (textStream.atEnd() == false)
- foreach (QString word, textStream.readLine().split(" "))
+ foreach (const QString &word, textStream.readLine().split(' '))
wordCount[word] += 1;
return wordCount;
diff --git a/examples/sql/books/bookdelegate.cpp b/examples/sql/books/bookdelegate.cpp
index ff965eda44..afc4edf434 100644
--- a/examples/sql/books/bookdelegate.cpp
+++ b/examples/sql/books/bookdelegate.cpp
@@ -44,7 +44,7 @@ void BookDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
const QModelIndex &index) const
{
if (index.column() != 5) {
- QStyleOptionViewItemV3 opt = option;
+ QStyleOptionViewItem opt = option;
opt.rect.adjust(0, 0, -1, -1); // since we draw the grid ourselves
QSqlRelationalDelegate::paint(painter, opt, index);
} else {
diff --git a/examples/sql/books/books.pro b/examples/sql/books/books.pro
index 94f8104414..c64766c29f 100644
--- a/examples/sql/books/books.pro
+++ b/examples/sql/books/books.pro
@@ -16,5 +16,5 @@ wince {
CONFIG(debug, debug|release):sqlPlugins.files = $$QT_BUILD_TREE/plugins/sqldrivers/*d4.dll
CONFIG(release, debug|release):sqlPlugins.files = $$QT_BUILD_TREE/plugins/sqldrivers/*[^d]4.dll
sqlPlugins.path = sqldrivers
- DEPLOYMENT += sqlPlugins
+ INSTALLS += sqlPlugins
}
diff --git a/examples/sql/masterdetail/dialog.cpp b/examples/sql/masterdetail/dialog.cpp
index 5518707f58..3171acc448 100644
--- a/examples/sql/masterdetail/dialog.cpp
+++ b/examples/sql/masterdetail/dialog.cpp
@@ -153,7 +153,7 @@ void Dialog::addTracks(int albumId, QStringList tracks)
for (int i = 0; i < tracks.count(); i++) {
QString trackNumber = QString::number(i);
if (i < 10)
- trackNumber.prepend("0");
+ trackNumber.prepend('0');
QDomText textNode = albumDetails.createTextNode(tracks.at(i));
diff --git a/examples/sql/querymodel/customsqlmodel.cpp b/examples/sql/querymodel/customsqlmodel.cpp
index 5966802abe..4cdfdd6ae3 100644
--- a/examples/sql/querymodel/customsqlmodel.cpp
+++ b/examples/sql/querymodel/customsqlmodel.cpp
@@ -53,7 +53,7 @@ QVariant CustomSqlModel::data(const QModelIndex &index, int role) const
QVariant value = QSqlQueryModel::data(index, role);
if (value.isValid() && role == Qt::DisplayRole) {
if (index.column() == 0)
- return value.toString().prepend("#");
+ return value.toString().prepend('#');
else if (index.column() == 2)
return value.toString().toUpper();
}
diff --git a/examples/webkit/webkit-guide/_copyright.txt b/examples/webkit/webkit-guide/_copyright.txt
deleted file mode 100644
index 32e0d2f918..0000000000
--- a/examples/webkit/webkit-guide/_copyright.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-<!--
-
-This file is part of QtWebKit
-
-Copyright (c) 2015 The Qt Company Ltd.
-Contact: http://www.qt.io/licensing/
-
-
-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:
-
-o Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
-o 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.
-
-o Neither the name of The Qt Company Ltd 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."
-
--->
-
-\1
diff --git a/examples/webkit/webkit-guide/_image_assets.htm b/examples/webkit/webkit-guide/_image_assets.htm
deleted file mode 100644
index e3699f22bb..0000000000
--- a/examples/webkit/webkit-guide/_image_assets.htm
+++ /dev/null
@@ -1,332 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<title>image assets</title>
-
-<style>
-img { max-height: 72px; }
-</style>
-
-</head>
-<body>
-<h1>image assets</h1>
-
-Notes:
-
-<ul>
-
-<li>Some of these may be redundant; feel free to merge
-
-<li>Feel free to rename files, but give me before & after list of filenames so I can reflect the change
-
-<li>use neutral grayscale if possible
-
-<li>use PNG file format if possible
-
-<li>I plan to cut new set of generic icons
-(e.g., <a href="anim_skew.htm">HERE</a> to be white text on darkish
-gray, probably #777777)
-
-<li>No more need for online/offline indicators (red/green circles) for
-this draft.
-
-</ul>
-
-<table border="1" width="100%">
-
-<tr>
-<th>FILENAME</th>
-<th>IMAGE (thumbnail & link)</th>
-<th>USED ON PAGE</th>
-<th>DESCRIPTION</th>
-</tr>
-
-<tr>
-<td>icon_dismiss.png,<br/>icon_dismiss_x22.png</td>
-<td>
-<a target="elsewhere" href="img/icon_dismiss.png"><img src="img/icon_dismiss.png"/></a>
-<a target="elsewhere" href="img/icon_dismiss_x22.png"><img src="img/icon_dismiss_x22.png"/></a>
-</td>
-<td>
-<a target="elsewhere" href="anim_skew.htm">HERE</a>
-<a target="elsewhere" href="storage.htm">HERE</a>
-<a target="elsewhere" href="css3_text-overflow.htm">HERE</a>
-<a target="elsewhere" href="layout_tbl-keyhole.htm">HERE</a>
-</td>
-<td>Dismiss panel or listed item</td>
-</tr>
-
-<tr>
-<td>icon_expand-nav.png</td>
-<td><a target="elsewhere" href="img/icon_expand-nav.png"><img src="img/icon_expand-nav.png"/></a></td>
-<td><a target="elsewhere" href="anim_accord.htm">HERE</a></td>
-<td>expand complex set of navigation options</td>
-</tr>
-
-<tr>
-<td>icon_nav-up.png</td>
-<td><a target="elsewhere" href="img/icon_nav-up.png"><img src="img/icon_nav-up.png"/></a></td>
-<td><a target="elsewhere" href="layout_tbl-keyhole.htm">HERE</a></td>
-<td>navigate within listings (up arrow also serves as down arrow using rotate transform)</td>
-</tr>
-
-<tr>
-<td>icon_drill-up.png,<br/>icon_drill-up_x32.png</td>
-<td>
-<a target="elsewhere" href="img/icon_drill-up.png"><img src="img/icon_drill-up.png"/></a>
-<a target="elsewhere" href="img/icon_drill-up_x32.png"><img src="img/icon_drill-up_x32.png"/></a>
-</td>
-<td><a target="elsewhere" href="anim_slide1.htm">HERE</a></td>
-<td>navigate up one level within sliding drilldown UI</td>
-</tr>
-
-<tr>
-<td>icon_drill-down.png,<br/>icon_drill-down_x32.png</td>
-<td>
-<a target="elsewhere" href="img/icon_drill-down.png"><img src="img/icon_drill-down.png"/></a>
-<a target="elsewhere" href="img/icon_drill-down_x32.png"><img src="img/icon_drill-down_x32.png"/></a>
-</td>
-<td><a target="elsewhere" href="anim_slide1.htm">HERE</a></td>
-<td>navigate down one level within sliding drilldown UI</td>
-</tr>
-
-<tr>
-<td>icon_scroll-left.png</td>
-<td><a target="elsewhere" href="img/icon_scroll-left.png"><img src="img/icon_scroll-left.png"/></a></td>
-<td><a target="elsewhere" href="css3_scroll.htm">HERE</a></td>
-<td>custom horizontal scroll button</td>
-</tr>
-
-<tr>
-<td>icon_scroll-right.png</td>
-<td><a target="elsewhere" href="img/icon_scroll-right.png"><img src="img/icon_scroll-right.png"/></a></td>
-<td><a target="elsewhere" href="css3_scroll.htm">HERE</a></td>
-<td>custom horizontal scroll button</td>
-</tr>
-
-<tr>
-<td>icon_head-expanded.png,<br/>icon_head-expanded_x13.png</td>
-<td>
-<a target="elsewhere" href="img/icon_head-expanded.png"><img src="img/icon_head-expanded.png"/></a>
-<a target="elsewhere" href="img/icon_head-expanded_x13.png"><img src="img/icon_head-expanded_x13.png"/></a>
-</td>
-<td><a target="elsewhere" href="anim_accord.htm">HERE</a>
-<a target="elsewhere" href="css3_backgrounds.htm">HERE</a></td>
-<td>marks accordion heading expanded state</td>
-</tr>
-
-<tr>
-<td>icon_head-collapsed.png,<br/>icon_head-collapsed_x13.png</td>
-<td>
-<a target="elsewhere" href="img/icon_head-collapsed.png"><img src="img/icon_head-collapsed.png"/></a>
-<a target="elsewhere" href="img/icon_head-collapsed_x13.png"><img src="img/icon_head-collapsed_x13.png"/></a>
-</td>
-<td><a target="elsewhere" href="anim_accord.htm">HERE</a>
-<a target="elsewhere" href="css3_backgrounds.htm">HERE</a></td>
-<td>marks accordion heading collapsed state</td>
-</tr>
-
-<tr>
-<td>icon_info.png,<br/>icon_info_x24.png</td>
-<td>
-<a target="elsewhere" href="img/icon_info.png"><img src="img/icon_info.png"/></a>
-<a target="elsewhere" href="img/icon_info_x24.png"><img src="img/icon_info_x24.png"/></a>
-</td>
-<td><a target="elsewhere" href="storage.htm">HERE</a></td>
-<td>link to panel specifying user preferences</td>
-</tr>
-
-<tr>
-<td>icon_list-all.png,<br/>icon_list-all_circ.png</td>
-<td>
-<a target="elsewhere" href="img/icon_list-all.png"><img src="img/icon_list-all.png"/></a>
-<a target="elsewhere" href="img/icon_list-all_circ.png"><img src="img/icon_list-all_circ.png"/></a>
-</td>
-<td><a target="elsewhere" href="anim_skew.htm">HERE</a></td>
-<td>within UI listing items users can filter by category, this indicates LIST ALL ITEMS</td>
-</tr>
-
-<tr>
-<td>gradient.jpg</td>
-<td><a target="elsewhere" href="img/gradient.jpg"><img src="img/gradient.jpg"/></a></td>
-<td><a target="elsewhere" href="css3_backgrounds.htm">HERE</a></td>
-<td>serves as background for expanded accordion heads (demonstrates CSS's >1 background image feature)</td>
-</tr>
-
-<tr>
-<td>border-frame.png</td>
-<td><a target="elsewhere" href="img/border-frame.png"><img src="img/border-frame.png"/></a></td>
-<td><a target="elsewhere" href="css3_border-img.htm">HERE</a></td>
-<td>border around chunk of text (got this from Wei Lu's sample; simply demo's this feature)</td>
-</tr>
-
-<tr>
-<td>mask.png</td>
-<td><a target="elsewhere" href="img/mask.png"><img src="img/mask.png"/></a></td>
-<td><a target="elsewhere" href="css3_mask-img.htm">HERE</a></td>
-<td>Used as a gradient to mask an image; think I got this one from <a href="http://webkit.org/blog/181/css-masks/">webkit.org</a></td>
-</tr>
-
-<tr>
-<td>icon_check.png,<br/>icon_check_x24green.png</td>
-<td>
-<a target="elsewhere" href="img/icon_check.png"><img src="img/icon_check.png"/></a>
-<a target="elsewhere" href="img/icon_check_x24green.png"><img src="img/icon_check_x24green.png"/></a>
-</td>
-<td><a target="elsewhere" href="form_tapper.htm">HERE</a></td>
-<td>This is not available as a separate file; it's specified within
-CSS using the "data:" URL scheme. It indicates radio/checkbox
-selection state within tappable UI; keep green if possible to match
-border</td>
-</tr>
-
-<tr>
-<th colspan="4">FILE FORMATS</th>
-<tr>
-
-<tr>
-<td>icon_link-sms.png</td>
-<td><a target="elsewhere" href="img/icon_link-sms.png"><img src="img/icon_link-sms.png"/></a></td>
-<td><a target="elsewhere" href="layout_link-fmt.htm">HERE</a></td>
-<td>provides visual hint marking context of hyperlink, in this case a link to initiate an instant message</td>
-</tr>
-
-<tr>
-<td>icon_link-tel.png</td>
-<td><a target="elsewhere" href="img/icon_link-tel.png"><img src="img/icon_link-tel.png"/></a></td>
-<td><a target="elsewhere" href="layout_link-fmt.htm">HERE</a></td>
-<td>...link to make phone call</td>
-</tr>
-
-<tr>
-<td>icon_link-xls.png</td>
-<td><a target="elsewhere" href="img/icon_link-xls.png"><img src="img/icon_link-xls.png"/></a></td>
-<td><a target="elsewhere" href="layout_link-fmt.htm">HERE</a></td>
-<td>...link to excel file</td>
-</tr>
-
-<tr>
-<td>icon_link-doc.png</td>
-<td><a target="elsewhere" href="img/icon_link-doc.png"><img src="img/icon_link-doc.png"/></a></td>
-<td><a target="elsewhere" href="layout_link-fmt.htm">HERE</a></td>
-<td>...link to MS Word file</td>
-</tr>
-
-<tr>
-<td>icon_link-email.png</td>
-<td><a target="elsewhere" href="img/icon_link-email.png"><img src="img/icon_link-email.png"/></a></td>
-<td><a target="elsewhere" href="layout_link-fmt.htm">HERE</a></td>
-<td>...email link</td>
-</tr>
-
-<tr>
-<td>icon_link-external.png</td>
-<td><a target="elsewhere" href="img/icon_link-external.png"><img src="img/icon_link-external.png"/></a></td>
-<td><a target="elsewhere" href="layout_link-fmt.htm">HERE</a></td>
-<td>...link to web page external to current site</td>
-</tr>
-
-<tr>
-<td>icon_link-pdf.png</td>
-<td><a target="elsewhere" href="img/icon_link-pdf.png"><img src="img/icon_link-pdf.png"/></a></td>
-<td><a target="elsewhere" href="layout_link-fmt.htm">HERE</a></td>
-<td>...loink to PDF file</td>
-</tr>
-
-<tr>
-<td>icon_link-ppt.png</td>
-<td><a target="elsewhere" href="img/icon_link-ppt.png"><img src="img/icon_link-ppt.png"/></a></td>
-<td><a target="elsewhere" href="layout_link-fmt.htm">HERE</a></td>
-<td>...link to PowerPoint file</td>
-</tr>
-
-<tr>
-<td>icon_link-rss.png</td>
-<td><a target="elsewhere" href="img/icon_link-rss.png"><img src="img/icon_link-rss.png"/></a></td>
-<td><a target="elsewhere" href="layout_link-fmt.htm">HERE</a></td>
-<td>...link to RSS feed</td>
-</tr>
-
-<tr>
-<th colspan="4">UNUSED</th>
-<tr>
-
-<tr>
-<td>icon_nav-top.png</td>
-<td><a target="elsewhere" href="img/icon_nav-top.png"><img src="img/icon_nav-top.png"/></a></td>
-<td></td>
-<td></td>
-</tr>
-
-<tr>
-<td>icon_nav-start.png</td>
-<td><a target="elsewhere" href="img/icon_nav-start.png"><img src="img/icon_nav-start.png"/></a></td>
-<td></td>
-<td></td>
-</tr>
-
-<tr>
-<td>icon_nav_end.png</td>
-<td><a target="elsewhere" href="img/icon_nav_end.png"><img src="img/icon_nav_end.png"/></a></td>
-<td></td>
-<td></td>
-</tr>
-
-<tr>
-<td>icon_question.png</td>
-<td><a target="elsewhere" href="img/icon_question.png"><img src="img/icon_question.png"/></a></td>
-<td></td>
-<td></td>
-</tr>
-
-<tr>
-<td>icon_trash.png</td>
-<td><a target="elsewhere" href="img/icon_trash.png"><img src="img/icon_trash.png"/></a></td>
-<td></td>
-<td></td>
-</tr>
-
-</table>
-
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/_index.html b/examples/webkit/webkit-guide/_index.html
deleted file mode 100644
index d683c0508e..0000000000
--- a/examples/webkit/webkit-guide/_index.html
+++ /dev/null
@@ -1,320 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<!-- examples.qdoc -->
- <title>CSS: SAMPLE PAGES</title>
- <link rel="stylesheet" type="text/css" href="style/style.css" />
- <script src="scripts/jquery.js" type="text/javascript"></script>
- <script src="scripts/functions.js" type="text/javascript"></script>
- <script src="./scripts/superfish.js" type="text/javascript"></script>
- <link rel="stylesheet" type="text/css" href="style/superfish.css" /> <script src="./scripts/narrow.js" type="text/javascript"></script>
- <link rel="stylesheet" type="text/css" href="style/narrow.css" />
-</head>
-<body class="" onload="CheckEmptyAndLoadList();">
-
- <style>
-div.header, div.toolbar, div.feedback, div#feedbackBox, div.footer, div.sidebar { display: none; background: pink }
-div.toc {
- background: #dddddd;
- border: thin solid #777777;
- padding: 1em;
- border-radius: 1em;
- margin: 1em
-}
-div.toc li:before { color: lightcoral; text-transform: uppercase; }
-h3 { border-top: thick pink solid }
-h4 { border-top: medium gold solid }
-h5 { border-top: medium lightgreen solid }
-h3,h4,h5 { padding-top: 1em }
-li.level1 { margin-left: 0 }
-li.level2 { margin-left: 2em }
-li.level3 { margin-left: 4em }
-li.level4 { margin-left: 6em }
-li.level5 { margin-left: 8em }
-table { border: solid #777777 thin }
-tr:nth-of-type(even) { background: beige }
-tr:nth-of-type(odd) { background: lightblue }
-th {
- background: #777777;
- color: #ffffff;
-}
-
-img[src^='images/cnd_'] { float: right; margin: 1em ; padding: 1em; border-radius: 1em; border: thin #777777 solid; }
-tt, pre { background: #dddddd; border: thin #dddddd solid; }
-a[href^='http://waplabdc.nokia-boston.com'] { color: black; }
-a[href^='http://waplabdc.nokia-boston.com']:before { content: url(http://waplabdc.nokia-boston.com/browser/users/sierra/x/img/html.jpg); }
- </style>
- <div class="header" id="qtdocheader">
- <div class="content">
- <div id="nav-logo">
- <a href="index.html">Home</a></div>
- <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
- <div id="narrowsearch"></div>
- <div id="nav-topright">
- <ul>
- <li class="nav-topright-home"><a href="http://qt.nokia.com/">Qt HOME</a></li>
- <li class="nav-topright-dev"><a href="http://developer.qt.nokia.com/">DEV</a></li>
- <li class="nav-topright-labs"><a href="http://labs.qt.nokia.com/blogs/">LABS</a></li>
- <li class="nav-topright-doc nav-topright-doc-active"><a href="http://doc.qt.nokia.com/">
- DOC</a></li>
- <li class="nav-topright-blog"><a href="http://blog.qt.nokia.com/">BLOG</a></li>
- </ul>
- </div>
- <div id="shortCut">
- <ul>
- <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.7</a></span></li>
- <li class="shortCut-topleft-active"><a href="http://doc.qt.nokia.com">ALL VERSIONS </a></li>
- </ul>
- </div>
- <ul class="sf-menu" id="narrowmenu">
- <li><a href="#">API Lookup</a>
- <ul>
- <li><a href="classes.html">Class index</a></li>
- <li><a href="functions.html">Function index</a></li>
- <li><a href="modules.html">Modules</a></li>
- <li><a href="namespaces.html">Namespaces</a></li>
- <li><a href="qtglobal.html">Global Declarations</a></li>
- <li><a href="qdeclarativeelements.html">QML elements</a></li>
- </ul>
- </li>
- <li><a href="#">Qt Topics</a>
- <ul>
- <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>
- <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>
- <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>
- <li><a href="developing-with-qt.html">Cross-platform and Platform-specific</a></li>
- <li><a href="platform-specific.html">Platform-specific info</a></li>
- <li><a href="technology-apis.html">Qt and Key Technologies</a></li>
- <li><a href="best-practices.html">How-To's and Best Practices</a></li>
- </ul>
- </li>
- <li><a href="#">Examples</a>
- <ul>
- <li><a href="all-examples.html">Examples</a></li>
- <li><a href="tutorials.html">Tutorials</a></li>
- <li><a href="qdeclarativeexamples.html">QML Examples</a></li>
- </ul>
- </li>
- </ul>
- </div>
- </div>
- <div class="wrapper">
- <div class="hd">
- <span></span>
- </div>
- <div class="bd group">
- <div class="sidebar">
- <div class="searchlabel">
- Search index:</div>
- <div class="search" id="sidebarsearch">
- <form id="qtdocsearch" action="" onsubmit="return false;">
- <fieldset>
- <input type="text" name="searchstring" id="pageType" value="" />
- <div id="resultdialog">
- <a href="#" id="resultclose">Close</a>
- <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p>
- <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p>
- <ul id="resultlist" class="all">
- </ul>
- </div>
- </fieldset>
- </form>
- </div>
- <div class="box first bottombar" id="lookup">
- <h2 title="API Lookup"><span></span>
- API Lookup</h2>
- <div id="list001" class="list">
- <ul id="ul001" >
- <li class="defaultLink"><a href="classes.html">Class index</a></li>
- <li class="defaultLink"><a href="functions.html">Function index</a></li>
- <li class="defaultLink"><a href="modules.html">Modules</a></li>
- <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
- <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
- <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
- </ul>
- </div>
- </div>
- <div class="box bottombar" id="topics">
- <h2 title="Qt Topics"><span></span>
- Qt Topics</h2>
- <div id="list002" class="list">
- <ul id="ul002" >
- <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li>
- <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>
- <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li>
- <li class="defaultLink"><a href="developing-with-qt.html">Cross-platform and Platform-specific</a></li>
- <li class="defaultLink"><a href="platform-specific.html">Platform-specific info</a></li>
- <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li>
- <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li>
- </ul>
- </div>
- </div>
- <div class="box" id="examples">
- <h2 title="Examples"><span></span>
- Examples</h2>
- <div id="list003" class="list">
- <ul id="ul003">
- <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
- <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
- <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
- </ul>
- </div>
- </div>
- </div>
- <div class="wrap">
- <div class="toolbar">
- <div class="breadcrumb toolblock">
- <ul>
- <li class="first"><a href="index.html">Home</a></li>
- <!-- Bread crumbs goes here -->
- <li>CSS: SAMPLE PAGES</li> </ul>
- </div>
- <div class="toolbuttons toolblock">
- <ul>
- <li id="smallA" class="t_button">A</li>
- <li id="medA" class="t_button active">A</li>
- <li id="bigA" class="t_button">A</li>
- <li id="print" class="t_button"><a href="javascript:this.print();">
- <span>Print</span></a></li>
- </ul>
- </div>
- </div>
- <div class="content mainContent">
-<div class="toc">
-<h3><a name="toc">Contents</a></h3>
-<ul>
-<li class="level1"><a href="#css-sample-pages">CSS: SAMPLE PAGES</a></li>
-<li class="level2"><a href="#media-queries">Media Queries</a></li>
-<li class="level2"><a href="#selectors">Selectors</a></li>
-<li class="level2"><a href="#visual-effects">Visual Effects</a></li>
-<li class="level2"><a href="#dynamic-css">Dynamic CSS</a></li>
-<li class="level1"><a href="#storage">Storage</a></li>
-</ul>
-</div>
-<h1 class="title">CSS: SAMPLE PAGES</h1>
-<span class="subtitle"></span>
-<!-- $$$examples-description -->
-<div class="descr"> <a name="details"></a>
-<a name="css-sample-pages"></a>
-<h2>CSS: SAMPLE PAGES</h2>
-<a name="media-queries"></a>
-<h3>1. Media Queries</h3>
-<ol type="1">
-<li><a target="test" href="mob_mediaquery.htm">MEDIA-QUERY, BASIC</a>: produces message indicating browser class (desktop/touch/low-end mobile)</li>
-<li><a target="test" href="mob_layout.htm">MEDIA-QUERY, LAYOUT</a>: same, but produces various skeletal layouts using media query criteria; large 3-column layout must appear only on desktop browser</li>
-<li><a target="test" href="mob_condjs.htm">MEDIA-QUERY, STYLEMEDIA</a>: Same as #1, but JS produces corresponding message via StyleMedia API</li>
-</ol>
-<a name="selectors"></a>
-<h3>2. Selectors</h3>
-<ol type="1">
-<li><a target="test" href="layout_link-fmt.htm">SELECTOR, ATTRIBUTE PREFIX/SUFFIX</a>: links appear w/different icons based on URL prefix/suffix; linebreaks should not appear within inline links</li>
-<li><a target="test" href="form_tapper.htm">SELECTOR, FORMS, TAP</a>: radio/checkbox inputs can be tapped (only 1 at a time within 'radio' set; any number within 'checkbox' set)</li>
-<li><a target="test" href="form_toggler.htm">SELECTOR, FORMS, TOGGLE</a>: radio/checkbox inputs can be toggled (only 1 at a time within 'radio' inputs; any number within 'checkbox' inputs); 2 "binary" examples at bottom use custom text</li>
-<li><a target="test" href="layout_tbl-keyhole.htm">SELECTOR, NAVIGATIONAL, TABLE</a>: pressing &quot;view listings&quot; displays stacked table rows, one at a time</li>
-<li><a target="test" href="css3_sel-nth.htm">SELECTOR, POSITIONAL</a>: displays 4x6 icon grid, implemted via nth-of-type()</li>
-</ol>
-<a name="visual-effects"></a>
-<h3>3. Visual Effects</h3>
-<ol type="1">
-<li><a target="test" href="css3_backgrounds.htm">CSS, BACKGROUNDS</a>: selected accordion tabs display both gradient background and icon; unselected only displays icon; uses scaleY transition</li>
-<li><a target="test" href="css3_border-img.htm">CSS, BORDER IMAGE</a>: border image surrounds box</li>
-<li><a target="test" href="css3_shadow.htm">CSS, BOX-SHADOW, PLAIN</a>: nav element has shadow; icons appear smaller while pressed</li>
-<li><a target="test" href="css3_gradientBack.htm">CSS, GRADIENT, BACKGROUND</a>: background fades vertically from light to dark</li>
-<li><a target="test" href="css3_gradientBackStop.htm">CSS, GRADIENT, BACKGROUND, COLOR-STOP</a>: as you scroll down page, background fades vertically from dark to light and back to dark again</li>
-<li><a target="test" href="css3_gradientButton.htm">CSS, GRADIENT, BUTTON</a>: buttons appear with vertical shading, appearing w/inverted gradient when pressed</li>
-<li><a target="test" href="css3_grad-radial.htm">CSS, GRADIENT, RADIAL</a>: touching within box produces colorful *splat* effect for duration of touch</li>
-<li><a target="test" href="css3_mask-grad.htm">CSS, MASK, GRADIENT</a>: images appear w/gradient; touching them removes gradient</li>
-<li><a target="test" href="css3_mask-img.htm">CSS, MASK, IMAGE</a>: image fills screen but fades to black around the edges</li>
-<li><a target="test" href="css3_reflect.htm">CSS, REFLECTION</a>: heading and image both appear w/mirror reflections along bottom</li>
-<li><a target="test" href="css3_scroll.htm">CSS, SCROLLBARS</a>: code block scrollable via big buttons</li>
-<li><a target="test" href="css3_text-overflow.htm">CSS, TEXT-OVERFLOW</a>: items appear w/ellipses; touching them expands them; pressing (X) collapses them</li>
-<li><a target="test" href="css3_text-shadow.htm">CSS, TEXT-SHADOW</a>: heading text appears with shadow</li>
-<li><a target="test" href="css3_text-stroke.htm">CSS, TEXT-STROKE</a>: first heading appears w/black outline</li>
-</ol>
-<a name="dynamic-css"></a>
-<h3>4. Dynamic CSS</h3>
-<ol type="1">
-<li><a target="test" href="anim_demo-rotate.htm">ANIMATION, DEMO, ROTATE</a>: animated demo of rotating boxes</li>
-<li><a target="test" href="anim_demo-scale.htm">ANIMATION, DEMO, SCALE</a>: animated demo of shrinking/expanding box</li>
-<li><a target="test" href="anim_demo-skew.htm">ANIMATION, DEMO, SKEW</a>: animated demo of box being pushed and piulled around</li>
-<li><a target="test" href="anim_pulse.htm">ANIMATION, KEYFRAME, PULSE</a>: pressing icons causes them to pulse indefinitely</li>
-<li><a target="test" href="anim_slide1.htm">ANIMATION, KEYFRAME, SLIDING</a>: drill-down menus</li>
-<li><a target="test" href="css3_multicol.htm">ANIMATION, KEYFRAME, BANNER</a>: banner scrolls through 5 colorful items</li>
-<li><a target="test" href="anim_tabbedSkew.htm">ANIMATION, TRANSFORM, SKEWED TABS</a>: touching parts of cube displays different tabbed text</li>
-<li><a target="test" href="anim_accord.htm">ANIMATION, TRANSITION, CHAINED, ACCORDION</a>: tapping icon animates in collapsed accordions; tapping them animates in display of subheads; tapping anywhere else reverses animation sequence, collapsing back to initial icon</li>
-<li><a target="test" href="anim_panel.htm">ANIMATION, TRANSITION, MAX-WIDTH, PANEL</a>: pressing icon animates to expand panel of choices; pressing anywhere collapses panel back down to initial icon</li>
-<li><a target="test" href="anim_skew.htm">ANIMATION, TRANSITION, SKEW</a>: tapping items causes them to wipe off right edge w/skew effect; remainder re-pack vertically; touching each category icon removes non-matching items and drops down matching ones</li>
-<li><a target="test" href="anim_gallery.htm">ANIMATION, TRANSITION, TRANSLATE, GALLERY</a>: tapping images adjacent to main image animates them in; tapping current image flips to display text; w/text displaying, tapping adjacent image animates both effects @ same time</li>
-</ol>
-
-<a name="storage"></a>
-<h2>5. Storage</h2>
-
-<ol type="1">
-<li><a target="test" href="storage.htm">LOCAL/SESSION STORAGE</a>:
-When opened for first time, form opens featuring
-login/password/credit-card fields. Fill them out. Each input's
-background will go pink if input is invalid. Login & password
-validate simply as "required" so any string will do. Credit card
-validates as 16-digit numeral. After filling out, press dismiss box.
-Then quit & reopen browser, go back to page, and press (i) info icon
-to get back into form. login/password should be same as initially
-entered (localStorage), but credit-card data s/b absent
-(sessionStorage).
-
-</li>
-</ol>
-
-</div>
-<!-- @@@examples -->
- <div class="feedback t_button">
- [+] Documentation Feedback</div>
- </div>
- </div>
- </div>
- <div class="ft">
- <span></span>
- </div>
- </div>
- <div class="footer">
- <p>
- <acronym title="Copyright">&copy;</acronym> 2015 The Qt Company Ltd.
- The Qt Company, Qt and their respective logos are trademarks of The Qt
- Company Ltd in Finland and/or other countries worldwide.</p>
- <p>
- All other trademarks are property of their respective owners. <a title="Privacy Policy"
- href="http://qt.nokia.com/about/privacy-policy">Privacy Policy</a></p>
- <br />
- <p>
- Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.</p>
- <p>
- Alternatively, this document may be used under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU
- Free Documentation License version 1.3</a>
- as published by the Free Software Foundation.</p>
- </div>
- <div id="feedbackBox">
- <div id="feedcloseX" class="feedclose t_button">X</div>
- <form id="feedform" action="http://doc.qt.nokia.com/docFeedbck/feedback.php" method="get">
- <p id="noteHead">Thank you for giving your feedback.</p> <p class="note">Make sure it is related to this specific page. For more general bugs and
- requests, please use the <a href="http://bugreports.qt.io/secure/Dashboard.jspa">Qt Bug Tracker</a>.</p>
- <p><textarea id="feedbox" name="feedText" rows="5" cols="40"></textarea></p>
- <p><input id="feedsubmit" class="feedclose" type="submit" name="feedback" /></p>
- </form>
- </div>
- <div id="blurpage">
- </div>
- <script src="scripts/functions.js" type="text/javascript"></script>
- <!-- <script type="text/javascript">
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', 'UA-4457116-5']);
- _gaq.push(['_trackPageview']);
- (function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
- })();
- </script> -->
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/anim_accord.htm b/examples/webkit/webkit-guide/anim_accord.htm
deleted file mode 100644
index 237457ce73..0000000000
--- a/examples/webkit/webkit-guide/anim_accord.htm
+++ /dev/null
@@ -1,123 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Nested Accordion</title>
-<link href='css/anim_accord.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section class="main">
-<article>
-
-<dl id="accordion" class="collapsed">
-
-<dt><a href="#">Event Info</a></dt>
-<dd>
-<ul>
-<li><a href="#">Travel</a></li>
-<li><a href="#">Area Info</a></li>
-<li><a href="#">Hospitality</a></li>
-<li><a href="#">Schedule of Events</a></li>
-<li><a href="#">Spectator Guide</a></li>
-<li><a href="#">Contact Us</a></li>
-</ul>
-</dd>
-<dt><a href="#">Team Info</a></dt>
-<dd>
-<ul>
-<li><a href="#">Team Captain</a></li>
-<li><a href="#">Team Members</a></li>
-<li><a href="#">Team Standings</a></li>
-</ul>
-</dd>
-<dt><a href="#">Course</a></dt>
-<dd>
-<ul>
-<li><a href="#">Overview</a></li>
-<li><a href="#">Tour</a></li>
-<li><a href="#">History</a></li>
-</ul>
-</dd>
-<dt><a href="#">History</a></dt>
-<dd>
-<ul>
-<li><a href="#">Past Results</a></li>
-<li><a href="#">U.S. Player Records</a></li>
-<li><a href="#">European Player Records</a></li>
-<li><a href="#">All-Time Records</a></li>
-<li><a href="#">The Trophy</a></li>
-</ul>
-</dd>
-<dt><a href="#">News</a></dt>
-<dd>
-<ul>
-<li><a href="#">News Stotries</a></li>
-<li><a href="#">Interviews</a></li>
-<li><a href="#">Photo Gallery</a></li>
-<li><a href="#">Videos</a></li>
-</ul>
-</dd>
-</dl>
-
-<h4>Nested Accordion</h4>
-
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
-urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
-felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
-turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
-venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
-at neque.
-</p>
-
-</article>
-</section>
-<script src="js/anim_accord.js"></script>
-
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/anim_demo-rotate.htm b/examples/webkit/webkit-guide/anim_demo-rotate.htm
deleted file mode 100644
index 48df70b6aa..0000000000
--- a/examples/webkit/webkit-guide/anim_demo-rotate.htm
+++ /dev/null
@@ -1,64 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>transforms: rotate</title>
-
-<link href='css/anim_demo-rotate.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section class="rotate">
-Rotate: from 0 to 180&deg;, then to 360&deg;<br/>(Origin: center)
-</section>
-
-<section class="rotateOrigin">
-Rotate: from 0 to -180&deg;, then to -360&deg;<br/>(Origin: top left)
-</section>
-
-<section class="end">
-(The End)
-</section>
-
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/anim_demo-scale.htm b/examples/webkit/webkit-guide/anim_demo-scale.htm
deleted file mode 100644
index 8d5320a471..0000000000
--- a/examples/webkit/webkit-guide/anim_demo-scale.htm
+++ /dev/null
@@ -1,68 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>transforms: scale</title>
-
-<link href='css/anim_demo-scale.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section class="scale">
-Scale: from 0 to 0.5, to 1.5 and back.<br/>(Origin: bottom)
-</section>
-
-<section class="scaleX">
-ScaleX: from 0 to 0.5, to 1.5 and back.<br/>(Origin: left)
-</section>
-
-<section class="scaleY">
-ScaleY: from 0 to 0.5, to 1.5 and back.<br/>(Origin: center)
-</section>
-
-<section class="end">
-(The End)
-</section>
-
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/anim_demo-skew.htm b/examples/webkit/webkit-guide/anim_demo-skew.htm
deleted file mode 100644
index b167600f09..0000000000
--- a/examples/webkit/webkit-guide/anim_demo-skew.htm
+++ /dev/null
@@ -1,62 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>transforms: skew</title>
-<link href='css/anim_demo-skew.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section class="skew">
-Skew: from 30&deg; to -30&deg; and back.<br/>(Origin: bottom)
-</section>
-
-<section class="skewY">
-SkewY: from 30&deg; to -30&deg; and back.<br/>(Origin: left)
-</section>
-
-<section class="end">
-(The End)
-</section>
-
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/anim_gallery.htm b/examples/webkit/webkit-guide/anim_gallery.htm
deleted file mode 100644
index 4320d6dd16..0000000000
--- a/examples/webkit/webkit-guide/anim_gallery.htm
+++ /dev/null
@@ -1,115 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Image Gallery</title>
-<link href='css/anim_gallery.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section class="gallery"><div>
-<img src="img/gal1.jpg"/>
-<div>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Donec a massa felis, a congue purus. Nullam et
-turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
-venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
-at neque.
-</div>
-</div><div>
-<img src="img/gal2.jpg"/>
-<div>
-Praesent luctus, risus eu vestibulum mollis, arcu mauris mollis ante, id mollis risus lectus ornare nisl.
-Aenean elementum arcu sed nibh faucibus pellentesque.
-Aenean vestibulum egestas metus, eu sodales dolor venenatis quis.
-Vivamus ipsum felis, cursus sed venenatis nec, tempus ac tellus.
-Donec a massa felis, a congue purus. Nullam et turpis diam.
-Aenean augue orci, facilisis et convallis ut, egestas at neque.
-</div>
-</div><div>
-<img src="img/gal3.jpg"/>
-<div>
-Aliquam erat volutpat. Mauris tempor, urna at dignissim pellentesque, velit lacus dictum sem, non porttitor felis nulla nec risus.
-Donec a massa felis, a congue purus. Nullam et turpis diam.
-Donec feugiat gravida viverra.
-Vivamus ipsum felis, cursus sed venenatis nec, tempus ac tellus.
-Aenean augue orci, facilisis et convallis ut, egestas at neque.
-</div>
-</div><div>
-<img src="img/gal4.jpg"/>
-<div>
-Donec feugiat gravida viverra.
-Praesent luctus, risus eu vestibulum mollis, arcu mauris mollis ante, id mollis risus lectus ornare nisl.
-Aliquam erat volutpat. Mauris tempor, urna at dignissim pellentesque, velit lacus dictum sem, non porttitor felis nulla nec risus.
-</div>
-</div><div>
-<img src="img/gal5.jpg"/>
-<div>
-Vivamus ipsum felis, cursus sed venenatis nec, tempus ac tellus.
-Aliquam erat volutpat. Mauris tempor, urna at dignissim pellentesque, velit lacus dictum sem, non porttitor felis nulla nec risus.
-Praesent luctus, risus eu vestibulum mollis, arcu mauris mollis ante, id mollis risus lectus ornare nisl.
-</div>
-</div><div>
-<img src="img/gal6.jpg"/>
-<div>
-Donec feugiat gravida viverra.
-Aenean elementum arcu sed nibh faucibus pellentesque.
-Aenean augue orci, facilisis et convallis ut, egestas at neque.
-</div>
-</div><div>
-<img src="img/gal7.jpg"/>
-<div>
-Praesent luctus, risus eu vestibulum mollis, arcu mauris mollis ante, id mollis risus lectus ornare nisl.
-Aliquam erat volutpat. Mauris tempor, urna at dignissim pellentesque, velit lacus dictum sem, non porttitor felis nulla nec risus.
-</div>
-</div><div>
-<img src="img/gal8.jpg"/>
-<div>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit.
-Aliquam erat volutpat. Mauris tempor, urna at dignissim pellentesque, velit lacus dictum sem, non porttitor felis nulla nec risus.
-Aenean augue orci, facilisis et convallis ut, egestas at neque.
-</div>
-</div></section>
-<script src="js/anim_gallery.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/anim_panel.htm b/examples/webkit/webkit-guide/anim_panel.htm
deleted file mode 100644
index fe2c7e29be..0000000000
--- a/examples/webkit/webkit-guide/anim_panel.htm
+++ /dev/null
@@ -1,64 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Animated Slide-out Panel</title>
-<link href='css/anim_panel.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section onclick="javascript:void(0)">
-<nav id="panel" class="collapsed">
-<img class="button" src="img/ic_c_032.png" onclick="share()"/>
-<img class="option" src="img/ic_ni_032.png" onclick="debug('Ni')"/>
-<img class="option" src="img/ic_fe_032.png" onclick="debug('Fe')"/>
-<img class="option" src="img/ic_he_032.png" onclick="debug('He')"/>
-<img class="option" src="img/ic_o_032.png" onclick="debug('O')"/>
-<img class="option" src="img/ic_na_032.png" onclick="debug('Na')"/>
-<img class="option" src="img/ic_zn_032.png" onclick="debug('Zn')"/>
-<span class="force">&nbsp;</span>
-</nav>
-<div id="dbg">Press the icon, then choose an option if you wish.</div>
-</section>
-<script src="js/anim_panel.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/anim_pulse.htm b/examples/webkit/webkit-guide/anim_pulse.htm
deleted file mode 100644
index 6e354cf229..0000000000
--- a/examples/webkit/webkit-guide/anim_pulse.htm
+++ /dev/null
@@ -1,72 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Animated Pulse</title>
-<link href='css/anim_pulse.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<article>
-<nav>
-<a href="#a" id="a"></a>
-<a href="#b" id="b"></a>
-<a href="#c" id="c"></a>
-<a href="#d" id="d"></a>
-<a href="#e" id="e"></a>
-<a href="#f" id="f"></a>
-<span class="force">&nbsp;</span>
-</nav>
-<h3>Animated Pulse</h3>
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque. Aliquam erat volutpat.
-</p>
-</article>
-</section>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/anim_skew.htm b/examples/webkit/webkit-guide/anim_skew.htm
deleted file mode 100644
index 99a9a9cc65..0000000000
--- a/examples/webkit/webkit-guide/anim_skew.htm
+++ /dev/null
@@ -1,80 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Transitions with Skew Transforms</title>
-<link href="css/anim_skew.css" rel="stylesheet" type="text/css" />
-<style id="custom"></style>
-</head>
-<body>
-<section class="items">
-<div title="cat1">Item #1</div>
-<div title="cat2">Item #2</div>
-<div title="cat1">Item #3</div>
-<div title="cat3">Item #4</div>
-<div title="cat4">Item #5</div>
-<div title="cat1">Item #6</div>
-<div title="cat3">Item #7</div>
-<div title="cat2">Item #8</div>
-<div title="cat4">Item #9</div>
-<div title="cat1">Item #10</div>
-<div title="cat2">Item #11</div>
-<div title="cat3">Item #12</div>
-<div title="cat4">Item #13</div>
-<div title="cat1">Item #14</div>
-<div title="cat2">Item #15</div>
-</section>
-
-<nav>
-<div>&nbsp;</div>
-<div class="cat1">&nbsp;</div>
-<div class="cat2">&nbsp;</div>
-<div class="cat4">&nbsp;</div>
-<div class="cat3">&nbsp;</div>
-</nav>
-
-<script src="js/anim_skew.js"></script>
-<!--
-<script src="js/mobile.js"></script>
--->
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/anim_slide1.htm b/examples/webkit/webkit-guide/anim_slide1.htm
deleted file mode 100644
index e017037b72..0000000000
--- a/examples/webkit/webkit-guide/anim_slide1.htm
+++ /dev/null
@@ -1,62 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Animated Drilldown Sliders</title>
-<link href="css/anim_slide.css" rel="stylesheet" type="text/css" />
-</head>
-<body>
-<a id='out'></a>
-<div id='in' class='panel'>
-<h1>Level 1</h1>
-<ul>
-<li><a href='anim_slide2.htm#in'>Level 2, Option A</a></li>
-<li><a href='anim_slide2.htm#in'>Level 2, Option B</a></li>
-<li><a href='anim_slide2.htm#in'>Level 2, Option C</a></li>
-<li><a href='anim_slide2.htm#in'>Level 2, Option D</a></li>
-<li><a href='anim_slide2.htm#in'>Level 2, Option E</a></li>
-</ul>
-</div>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/anim_slide2.htm b/examples/webkit/webkit-guide/anim_slide2.htm
deleted file mode 100644
index b5275287ca..0000000000
--- a/examples/webkit/webkit-guide/anim_slide2.htm
+++ /dev/null
@@ -1,62 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Animated Drilldown Sliders</title>
-<link href="css/anim_slide.css" rel="stylesheet" type="text/css" />
-</head>
-<body>
-<a id='out'></a>
-<div id='in' class='panel'>
-<h1>Level 2</h1>
-<a class='go_out' href='anim_slide1.htm#out'></a>
-<ul>
-<li><a href='anim_slide3.htm#in'>Level 3, Option A</a></li>
-<li><a href='anim_slide3.htm#in'>Level 3, Option B</a></li>
-<li><a href='anim_slide3.htm#in'>Level 3, Option C</a></li>
-<li><a href='anim_slide3.htm#in'>Level 3, Option D</a></li>
-<li><a href='anim_slide3.htm#in'>Level 3, Option E</a></li>
-</ul>
-</div>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/anim_slide3.htm b/examples/webkit/webkit-guide/anim_slide3.htm
deleted file mode 100644
index 70693dc25e..0000000000
--- a/examples/webkit/webkit-guide/anim_slide3.htm
+++ /dev/null
@@ -1,65 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Animated Drilldown Sliders</title>
-<link href="css/anim_slide.css" rel="stylesheet" type="text/css" />
-</head>
-<body>
-<a id='out'></a>
-<div id='in' class='panel'>
-<h1>Level 3</h1>
-
-<a class='go_out' href='anim_slide2.htm#out'></a>
-
-<article>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque.
-</article>
-
-</div>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/anim_tabbedSkew.htm b/examples/webkit/webkit-guide/anim_tabbedSkew.htm
deleted file mode 100644
index 0bf2eb6a4e..0000000000
--- a/examples/webkit/webkit-guide/anim_tabbedSkew.htm
+++ /dev/null
@@ -1,89 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Transformed Tabs</title>
-<link href='css/anim_tabbedSkew.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<nav>
-<a id="l1" href="#a1">&nbsp;</a>
-<a id="l2" href="#a2">&nbsp;</a>
-<a id="l3" href="#a3">&nbsp;</a>
-</nav>
-<article id="a1">
-<h3>Tab #1</h3>
-<div>&nbsp;</div>
-<p>Praesent luctus, risus eu vestibulum mollis, arcu mauris mollis
-ante, id mollis risus lectus ornare nisl. Lorem ipsum dolor sit amet,
-consectetur adipiscing elit. Donec feugiat gravida viverra. Vivamus
-ipsum felis, cursus sed venenatis nec, tempus ac tellus. Aenean
-elementum arcu sed nibh faucibus pellentesque. </p>
-</article>
-<article id="a2">
-<h3>Tab #2</h3>
-<div>&nbsp;</div>
-
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl.
-
-</article>
-<article id="a3">
-<h3>Tab #3</h3>
-<div>&nbsp;</div>
-
-Donec feugiat gravida viverra. Vivamus ipsum felis, cursus sed
-venenatis nec, tempus ac tellus. Praesent luctus, risus eu vestibulum
-mollis, arcu mauris mollis ante, id mollis risus lectus ornare nisl.
-Nullam et turpis diam. Aenean vestibulum egestas metus, eu sodales
-dolor venenatis quis. Aenean augue orci, facilisis et convallis ut,
-egestas at neque.
-
-</article>
-</section>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/css/anim_accord.css b/examples/webkit/webkit-guide/css/anim_accord.css
deleted file mode 100644
index f65d05d783..0000000000
--- a/examples/webkit/webkit-guide/css/anim_accord.css
+++ /dev/null
@@ -1,246 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-body {
- background : #aaaaaa;
- font-family : sans-serif;
- width : 100;
-}
-
-body > section {
- border-radius : 1em;
- background : #ffffff;
- border-radius : 1em;
- padding : 1em;
- background : #ffffff;
- min-height : 70%;
-}
-
-.hidden {
- display : none;
-}
-
-.active {
- color : blue;
- cursor : pointer;
- text-decoration : none;
-}
-
-.nav > a {
- display : inline-block;
- width : 48px;
- height : 48px;
-}
-
-h1, h2, h3, h4 {
- margin-top : 0.0em;
- font-size : smaller;
- padding-top : 1em;
-}
-
-body > section.main {
- position : absolute;
- left : 1em;
- right : 1em;
- top : 1em;
- min-height : 50%;
- border-radius : 0.5em;
- background : #aaaaaa;
- padding : 0;
-}
-
-section.main > article {
- background : #ffffff;
- padding : 1em;
- margin-bottom : 10em;
- border-radius : 0.5em;
-}
-
-#accordion,
-#accordion > dt,
-#accordion > dd,
-{
- display : block;
-}
-
-#accordion > dt {
- border-top : thin solid #777777;
-}
-
-#accordion > dd {
- border-bottom : thin solid #777777;
-}
-
-#accordion > dd {
- background-image : -webkit-gradient(linear,center top,center bottom,from(#aaaaaa),to(#ffffff));
-}
-
-#accordion.collapsed {
- background-size : auto;
- background-image : url(../img/icon_expand-nav.png);
- background-repeat : no-repeat;
- background-position : 0.25em 0.25em;
-}
-
-#accordion {
- position : absolute;;
- right : 2em;
- top : 0em;
- overflow : hidden;
- background : #ffffff;
- cursor : pointer;
- z-index : 100;
- font-weight : bold;
-}
-
-#accordion.expanded {
- border : thin solid #206ead;
- width : 80%;
- height : 90%;
- -webkit-transition:
- width 0.5s ease-in-out 0.0s,
- height 0.5s ease-in-out 0.5s
- ;
-}
-
-#accordion.collapsed {
- width : 15%;
- height : 9%;
- -webkit-transition:
- height 0.5s ease-in-out 0.0s,
- width 0.5s ease-in-out 0.5s
- ;
-}
-
-#accordion.collapsed > dt,
-#accordion.collapsed > dd {
- -webkit-transform : translate(100%);
- -webkit-transition : -webkit-transform 0.5s ease-in-out 0.5s;
-}
-
-#accordion.expanded > dt,
-#accordion.expanded > dd {
- -webkit-transform : translate(0%);
- -webkit-transition : -webkit-transform 0.5s ease-in-out 0.0s;
-}
-
-#accordion > dt > a {
- margin-left : 0.5em;
-}
-
-#accordion > dt ,
-#accordion > dd {
- padding : 0.5em;
-}
-
-#accordion > dt ~ dd {
- margin : 0;
-}
-
-#accordion > dd > ul,
-#accordion > dd > ul > li
-{
- padding : 0;
- margin : 0;
-}
-
-#accordion a,
-#accordion a:active,
-#accordion a:hover,
-#accordion a:visited
-{
- text-decoration : none;
- color : #000000;
-}
-
-#accordion > dt.expanded:before {
- content : url(../img/icon_head-expanded_x13.png);
-}
-
-#accordion > dt.collapsed:before {
- content : url(../img/icon_head-collapsed_x13.png);
-}
-
-#accordion > dt.expanded {
- background-image : -webkit-gradient(linear, center top, center bottom, from(#aaaaaa), to(#ffffff));
-}
-
-#accordion > dt.collapsed {
- background-image : -webkit-gradient(linear, center top, center bottom, from(#aaaaaa), to(#ffffff));
-}
-
-#accordion > dt + dd {
- background : #ffffff;
- display : block;
-}
-
-#accordion dd {
- overflow : none;
-}
-
-#accordion > dt.collapsed + dd {
- max-height : 0%;
- opacity : 0;
- -webkit-transform : scaleY(0);
- -webkit-transition : all 0.5s ease-in-out;
-}
-
-#accordion > dt.expanded + dd {
- max-height : 50%;
- opacity : 1;
- -webkit-transform : scaleY(1);
- -webkit-transition : all 0.5s ease-in-out;
-}
-
-#accordion > dd {
- margin : 0;
- padding : 0;
-}
-
-#accordion > dd > ul > li {
- padding-top : 0.25em;
- padding-bottom : 0.5em;
- padding-left : 1.0em;
- padding-right : 1.0em;
-}
-
-#accordion> dt.collapsed:last-of-type {
- border-bottom : thin solid #aaaaaa;
-}
-
diff --git a/examples/webkit/webkit-guide/css/anim_demo-rotate.css b/examples/webkit/webkit-guide/css/anim_demo-rotate.css
deleted file mode 100644
index e03c9a86ce..0000000000
--- a/examples/webkit/webkit-guide/css/anim_demo-rotate.css
+++ /dev/null
@@ -1,95 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-body {
- background : #aaaaaa;
- font-weight : bold;
-}
-
-section {
- color : #ffffff;
- background : #777777;
- font-size : x-large;
- -webkit-transform : translate(-150%) scale(1);
- position : absolute;
- text-align : center;
- padding : 1em;
- top : 3em;
- left : 3em;
- bottom : 3em;
- right : 3em;
-}
-
-@-webkit-keyframes demoRotate {
- 0% { -webkit-transform : translate(-150%); }
- 10% { -webkit-transform : rotate(0deg) translate(0); }
- 50% { -webkit-transform : rotate(180deg) translate(0); }
- 90% { -webkit-transform : rotate(360deg) translate(0); }
- 100% { -webkit-transform : translate(150%); }
-}
-
-@-webkit-keyframes demoRotateOrigin {
- 0% { -webkit-transform : rotate(0deg) translate(-150%); }
- 10% { -webkit-transform : rotate(0deg) translate(0); }
- 50% { -webkit-transform : rotate(-180deg) translate(0); }
- 90% { -webkit-transform : rotate(-360deg) translate(0); }
- 100% { -webkit-transform : rotate(-360deg) translate(150%) }
-}
-
-@-webkit-keyframes end {
- 0% { -webkit-transform : translate(150%); }
- 30% { -webkit-transform : translate(0); }
- 70% { -webkit-transform : translate(0); }
- 100% { -webkit-transform : translate(150%); }
-}
-
-.rotate {
- -webkit-animation : demoRotate 9s 2s;
- -webkit-transform-origin : center;
- -webkit-animation-timing-function : linear;
-}
-.rotateOrigin {
- -webkit-animation : demoRotateOrigin 9s 12s;
- -webkit-transform-origin : top left;
- -webkit-animation-timing-function : linear;
-}
-.end {
- -webkit-animation : end 3s 22s;
-}
-
diff --git a/examples/webkit/webkit-guide/css/anim_demo-scale.css b/examples/webkit/webkit-guide/css/anim_demo-scale.css
deleted file mode 100644
index c9b69c4a9c..0000000000
--- a/examples/webkit/webkit-guide/css/anim_demo-scale.css
+++ /dev/null
@@ -1,112 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-weight : bold;
-}
-
-section {
- color : #ffffff;
- background : #777777;
- font-size : x-large;
- -webkit-transform : translate(-150%) scale(1);
- position : absolute;
- text-align : center;
- padding : 1em;
- top : 3em;
- left : 3em;
- bottom : 3em;
- right : 3em;
-}
-
-@-webkit-keyframes demoScale {
- 0% { -webkit-transform : translate(-150%) scale(1); }
- 10% { -webkit-transform : scale(1.0) translate(0); }
- 30% { -webkit-transform : scale(0.5) translate(0); }
- 50% { -webkit-transform : scale(1.0) translate(0); }
- 70% { -webkit-transform : scale(1.5) translate(0); }
- 90% { -webkit-transform : scale(1.0) translate(0); }
- 100% { -webkit-transform : translate(150%) scale(1); }
-}
-
-@-webkit-keyframes demoScaleX {
- 0% { -webkit-transform : translate(-150%) scale(1); }
- 10% { -webkit-transform : scaleX(1.0) translate(0); }
- 30% { -webkit-transform : scaleX(0.5) translate(0); }
- 50% { -webkit-transform : scaleX(1.0) translate(0); }
- 70% { -webkit-transform : scaleX(1.5) translate(0); }
- 90% { -webkit-transform : scaleX(1.0) translate(0); }
- 100% { -webkit-transform : translate(150%) scale(1); }
-}
-
-@-webkit-keyframes demoScaleY {
- 0% { -webkit-transform : translate(-150%) scale(1); }
- 10% { -webkit-transform : scaleY(1.0) translate(0); }
- 30% { -webkit-transform : scaleY(0.5) translate(0); }
- 50% { -webkit-transform : scaleY(1.0) translate(0); }
- 70% { -webkit-transform : scaleY(1.5) translate(0); }
- 90% { -webkit-transform : scaleY(1.0) translate(0); }
- 100% { -webkit-transform : translate(150%) scale(1); }
-}
-
-@-webkit-keyframes end {
- 0% { -webkit-transform : translate(150%); }
- 30% { -webkit-transform : translate(0); }
- 70% { -webkit-transform : translate(0); }
- 100% { -webkit-transform : translate(150%); }
-}
-
-.scale {
- -webkit-animation : demoScale 9s 2s;
- -webkit-transform-origin : bottom;
-}
-.scaleX {
- -webkit-animation : demoScaleX 9s 12s;
- -webkit-transform-origin : left;
-}
-.scaleY {
- -webkit-animation : demoScaleY 9s 22s;
- -webkit-transform-origin : center;
-}
-.end {
- -webkit-animation : end 3s 32s;
-}
-
diff --git a/examples/webkit/webkit-guide/css/anim_demo-skew.css b/examples/webkit/webkit-guide/css/anim_demo-skew.css
deleted file mode 100644
index abb1eaecfb..0000000000
--- a/examples/webkit/webkit-guide/css/anim_demo-skew.css
+++ /dev/null
@@ -1,98 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-weight : bold;
-}
-
-section {
- color : #ffffff;
- background : #777777;
- font-size : x-large;
- -webkit-transform : translate(-150%) scale(1);
- position : absolute;
- text-align : center;
- padding : 1em;
- top : 3em;
- left : 3em;
- bottom : 3em;
- right : 3em;
-}
-
-@-webkit-keyframes demoSkew {
- 0% { -webkit-transform : translate(-150%); }
- 10% { -webkit-transform : skew(0deg) translate(0); }
- 30% { -webkit-transform : skew(30deg) translate(0); }
- 50% { -webkit-transform : skew(0deg) translate(0); }
- 70% { -webkit-transform : skew(-30deg) translate(0); }
- 90% { -webkit-transform : skew(0deg) translate(0); }
- 100% { -webkit-transform : translate(150%); }
-}
-
-@-webkit-keyframes demoSkewY {
- 0% { -webkit-transform : translate(-150%); }
- 10% { -webkit-transform : skewY(0deg) translate(0); }
- 30% { -webkit-transform : skewY(30deg) translate(0); }
- 50% { -webkit-transform : skewY(0deg) translate(0); }
- 70% { -webkit-transform : skewY(-30deg) translate(0); }
- 90% { -webkit-transform : skewY(0deg) translate(0); }
- 100% { -webkit-transform : translate(150%); }
-}
-
-@-webkit-keyframes end {
- 0% { -webkit-transform : translate(150%); }
- 30% { -webkit-transform : translate(0); }
- 70% { -webkit-transform : translate(0); }
- 100% { -webkit-transform : translate(150%); }
-}
-
-.skew {
- -webkit-animation : demoSkew 9s 2s;
- -webkit-transform-origin : bottom;
-}
-.skewY {
- -webkit-animation : demoSkewY 9s 12s;
- -webkit-transform-origin : left;
-}
-.end {
- -webkit-animation : end 3s 22s;
-}
-
diff --git a/examples/webkit/webkit-guide/css/anim_gallery.css b/examples/webkit/webkit-guide/css/anim_gallery.css
deleted file mode 100644
index 2e87de2b3c..0000000000
--- a/examples/webkit/webkit-guide/css/anim_gallery.css
+++ /dev/null
@@ -1,110 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-body {
- font-family : sans-serif;
- background : #444444;
-}
-.gallery > div > div {
- border-radius : 1.0em;
- padding : 1em;
- background : #dddddd;
- min-height : 75%;
-}
-.gallery > div {
- -webkit-transition : all 0.5s ease-in-out;
- z-index : 0;
- position : absolute;
- top : 2.0em;
- bottom : 2.0em;
- left : 2.0em;
- right : 2.0em;
-}
-.gallery > div.selected {
- -webkit-transform : translate(0) scale(1);
- opacity : 1.0;
- z-index : 1;
-}
-.gallery > div.queueR {
- -webkit-transform : translate(70%) scale(0.5);
- opacity : 0.75;
-}
-.gallery > div.queueL {
- -webkit-transform : translate(-70%) scale(0.5);
- opacity : 0.75;
-}
-.gallery > div.hideR {
- -webkit-transform : translate(200%) scale(0.5);
- opacity : 0.0;
-}
-.gallery > div.hideL {
- -webkit-transform : translate(-200%) scale(0.5);
- opacity : 0.0;
-}
-.gallery img {
- max-width : 100%;
- max-height : 100%;
- border-radius : 1.0em;
-}
-
-.gallery > #reveal > div, .gallery > div > img {
- -webkit-transform : scaleX(1) scaleY(1);
- -webkit-transition : -webkit-transform 0.25s ease-out 0.25s;
-}
-.gallery > div > div, .gallery > #reveal > img {
- -webkit-transform : scaleX(0) scaleY(1);
- -webkit-transition : -webkit-transform 0.25s ease-out;
-}
-
-section > div {
- text-align : center;
-}
-
-section > div > img {
- display : inline-block;
-}
-
-section > div > div {
- position : absolute;
- top : 0;
- left : 1.5em;
- right : 1.5em;
-}
-
diff --git a/examples/webkit/webkit-guide/css/anim_panel.css b/examples/webkit/webkit-guide/css/anim_panel.css
deleted file mode 100644
index 4c4282ba54..0000000000
--- a/examples/webkit/webkit-guide/css/anim_panel.css
+++ /dev/null
@@ -1,116 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
-}
-
-section {
- background : #aaaaaa;
- position : absolute;
- left : 1em;
- right : 1em;
- top : 1em;
- bottom : 1em;
-}
-
-.force {
- padding-right : 5in;
-}
-
-#panel {
- text-align : justify;
- padding : 0.5em;
- border-radius : 0.5em;
- background : #ffffff;
- max-height : 2.0em;
- float : right;
- overflow : hidden;
-}
-
-nav.expanded {
- max-width : 95%;
- -webkit-transition : max-width 0.5s ease-in-out;
-}
-
-nav.collapsed {
- max-width : 12%;
- -webkit-transition : max-width 0.5s ease-in-out;
-
-}
-
-nav.expanded > .button {
- display : none;
-}
-
-nav.collapsed > .button {
- display : inline-block;
-}
-
-nav.expanded > .option {
- opacity : 1;
- -webkit-transform : scale(1);
- -webkit-transition : all 0.5s linear;
-}
-nav.collapsed > .option {
- opacity : 0;
- -webkit-transform : scale(0);
- -webkit-transition : all 0.5s linear;
-}
-
-#dbg {
- padding : 1em;
- border-radius : 1em;
- position : absolute;
- top : 75%;
- bottom : 1em;
- left : 1em;
- right : 1em;
- background : #ffffff;
-}
-
-.measure {
- position : absolute;
- top : 0;
- left : 0;
- width : 320px;
- background : green;
-}
diff --git a/examples/webkit/webkit-guide/css/anim_pulse.css b/examples/webkit/webkit-guide/css/anim_pulse.css
deleted file mode 100644
index 0cd2eae5b9..0000000000
--- a/examples/webkit/webkit-guide/css/anim_pulse.css
+++ /dev/null
@@ -1,100 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
-}
-
-h1,h2,h3,h4 {
- text-align : center;
-}
-
-section {
- position : absolute;
- top : 0;
- left : 0;
- right : 0;
- bottom : 0;
-}
-
-article {
- background : #ffffff;
- border-radius : 1.0em;
- padding : 1.0em;
- margin : 1em;
- min-height : 50%;
-}
-
-.force {
- padding-left : 100%
-}
-
-nav {
- text-align : justify;
-}
-
-nav > a {
- background-size : contain;
- background-repeat : no-repeat;
-}
-
-nav > a {
- display : inline-block;
- width : 2em;
- height : 2em;
-}
-
-nav > a:nth-of-type(1) { background-image : url(../img/ic_fe_032.png); }
-nav > a:nth-of-type(2) { background-image : url(../img/ic_ni_032.png); }
-nav > a:nth-of-type(3) { background-image : url(../img/ic_he_032.png); }
-nav > a:nth-of-type(4) { background-image : url(../img/ic_na_032.png); }
-nav > a:nth-of-type(5) { background-image : url(../img/ic_zn_032.png); }
-nav > a:nth-of-type(6) { background-image : url(../img/ic_o_032.png); }
-
-h1,h2,h3 { margin-top : 0; }
-
-nav > a:target { -webkit-animation : pulse 1s infinite; }
-
-@-webkit-keyframes pulse {
- 0% { opacity : 1.0 }
- 50% { opacity : 0.7 }
-}
-
diff --git a/examples/webkit/webkit-guide/css/anim_skew.css b/examples/webkit/webkit-guide/css/anim_skew.css
deleted file mode 100644
index 99d48a2a89..0000000000
--- a/examples/webkit/webkit-guide/css/anim_skew.css
+++ /dev/null
@@ -1,186 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- padding : 1em;
- font-family : "Helvetica";
- font-weight : bold;
-}
-
-span {
- background : #ffffff;
- font-weight : bold;
- cursor : pointer;
-}
-
-.items > div {
- cursor : pointer;
- background : #ffffff;
- height : 2em;
- padding : 0.5em 0.5em 0.0em 0.5em;
- border-radius : 0.25em;
- position : absolute;
- left : 1em;
- right : 1em;
- -webkit-transition-property : -webkit-transform, top;
- -webkit-transition-duration : 0.5s, 0.5s;
- -webkit-transition-delay : 0s, 0.5s;
- -webkit-transition-timing-function : ease-in-out;
-}
-
-.hide {
- -webkit-transform-origin : bottom left;
- -webkit-transform : skew(40deg) translate(140%,0em);
-}
-
-.items > div:after {
- content : url(../img/icon_dismiss_x22.png);
- float : right;
-}
-
-.row1 {
- top : 3.5em;
-}
-.row2 {
- top : 6.5em;
-}
-.row3 {
- top : 9.5em;
-}
-.row4 {
- top : 12.5em;
-}
-.row5 {
- top : 15.5em;
-}
-.row6 {
- top : 18.5em;
-}
-.row7 {
- top : 21.5em;
-}
-.row8 {
- top : 24.5em;
-}
-.row9 {
- top : 27.5em;
-}
-.row10 {
- top : 30.5em;
-}
-.row11 {
- top : 33.5em;
-}
-.row12 {
- top : 36.5em;
-}
-.row13 {
- top : 39.5em;
-}
-.row14 {
- top : 42.5em;
-}
-.row15 {
- top : 45.5em;
-}
-
-.items > div {
- padding-left : 3.0em;
- color : #444444;
- background-size : contain;
- background-repeat : no-repeat;
-}
-
-.items > div[title='cat1'] {
- background-image : url(../img/ic_fe_036.png);
-}
-
-.items > div[title='cat2'] {
- background-image : url(../img/ic_na_036.png);
-}
-
-.items > div[title='cat3'] {
- background-image : url(../img/ic_ni_036.png);
-}
-
-.items > div[title='cat4'] {
- background-image : url(../img/ic_mg_036.png);
-}
-
-nav {
- position : absolute;
- background : #aaaaaa;
- top : 0;
- left : 0;
- right : 0;
- z-index : 10;
- height : 2em;
- text-align : center;
- padding : 0.5em;
-}
-
-nav > div {
- background-size : contain;
- background-repeat : no-repeat;
- display : inline-block;
- width : 36px;
- height : 36px;
- margin-left : 0.25em;
- margin-right : 0.25em;
- background-image : -webkit-gradient(linear,center top,center bottom,from(#ffffff),to(#eeeeee));
-}
-
-nav > div {
- background-image : url(../img/icon_list-all.png);
-}
-nav > .cat1 {
- background-image : url(../img/ic_fe_036.png);
-}
-nav > .cat2 {
- background-image : url(../img/ic_na_036.png);
-}
-nav > .cat3 {
- background-image : url(../img/ic_ni_036.png);
-}
-nav > .cat4 {
- background-image : url(../img/ic_mg_036.png);
-}
-
diff --git a/examples/webkit/webkit-guide/css/anim_slide.css b/examples/webkit/webkit-guide/css/anim_slide.css
deleted file mode 100644
index cd715efaf3..0000000000
--- a/examples/webkit/webkit-guide/css/anim_slide.css
+++ /dev/null
@@ -1,148 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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 layout */
-body {
- background : #aaaaaa;
- font-family : sans-serif;
- font-weight : bold;
-}
-
-h1 {
- min-height : 1.5em;
- background : #ffffff;
- margin-left : 1em;
- margin-right : 1em;
- text-align : center;
- font-size : 18px;
- padding-top : 0.25em;
- padding-bottom : 0.25em;
- border-radius : 0.5em;
-}
-
-.panel {
- position : absolute;
- top : 0em;
- bottom : 0em;
- left : 0em;
- right : 0em;
-}
-
-article {
- background : #ffffff;
- padding : 1em;
- border-radius : 1em;
- margin : 1em;
-}
-
-.panel > ul {
- padding : 0em;
- list-style-type : none;
-}
-.panel > ul > li {
- background : #fff;
- margin : 0.5em 1.0em 0.5em 1.0em;
- padding : 0.5em;
- display : block;
- border-radius : 0.5em;
-}
-.panel > ul > li > a {
- width : 100%;
- display : block;
- text-decoration : none;
- text-align : justify;
- color : #000000;
-}
-.panel > a {
- background : #fff;
- margin : 0 1.0em 1.0em 0em;
- padding : 0.5em;
-}
-/* navigational hints */
-
-a.go_out {
- background : transparent;
- position : absolute;
- top : 0.5em;
- left : 1.2em;
- content : url(../img/icon_drill-up_x32.png);
- padding : 0.25em;
- border-radius : 1em;
- display : block;
-}
-
-.panel > ul > li > a:after {
- text-align : right;
- float : right;
- font-size : 1em;
- font-weight : bold;
-}
-.panel > ul > li > a:after {
- -webkit-transform : translate(0, -0.5em);
- content : url(../img/icon_drill-down_x32.png);
-}
-
-/* animations */
-#in:target {
- -webkit-animation : slide_in 0.25s;
-}
-#out:target + .panel {
- -webkit-animation : slide_out 0.25s;
-}
-@-webkit-keyframes slide_in {
- from {
- left : 80%;
- right : -80%;
- }
- to {
- left : 0em;
- right : 0em;
- }
-}
-@-webkit-keyframes slide_out {
- from {
- left : -80%;
- right : 80%;
- }
- to {
- left : 0em;
- right : 0em;
- }
-}
diff --git a/examples/webkit/webkit-guide/css/anim_tabbedSkew.css b/examples/webkit/webkit-guide/css/anim_tabbedSkew.css
deleted file mode 100644
index 16bbd7983e..0000000000
--- a/examples/webkit/webkit-guide/css/anim_tabbedSkew.css
+++ /dev/null
@@ -1,113 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
-}
-
-section {
- background : #ffffff;
- position : absolute;
- left : 1em;
- right : 1em;
- top : 1em;
- min-height : 60%;
- padding : 1.0em;
- border-radius : 0.5em;
-}
-
-nav {
- text-align : right;
- width : 3.5em;
- height : 4em;
- float : right;
-}
-
-nav > a {
- border-radius : 0.25em;
- width : 1em;
- height : 1em;
- text-align : center;
- font-weight : bold;
- font-size : 2em;
- text-decoration : none;
- color : black;
- position : relative;
- background-size : contain;
- display : block;
-}
-
-nav > a:nth-of-type(1) {
- margin-bottom : 0.1em;
- background-image : url(../img/ic_he_032.png);
- -webkit-transform : skew(-30deg);
-}
-
-nav > a:nth-of-type(2) {
- background-image : url(../img/ic_o_032.png);
- -webkit-transform : skew(30deg);
-}
-
-nav > a:nth-of-type(3) {
- background-image : url(../img/ic_na_032.png);
- -webkit-transform : rotate(-60deg) skew(-30deg) translate(1.7em, -1px);
-}
-
-article {
- display : none;
- margin-bottom : 4em;
-}
-
-article:target {
- display : block;
-}
-
-h3 + div {
- display : inline-block;
- float : right;
- width : 12px;
- height : 3em;
-}
-
-h1,h2,h3,h4 {
- margin-top : 0.5em;
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_backgrounds.css b/examples/webkit/webkit-guide/css/css3_backgrounds.css
deleted file mode 100644
index a466603046..0000000000
--- a/examples/webkit/webkit-guide/css/css3_backgrounds.css
+++ /dev/null
@@ -1,105 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-body {
- font-family : sans-serif;
- background : #aaaaaa;
-}
-
-h1,h2,h3,h4 {
- background : #ffffff;
- text-align : center;
- margin : 0.5em;
- padding : 0.5em;
- border-radius : 0.5em;
-}
-
-.accordion {
- margin : 0.5em 0.5em 6em 0.5em;
- border-radius : 0.5em;
- border : thin solid #aaa;
- background : #ffffff;
- overflow : hidden;
- padding : 1.0em 0.5em 1.0em 0.5em;
-
-}
-
-.accordion > dt {
- cursor : pointer;
- border-top : thin solid #aaa;
- border-radius : 0.5em;
- padding : 0.5em 0.5em 0.5em 2.5em;
- font-weight : bold;
- background-size : auto;
- background-image : url(../img/icon_head-collapsed_x13.png);
- background-repeat : no-repeat;
- background-position : 12px 12px;
-}
-
-.accordion > dt:first-of-type {
- border-top : none;
-}
-
-.accordion > dt.selected {
- background-image : url(../img/icon_head-expanded_x13.png) , url(../img/gradient.jpg);
- background-repeat : no-repeat , repeat-x;
- background-position : 12px 12px , 0 0;
- margin-bottom : 0em;
-}
-
-dt + dd {
- max-height : 0%;
- margin : 0;
- opacity : 0;
- padding : 0.5em;
- overflow-y : hidden;
- max-height : 0;
- -webkit-transform : scaleY(0);
- -webkit-transition : all 0.5s linear;
-}
-
-dt.selected + dd {
- -webkit-transform : scaleY(1);
- -webkit-transform-origin : center;
- max-height : 1000px;
- -webkit-transition : all 0.5s linear;
- opacity : 1;
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_border-img.css b/examples/webkit/webkit-guide/css/css3_border-img.css
deleted file mode 100644
index 878741f255..0000000000
--- a/examples/webkit/webkit-guide/css/css3_border-img.css
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
-}
-
-h1,h2,h3,h4 {
- text-align : center;
-}
-
-section {
- position : absolute;
- top : 0;
- left : 0;
- right : 0;
- bottom : 0;
-}
-
-article {
- background : #ffffff;
- border-radius : 1.0em;
- padding : 1.0em;
- margin : 1em;
- min-height : 50%;
-}
-
-.fruit {
- padding : 2.5em;
- -webkit-border-image : url(../img/border-frame.png) 2 stretch stretch;
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_grad-radial.css b/examples/webkit/webkit-guide/css/css3_grad-radial.css
deleted file mode 100644
index 1b2ecaf1d9..0000000000
--- a/examples/webkit/webkit-guide/css/css3_grad-radial.css
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
- font-weight : bold;
-}
-
-h1,h2,h3,h4 {
- text-align : center;
-}
-
-section {
- position : absolute;
- top : 0;
- left : 0;
- right : 0;
- bottom : 0;
-}
-
-article {
- background : #ffffff;
- border-radius : 1.0em;
- padding : 1.0em;
- margin : 1em;
- min-height : 70%;
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_gradientBack.css b/examples/webkit/webkit-guide/css/css3_gradientBack.css
deleted file mode 100644
index 63c7843926..0000000000
--- a/examples/webkit/webkit-guide/css/css3_gradientBack.css
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-body {
- font-family : sans-serif;
-}
-
-section {
- position : absolute;
- top : 0.0em;
- left : 0.0em;
- right : 0.0em;
- background : #aaaaaa;
- background : -webkit-gradient(linear, center top, center bottom, from(#dddddd), to(#777777) );
- padding : 1em;
-}
-
-article {
- background : #ffffff;
- padding : 1em;
- border-radius : 0.5em;
- border : thin #aaaaaa solid;
- margin-bottom : 12em;
-}
-
-h1, h2, h3, h4 {
- text-align : center;
- margin-top : 0.5em;
-}
-
-.hidden {
- display : none;
-}
-
-.active {
- color : blue;
- cursor : pointer;
- text-decoration : none;
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_gradientBackStop.css b/examples/webkit/webkit-guide/css/css3_gradientBackStop.css
deleted file mode 100644
index c3c89af542..0000000000
--- a/examples/webkit/webkit-guide/css/css3_gradientBackStop.css
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-body {
- font-family : sans-serif;
-}
-
-section {
- position : absolute;
- top : 0.0em;
- left : 0.0em;
- right : 0.0em;
- background : #aaaaaa;
- background : -webkit-gradient(linear, center top, center bottom, from(#777777), color-stop(50%,#dddddd), to(#777777) );
- padding : 1em;
-}
-
-article {
- background : #ffffff;
- padding : 1em;
- border-radius : 0.5em;
- border : thin #aaaaaa solid;
- margin-bottom : 12em;
-}
-
-h1, h2, h3, h4 {
- text-align : center;
- margin-top : 0.5em;
-}
-
-.hidden {
- display : none;
-}
-
-.active {
- color : blue;
- cursor : pointer;
- text-decoration : none;
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_gradientButton.css b/examples/webkit/webkit-guide/css/css3_gradientButton.css
deleted file mode 100644
index 05f3395114..0000000000
--- a/examples/webkit/webkit-guide/css/css3_gradientButton.css
+++ /dev/null
@@ -1,88 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-body {
- background : #ffffff;
-}
-
-article {
- background : #ffffff;
- position : absolute;
- margin : 0;
- left : 0;
- right : 0;
- top : 0;
- bottom : 0;
-}
-
-ul {
- font-weight : bold;
- padding : 0;
- list-style : none;
- margin : 0.5em 0.5em 6em 0.5em;
-}
-
-ul > li {
- margin-bottom : 0.5em;
-}
-
-ul > li > a {
- padding : 0.5em;
- display : block;
- text-decoration : none;
- color : #000000;
- border : thin #aaaaaa solid;
- border-radius : 0.5em;
- background : #dddddd;
- background : -webkit-gradient(linear, center top, center bottom,
- from(#cccccc), to(#ffffff) );
-}
-
-ul > li > a:active {
- color : #ffffff;
- background : #ffffff;
- background : -webkit-gradient(linear, center top, center bottom,
- from(#dddddd), to(#444444) );
-}
-
-h1,h2,h3,h4 {
- text-align : center;
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_mask-grad.css b/examples/webkit/webkit-guide/css/css3_mask-grad.css
deleted file mode 100644
index f77d7f1164..0000000000
--- a/examples/webkit/webkit-guide/css/css3_mask-grad.css
+++ /dev/null
@@ -1,60 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-body {
- font-family : sans-serif;
- background : #ffffff;
-}
-
-h1,h2,h3,h4 {
- text-align : center;
-}
-
-img {
- -webkit-mask-box-image : -webkit-gradient(linear, left top, left bottom, from(rgba(0,0,0,1)), to(rgba(0,0,0,0)));
- border-radius : 0.25em;
- margin : 0.1em;
-}
-
-img.select {
- -webkit-mask-box-image : none;
- -webkit-box-shadow : 0.2em 0.2em 0.4em #aaaaaa;
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_mask-img.css b/examples/webkit/webkit-guide/css/css3_mask-img.css
deleted file mode 100644
index 58e97fa4ef..0000000000
--- a/examples/webkit/webkit-guide/css/css3_mask-img.css
+++ /dev/null
@@ -1,58 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-body {
- font-family : sans-serif;
- background : #333333;
-}
-
-h1,h2,h3,h4 {
- text-align : center;
-}
-
-img {
- position : absolute;
- left : 5%;
- top : 5%;
- height : 90%;
- width : 90%;
- -webkit-mask-box-image : url(../img/mask.png) 5% stretch;
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_multicol.css b/examples/webkit/webkit-guide/css/css3_multicol.css
deleted file mode 100644
index 75cfc8d639..0000000000
--- a/examples/webkit/webkit-guide/css/css3_multicol.css
+++ /dev/null
@@ -1,110 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-body {
- font-family : sans-serif;
- background : #aaaaaa;
-}
-
-section {
- bottom : 0;
- left : 0;
- top : 12%;
- right : 0;
- position : absolute;
- padding-bottom : 6em;
-}
-
-article {
- border-radius : 1em;
- margin : 1em;
- padding : 1em;
- background : #ffffff;
-}
-
-h1,h2,h3,h4 {
- text-align : center;
- margin-top : 0.0em;
-}
-
-nav.ad {
- width : 500%;
- border : thin #aaaaaa solid;
- background : #dddddd;
- position : absolute;
- top : 0%;
- height : 10%;
- column-count : 5;
- column-width : 100%;
- -webkit-animation : banner_scroll 30s infinite;
-}
-
-nav.ad > a {
- width : 20%;
- height : 100%;
- display : inline-block;
- text-align : center;
- padding-top : 0.5em;
- text-decoration : none;
- font-weight : bold;
- color : #000000;
- font-size : larger;
-}
-
-nav.ad > a:nth-of-type(5n-0) { background : lightgreen; }
-nav.ad > a:nth-of-type(5n-1) { background : pink; }
-nav.ad > a:nth-of-type(5n-2) { background : plum; }
-nav.ad > a:nth-of-type(5n-3) { background : lightblue; }
-nav.ad > a:nth-of-type(5n-4) { background : lightcoral; }
-
-@-webkit-keyframes banner_scroll {
- 0% { left : 0%; }
- 18% { left : 0%; }
- 20% { left : -100%; }
- 38% { left : -100%; }
- 40% { left : -200%; }
- 58% { left : -200%; }
- 60% { left : -300%; }
- 78% { left : -300%; }
- 80% { left : -400%; }
- 95% { left : -400%; }
- 100% { left : 0%; }
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_reflect.css b/examples/webkit/webkit-guide/css/css3_reflect.css
deleted file mode 100644
index 2847c0712b..0000000000
--- a/examples/webkit/webkit-guide/css/css3_reflect.css
+++ /dev/null
@@ -1,127 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
-}
-
-body > section {
- border-radius : 1em;
- padding : 1em;
- background : #ffffff;
- margin-bottom : 10em;
- min-height : 70%;
-}
-
-.hidden {
- display : none;
-}
-
-.active {
- color : blue;
- cursor : pointer;
- text-decoration : none;
-}
-
-.nav > a {
- display : inline-block;
- width : 48px;
- height : 48px;
-}
-
-body > section.main {
- position : absolute;
- left : 0em;
- right : 0em;
- top : 0em;
- min-height : 50%;
- border-radius : 0.5em;
- background : #aaaaaa;
- padding : 0;
-}
-
-section.main > article {
- background : #ffffff;
- padding : 1em;
- margin : 1em 1em 10em 1em;
- border-radius : 0.5em;
-}
-
-h1, h2, h3 {
- color : #206ead;
- margin-top : 0em;
- text-align : center;
- margin-bottom : 1em;
- -webkit-box-reflect : below -0.25em -webkit-gradient(linear, center top, center bottom, from(transparent), color-stop(0.25, transparent), to(black));
-}
-
-.nav1 { background-image : url(../img/ic_he_032.png) }
-.nav2 { background-image : url(../img/ic_o_032.png) }
-.nav3 { background-image : url(../img/ic_ni_032.png) }
-.nav4 { background-image : url(../img/ic_fe_032.png) }
-.nav5 { background-image : url(../img/ic_na_032.png) }
-.nav6 { background-image : url(../img/ic_zn_032.png) }
-
-h1 { font-size : 1.5em; }
-h2 { font-size : 1.2em; }
-h3 { font-size : 1.0em; }
-
-figure {
- display : block;
- text-align : center;
-}
-
-figure > img {
- width : 70%;
- margin-bottom : 3em;
- -webkit-box-reflect : below 0.25em -webkit-gradient(linear, center top, center bottom, from(transparent), color-stop(0.50, transparent), to(black));
-}
-
-p:first-line {
- font-weight : bold;
-}
-
-p:first-letter {
- font-size : 200%;
- float : left;
- padding-right : 0.1em;
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_scroll.css b/examples/webkit/webkit-guide/css/css3_scroll.css
deleted file mode 100644
index af4b177d89..0000000000
--- a/examples/webkit/webkit-guide/css/css3_scroll.css
+++ /dev/null
@@ -1,93 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-body {
- background-color : #aaaaaa;
- font-family : sans-serif;
-}
-
-h1,h2,h3,h4 {
- margin-top : 0.5em;
- font-size : 18px;
- text-align : center;
-}
-
-article {
- background : #ffffff;
- border-radius : 1.0em;
- padding : 1.0em;
- margin : 1.0em 0.5em 6.0em 0.5em;
- min-height : 50%;
-}
-
-pre {
- font-weight : bold;
- font-family : monospace;
- padding : 1.0em 3em 1.0em 1.0em;
- border : thin solid #aaaaaa;
- border-radius : 1.5em;
- overflow-x : auto;
- background-image : -webkit-gradient(linear,left center,right center,from(#ffffff),to(#777777));
-}
-
-pre::-webkit-scrollbar {
- height : 3em;
-}
-
-pre::-webkit-scrollbar-button:increment {
- background-image : url(../img/icon_scroll-right.png);
-x background-size : contain;
- background-repeat : no-repeat;
- width : 3em;
- height : 3em;
-}
-
-pre::-webkit-scrollbar-button:decrement {
- background-image : url(../img/icon_scroll-left.png);
- background-size : contain;
- background-repeat : no-repeat;
- width : 3em;
- height : 3em;
-}
-
-pre::-webkit-scrollbar-track {
- display : none;
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_sel-nth.css b/examples/webkit/webkit-guide/css/css3_sel-nth.css
deleted file mode 100644
index dd4ff26901..0000000000
--- a/examples/webkit/webkit-guide/css/css3_sel-nth.css
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-img {
- position : absolute;
- width : 48px;
- height : 48px;
- padding : 0.25em;
- border : #ffffff medium solid;
- border-radius : 0.5em;
-}
-
-/* columns */
-img:nth-of-type(4n-3) { left : 2% }
-img:nth-of-type(4n-2) { left : 27% }
-img:nth-of-type(4n-1) { left : 52% }
-img:nth-of-type(4n-0) { left : 77% }
-
-/* rows */
-img:nth-of-type(n) { top : 5% }
-img:nth-of-type(n+5) { top : 20% }
-img:nth-of-type(n+9) { top : 35% }
-img:nth-of-type(n+13) { top : 50% }
-img:nth-of-type(n+17) { top : 65% }
-img:nth-of-type(n+21) { top : 80% }
-
diff --git a/examples/webkit/webkit-guide/css/css3_shadow.css b/examples/webkit/webkit-guide/css/css3_shadow.css
deleted file mode 100644
index 3086ace680..0000000000
--- a/examples/webkit/webkit-guide/css/css3_shadow.css
+++ /dev/null
@@ -1,145 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
-}
-
-body > section {
- border-radius : 1em;
- padding : 1em;
- background : #ffffff;
- margin-bottom : 10em;
- min-height : 70%;
-}
-
-.hidden {
- display : none;
-}
-
-.active {
- color : blue;
- cursor : pointer;
- text-decoration : none;
-}
-
-.nav > a {
- display : inline-block;
- width : 48px;
- height : 48px;
-}
-
-nav > a:active {
- -webkit-transform : scale(0.8);
-}
-
-h1, h2 {
- margin-top : 0em;
- font-size : 18px;
- text-align : center;
-}
-
-h2 {
- border-top : solid thin #aaaaaa;
-}
-
-body > section.main {
- position : absolute;
- left : 0em;
- right : 0em;
- top : 5em;
- min-height : 50%;
- border-radius : 0.5em;
- background : #aaaaaa;
- padding : 0;
-}
-
-section.main > article {
- background : #ffffff;
- padding : 1em;
- margin : 1em 1em 10em 1em;
- border-radius : 0.5em;
-}
-
-section.nav {
- z-index : 10;
- border-radius : 0;
- background : #aaaaaa;
- background : transparent;
- position : absolute;;
- padding : 1em;
- top : 0;
- right : 0.0em;
- left : 0.0em;
-}
-
-nav {
- padding : 0.5em;
- border-radius : 0.5em;
- background : #ffffff;
- top : 10px;
- text-align : justify;
- height : 36px;
- overflow : hidden;
-}
-
-nav > a {
- display : inline-block;
- background-repeat : no-repeat;
- height : 36px;
- width : 36px;
-}
-
-#force_justify {
- padding-left : 100%;
-}
-
-.nav1 { background-image : url(../img/ic_he_032.png) }
-.nav2 { background-image : url(../img/ic_o_032.png) }
-.nav3 { background-image : url(../img/ic_ni_032.png) }
-.nav4 { background-image : url(../img/ic_fe_032.png) }
-.nav5 { background-image : url(../img/ic_na_032.png) }
-.nav6 { background-image : url(../img/ic_zn_032.png) }
-
-nav {
- -webkit-box-shadow : 0.5em 0.5em #777777;
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_shadowBlur.css b/examples/webkit/webkit-guide/css/css3_shadowBlur.css
deleted file mode 100644
index e65fcd5692..0000000000
--- a/examples/webkit/webkit-guide/css/css3_shadowBlur.css
+++ /dev/null
@@ -1,145 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
-}
-
-body > section {
- border-radius : 1em;
- padding : 1em;
- background : #ffffff;
- margin-bottom : 10em;
- min-height : 70%;
-}
-
-.hidden {
- display : none;
-}
-
-.active {
- color : blue;
- cursor : pointer;
- text-decoration : none;
-}
-
-.nav > a {
- display : inline-block;
- width : 48px;
- height : 48px;
-}
-
-h1, h2 {
- margin-top : 0em;
- font-size : 18px;
- text-align : center;
-}
-
-h2 {
- border-top : solid thin #aaaaaa;
-}
-
-body > section.main {
- position : absolute;
- left : 0em;
- right : 0em;
- top : 5em;
- min-height : 50%;
- border-radius : 0.5em;
- background : #aaaaaa;
- padding : 0;
-}
-
-section.main > article {
- background : #ffffff;
- padding : 1em;
- margin : 1em 1em 10em 1em;
- border-radius : 0.5em;
-}
-
-section.nav {
- z-index : 10;
- border-radius : 0;
- background : #aaaaaa;
- background : transparent;
- position : absolute;;
- padding : 1em;
- top : 0;
- right : 0.0em;
- left : 0.0em;
-}
-
-nav {
- padding : 0.5em;
- border-radius : 0.5em;
- background : #ffffff;
- top : 10px;
- text-align : justify;
- height : 36px;
- overflow : hidden;
-}
-
-nav > a {
- display : inline-block;
- background-repeat : no-repeat;
- height : 36px;
- width : 36px;
-}
-
-nav > a:active {
- -webkit-transform : scale(0.8);
-}
-
-#force_justify {
- padding-left : 100%;
-}
-
-.nav1 { background-image : url(../img/ic_he_032.png) }
-.nav2 { background-image : url(../img/ic_o_032.png) }
-.nav3 { background-image : url(../img/ic_ni_032.png) }
-.nav4 { background-image : url(../img/ic_fe_032.png) }
-.nav5 { background-image : url(../img/ic_na_032.png) }
-.nav6 { background-image : url(../img/ic_zn_032.png) }
-
-nav {
- -webkit-box-shadow : 0.5em 0.5em 0.5em #444444;
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_text-overflow.css b/examples/webkit/webkit-guide/css/css3_text-overflow.css
deleted file mode 100644
index 3330a78d20..0000000000
--- a/examples/webkit/webkit-guide/css/css3_text-overflow.css
+++ /dev/null
@@ -1,119 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
- font-weight : bold;
-}
-
-h1,h2,h3,h4 {
- text-align : center;
-}
-
-section {
- position : absolute;
- top : 0;
- left : 0;
- right : 0;
- bottom : 0;
-}
-
-article {
- background : #ffffff;
- border-radius : 1.0em;
- padding : 1.0em;
- margin : 1em;
- min-height : 50%;
-}
-
-.accordion {
- border : #777777 solid thin;
- padding : 0.0em;
- border-radius : 0.5em;
- list-style : none;
-}
-
-.accordion > li {
- padding : 0.5em;
- border-bottom : #777777 solid thin;
- white-space : nowrap;
- max-height : 1.5em;
- overflow : hidden;
- text-overflow : clip;
- text-overflow : ellipsis;
- text-overflow : ellipsis-word;
- -webkit-transition : max-height 1s ease-in-out;
-}
-
-.accordion > li:last-of-type {
- border-bottom : none;
-}
-
-.accordion > li.selected {
- -webkit-transition : max-height 1s ease-in-out;
- max-height : 100em;
- white-space : normal;
- font-weight : normal;
-}
-
-.accordion > li.selected:first-line {
- font-weight : bold;
-}
-
-.accordion > li.selected:first-letter {
- font-size : 200%;
- float : left;
- padding-right : 0.1em;
-}
-
-.dismiss {
- content : url(../img/icon_dismiss.png);
-}
-
-.accordion > li > .dismiss {
- display : none;
-}
-
-.accordion > li.selected > .dismiss {
- display : block;
- float : right;
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_text-shadow.css b/examples/webkit/webkit-guide/css/css3_text-shadow.css
deleted file mode 100644
index 31e58e8587..0000000000
--- a/examples/webkit/webkit-guide/css/css3_text-shadow.css
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
-}
-
-h1,h2,h3,h4 {
- text-align : center;
- text-shadow : 0.20em 0.20em 0.20em #999;
- color : #206ead;
-}
-
-section {
- position : absolute;
- top : 0;
- left : 0;
- right : 0;
- bottom : 0;
-}
-
-article {
- background : #ffffff;
- border-radius : 1.0em;
- padding : 1.0em;
- margin : 1em;
- min-height : 50%;
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_text-stroke.css b/examples/webkit/webkit-guide/css/css3_text-stroke.css
deleted file mode 100644
index 996ce09db1..0000000000
--- a/examples/webkit/webkit-guide/css/css3_text-stroke.css
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
-}
-
-h1,h2,h3,h4 {
- margin-top : 0.5em;
- text-align : center;
-}
-
-h1 {
- -webkit-text-stroke : 2px #000000;
- font-size : 40px;
-}
-
-h1, h2, h3 {
- color : #206ead;
-}
-
-section {
- position : absolute;
- top : 0;
- left : 0;
- right : 0;
- bottom : 0;
-}
-
-article {
- background : #ffffff;
- border-radius : 1.0em;
- padding : 1.0em;
- margin : 1em;
- min-height : 50%;
-}
-
diff --git a/examples/webkit/webkit-guide/css/form_tapper.css b/examples/webkit/webkit-guide/css/form_tapper.css
deleted file mode 100644
index 7b86ec443d..0000000000
--- a/examples/webkit/webkit-guide/css/form_tapper.css
+++ /dev/null
@@ -1,108 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-/* MOBILE UI */
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
-}
-
-body > section {
- border-radius : 1em;
- padding : 1em;
- background : #ffffff;
- margin : 1em 1em 10em 1em;
- min-height : 70%
-}
-
-h1, h2 {
- margin-top : 1em;
- font-size : smaller;
- text-align : center;
- padding-top : 1em;
-}
-
-h2 {
- border-top : solid thin #dddddd;
-}
-
-/* FORM */
-
-form {
- font-weight : bold;
- font-size : small;
-}
-
-input[type=radio],
-input[type=checkbox] {
- -webkit-appearance : button;
- float : right;
- margin-bottom : -2em;
- opacity : 0;
-}
-
-label,
-input[type=radio],
-input[type=checkbox] {
- width : 90%;
- display : block;
- padding : 0.5em;
- height : 2em;
-}
-
-label {
- padding-top : 0.5em;
- border : medium solid #aaaaaa;
- border-radius : 1.0em;
-}
-
-input[type=radio]:checked + label,
-input[type=checkbox]:checked + label {
- border : medium solid green;
-}
-
-input[type=radio]:checked + label:after,
-input[type=checkbox]:checked + label:after {
- float : right;
- padding-right : 0.5em;
- content : url(../img/icon_check_x24green.png);
-}
-
diff --git a/examples/webkit/webkit-guide/css/form_toggler.css b/examples/webkit/webkit-guide/css/form_toggler.css
deleted file mode 100644
index fc5d888a4d..0000000000
--- a/examples/webkit/webkit-guide/css/form_toggler.css
+++ /dev/null
@@ -1,200 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-/* MOBILE UI */
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
-}
-
-body > section {
- border-radius : 1em;
- padding : 1em;
- background : #ffffff;
- margin : 1em 1em 10em 1em;
- min-height : 70%
-}
-
-h1, h2 {
- margin-top : 1em;
- font-size : smaller;
- text-align : center;
- padding-top : 1em;
-}
-
-h2 {
- border-top : solid thin #dddddd;
-}
-
- /* FORM */
-
-form
-{
- line-height : 250%;
- font-weight : bold;
- font-size : small;
-}
-
- /* DEFAULT INPUT */
-
-input[type=radio],
-input[type=checkbox]
-{
- text-align : right;
- padding-top : 0.1em;
- text-transform : uppercase;
- float : right;
- -webkit-appearance : button;
- border : 0.25em #aaaaaa solid;
- background : #aaaaaa;
- background : -webkit-gradient(linear,center top,center bottom,from(#999999),to(#ffffff));
- border-radius : 0.5em;
- min-width : 6em;
- height : 2em;
- display : inline-block;
-}
-
- /* CHECKED INPUT */
-
-input[type=radio]:checked,
-input[type=checkbox]:checked
-{
- text-align : left;
-}
-
- /* FLIPPED INPUT */
-
-input.invert
-{
- text-align : left;
-}
-
-input.invert:checked
-{
- text-align : right;
-}
-
- /* DEFAULT TEXT */
-
-input[type=radio]:before,
-input[type=checkbox]:before
-{
- color : #888888;
- height : 1.4em;
- display : inline-block;
- background : pink;
- background : -webkit-gradient(linear,center top,center bottom,from(pink),to(#ffffff));
- min-width : 50%;
- content : "off";
- text-align : center;
- font-weight : bold;
- padding-left : 0.5em;
- padding-right : 0.5em;
- border-radius : 0.25em;
-}
-
- /* CHECKED TEXT */
-
-input[type=radio]:checked:before,
-input[type=checkbox]:checked:before
-{
- color : #ffffff;
- content : "on";
- background : #00aa00;
- background : -webkit-gradient(linear,center top,center bottom,from(green),to(cyan));
-}
-
- /* ALTERNATE DISPLAY */
-
-input.yn:before
-{
- content : "no";
-}
-
-input.yn:checked:before
-{
- content : "yes";
-}
-
-input.tf:before
-{
- content : "false";
-}
-
-input.tf:checked:before
-{
- content : "true";
-}
-
- /* BINARY */
-
-input.binary {
- display : inline-block;
-}
-
-input.binary:checked {
- display : none;
-}
-
-input.binary:before {
- background : #00aa00;
- background : -webkit-gradient(linear,center top,center bottom,from(green),to(cyan));
- color : #ffffff;
-}
-
-input.binary:nth-of-type(odd) {
- text-align : left;
-}
-
-input.binary:nth-of-type(even) {
- text-align : right;
-}
-
- /* CUSTOM */
-
-input.ampm:nth-of-type(odd):before { content : "am"; }
-input.ampm:nth-of-type(even):before { content : "pm"; }
-
-input.sex:nth-of-type(odd):before { content : "male"; }
-input.sex:nth-of-type(even):before { content : "female"; }
-
-input.sex { width : 8em }
-
diff --git a/examples/webkit/webkit-guide/css/layout_link-fmt.css b/examples/webkit/webkit-guide/css/layout_link-fmt.css
deleted file mode 100644
index 918b694dca..0000000000
--- a/examples/webkit/webkit-guide/css/layout_link-fmt.css
+++ /dev/null
@@ -1,137 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
- font-weight : bold;
-}
-
-p {
- font-weight : normal;
-}
-
-a {
- text-wrap : suppress;
- -webkit-text-wrap : suppress;
-}
-
-article {
- background : #ffffff;
- position : absolute;
- top : 1em;
- left : 1em;
- right : 1em;
- padding : 1em;
- border-radius : 1em;
- margin-bottom : 2em;
-}
-
-ol {
- padding-left : 1em;
-}
-
-ol.links {
- margin-bottom : 1em;
- border : #aaaaaa thin solid;
- list-style : none;
- padding-top : 0.5em;
- padding-bottom : 0.5em;
- padding-left : 0em;
- border-radius : 1.0em;
-}
-
-ol.links > li {
- min-height : 2em;
- border-bottom : #aaaaaa thin solid;
- padding-left : 0.5em;
- padding-right : 0.5em;
- padding-top : 0.5em;
-}
-
-ol.links > li:last-of-type {
- border : none;
-}
-
-p a[href]:after {
- -webkit-transform : scale(0.6);
- -webkit-transform-origin : bottom;
- padding-left : 0.25em;
- padding-right : 0.0em;
- display : inline-block;
-}
-
-a[href] {
- text-decoration : none;
-}
-
-ol.links > li > a {
- display : block;
-}
-
-ol.links a:after {
- -webkit-transform : scale(0.8);
- -webkit-transform-origin : top;
-}
-
-a[href^="http://"]:after, a[href^="https://"]:after {
- content : url(../img/icon_link-external.png);
-}
-
-a[href^="mailto:"]:after { content : url(../img/icon_link-email.png); }
-
-a[href^="sms:"]:after { content : url(../img/icon_link-sms.png); }
-
-a[href^="tel:"]:after { content : url(../img/icon_link-tel.png); }
-
-a[href$=".doc"]:after { content : url(../img/icon_link-doc.png); }
-
-a[href$=".ppt"]:after { content : url(../img/icon_link-ppt.png); }
-
-a[href$=".rss"]:after,
-a[href$=".xml"]:after { content : url(../img/icon_link-rss.png); }
-
-a[href$=".pdf"]:after { content : url(../img/icon_link-pdf.png); }
-
-a[href$=".xls"]:after { content : url(../img/icon_link-xls.png); }
-
-ol.links a:after {
- float : right;
-}
diff --git a/examples/webkit/webkit-guide/css/layout_tbl-keyhole.css b/examples/webkit/webkit-guide/css/layout_tbl-keyhole.css
deleted file mode 100644
index 66b9f03a49..0000000000
--- a/examples/webkit/webkit-guide/css/layout_tbl-keyhole.css
+++ /dev/null
@@ -1,147 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
-}
-
-.mobile {
- display : block;
-}
-
-.mobile > thead > th,
-.mobile > thead > tr {
- display : none;
-}
-
-.mobile > tbody > tr {
- display : none;
- background : #ffffff;
- padding : 0.5em;
- padding-top : 0.5em;
- border-radius : 0.25em;
-}
-
-.mobile > tbody > tr:target {
- display : block;
- border : medium solid #aaaaaa;
-}
-
-.mobile > tbody > tr:nth-of-type(1) {
- padding-top : 0.5em;
-}
-
-.mobile td {
- display : block;
-}
-
-.mobile td:before {
- font-style : italic;
- font-weight : bold;
-}
-
-.mobile td:nth-of-type(5n+1) {
- font-weight : bold;
- color : #206ead;
-}
-
-.mobile td:nth-of-type(5n+2):before {
- content : 'Price: ';
-}
-.mobile td:nth-of-type(5n+3):before {
- content : 'Location: ';
-}
-.mobile td:nth-of-type(5n+4):before {
- content : 'Posted: ';
-}
-
-table th.nav {
- display : none;
-}
-
-.mobile tbody th.nav {
- display : block;
- width : 36px;
- float : right;
-}
-
-th.nav a {
- display : inline-block;
- width : 36px;
- height : 36px;
- background : #ffffff;
- content : url(../img/icon_nav-up.png);
- margin-bottom : 0.5em;
-}
-
-th.nav a:nth-of-type(even) {
- -webkit-transform : rotate(180deg);
-}
-
-tr:first-of-type th.nav a:nth-of-type(odd),
-tr:last-of-type th.nav a:nth-of-type(even)
-{
- content : url(../img/icon_dismiss.png);
-}
-
-tr th.nav a {
- display : none;
-}
-
-tr:first-of-type th.nav a,
-tr:last-of-type th.nav a,
-tr:target th.nav a {
- display : block;
-}
-
-article {
- background : #ffffff;
- border-radius : 0.5em;
- margin : 0.5em;
- padding : 0.5em;
-}
-
-h1 {
- margin-top : 0.5em;
- text-align : center;
- font-size : 18px;
-}
-
diff --git a/examples/webkit/webkit-guide/css/mob_condjs.css b/examples/webkit/webkit-guide/css/mob_condjs.css
deleted file mode 100644
index 401daa90bb..0000000000
--- a/examples/webkit/webkit-guide/css/mob_condjs.css
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-#js {
- background : pink;
- padding : 0.5em;
- border-radius : 0.5em;
-}
-#js, #design {
- padding : 0.5em;
- border-radius : 0.5em;
-}
-#js {
- background : pink;
-}
-#design {
- background : lightgreen;
-}
diff --git a/examples/webkit/webkit-guide/css/mob_mediaquery.css b/examples/webkit/webkit-guide/css/mob_mediaquery.css
deleted file mode 100644
index 7979f30578..0000000000
--- a/examples/webkit/webkit-guide/css/mob_mediaquery.css
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-#design {
- padding : 0.5em;
- border-radius : 0.5em;
- background : lightgreen;
-}
-
-#design {
- background : lightgreen;
-}
diff --git a/examples/webkit/webkit-guide/css/mobile.css b/examples/webkit/webkit-guide/css/mobile.css
deleted file mode 100644
index dd162f9633..0000000000
--- a/examples/webkit/webkit-guide/css/mobile.css
+++ /dev/null
@@ -1,82 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
- width : 100;
-}
-
-body > section {
- border-radius : 1em;
- background : #ffffff;
- border-radius : 1em;
- padding : 1em;
- background : #ffffff;
- min-height : 70%
-}
-
-.hidden {
- display : none;
-}
-
-.active {
- color : blue;
- cursor : pointer;
- text-decoration : none;
-}
-
-.nav > a {
- display : inline-block;
- width : 48px;
- height : 48px;
-}
-
-h1, h2 {
- margin-top : 1em;
- font-size : smaller;
- text-align : center;
- padding-top : 1em;
-}
-
-h2 {
- border-top : solid thin #dddddd;
-}
-
diff --git a/examples/webkit/webkit-guide/css/mq_desktop.css b/examples/webkit/webkit-guide/css/mq_desktop.css
deleted file mode 100644
index 4438d74ccb..0000000000
--- a/examples/webkit/webkit-guide/css/mq_desktop.css
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
- font-weight : bold;
-}
-
-h1,h2,h3,h4 {
- text-align : center;
-}
-
-section {
- position : absolute;
- top : 0;
- left : 0;
- right : 0;
- bottom : 0;
-}
-
-article {
- background : #ffffff;
- border-radius : 1.0em;
- padding : 1.0em;
- margin : 1em;
- min-height : 50%;
-}
-
-#design:before {
- content : "CSS thinks you are viewing this page with a full desktop browser."
-}
-
diff --git a/examples/webkit/webkit-guide/css/mq_mobile.css b/examples/webkit/webkit-guide/css/mq_mobile.css
deleted file mode 100644
index 91a6872b43..0000000000
--- a/examples/webkit/webkit-guide/css/mq_mobile.css
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
- font-weight : bold;
-}
-
-h1,h2,h3,h4 {
- text-align : center;
-}
-
-section {
- position : absolute;
- top : 0;
- left : 0;
- right : 0;
- bottom : 0;
-}
-
-article {
- background : #ffffff;
- border-radius : 1.0em;
- padding : 1.0em;
- margin : 1em;
- min-height : 50%;
-}
-
-#design:before {
- content : "CSS thinks you are viewing this page with a non-touch mobile browser."
-}
diff --git a/examples/webkit/webkit-guide/css/mq_touch.css b/examples/webkit/webkit-guide/css/mq_touch.css
deleted file mode 100644
index 3dec1f67b6..0000000000
--- a/examples/webkit/webkit-guide/css/mq_touch.css
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
- font-weight : bold;
-}
-
-h1,h2,h3,h4 {
- text-align : center;
-}
-
-section {
- position : absolute;
- top : 0;
- left : 0;
- right : 0;
- bottom : 0;
-}
-
-article {
- background : #ffffff;
- border-radius : 1.0em;
- padding : 1.0em;
- margin : 1em;
- min-height : 50%;
-}
-
-#design:before {
- content : "CSS thinks you are viewing this page with a touch-based mobile browser."
-}
diff --git a/examples/webkit/webkit-guide/css/mqlayout_desktop.css b/examples/webkit/webkit-guide/css/mqlayout_desktop.css
deleted file mode 100644
index aff0d7f350..0000000000
--- a/examples/webkit/webkit-guide/css/mqlayout_desktop.css
+++ /dev/null
@@ -1,92 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-/* Desktop UI */
-
-body {
- font-family : sans-serif;
- font-weight : bold;
- min-width : 60em;
-}
-
-nav, body > section, header, footer {
- border-radius : 0.5em;
- padding : 0.5em;
-}
-
-nav, section {
- min-height : 30em;
-}
-
-header {
- background-color : pink;
- height : 3em;
- margin-bottom : 1em;
-}
-
-section#main {
- background-color : lightgreen;
- float : left;
- margin-bottom : 1em;
- margin-left : 2%;
- min-width : 60%;
-}
-
-nav {
- background-color : lightblue;
- float : left;
- margin-bottom : 1em;
- width : 15%;
-}
-
-section#sidebar {
- background-color : plum;
- float : left;
- margin-bottom : 1em;
- margin-left : 2%;
- width : 15%;
-}
-
-footer {
- background-color : gold;
- clear : both;
- height : 3em;
-}
-
diff --git a/examples/webkit/webkit-guide/css/mqlayout_mobile.css b/examples/webkit/webkit-guide/css/mqlayout_mobile.css
deleted file mode 100644
index db49f8050d..0000000000
--- a/examples/webkit/webkit-guide/css/mqlayout_mobile.css
+++ /dev/null
@@ -1,82 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-/* Mobile UI */
-
-body {
- font-family : sans-serif;
- font-weight : bold;
-}
-
-nav, body > section, header, footer {
- padding : 0.5em;
-}
-
-header {
- display : none;
-}
-
-section#main {
- background-color : lightgreen;
- margin-bottom : 1em;
-}
-
-nav:after {
- float : right;
- content : '[ICON]';
-}
-
-nav:before {
- content : 'SIMPLE ';
-}
-
-nav {
- background-color : lightblue;
- margin-bottom : 1em;
-}
-
-section#sidebar {
- display : none;
-}
-
-footer {
- background-color : gold;
-}
-
diff --git a/examples/webkit/webkit-guide/css/mqlayout_touch.css b/examples/webkit/webkit-guide/css/mqlayout_touch.css
deleted file mode 100644
index c98e40c1ad..0000000000
--- a/examples/webkit/webkit-guide/css/mqlayout_touch.css
+++ /dev/null
@@ -1,86 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-/* Touch UI */
-
-body {
- font-family : sans-serif;
- font-weight : bold;
-}
-
-nav, body > section, header, footer {
- border-radius : 0.5em;
- padding : 0.5em;
-}
-
-header {
- background-color : pink;
- margin-bottom : 1em;
- float : left;
- width : 30%;
- height : 3em;
-}
-
-section#main {
- background-color : lightgreen;
- margin-bottom : 1em;
- min-height : 20em;
-}
-
-nav:before {
- content : 'TOUCH ';
-}
-
-nav {
- background-color : lightblue;
- margin-bottom : 1em;
- margin-left : 40%;
- max-width : 60%;
- height : 3em;
-}
-
-section#sidebar {
- display : none;
-}
-
-footer {
- background-color : gold;
-}
-
diff --git a/examples/webkit/webkit-guide/css/storage.css b/examples/webkit/webkit-guide/css/storage.css
deleted file mode 100644
index 5984512043..0000000000
--- a/examples/webkit/webkit-guide/css/storage.css
+++ /dev/null
@@ -1,156 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-body {
- background-color : #aaaaaa;
- font-family : sans-serif;
- padding: 1em;
-}
-
-body.off > h1 {
- background-color : pink;
- background-image : url(../img/offline.png), -webkit-gradient(linear,center top,center bottom,from(#ffffff),to(#ffffff))
-;
-}
-
-body.on > h1 {
- background-color : lightgreen;
- background-image : url(../img/online.png), -webkit-gradient(linear,center top,center bottom,from(#ffffff),to(#ffffff))
-;
-}
-
-body.unknown > h1 {
- background-image : url(../img/offline_idle.png), -webkit-gradient(linear,center top,center bottom,from(#ffffff),to(#ffffff));
-}
-
-
-h1 {
- background-color : #ffffff;
- background-repeat : no-repeat;
- background-position : 0.5em center, 0 0;
- height : 1.25em;
- border-radius : 0.5em;
- margin : 0.0em;
- padding : 0.5em;
- text-align : center;
- font-size : 18px;
-}
-
-form.show {
- display : block;
- z-index : 99;
-}
-
-form.hide {
- display : none;
-}
-
-#cred {
- background : #ffffff;
- padding : 1em;
- border-radius : 1.0em;
- position : absolute;
- left : 1.0em;;
- right : 1.0em;;
- top : 1.0em;;
- bottom : 1.0em;;
-}
-
-#cred > input, #email > input {
- height : 2.0em;
- width : 95%;
- border-radius : 0.5em;
- padding-left : 0.5em;
-}
-
-#cred > img {
- float : right;
-}
-
-#cred > div:first-of-type {
- margin-top : 2em;
-}
-
-#cred > div, #email > div {
- font-weight : bold;
- margin : 0.5em;
-}
-
-#cred > input[type='submit'] {
- background : lightgreen;
- font-weight : bold;
-}
-
-#cred > input[type='submit']:active {
- background : #777777;
- color : #ffffff;
-}
-
-#cred > input.validate:invalid {
- background : pink;
-}
-
-#cred > input.validate:invalid:after {
- content : "need!";
-}
-
-#cred > input {
- background : #ffffff;
- -webkit-transition : all 1s linear;
-}
-
-#openform {
- float : right;
-}
-
-#email {
- background : #ffffff;
- min-height : 6em;
- margin-top : 1em;
- border-radius : 0.5em;
- padding : 0.5em;
-}
-
-textarea {
- min-height : 10em;
- width : 95%;
- border-radius : 0.5em;
-}
-
diff --git a/examples/webkit/webkit-guide/css3_backgrounds.htm b/examples/webkit/webkit-guide/css3_backgrounds.htm
deleted file mode 100644
index 3d85c68af8..0000000000
--- a/examples/webkit/webkit-guide/css3_backgrounds.htm
+++ /dev/null
@@ -1,87 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Accordion Tabs</title>
-<link href='css/css3_backgrounds.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<h3>Accordion Tabs</h3>
-<dl class="accordion">
-<dt>Option 1</dt>
-<dd>
-Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
-eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
-minim veniam, quis nostrud exercitation ullamco laboris nisi ut
-aliquip ex ea commodo consequat.
-</dd>
-<dt>Option 2</dt>
-<dd>
-Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
-nisi ut aliquip ex ea commodo consequat. Lorem ipsum dolor sit amet,
-consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
-labore et dolore magna aliqua.
-Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
-eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
-minim veniam, quis nostrud exercitation ullamco laboris nisi ut
-aliquip ex ea commodo consequat.
-</dd>
-<dt>Option 3</dt>
-<dd>
-Lorem ipsum dolor sit amet, quis nostrud exercitation ullamco laboris
-nisi ut aliquip ex ea commodo consequat.
-</dd>
-<dt>Option 4</dt>
-<dd>
-Lorem ipsum dolor sit amet, sed do eiusmod tempor incididunt ut labore
-et dolore magna aliqua. Ut enim ad minim veniam, consectetur
-adipisicing elit, quis nostrud exercitation ullamco laboris nisi ut
-aliquip ex ea commodo consequat. Consectetur adipisicing elit, ut
-enim ad minim veniam, sed do eiusmod tempor incididunt ut labore et
-dolore magna aliqua.
-</dd>
-</dl>
-<script src="js/css3_backgrounds.js"></script>
-<script src="js/mobile.js"></script>
-</body>
-</html>
-
diff --git a/examples/webkit/webkit-guide/css3_border-img.htm b/examples/webkit/webkit-guide/css3_border-img.htm
deleted file mode 100644
index 64ab267790..0000000000
--- a/examples/webkit/webkit-guide/css3_border-img.htm
+++ /dev/null
@@ -1,78 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>border-image</title>
-<link href='css/css3_border-img.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<article>
-<h3>border-image</h3>
-
-<p>
-Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante.
-</p>
-
-<div class="fruit">
-
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus.
-
-</div>
-
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque.
-</p>
-
-</article>
-</section>
-<script src="js/css3_border-img.js"></script>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/css3_grad-radial.htm b/examples/webkit/webkit-guide/css3_grad-radial.htm
deleted file mode 100644
index ff6fdfefb7..0000000000
--- a/examples/webkit/webkit-guide/css3_grad-radial.htm
+++ /dev/null
@@ -1,62 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Radial Gradient</title>
-<link href='css/css3_grad-radial.css' type='text/css' rel='stylesheet'/>
-<style id="localStyles"></style>
-</head>
-<body>
-<section>
-<article id="main">
-<h3>Radial Gradient</h3>
-
-Touch within the main content area.
-
-</article>
-</section>
-<script src="js/css3_grad-radial.js">
-</script>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/css3_gradientBack.htm b/examples/webkit/webkit-guide/css3_gradientBack.htm
deleted file mode 100644
index c7166ec780..0000000000
--- a/examples/webkit/webkit-guide/css3_gradientBack.htm
+++ /dev/null
@@ -1,79 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Background Gradient</title>
-<link href='css/css3_gradientBack.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<article>
-<h4>Background Gradient</h4>
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
-urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
-felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
-turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
-venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
-at neque.
-</p>
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
-urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
-felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
-turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
-venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
-at neque.
-</p>
-</article>
-</section>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/css3_gradientBackStop.htm b/examples/webkit/webkit-guide/css3_gradientBackStop.htm
deleted file mode 100644
index ece3cdf757..0000000000
--- a/examples/webkit/webkit-guide/css3_gradientBackStop.htm
+++ /dev/null
@@ -1,93 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Background Gradient + stop-color</title>
-<link href='css/css3_gradientBackStop.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<article>
-<h4>Background Gradient<br/>with stop-color</h4>
-
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
-urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
-felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
-turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
-venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
-at neque.
-</p>
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
-urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
-felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
-turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
-venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
-at neque.
-</p><p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
-urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
-felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
-turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
-venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
-at neque.
-</p>
-
-</article>
-</section>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/css3_gradientButton.htm b/examples/webkit/webkit-guide/css3_gradientButton.htm
deleted file mode 100644
index 39e5ff907c..0000000000
--- a/examples/webkit/webkit-guide/css3_gradientButton.htm
+++ /dev/null
@@ -1,67 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Beveled Buttons</title>
-<link href='css/css3_gradientButton.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<article>
-<h3>Beveled Buttons</h3>
-<ul>
-<li><a href="#">Option 1</a></li>
-<li><a href="#">Option 2</a></li>
-<li><a href="#">Option 3</a></li>
-<li><a href="#">Option 4</a></li>
-<li><a href="#">Option 5</a></li>
-<li><a href="#">Option 6</a></li>
-<li><a href="#">Option 7</a></li>
-<li><a href="#">Option 8</a></li>
-<li><a href="#">Option 9</a></li>
-</ul>
-<p>&nbsp;</p>
-
-</article>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/css3_mask-grad.htm b/examples/webkit/webkit-guide/css3_mask-grad.htm
deleted file mode 100644
index 4a5b7779b1..0000000000
--- a/examples/webkit/webkit-guide/css3_mask-grad.htm
+++ /dev/null
@@ -1,67 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Webkit Masks</title>
-<link href='css/css3_mask-grad.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<article>
-<h3>Webkit Masks</h3>
-
-<img src="img/tnail_gal1.png"/>
-<img src="img/tnail_gal2.png"/>
-<img src="img/tnail_gal3.png"/>
-<img src="img/tnail_gal4.png"/>
-<img src="img/tnail_gal5.png"/>
-<img src="img/tnail_gal6.png"/>
-<img src="img/tnail_gal7.png"/>
-<img src="img/tnail_gal8.png"/>
-
-</article>
-</section>
-<script src="js/css3_mask-grad.js"></script>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/css3_mask-img.htm b/examples/webkit/webkit-guide/css3_mask-img.htm
deleted file mode 100644
index dd48b7b1fe..0000000000
--- a/examples/webkit/webkit-guide/css3_mask-img.htm
+++ /dev/null
@@ -1,57 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Webkit Masks</title>
-<link href='css/css3_mask-img.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<article>
-<img src="img/gal3.jpg" width="240" height="360"/>
-</article>
-</section>
-<script src="js/css3_mask-img.js"></script>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/css3_multicol.htm b/examples/webkit/webkit-guide/css3_multicol.htm
deleted file mode 100644
index 56bf22d3d1..0000000000
--- a/examples/webkit/webkit-guide/css3_multicol.htm
+++ /dev/null
@@ -1,92 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Animated Banners</title>
-<link href='css/css3_multicol.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<article>
-<h3>Animated Banners</h3>
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
-urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
-felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
-turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
-venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
-at neque.
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
-urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
-felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
-turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
-venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
-at neque.
-
-</article>
-<br/>
-<br/>
-<br/>
-<br/>
-<br/>
-<br/>
-<br/>
-<br/>
-</section>
-
-<nav class="ad">
-<a href="#">Item #1</a><a href="#">Item #2</a><a href="#">Item #3</a><a href="#">Item #4</a><a href="#">Item #5</a>
-</nav>
-
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/css3_reflect.htm b/examples/webkit/webkit-guide/css3_reflect.htm
deleted file mode 100644
index 39b5f77d32..0000000000
--- a/examples/webkit/webkit-guide/css3_reflect.htm
+++ /dev/null
@@ -1,101 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Webkit Reflections</title>
-<link href='css/css3_reflect.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section class="main">
-<article>
-<h1>Webkit Reflections</h1>
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque.
-</p>
-
-<figure>
-<img src="img/land5.jpg">
-</figure>
-
-<p>Aliquam erat volutpat. Mauris tempor, urna at dignissim
-pellentesque, velit lacus dictum sem, non porttitor felis nulla nec
-risus. Donec a massa felis, a congue purus. Nullam et turpis
-diam. Aenean vestibulum egestas metus, eu sodales dolor venenatis
-quis. Aenean augue orci, facilisis et convallis ut, egestas at neque.
-</p>
-
-<h2>Webkit Reflections</h2>
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
-urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
-felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
-turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
-venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
-at neque.
-</p>
-<h3>Webkit Reflections</h3>
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
-urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
-felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
-turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
-venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
-at neque.
-</p>
-</article>
-</section>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/css3_scroll.htm b/examples/webkit/webkit-guide/css3_scroll.htm
deleted file mode 100644
index c56707e853..0000000000
--- a/examples/webkit/webkit-guide/css3_scroll.htm
+++ /dev/null
@@ -1,95 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Custom Scrollbars</title>
-<link href='css/css3_scroll.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<article>
-<h3>Custom Scrollbars</h3>
-
-<p>
-Unlike standard text, linebreaks cannot appear arbitrarily within
-blocks of code. Wide lines may be difficult to read within a
-narrow-screen mobile interface:
-</p>
-
-<pre>
-window.onload = function() {
- var aside = document.querySelector('#related');
- document.querySelector('#main').addEventListener('mouseup', function(event){
- var thresholdDec = 0.5;
- var totalHeight = event.currentTarget.scrollHeight;
- var tapHeight = event.layerY;
- var tapHeightDec = tapHeight / totalHeight;
- var minHeight = 360;
- if ( tapHeight < minHeight ) aside.className = '';
- if (tapHeightDec > thresholdDec ) {
- aside.className = 'visible';
- }
- else {
- aside.className = '';
- }
- });
-};
-</pre>
-
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
-urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
-felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
-turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
-venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
-at neque.
-</p>
-
-</article>
-</section>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/css3_sel-nth.htm b/examples/webkit/webkit-guide/css3_sel-nth.htm
deleted file mode 100644
index 05e6bba340..0000000000
--- a/examples/webkit/webkit-guide/css3_sel-nth.htm
+++ /dev/null
@@ -1,81 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>CSS-only Grid Layout</title>
-<link href='css/css3_sel-nth.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<article>
-
-<img src="img/ic_ag_048.png"/>
-<img src="img/ic_al_048.png"/>
-<img src="img/ic_ar_048.png"/>
-<img src="img/ic_be_048.png"/>
-<img src="img/ic_b_048.png"/>
-<img src="img/ic_ca_048.png"/>
-<img src="img/ic_cl_048.png"/>
-<img src="img/ic_cu_048.png"/>
-<img src="img/ic_c_048.png"/>
-<img src="img/ic_fe_048.png"/>
-<img src="img/ic_f_048.png"/>
-<img src="img/ic_he_048.png"/>
-<img src="img/ic_h_048.png"/>
-<img src="img/ic_k_048.png"/>
-<img src="img/ic_li_048.png"/>
-<img src="img/ic_mg_048.png"/>
-<img src="img/ic_na_048.png"/>
-<img src="img/ic_ne_048.png"/>
-<img src="img/ic_ni_048.png"/>
-<img src="img/ic_n_048.png"/>
-<img src="img/ic_o_048.png"/>
-<img src="img/ic_pt_048.png"/>
-<img src="img/ic_si_048.png"/>
-<img src="img/ic_zn_048.png"/>
-
-</article>
-</section>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/css3_shadow.htm b/examples/webkit/webkit-guide/css3_shadow.htm
deleted file mode 100644
index 85547e38b1..0000000000
--- a/examples/webkit/webkit-guide/css3_shadow.htm
+++ /dev/null
@@ -1,79 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Navigation Icon Feedback</title>
-<link href='css/css3_shadow.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section class="nav">
-<nav>
-<a class="nav1" href="#"></a>
-<a class="nav2" href="#"></a>
-<a class="nav3" href="#"></a>
-<a class="nav4" href="#"></a>
-<a class="nav5" href="#"></a>
-<a class="nav6" href="#"></a>
-<span id="force_justify">&nbsp;</span>
-</nav>
-</section>
-<section class="main">
-<article>
-<h1>Navigation Icon Feedback</h1>
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
-urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
-felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
-turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
-venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
-at neque.
-</p>
-</article>
-</section>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/css3_text-overflow.htm b/examples/webkit/webkit-guide/css3_text-overflow.htm
deleted file mode 100644
index 7307b6536d..0000000000
--- a/examples/webkit/webkit-guide/css3_text-overflow.htm
+++ /dev/null
@@ -1,118 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>text-overflow</title>
-<link href='css/css3_text-overflow.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<article>
-<h3>text-overflow</h3>
-
-<ul class="accordion">
-<li id="l1">
-<div class="dismiss"></div>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Mauris tempor, urna at dignissim pellentesque, velit lacus
-dictum sem, non porttitor felis nulla nec risus.
-</li>
-<li id="l2">
-<div class="dismiss"></div>
-Praesent luctus, risus eu vestibulum mollis, arcu mauris mollis ante,
-id mollis risus lectus ornare nisl. Aenean elementum arcu sed nibh
-faucibus pellentesque. Aliquam erat volutpat. Donec a massa felis, a
-congue purus. Nullam et turpis diam. Aenean vestibulum egestas metus,
-eu sodales dolor venenatis quis. Aenean augue orci, facilisis et
-convallis ut, egestas at neque.
-</li>
-<li id="l3">
-<div class="dismiss"></div>
-Donec a massa felis, a congue purus. Nullam et turpis diam. Aenean
-vestibulum egestas metus, eu sodales dolor venenatis quis. Aenean
-augue orci, facilisis et convallis ut, egestas at neque. Lorem ipsum
-dolor sit amet, consectetur adipiscing elit. Donec feugiat gravida
-viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus ac
-tellus.
-</li>
-<li id="l4">
-<div class="dismiss"></div>
-Aenean vestibulum egestas metus, eu sodales dolor venenatis quis.
-Aenean augue orci, facilisis et convallis ut, egestas at neque.
-Vivamus ipsum felis, cursus sed venenatis nec, tempus ac tellus.
-Donec a massa felis, a congue purus.
-</li>
-<li id="l5">
-<div class="dismiss"></div>
-Nullam et turpis diam. Vivamus ipsum felis, cursus sed venenatis nec,
-tempus ac tellus. Lorem ipsum dolor sit amet, consectetur adipiscing
-elit. Donec a massa felis, a congue purus. Aenean vestibulum egestas
-metus, eu sodales dolor venenatis quis. Donec feugiat gravida
-viverra. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl.
-</li>
-<li id="l6">
-<div class="dismiss"></div>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit.
-Vivamus ipsum felis, cursus sed venenatis nec, tempus ac tellus.
-Aenean elementum arcu sed nibh faucibus pellentesque. Aliquam erat
-volutpat.
-Donec a massa felis, a congue purus.
-Aenean vestibulum egestas metus, eu sodales dolor venenatis quis.
-</li>
-<li id="l7">
-<div class="dismiss"></div>
-Donec feugiat gravida viverra. Praesent luctus, risus eu vestibulum
-mollis, arcu mauris mollis ante, id mollis risus lectus ornare nisl.
-Aliquam erat volutpat. Nullam et turpis diam. Aenean augue orci,
-facilisis et convallis ut, egestas at neque.
-</li>
-</ul>
-
-</article>
-</section>
-<script src="js/css3_text-overflow.js"></script>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/css3_text-shadow.htm b/examples/webkit/webkit-guide/css3_text-shadow.htm
deleted file mode 100644
index 2fa10d2e32..0000000000
--- a/examples/webkit/webkit-guide/css3_text-shadow.htm
+++ /dev/null
@@ -1,75 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Text Shadow</title>
-<link href='css/css3_text-shadow.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<article>
-<h1>Text Shadow</h1>
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus.
-</p>
-<h2>Subhead</h2>
-<p>
-Praesent luctus, risus eu vestibulum mollis, arcu mauris mollis ante,
-id mollis risus lectus ornare nisl. Aenean elementum arcu sed nibh
-faucibus pellentesque. Aliquam erat volutpat. Mauris tempor, urna at
-dignissim pellentesque, velit lacus dictum sem, non porttitor felis
-nulla nec risus. Donec a massa felis, a congue purus. Nullam et turpis
-diam.
-</p>
-<h3>Subhead</h3>
-<p>
-Aenean vestibulum egestas metus, eu sodales dolor venenatis
-quis. Aenean augue orci, facilisis et convallis ut, egestas at neque.
-</p>
-</article>
-</section>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/css3_text-stroke.htm b/examples/webkit/webkit-guide/css3_text-stroke.htm
deleted file mode 100644
index 9f8af0e055..0000000000
--- a/examples/webkit/webkit-guide/css3_text-stroke.htm
+++ /dev/null
@@ -1,75 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Text Stroke</title>
-<link href='css/css3_text-stroke.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<article>
-<h1>Text Stroke</h1>
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus.
-</p>
-<h2>Subhead</h2>
-<p>
-Praesent luctus, risus eu vestibulum mollis, arcu mauris mollis ante,
-id mollis risus lectus ornare nisl. Aenean elementum arcu sed nibh
-faucibus pellentesque. Aliquam erat volutpat. Mauris tempor, urna at
-dignissim pellentesque, velit lacus dictum sem, non porttitor felis
-nulla nec risus. Donec a massa felis, a congue purus. Nullam et turpis
-diam.
-</p>
-<h3>Subhead</h3>
-<p>
-Aenean vestibulum egestas metus, eu sodales dolor venenatis
-quis. Aenean augue orci, facilisis et convallis ut, egestas at neque.
-</p>
-</article>
-</section>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/form_tapper.htm b/examples/webkit/webkit-guide/form_tapper.htm
deleted file mode 100644
index cf755a59f6..0000000000
--- a/examples/webkit/webkit-guide/form_tapper.htm
+++ /dev/null
@@ -1,75 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>CSS-only Tap Button Inputs</title>
-<link href='css/form_tapper.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<h1>CSS-only Tap Button Inputs</h1>
-<form>
-<h2>radio</h2>
-<input type="radio" name="radio_basic" value="one"/>
-<label>Option One</label>
-<br/>
-<input type="radio" name="radio_basic" value="two"/>
-<label>Option Two</label>
-<br/>
-<input type="radio" name="radio_basic" value="three"/>
-<label>Option Three</label>
-<h2>checkbox</h2>
-<input type="checkbox" name="checkbox_basic" value="one"/>
-<label>Option One</label>
-<br/>
-<input type="checkbox" name="checkbox_basic" value="two"/>
-<label>Option Two</label>
-<br/>
-<input type="checkbox" name="checkbox_basic" value="three"/>
-<label>Option Three</label>
-</form>
-</section>
-<script src="js/form_tapper.js"></script>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/form_toggler.htm b/examples/webkit/webkit-guide/form_toggler.htm
deleted file mode 100644
index 113f450425..0000000000
--- a/examples/webkit/webkit-guide/form_toggler.htm
+++ /dev/null
@@ -1,141 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>CSS-only Toggle Button Inputs</title>
-<link href='css/form_toggler.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<h1>CSS-only Toggle Button Inputs</h1>
-<form>
-<h2>radio (default)</h2>
-<label>Option One</label>
-<input type="radio" name="radio_basic" value="one"/>
-<br/>
-<label>Option Two</label>
-<input type="radio" name="radio_basic" value="two"/>
-<br/>
-<label>Option Three</label>
-<input type="radio" name="radio_basic" value="three"/>
-<h2>checkbox (default)</h2>
-<input type="checkbox" name="checkbox_basic" value="one"/>
-<label>Option One</label>
-<br/>
-<input type="checkbox" name="checkbox_basic" value="two"/>
-<label>Option Two</label>
-<br/>
-<input type="checkbox" name="checkbox_basic" value="three"/>
-<label>Option Three</label>
-<h2>radio class="invert"</h2>
-<label>Option One</label>
-<input class="invert" type="radio" name="radio_invert" value="one"/>
-<br/>
-<label>Option Two</label>
-<input class="invert" type="radio" name="radio_invert" value="two"/>
-<br/>
-<label>Option Three</label>
-<input class="invert" type="radio" name="radio_invert" value="three"/>
-<h2>checkbox class="invert"</h2>
-<input class="invert" type="checkbox" name="checkbox_invert" value="one"/>
-<label>Option One</label>
-<br/>
-<input class="invert" type="checkbox" name="checkbox_invert" value="two"/>
-<label>Option Two</label>
-<br/>
-<input class="invert" type="checkbox" name="checkbox_invert" value="three"/>
-<label>Option Three</label>
-<h2>radio class="yn"</h2>
-<label>Option One</label>
-<input class="yn" type="radio" name="radio_yn" value="one"/>
-<br/>
-<label>Option Two</label>
-<input class="yn" type="radio" name="radio_yn" value="two"/>
-<br/>
-<label>Option Three</label>
-<input class="yn" type="radio" name="radio_yn" value="three"/>
-<h2>checkbox class="yn"</h2>
-<input class="yn" type="checkbox" name="checkbox_yn" value="one"/>
-<label>Option One</label>
-<br/>
-<input class="yn" type="checkbox" name="checkbox_yn" value="two"/>
-<label>Option Two</label>
-<br/>
-<input class="yn" type="checkbox" name="checkbox_yn" value="three"/>
-<label>Option Three</label>
-<h2>radio class="tf"</h2>
-<label>Option One</label>
-<input class="tf" type="radio" name="radio_tf" value="one"/>
-<br/>
-<label>Option Two</label>
-<input class="tf" type="radio" name="radio_tf" value="two"/>
-<br/>
-<label>Option Three</label>
-<input class="tf" type="radio" name="radio_tf" value="three"/>
-<h2>checkbox class="tf"</h2>
-<input class="tf" type="checkbox" name="checkbox_tf" value="one"/>
-<label>Option One</label>
-<br/>
-<input class="tf" type="checkbox" name="checkbox_tf" value="two"/>
-<label>Option Two</label>
-<br/>
-<input class="tf" type="checkbox" name="checkbox_tf" value="three"/>
-<label>Option Three</label>
-<h2>radio class="binary"</h2>
-<label>Time of Day</label>
-<input class="binary ampm" type="radio" name="radio_binary" value="am"/>
-<input class="binary ampm" type="radio" name="radio_binary" value="pm" checked/>
-<br/>
-<label>Sex</label>
-<input class="binary sex" type="radio" name="radio_sex" value="male" checked/>
-<input class="binary sex" type="radio" name="radio_sex" value="female"/>
-<br/>
-<br/>
-<p>(These use custom button values)</p>
-<br/>
-<br/>
-</form>
-</section>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/img/border-frame.png b/examples/webkit/webkit-guide/img/border-frame.png
deleted file mode 100644
index 7a0894cabc..0000000000
--- a/examples/webkit/webkit-guide/img/border-frame.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/gal1.jpg b/examples/webkit/webkit-guide/img/gal1.jpg
deleted file mode 100644
index 8f9edcb2ca..0000000000
--- a/examples/webkit/webkit-guide/img/gal1.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/gal2.jpg b/examples/webkit/webkit-guide/img/gal2.jpg
deleted file mode 100644
index a2301ef22f..0000000000
--- a/examples/webkit/webkit-guide/img/gal2.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/gal3.jpg b/examples/webkit/webkit-guide/img/gal3.jpg
deleted file mode 100644
index a768530a8c..0000000000
--- a/examples/webkit/webkit-guide/img/gal3.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/gal4.jpg b/examples/webkit/webkit-guide/img/gal4.jpg
deleted file mode 100644
index 96c00015c0..0000000000
--- a/examples/webkit/webkit-guide/img/gal4.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/gal5.jpg b/examples/webkit/webkit-guide/img/gal5.jpg
deleted file mode 100644
index 6ec78fc43a..0000000000
--- a/examples/webkit/webkit-guide/img/gal5.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/gal6.jpg b/examples/webkit/webkit-guide/img/gal6.jpg
deleted file mode 100644
index 25eb95cb22..0000000000
--- a/examples/webkit/webkit-guide/img/gal6.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/gal7.jpg b/examples/webkit/webkit-guide/img/gal7.jpg
deleted file mode 100644
index b9fda2fb9d..0000000000
--- a/examples/webkit/webkit-guide/img/gal7.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/gal8.jpg b/examples/webkit/webkit-guide/img/gal8.jpg
deleted file mode 100644
index c23e2260c3..0000000000
--- a/examples/webkit/webkit-guide/img/gal8.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/gradient.jpg b/examples/webkit/webkit-guide/img/gradient.jpg
deleted file mode 100644
index 014386e275..0000000000
--- a/examples/webkit/webkit-guide/img/gradient.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/gray_icon_close.png b/examples/webkit/webkit-guide/img/gray_icon_close.png
deleted file mode 100644
index 8e7450153e..0000000000
--- a/examples/webkit/webkit-guide/img/gray_icon_close.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ag_016.png b/examples/webkit/webkit-guide/img/ic_ag_016.png
deleted file mode 100644
index bb961cb393..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ag_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ag_032.png b/examples/webkit/webkit-guide/img/ic_ag_032.png
deleted file mode 100644
index edb051f50e..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ag_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ag_036.png b/examples/webkit/webkit-guide/img/ic_ag_036.png
deleted file mode 100644
index e555e92071..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ag_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ag_048.png b/examples/webkit/webkit-guide/img/ic_ag_048.png
deleted file mode 100644
index d2d417da2e..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ag_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_al_016.png b/examples/webkit/webkit-guide/img/ic_al_016.png
deleted file mode 100644
index 0f1c0240fb..0000000000
--- a/examples/webkit/webkit-guide/img/ic_al_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_al_032.png b/examples/webkit/webkit-guide/img/ic_al_032.png
deleted file mode 100644
index 5727a5104e..0000000000
--- a/examples/webkit/webkit-guide/img/ic_al_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_al_036.png b/examples/webkit/webkit-guide/img/ic_al_036.png
deleted file mode 100644
index 76382779b8..0000000000
--- a/examples/webkit/webkit-guide/img/ic_al_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_al_048.png b/examples/webkit/webkit-guide/img/ic_al_048.png
deleted file mode 100644
index 9671d86944..0000000000
--- a/examples/webkit/webkit-guide/img/ic_al_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ar_016.png b/examples/webkit/webkit-guide/img/ic_ar_016.png
deleted file mode 100644
index fa91e96dca..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ar_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ar_032.png b/examples/webkit/webkit-guide/img/ic_ar_032.png
deleted file mode 100644
index d899c41fdb..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ar_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ar_036.png b/examples/webkit/webkit-guide/img/ic_ar_036.png
deleted file mode 100644
index 836593f4bc..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ar_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ar_048.png b/examples/webkit/webkit-guide/img/ic_ar_048.png
deleted file mode 100644
index e1c77aca74..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ar_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_b_016.png b/examples/webkit/webkit-guide/img/ic_b_016.png
deleted file mode 100644
index a0ebdf7964..0000000000
--- a/examples/webkit/webkit-guide/img/ic_b_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_b_032.png b/examples/webkit/webkit-guide/img/ic_b_032.png
deleted file mode 100644
index f5571f2bb9..0000000000
--- a/examples/webkit/webkit-guide/img/ic_b_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_b_036.png b/examples/webkit/webkit-guide/img/ic_b_036.png
deleted file mode 100644
index 4aff7eb601..0000000000
--- a/examples/webkit/webkit-guide/img/ic_b_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_b_048.png b/examples/webkit/webkit-guide/img/ic_b_048.png
deleted file mode 100644
index b84434cec4..0000000000
--- a/examples/webkit/webkit-guide/img/ic_b_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_be_016.png b/examples/webkit/webkit-guide/img/ic_be_016.png
deleted file mode 100644
index 0297cd827d..0000000000
--- a/examples/webkit/webkit-guide/img/ic_be_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_be_032.png b/examples/webkit/webkit-guide/img/ic_be_032.png
deleted file mode 100644
index 5c5b9cd9e1..0000000000
--- a/examples/webkit/webkit-guide/img/ic_be_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_be_036.png b/examples/webkit/webkit-guide/img/ic_be_036.png
deleted file mode 100644
index 96ec4bb4ca..0000000000
--- a/examples/webkit/webkit-guide/img/ic_be_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_be_048.png b/examples/webkit/webkit-guide/img/ic_be_048.png
deleted file mode 100644
index afcdf183dd..0000000000
--- a/examples/webkit/webkit-guide/img/ic_be_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_c_016.png b/examples/webkit/webkit-guide/img/ic_c_016.png
deleted file mode 100644
index a3cc4cfadf..0000000000
--- a/examples/webkit/webkit-guide/img/ic_c_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_c_032.png b/examples/webkit/webkit-guide/img/ic_c_032.png
deleted file mode 100644
index 404babecf1..0000000000
--- a/examples/webkit/webkit-guide/img/ic_c_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_c_036.png b/examples/webkit/webkit-guide/img/ic_c_036.png
deleted file mode 100644
index 78d71500d9..0000000000
--- a/examples/webkit/webkit-guide/img/ic_c_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_c_048.png b/examples/webkit/webkit-guide/img/ic_c_048.png
deleted file mode 100644
index 73462ad394..0000000000
--- a/examples/webkit/webkit-guide/img/ic_c_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ca_016.png b/examples/webkit/webkit-guide/img/ic_ca_016.png
deleted file mode 100644
index af4c37b0e5..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ca_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ca_032.png b/examples/webkit/webkit-guide/img/ic_ca_032.png
deleted file mode 100644
index 6ac8db4ce6..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ca_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ca_036.png b/examples/webkit/webkit-guide/img/ic_ca_036.png
deleted file mode 100644
index 19988c165d..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ca_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ca_048.png b/examples/webkit/webkit-guide/img/ic_ca_048.png
deleted file mode 100644
index 0349061038..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ca_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_cl_016.png b/examples/webkit/webkit-guide/img/ic_cl_016.png
deleted file mode 100644
index e9b421e70c..0000000000
--- a/examples/webkit/webkit-guide/img/ic_cl_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_cl_032.png b/examples/webkit/webkit-guide/img/ic_cl_032.png
deleted file mode 100644
index f5968d5dfe..0000000000
--- a/examples/webkit/webkit-guide/img/ic_cl_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_cl_036.png b/examples/webkit/webkit-guide/img/ic_cl_036.png
deleted file mode 100644
index 2a6721d780..0000000000
--- a/examples/webkit/webkit-guide/img/ic_cl_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_cl_048.png b/examples/webkit/webkit-guide/img/ic_cl_048.png
deleted file mode 100644
index f32981fe81..0000000000
--- a/examples/webkit/webkit-guide/img/ic_cl_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_cu_016.png b/examples/webkit/webkit-guide/img/ic_cu_016.png
deleted file mode 100644
index 129f99ffd1..0000000000
--- a/examples/webkit/webkit-guide/img/ic_cu_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_cu_032.png b/examples/webkit/webkit-guide/img/ic_cu_032.png
deleted file mode 100644
index a07933ea68..0000000000
--- a/examples/webkit/webkit-guide/img/ic_cu_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_cu_036.png b/examples/webkit/webkit-guide/img/ic_cu_036.png
deleted file mode 100644
index 5eb6ed6363..0000000000
--- a/examples/webkit/webkit-guide/img/ic_cu_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_cu_048.png b/examples/webkit/webkit-guide/img/ic_cu_048.png
deleted file mode 100644
index f21593cf78..0000000000
--- a/examples/webkit/webkit-guide/img/ic_cu_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_f_016.png b/examples/webkit/webkit-guide/img/ic_f_016.png
deleted file mode 100644
index ff2e3fb5f4..0000000000
--- a/examples/webkit/webkit-guide/img/ic_f_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_f_032.png b/examples/webkit/webkit-guide/img/ic_f_032.png
deleted file mode 100644
index 3424799317..0000000000
--- a/examples/webkit/webkit-guide/img/ic_f_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_f_036.png b/examples/webkit/webkit-guide/img/ic_f_036.png
deleted file mode 100644
index 019b7032a6..0000000000
--- a/examples/webkit/webkit-guide/img/ic_f_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_f_048.png b/examples/webkit/webkit-guide/img/ic_f_048.png
deleted file mode 100644
index 567d30310a..0000000000
--- a/examples/webkit/webkit-guide/img/ic_f_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_fe_016.png b/examples/webkit/webkit-guide/img/ic_fe_016.png
deleted file mode 100644
index e6d9b829b9..0000000000
--- a/examples/webkit/webkit-guide/img/ic_fe_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_fe_032.png b/examples/webkit/webkit-guide/img/ic_fe_032.png
deleted file mode 100644
index f2b4e4b417..0000000000
--- a/examples/webkit/webkit-guide/img/ic_fe_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_fe_036.png b/examples/webkit/webkit-guide/img/ic_fe_036.png
deleted file mode 100644
index 2aa81b5fec..0000000000
--- a/examples/webkit/webkit-guide/img/ic_fe_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_fe_048.png b/examples/webkit/webkit-guide/img/ic_fe_048.png
deleted file mode 100644
index b6914735d9..0000000000
--- a/examples/webkit/webkit-guide/img/ic_fe_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_h_016.png b/examples/webkit/webkit-guide/img/ic_h_016.png
deleted file mode 100644
index 957a1ffabe..0000000000
--- a/examples/webkit/webkit-guide/img/ic_h_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_h_032.png b/examples/webkit/webkit-guide/img/ic_h_032.png
deleted file mode 100644
index 824620d4a2..0000000000
--- a/examples/webkit/webkit-guide/img/ic_h_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_h_036.png b/examples/webkit/webkit-guide/img/ic_h_036.png
deleted file mode 100644
index fba59a5d27..0000000000
--- a/examples/webkit/webkit-guide/img/ic_h_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_h_048.png b/examples/webkit/webkit-guide/img/ic_h_048.png
deleted file mode 100644
index f75822c3aa..0000000000
--- a/examples/webkit/webkit-guide/img/ic_h_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_he_016.png b/examples/webkit/webkit-guide/img/ic_he_016.png
deleted file mode 100644
index 33fe83677f..0000000000
--- a/examples/webkit/webkit-guide/img/ic_he_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_he_032.png b/examples/webkit/webkit-guide/img/ic_he_032.png
deleted file mode 100644
index 425c525b69..0000000000
--- a/examples/webkit/webkit-guide/img/ic_he_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_he_036.png b/examples/webkit/webkit-guide/img/ic_he_036.png
deleted file mode 100644
index a976aece8b..0000000000
--- a/examples/webkit/webkit-guide/img/ic_he_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_he_048.png b/examples/webkit/webkit-guide/img/ic_he_048.png
deleted file mode 100644
index f8f9d4d853..0000000000
--- a/examples/webkit/webkit-guide/img/ic_he_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_k_016.png b/examples/webkit/webkit-guide/img/ic_k_016.png
deleted file mode 100644
index 860bd62f96..0000000000
--- a/examples/webkit/webkit-guide/img/ic_k_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_k_032.png b/examples/webkit/webkit-guide/img/ic_k_032.png
deleted file mode 100644
index a14f2c65e9..0000000000
--- a/examples/webkit/webkit-guide/img/ic_k_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_k_036.png b/examples/webkit/webkit-guide/img/ic_k_036.png
deleted file mode 100644
index 49f19e6df0..0000000000
--- a/examples/webkit/webkit-guide/img/ic_k_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_k_048.png b/examples/webkit/webkit-guide/img/ic_k_048.png
deleted file mode 100644
index a7515cd782..0000000000
--- a/examples/webkit/webkit-guide/img/ic_k_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_li_016.png b/examples/webkit/webkit-guide/img/ic_li_016.png
deleted file mode 100644
index c16d81a4bc..0000000000
--- a/examples/webkit/webkit-guide/img/ic_li_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_li_032.png b/examples/webkit/webkit-guide/img/ic_li_032.png
deleted file mode 100644
index 3a34f37066..0000000000
--- a/examples/webkit/webkit-guide/img/ic_li_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_li_036.png b/examples/webkit/webkit-guide/img/ic_li_036.png
deleted file mode 100644
index e5b97a7a2e..0000000000
--- a/examples/webkit/webkit-guide/img/ic_li_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_li_048.png b/examples/webkit/webkit-guide/img/ic_li_048.png
deleted file mode 100644
index 7b030e4cd7..0000000000
--- a/examples/webkit/webkit-guide/img/ic_li_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_mg_016.png b/examples/webkit/webkit-guide/img/ic_mg_016.png
deleted file mode 100644
index 2606336415..0000000000
--- a/examples/webkit/webkit-guide/img/ic_mg_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_mg_032.png b/examples/webkit/webkit-guide/img/ic_mg_032.png
deleted file mode 100644
index 2f9d03e6b0..0000000000
--- a/examples/webkit/webkit-guide/img/ic_mg_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_mg_036.png b/examples/webkit/webkit-guide/img/ic_mg_036.png
deleted file mode 100644
index 584078db84..0000000000
--- a/examples/webkit/webkit-guide/img/ic_mg_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_mg_048.png b/examples/webkit/webkit-guide/img/ic_mg_048.png
deleted file mode 100644
index 8cd2f3acc7..0000000000
--- a/examples/webkit/webkit-guide/img/ic_mg_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_n_016.png b/examples/webkit/webkit-guide/img/ic_n_016.png
deleted file mode 100644
index 90e8f9fec9..0000000000
--- a/examples/webkit/webkit-guide/img/ic_n_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_n_032.png b/examples/webkit/webkit-guide/img/ic_n_032.png
deleted file mode 100644
index afeb47a105..0000000000
--- a/examples/webkit/webkit-guide/img/ic_n_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_n_036.png b/examples/webkit/webkit-guide/img/ic_n_036.png
deleted file mode 100644
index 0b7a11deed..0000000000
--- a/examples/webkit/webkit-guide/img/ic_n_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_n_048.png b/examples/webkit/webkit-guide/img/ic_n_048.png
deleted file mode 100644
index c0d7c0699e..0000000000
--- a/examples/webkit/webkit-guide/img/ic_n_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_na_016.png b/examples/webkit/webkit-guide/img/ic_na_016.png
deleted file mode 100644
index 7888d0f9c0..0000000000
--- a/examples/webkit/webkit-guide/img/ic_na_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_na_032.png b/examples/webkit/webkit-guide/img/ic_na_032.png
deleted file mode 100644
index 801ddca50b..0000000000
--- a/examples/webkit/webkit-guide/img/ic_na_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_na_036.png b/examples/webkit/webkit-guide/img/ic_na_036.png
deleted file mode 100644
index a6878d45d7..0000000000
--- a/examples/webkit/webkit-guide/img/ic_na_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_na_048.png b/examples/webkit/webkit-guide/img/ic_na_048.png
deleted file mode 100644
index 76adaf479c..0000000000
--- a/examples/webkit/webkit-guide/img/ic_na_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ne_016.png b/examples/webkit/webkit-guide/img/ic_ne_016.png
deleted file mode 100644
index 64562fc2d5..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ne_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ne_032.png b/examples/webkit/webkit-guide/img/ic_ne_032.png
deleted file mode 100644
index fab5cd8fcb..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ne_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ne_036.png b/examples/webkit/webkit-guide/img/ic_ne_036.png
deleted file mode 100644
index 41092bf3e7..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ne_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ne_048.png b/examples/webkit/webkit-guide/img/ic_ne_048.png
deleted file mode 100644
index 4ec0db0806..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ne_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ni_016.png b/examples/webkit/webkit-guide/img/ic_ni_016.png
deleted file mode 100644
index 9b88e368a2..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ni_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ni_032.png b/examples/webkit/webkit-guide/img/ic_ni_032.png
deleted file mode 100644
index fc4fcf3ebc..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ni_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ni_036.png b/examples/webkit/webkit-guide/img/ic_ni_036.png
deleted file mode 100644
index 9d527470bb..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ni_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ni_048.png b/examples/webkit/webkit-guide/img/ic_ni_048.png
deleted file mode 100644
index b563c50361..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ni_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_o_016.png b/examples/webkit/webkit-guide/img/ic_o_016.png
deleted file mode 100644
index a95460d457..0000000000
--- a/examples/webkit/webkit-guide/img/ic_o_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_o_032.png b/examples/webkit/webkit-guide/img/ic_o_032.png
deleted file mode 100644
index 1d4864dded..0000000000
--- a/examples/webkit/webkit-guide/img/ic_o_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_o_036.png b/examples/webkit/webkit-guide/img/ic_o_036.png
deleted file mode 100644
index 7f5dd02ed2..0000000000
--- a/examples/webkit/webkit-guide/img/ic_o_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_o_048.png b/examples/webkit/webkit-guide/img/ic_o_048.png
deleted file mode 100644
index 7461a8e9e4..0000000000
--- a/examples/webkit/webkit-guide/img/ic_o_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_pt_016.png b/examples/webkit/webkit-guide/img/ic_pt_016.png
deleted file mode 100644
index 513eb97a30..0000000000
--- a/examples/webkit/webkit-guide/img/ic_pt_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_pt_032.png b/examples/webkit/webkit-guide/img/ic_pt_032.png
deleted file mode 100644
index 1550c399c8..0000000000
--- a/examples/webkit/webkit-guide/img/ic_pt_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_pt_036.png b/examples/webkit/webkit-guide/img/ic_pt_036.png
deleted file mode 100644
index 7eec4d0ce4..0000000000
--- a/examples/webkit/webkit-guide/img/ic_pt_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_pt_048.png b/examples/webkit/webkit-guide/img/ic_pt_048.png
deleted file mode 100644
index 50dece6610..0000000000
--- a/examples/webkit/webkit-guide/img/ic_pt_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_si_016.png b/examples/webkit/webkit-guide/img/ic_si_016.png
deleted file mode 100644
index e639b683ae..0000000000
--- a/examples/webkit/webkit-guide/img/ic_si_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_si_032.png b/examples/webkit/webkit-guide/img/ic_si_032.png
deleted file mode 100644
index 8657e6276f..0000000000
--- a/examples/webkit/webkit-guide/img/ic_si_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_si_036.png b/examples/webkit/webkit-guide/img/ic_si_036.png
deleted file mode 100644
index ffe0ee27fc..0000000000
--- a/examples/webkit/webkit-guide/img/ic_si_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_si_048.png b/examples/webkit/webkit-guide/img/ic_si_048.png
deleted file mode 100644
index 5b9400dbdc..0000000000
--- a/examples/webkit/webkit-guide/img/ic_si_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_zn_016.png b/examples/webkit/webkit-guide/img/ic_zn_016.png
deleted file mode 100644
index 11e5705130..0000000000
--- a/examples/webkit/webkit-guide/img/ic_zn_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_zn_032.png b/examples/webkit/webkit-guide/img/ic_zn_032.png
deleted file mode 100644
index cb78a5c139..0000000000
--- a/examples/webkit/webkit-guide/img/ic_zn_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_zn_036.png b/examples/webkit/webkit-guide/img/ic_zn_036.png
deleted file mode 100644
index 66abffd40d..0000000000
--- a/examples/webkit/webkit-guide/img/ic_zn_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_zn_048.png b/examples/webkit/webkit-guide/img/ic_zn_048.png
deleted file mode 100644
index d8361ad6c0..0000000000
--- a/examples/webkit/webkit-guide/img/ic_zn_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_check.png b/examples/webkit/webkit-guide/img/icon_check.png
deleted file mode 100644
index 294b62d24d..0000000000
--- a/examples/webkit/webkit-guide/img/icon_check.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_check_x24green.png b/examples/webkit/webkit-guide/img/icon_check_x24green.png
deleted file mode 100644
index 803928c231..0000000000
--- a/examples/webkit/webkit-guide/img/icon_check_x24green.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_dismiss.png b/examples/webkit/webkit-guide/img/icon_dismiss.png
deleted file mode 100644
index e7a842640a..0000000000
--- a/examples/webkit/webkit-guide/img/icon_dismiss.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_dismiss_x22.png b/examples/webkit/webkit-guide/img/icon_dismiss_x22.png
deleted file mode 100644
index e52a62a598..0000000000
--- a/examples/webkit/webkit-guide/img/icon_dismiss_x22.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_drill-down.png b/examples/webkit/webkit-guide/img/icon_drill-down.png
deleted file mode 100644
index 7928c6e59e..0000000000
--- a/examples/webkit/webkit-guide/img/icon_drill-down.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_drill-down_x32.png b/examples/webkit/webkit-guide/img/icon_drill-down_x32.png
deleted file mode 100644
index 477d7cda0d..0000000000
--- a/examples/webkit/webkit-guide/img/icon_drill-down_x32.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_drill-up.png b/examples/webkit/webkit-guide/img/icon_drill-up.png
deleted file mode 100644
index ff7594054d..0000000000
--- a/examples/webkit/webkit-guide/img/icon_drill-up.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_drill-up_x32.png b/examples/webkit/webkit-guide/img/icon_drill-up_x32.png
deleted file mode 100644
index d63fe083a1..0000000000
--- a/examples/webkit/webkit-guide/img/icon_drill-up_x32.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_expand-nav.png b/examples/webkit/webkit-guide/img/icon_expand-nav.png
deleted file mode 100644
index 7ec5aa68d1..0000000000
--- a/examples/webkit/webkit-guide/img/icon_expand-nav.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_head-collapsed.png b/examples/webkit/webkit-guide/img/icon_head-collapsed.png
deleted file mode 100644
index ed47838b5b..0000000000
--- a/examples/webkit/webkit-guide/img/icon_head-collapsed.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_head-collapsed_x13.png b/examples/webkit/webkit-guide/img/icon_head-collapsed_x13.png
deleted file mode 100644
index 6892dc08a6..0000000000
--- a/examples/webkit/webkit-guide/img/icon_head-collapsed_x13.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_head-expanded.png b/examples/webkit/webkit-guide/img/icon_head-expanded.png
deleted file mode 100644
index ee7e0a767a..0000000000
--- a/examples/webkit/webkit-guide/img/icon_head-expanded.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_head-expanded_x13.png b/examples/webkit/webkit-guide/img/icon_head-expanded_x13.png
deleted file mode 100644
index 40e8eeb4c1..0000000000
--- a/examples/webkit/webkit-guide/img/icon_head-expanded_x13.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_info.png b/examples/webkit/webkit-guide/img/icon_info.png
deleted file mode 100644
index b70c760621..0000000000
--- a/examples/webkit/webkit-guide/img/icon_info.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_info_x24.png b/examples/webkit/webkit-guide/img/icon_info_x24.png
deleted file mode 100644
index 9f4f352c84..0000000000
--- a/examples/webkit/webkit-guide/img/icon_info_x24.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_link-doc.png b/examples/webkit/webkit-guide/img/icon_link-doc.png
deleted file mode 100644
index fc9bd54e06..0000000000
--- a/examples/webkit/webkit-guide/img/icon_link-doc.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_link-email.png b/examples/webkit/webkit-guide/img/icon_link-email.png
deleted file mode 100644
index ef5f95d318..0000000000
--- a/examples/webkit/webkit-guide/img/icon_link-email.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_link-external.png b/examples/webkit/webkit-guide/img/icon_link-external.png
deleted file mode 100644
index 47ddd807e4..0000000000
--- a/examples/webkit/webkit-guide/img/icon_link-external.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_link-pdf.png b/examples/webkit/webkit-guide/img/icon_link-pdf.png
deleted file mode 100644
index fb90a6a2b9..0000000000
--- a/examples/webkit/webkit-guide/img/icon_link-pdf.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_link-ppt.png b/examples/webkit/webkit-guide/img/icon_link-ppt.png
deleted file mode 100644
index c6a532878c..0000000000
--- a/examples/webkit/webkit-guide/img/icon_link-ppt.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_link-rss.png b/examples/webkit/webkit-guide/img/icon_link-rss.png
deleted file mode 100644
index d3cf2c4916..0000000000
--- a/examples/webkit/webkit-guide/img/icon_link-rss.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_link-sms.png b/examples/webkit/webkit-guide/img/icon_link-sms.png
deleted file mode 100644
index f36de100f8..0000000000
--- a/examples/webkit/webkit-guide/img/icon_link-sms.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_link-tel.png b/examples/webkit/webkit-guide/img/icon_link-tel.png
deleted file mode 100644
index 7b665ee5de..0000000000
--- a/examples/webkit/webkit-guide/img/icon_link-tel.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_link-xls.png b/examples/webkit/webkit-guide/img/icon_link-xls.png
deleted file mode 100644
index 977c868eae..0000000000
--- a/examples/webkit/webkit-guide/img/icon_link-xls.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_list-all.png b/examples/webkit/webkit-guide/img/icon_list-all.png
deleted file mode 100644
index 97ce879fb8..0000000000
--- a/examples/webkit/webkit-guide/img/icon_list-all.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_list-all_circ.png b/examples/webkit/webkit-guide/img/icon_list-all_circ.png
deleted file mode 100644
index 6c5828e835..0000000000
--- a/examples/webkit/webkit-guide/img/icon_list-all_circ.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_nav-start.png b/examples/webkit/webkit-guide/img/icon_nav-start.png
deleted file mode 100644
index cbe127fdc9..0000000000
--- a/examples/webkit/webkit-guide/img/icon_nav-start.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_nav-top.png b/examples/webkit/webkit-guide/img/icon_nav-top.png
deleted file mode 100644
index d57d3efa11..0000000000
--- a/examples/webkit/webkit-guide/img/icon_nav-top.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_nav-up.png b/examples/webkit/webkit-guide/img/icon_nav-up.png
deleted file mode 100644
index bab32593e3..0000000000
--- a/examples/webkit/webkit-guide/img/icon_nav-up.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_nav_end.png b/examples/webkit/webkit-guide/img/icon_nav_end.png
deleted file mode 100644
index 6d7dd319b4..0000000000
--- a/examples/webkit/webkit-guide/img/icon_nav_end.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_question.png b/examples/webkit/webkit-guide/img/icon_question.png
deleted file mode 100644
index 28c2ae1f12..0000000000
--- a/examples/webkit/webkit-guide/img/icon_question.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_scroll-left.png b/examples/webkit/webkit-guide/img/icon_scroll-left.png
deleted file mode 100644
index 38b3c3fa0e..0000000000
--- a/examples/webkit/webkit-guide/img/icon_scroll-left.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_scroll-right.png b/examples/webkit/webkit-guide/img/icon_scroll-right.png
deleted file mode 100644
index 4d6191942b..0000000000
--- a/examples/webkit/webkit-guide/img/icon_scroll-right.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_trash.png b/examples/webkit/webkit-guide/img/icon_trash.png
deleted file mode 100644
index b5f6eaae73..0000000000
--- a/examples/webkit/webkit-guide/img/icon_trash.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/land1.jpg b/examples/webkit/webkit-guide/img/land1.jpg
deleted file mode 100644
index 05b11d5393..0000000000
--- a/examples/webkit/webkit-guide/img/land1.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/land2.jpg b/examples/webkit/webkit-guide/img/land2.jpg
deleted file mode 100644
index 0f504b4106..0000000000
--- a/examples/webkit/webkit-guide/img/land2.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/land3.jpg b/examples/webkit/webkit-guide/img/land3.jpg
deleted file mode 100644
index fd86c950e8..0000000000
--- a/examples/webkit/webkit-guide/img/land3.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/land4.jpg b/examples/webkit/webkit-guide/img/land4.jpg
deleted file mode 100644
index bcf33daf7f..0000000000
--- a/examples/webkit/webkit-guide/img/land4.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/land5.jpg b/examples/webkit/webkit-guide/img/land5.jpg
deleted file mode 100644
index c8d550923d..0000000000
--- a/examples/webkit/webkit-guide/img/land5.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/land6.jpg b/examples/webkit/webkit-guide/img/land6.jpg
deleted file mode 100644
index 2762864634..0000000000
--- a/examples/webkit/webkit-guide/img/land6.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/land7.jpg b/examples/webkit/webkit-guide/img/land7.jpg
deleted file mode 100644
index 6ac6d88966..0000000000
--- a/examples/webkit/webkit-guide/img/land7.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/land8.jpg b/examples/webkit/webkit-guide/img/land8.jpg
deleted file mode 100644
index 37c51df15e..0000000000
--- a/examples/webkit/webkit-guide/img/land8.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/mask.png b/examples/webkit/webkit-guide/img/mask.png
deleted file mode 100644
index f9764b54aa..0000000000
--- a/examples/webkit/webkit-guide/img/mask.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/gal1.jpg b/examples/webkit/webkit-guide/img/tmp/gal1.jpg
deleted file mode 100644
index 8f9edcb2ca..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/gal1.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/gal2.jpg b/examples/webkit/webkit-guide/img/tmp/gal2.jpg
deleted file mode 100644
index a2301ef22f..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/gal2.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/gal3.jpg b/examples/webkit/webkit-guide/img/tmp/gal3.jpg
deleted file mode 100644
index a768530a8c..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/gal3.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/gal4.jpg b/examples/webkit/webkit-guide/img/tmp/gal4.jpg
deleted file mode 100644
index 96c00015c0..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/gal4.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/gal5.jpg b/examples/webkit/webkit-guide/img/tmp/gal5.jpg
deleted file mode 100644
index 6ec78fc43a..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/gal5.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/gal6.jpg b/examples/webkit/webkit-guide/img/tmp/gal6.jpg
deleted file mode 100644
index 25eb95cb22..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/gal6.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/gal7.jpg b/examples/webkit/webkit-guide/img/tmp/gal7.jpg
deleted file mode 100644
index b9fda2fb9d..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/gal7.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/gal8.jpg b/examples/webkit/webkit-guide/img/tmp/gal8.jpg
deleted file mode 100644
index c23e2260c3..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/gal8.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/land1.jpg b/examples/webkit/webkit-guide/img/tmp/land1.jpg
deleted file mode 100644
index 05b11d5393..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/land1.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/land2.jpg b/examples/webkit/webkit-guide/img/tmp/land2.jpg
deleted file mode 100644
index 0f504b4106..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/land2.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/land3.jpg b/examples/webkit/webkit-guide/img/tmp/land3.jpg
deleted file mode 100644
index fd86c950e8..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/land3.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/land4.jpg b/examples/webkit/webkit-guide/img/tmp/land4.jpg
deleted file mode 100644
index bcf33daf7f..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/land4.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/land5.jpg b/examples/webkit/webkit-guide/img/tmp/land5.jpg
deleted file mode 100644
index c8d550923d..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/land5.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/land6.jpg b/examples/webkit/webkit-guide/img/tmp/land6.jpg
deleted file mode 100644
index 2762864634..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/land6.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/land7.jpg b/examples/webkit/webkit-guide/img/tmp/land7.jpg
deleted file mode 100644
index 6ac6d88966..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/land7.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/land8.jpg b/examples/webkit/webkit-guide/img/tmp/land8.jpg
deleted file mode 100644
index 37c51df15e..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/land8.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tnail_gal1.png b/examples/webkit/webkit-guide/img/tnail_gal1.png
deleted file mode 100644
index 6c83482e25..0000000000
--- a/examples/webkit/webkit-guide/img/tnail_gal1.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tnail_gal2.png b/examples/webkit/webkit-guide/img/tnail_gal2.png
deleted file mode 100644
index f090b68959..0000000000
--- a/examples/webkit/webkit-guide/img/tnail_gal2.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tnail_gal3.png b/examples/webkit/webkit-guide/img/tnail_gal3.png
deleted file mode 100644
index 6cc257b490..0000000000
--- a/examples/webkit/webkit-guide/img/tnail_gal3.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tnail_gal4.png b/examples/webkit/webkit-guide/img/tnail_gal4.png
deleted file mode 100644
index ae9983ccbc..0000000000
--- a/examples/webkit/webkit-guide/img/tnail_gal4.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tnail_gal5.png b/examples/webkit/webkit-guide/img/tnail_gal5.png
deleted file mode 100644
index 58d764c9a9..0000000000
--- a/examples/webkit/webkit-guide/img/tnail_gal5.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tnail_gal6.png b/examples/webkit/webkit-guide/img/tnail_gal6.png
deleted file mode 100644
index f5d0b8b657..0000000000
--- a/examples/webkit/webkit-guide/img/tnail_gal6.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tnail_gal7.png b/examples/webkit/webkit-guide/img/tnail_gal7.png
deleted file mode 100644
index 8d33ea69f6..0000000000
--- a/examples/webkit/webkit-guide/img/tnail_gal7.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tnail_gal8.png b/examples/webkit/webkit-guide/img/tnail_gal8.png
deleted file mode 100644
index 61e1431ab5..0000000000
--- a/examples/webkit/webkit-guide/img/tnail_gal8.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/js/anim_accord.js b/examples/webkit/webkit-guide/js/anim_accord.js
deleted file mode 100755
index cc95b7f7c9..0000000000
--- a/examples/webkit/webkit-guide/js/anim_accord.js
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-window.onload = function() {
-
- initDT();
- document.querySelector('body').addEventListener('click', function(event){
- var dl = document.querySelector('#accordion');
- var ct = event.currentTarget;
- var t = event.target;
- var dt;
- if (t.id == 'accordion' && t.className == 'collapsed') {
- dl.className = 'expanded';
- }
- else if (t.tagName == 'DT' && t.parentNode.id == 'accordion') {
- if ( t.className == 'collapsed' ) {
- t.className = 'expanded';
- }
- else {
- t.className = 'collapsed';
- }
- }
- else {
- dl.className = 'collapsed';
- initDT();
- }
- });
-};
-
-function initDT() {
- var el = nlToAr(document.querySelectorAll('#accordion > dt'));
- el.forEach( function(l){ l.className = 'collapsed'; });
-}
-
-function nlToAr(nl) {
- var a = new Array();
- var l = nl.length;
- var i = l - 1;
- a[i] = true;
- for ( i = 0; i < l ; i++ ) { a[i] = nl[i]; }
- return(a);
-}
diff --git a/examples/webkit/webkit-guide/js/anim_gallery.js b/examples/webkit/webkit-guide/js/anim_gallery.js
deleted file mode 100755
index 050f113bb4..0000000000
--- a/examples/webkit/webkit-guide/js/anim_gallery.js
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-var app = new Function();
-
-app.init = function() {
- var divs = document.querySelectorAll('section > div');
- if ( divs.length < 2 ) return false;
- for (var i = 0, l = divs.length ; i < l ; i++ ) {
- if (i > 1) divs[i].className = 'hideR';
- divs[i].addEventListener('click', app.navigate );
- }
- divs[0].className = 'selected';
- divs[1].className = 'queueR';
-};
-
-app.navigate = function(event) {
- var el, n1, n2, p1, p2;
- el = event.currentTarget;
- n1 = el.nextSibling;
- if (n1) n2 = el.nextSibling.nextSibling;
- p1 = el.previousSibling;
- if (p1) p2 = el.previousSibling.previousSibling;
- if ( el.className == 'selected' ) {
- if ( el.id == 'reveal') {
- el.id = '';
- }
- else {
- el.id = 'reveal';
- }
- return false;
- }
- if (n1) { n1.className = 'queueR'; n1.id = ''}
- if (n2) { n2.className = 'hideR'; n2.id = '' }
- if (p1) { p1.className = 'queueL'; p1.id = '' }
- if (p2) { p2.className = 'hideL'; p2.id = '' }
- el.className = 'selected';
-};
-
-window.onload = function() {
- // alert(app.init);
- app.init();
-};
diff --git a/examples/webkit/webkit-guide/js/anim_panel.js b/examples/webkit/webkit-guide/js/anim_panel.js
deleted file mode 100755
index e6cc5e6d8f..0000000000
--- a/examples/webkit/webkit-guide/js/anim_panel.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-window.onload = function() {
- document.querySelector('body').addEventListener('click', function(event){
- document.querySelector('#panel').className = 'collapsed';
- });
-}
-
-function share() {
- document.querySelector('#panel').className = 'expanded';
- event.stopPropagation();
-}
-
-function debug(str) {
- document.querySelector('#dbg').innerHTML = 'You chose the <b>' + str.toUpperCase() + '</b> option.';
-}
diff --git a/examples/webkit/webkit-guide/js/anim_skew.js b/examples/webkit/webkit-guide/js/anim_skew.js
deleted file mode 100755
index 8b1300fd1f..0000000000
--- a/examples/webkit/webkit-guide/js/anim_skew.js
+++ /dev/null
@@ -1,97 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-var app = new Function();
-
-app.init = function() {
- app.elements = document.querySelectorAll('.items > div');
- app.navs = document.querySelectorAll('nav > div');
-
- // elements
- for ( var i = 0, ln = app.elements.length ; i < ln ; i++ ) {
- app.elements[i].className = 'row' + (i + 1);
- app.elements[i].addEventListener('click', app.remove);
- }
-
- // navigation
- for ( var i = 0, ln = app.navs.length ; i < ln ; i++ ) {
- app.navs[i].addEventListener('click', app.filter );
- }
-};
-
-app.filter = function(event) {
- var type = event.target.className;
-
- var hiddenCount = 0;
-
- if (! type ) {
- app.init();
- return false;
- }
-
- for ( var i = 0, ln = app.elements.length ; i < ln ; i++ ) {
- if ( app.elements[i].title == type ) {
- app.elements[i].className = 'row' + ((i + 1) - hiddenCount);
- }
- else {
- app.elements[i].className = 'hide';
- hiddenCount++;
- }
- }
-};
-
-app.remove = function() {
- event.currentTarget.className = 'hide';
- app.rearrange();
-};
-
-app.rearrange = function() {
- var hiddenCount = 0;
- for ( var i = 0, ln = app.elements.length ; i < ln ; i++ ) {
- if ( app.elements[i].className.match(/hide/) ) {
- hiddenCount++;
- }
- else {
- app.elements[i].className = 'row' + ((i + 1) - hiddenCount);
- }
- }
-};
-
-window.onload = function() { app.init() };
-
diff --git a/examples/webkit/webkit-guide/js/css3_backgrounds.js b/examples/webkit/webkit-guide/js/css3_backgrounds.js
deleted file mode 100755
index 29004c7b53..0000000000
--- a/examples/webkit/webkit-guide/js/css3_backgrounds.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-document.querySelector('body').addEventListener('click', function(event) {
- var l = event.target;
- if (l.tagName != 'DT') return false ;
- if ( l.className ) {
- l.className = '';
- }
- else {
- l.className = 'selected';
- }
-});
diff --git a/examples/webkit/webkit-guide/js/css3_border-img.js b/examples/webkit/webkit-guide/js/css3_border-img.js
deleted file mode 100755
index a8bfd9132d..0000000000
--- a/examples/webkit/webkit-guide/js/css3_border-img.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-window.onload = function() {
- var el = document.querySelectorAll('input');
- for (var i = 0, l = el.length ; i < l ; i++ ) {
- }
-}
diff --git a/examples/webkit/webkit-guide/js/css3_grad-radial.js b/examples/webkit/webkit-guide/js/css3_grad-radial.js
deleted file mode 100755
index f194ddaa6c..0000000000
--- a/examples/webkit/webkit-guide/js/css3_grad-radial.js
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-window.onload = function() {
- var el = document.querySelector('#main');
- el.addEventListener('mousedown', function(event){
-
- var colors = [ 'beige', 'crimson', 'darkcyan', 'turquoise',
- 'darkgoldenrod', 'darkorange', 'fuchsia',
- 'greenyellow', 'lightblue', 'lightcoral',
- 'lightgreen', 'mediumorchid', 'pink', 'plum',
- 'skyblue', 'springgreen', 'tan', 'tomato',
- 'violet', 'yellow', 'teal'];
-
- var x = event.offsetX;
- var y = event.offsetY;
-
- var loc = document.querySelector('#localStyles');
- var style = '#main:active {' + 'background: -webkit-gradient(radial, ';
- style += (x + ' ');
- style += (y + ' ');
- style += ',5,';
- style += ((x + 10) + ' ');
- style += ((y + 10) + ' ');
- style += ', 48, ';
- style += 'from(' + colors[r(5)] + '),';
- style += 'color-stop(20%, ' + colors[r(5)] + '),';
- style += 'color-stop(40%, ' + colors[r(5)] + '),';
- style += 'color-stop(60%, ' + colors[r(5)] + '),';
- style += 'color-stop(80%, ' + colors[r(5)] + '),';
- style += 'to(#ffffff) );'
- style += '}'
- loc.innerHTML = style;
- });
-}
-
-function r(i) {
- return Math.floor( (Math.random() * i ) );
-}
diff --git a/examples/webkit/webkit-guide/js/css3_mask-grad.js b/examples/webkit/webkit-guide/js/css3_mask-grad.js
deleted file mode 100755
index 911212dcf4..0000000000
--- a/examples/webkit/webkit-guide/js/css3_mask-grad.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-document.querySelector('body').addEventListener('click', function(event) {
- var l = event.target;
- if (l.tagName != 'IMG') return false ;
- event.target.className = 'select';
-});
diff --git a/examples/webkit/webkit-guide/js/css3_mask-img.js b/examples/webkit/webkit-guide/js/css3_mask-img.js
deleted file mode 100755
index a8bfd9132d..0000000000
--- a/examples/webkit/webkit-guide/js/css3_mask-img.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-window.onload = function() {
- var el = document.querySelectorAll('input');
- for (var i = 0, l = el.length ; i < l ; i++ ) {
- }
-}
diff --git a/examples/webkit/webkit-guide/js/css3_text-overflow.js b/examples/webkit/webkit-guide/js/css3_text-overflow.js
deleted file mode 100755
index 58af80d6d1..0000000000
--- a/examples/webkit/webkit-guide/js/css3_text-overflow.js
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-window.onload = function() {
- var el = document.querySelectorAll('.accordion > li');
- for (var i = 0, l = el.length ; i < l ; i++ ) {
- el[i].addEventListener('click', function(event){
- var tgt = event.target;
- if ( tgt.tagName == 'LI' && ( ! tgt.className ) ) {
- tgt.className = 'selected';
- }
- if ( tgt.tagName == 'DIV' && ( tgt.className == 'dismiss') ) {
- tgt.parentNode.className = '';
- }
-
- });
- }
-}
diff --git a/examples/webkit/webkit-guide/js/form_tapper.js b/examples/webkit/webkit-guide/js/form_tapper.js
deleted file mode 100755
index d4d87a2c1a..0000000000
--- a/examples/webkit/webkit-guide/js/form_tapper.js
+++ /dev/null
@@ -1,57 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-window.onload = function() {
- return false;
- var el = document.querySelectorAll('input[type=radio]');
- for ( var i = 0, l = el.length ; i < l ; i++ ) {
- el[i].addEventListener('click', resetRadio);
- }
-}
-
-function resetRadio(event) {
- if (event.target._checked == true) {
- event.target._checked = false;
- event.target.checked = false;
- event.target.indeterminate = true;
- }
- else {
- event.target._checked = true;
- }
-}
diff --git a/examples/webkit/webkit-guide/js/mob_condjs.js b/examples/webkit/webkit-guide/js/mob_condjs.js
deleted file mode 100755
index 32bf550d20..0000000000
--- a/examples/webkit/webkit-guide/js/mob_condjs.js
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-window.onload = function() {
- var msg = 'JavaScript thinks you are viewing this page with a ';
- if ( isDesign('desktop') ) {
- msg += 'full desktop browser';
- }
- else if ( isDesign('touch') ) {
- msg += 'touch-based mobile browser';
- }
- else if ( isDesign('mobile') ) {
- msg += 'non-touch mobile browser';
- }
- else {
- msg = window.styleMedia.matchMedium;
- }
- document.getElementById('js').innerHTML = msg;
-};
-
-function isDesign(str) {
- var design;
- if (matchesMedia('only screen and (min-device-width: 481px)')) {
- design = 'desktop';
- }
- else if (matchesMedia('only screen and (max-device-width: 480px)')) {
- design = 'touch';
- }
- else if (matchesMedia('handheld')) {
- design = 'mobile';
- }
- return str == design;
-}
-
-function matchesMedia(query) {
- if (!!window.matchMedia)
- return window.matchMedia(query).matches;
- if (!!window.styleMedia && !!window.styleMedia.matchMedium)
- return window.styleMedia.matchMedium(query);
- if (!!window.media && window.media.matchMedium)
- return window.media.matchMedium(query);
- return false;
-}
diff --git a/examples/webkit/webkit-guide/js/mobile.js b/examples/webkit/webkit-guide/js/mobile.js
deleted file mode 100755
index 51c94d4080..0000000000
--- a/examples/webkit/webkit-guide/js/mobile.js
+++ /dev/null
@@ -1,50 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-var app = new Function();
-
-app.toggleDisplay = function(id) {
- var el = document.getElementById(id);
- if (el.className.match(/hidden/)) {
- el.className = '';
- }
- else {
- el.className = 'hidden';
- }
-}
diff --git a/examples/webkit/webkit-guide/js/storage.js b/examples/webkit/webkit-guide/js/storage.js
deleted file mode 100755
index b5a374f39d..0000000000
--- a/examples/webkit/webkit-guide/js/storage.js
+++ /dev/null
@@ -1,94 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
-****************************************************************************/
-var app = new Function();
-
-app.dbg = false;
-
-window.onload = function() {
-
- app.cred = document.querySelector('#cred');
-
- // open form:
- document.querySelector('#openform').addEventListener('mousedown', app.getInfo);
- // dismiss form:
- document.querySelector('#dismiss').addEventListener('mousedown', app.dismiss);
-
- // form validation:
- app.inputs = document.querySelectorAll('input:not([type="submit"])');
- for (var i = 0, l = app.inputs.length ; i < l ; i++ ) {
- app.inputs[i].addEventListener('blur', app.checkEdit);
- }
-
- // storage
- app.db_loc = window.localStorage;
- app.db_ses = window.sessionStorage;
-
- if (!!app.db_loc) {
- // no login info yet...
- if ( !app.db_loc.getItem('login') || !app.db_loc.getItem('password') ) app.getInfo();
- }
- else {
- alert("This application needs to run on a recent WebKit-based browser.");
- }
-
-};
-
-app.hint = function(str) {
- document.querySelector('body').className = str;
-};
-
-app.checkEdit = function(ev) {
- ev.currentTarget.className = 'validate';
-}
-
-app.getInfo = function(ev) {
- app.cred.className = 'show';
- app.inputs[0].value = app.db_loc.getItem('login');
- app.inputs[1].value = app.db_loc.getItem('password');
- app.inputs[2].value = app.db_ses.getItem('credit');
-}
-
-app.dismiss = function(ev) {
- app.db_loc.setItem('login', app.inputs[0].value);
- app.db_loc.setItem('password', app.inputs[1].value);
- app.db_ses.setItem('credit', app.inputs[2].value);
- ev.currentTarget.parentNode.className = 'hide';
-}
-
diff --git a/examples/webkit/webkit-guide/layout_link-fmt.htm b/examples/webkit/webkit-guide/layout_link-fmt.htm
deleted file mode 100644
index bcb6228a32..0000000000
--- a/examples/webkit/webkit-guide/layout_link-fmt.htm
+++ /dev/null
@@ -1,82 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Link Context Hints</title>
-<link href='css/layout_link-fmt.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<article>
-<h3>Link Context Hints</h3>
-<ol class="links">
-<li> <a href="#">Link to internal page</a></li>
-<li> <a href="http://www.google.com" target="new">Link to external page</a></li>
-<li> <a href="mailto:who@where.com">Email Link</a></li>
-<li> <a href="tel:+2125551212">Phone: 212.555.1212</a></li>
-<li> <a href="sms:+2125551212%3Fbody=hello world">SMS Link</a></li>
-<li> <a href="http://whmp.com/pages/podcast/122411.rss">Link to RSS feed</a></li>
-<li> <a href="http://www.ous.edu/about/polipro/files/Budget%20Outline.doc">Link to Word file</a></li>
-<li> <a href="http://www.greenfield-nh.gov/Public_Documents/GreenfieldNH_Admin/BudgetReport2006.pdf">List to PDF file</a></li>
-<li> <a href="http://www.agmconnect.org/cpf/CPF_Budget_Template.xls">Link to Excel file</a></li>
-<li> <a href="http://www.unh.edu/hr/banner/position-budget-training.ppt">Link to Powerpoint file</a></li>
-</ol>
-<h3>Inline Links</h3>
-<p>
-Links to an
-<a href="item2.htm">internal page</a>, an
-<a href="http://example.com/item1.htm" target="new">external page</a>,
-<a href="mailto:who@where.com">email link</a>,
-phone link
-<a href="tel:+2125551212">212.555.1212</a>,
-<a href="sms:+2125551212%3Fbody=hello world">SMS Link</a>,
-<a href="http://whmp.com/pages/podcast/122411.rss">RSS feed</a>,
-<a href="http://www.ous.edu/about/polipro/files/Budget%20Outline.doc">Word file</a>,
-<a href="http://www.greenfield-nh.gov/Public_Documents/GreenfieldNH_Admin/BudgetReport2006.pdf">PDF</a>,
-<a href="http://www.agmconnect.org/cpf/CPF_Budget_Template.xls">Excel</a>,
-<a href="http://www.unh.edu/hr/banner/position-budget-training.ppt">Powerpoint</a>.
-</p>
-</article>
-<p>&nbsp</p>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/layout_tbl-keyhole.htm b/examples/webkit/webkit-guide/layout_tbl-keyhole.htm
deleted file mode 100644
index 58d1ebd6d4..0000000000
--- a/examples/webkit/webkit-guide/layout_tbl-keyhole.htm
+++ /dev/null
@@ -1,142 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Mobilized Tables</title>
-<link href='css/layout_tbl-keyhole.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-
-<article id="r0">
-
-<h1>Mobilized Tables</h1>
-
-<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec
-feugiat gravida viverra. Vivamus ipsum felis, cursus sed venenatis
-nec, tempus ac tellus.</p>
-
-<p><a href="#r1">View Listings</a></p>
-
-<table class="mobile">
-
-<thead>
-<tr>
-<th class="nav"></th>
-<th>Item</th>
-<th>Price</th>
-<th>Location</th>
-<th>Posted</th>
-<th>Description</th>
-</tr>
-</thead>
-
-<tbody>
-
-<tr id="r1">
-<th class="nav"><a href="#"></a><a href="#r2"></a></th>
-<td>Keiser Indoor Cycling Bike / Platform</td>
-<td>$250</td>
-<td>Santa Monica, CA</td>
-<td>4 days ago</td>
-<td>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui
-officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit
-amet, consectetur adipiscing elit. Donec feugiat gravida viverra.
-Vivamus ipsum felis, cursus sed venenatis nec, tempus ac tellus.</td>
-</tr>
-
-<tr id="r2">
-<th class="nav"><a href="#r1"></a><a href="#r3"></a></th>
-<td>Ladies Diamondback Mountain Bike</td>
-<td>$300</td>
-<td>North Hollywood, CA</td>
-<td>3 hours ago</td>
-<td>Duis aute irure dolor in reprehenderit in voluptate velit esse
-cillum dolore eu fugiat nulla pariatur. Lorem ipsum dolor sit amet,
-consectetur adipiscing elit. Donec feugiat gravida viverra. Vivamus
-ipsum felis, cursus sed venenatis nec, tempus ac tellus.</td>
-</tr>
-
-<tr id="r3">
-<th class="nav"><a href="#r2"></a><a href="#r4"></a></th>
-<td>AA Cycle 10 Speed Road Bike</td>
-<td>$150</td>
-<td>Burbank, CA</td>
-<td>2 days ago</td>
-<td>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
-nisi ut aliquip ex ea commodo consequat. Lorem ipsum dolor sit amet,
-consectetur adipiscing elit. Donec feugiat gravida viverra. Vivamus
-ipsum felis, cursus sed venenatis nec, tempus ac tellus.</td>
-</tr>
-
-<tr id="r4">
-<th class="nav"><a href="#r3"></a><a href="#"></a></th>
-<td>Magna Dual Suspection Mountain Bike 24</td>
-<td>$60</td>
-<td>El Segundo, CA</td>
-<td>2 weeks ago</td>
-<td>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
-eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem
-ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus.</td>
-</tr>
-
-</tbody>
-
-</table>
-
-<p>
-Text continues here. Donec a massa felis, a congue purus. Nullam et
-turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
-venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
-at neque.
-</p>
-</article>
-
-<script src="js/mobile.js"></script>
-
-</section>
-
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/mob_condjs.htm b/examples/webkit/webkit-guide/mob_condjs.htm
deleted file mode 100644
index 1cc4a9da00..0000000000
--- a/examples/webkit/webkit-guide/mob_condjs.htm
+++ /dev/null
@@ -1,66 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Media Queries + JavaScript</title>
-<link media='only screen and (min-device-width: 481px)' href='css/mq_desktop.css' type='text/css' rel='stylesheet'/>
-<link media='only screen and (max-device-width: 480px)' href='css/mq_touch.css' type='text/css' rel='stylesheet'/>
-<link media='handheld' href='css/mqmobile.css' type='text/css' rel='stylesheet'/>
-<link href='css/mob_condjs.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<article>
-<h3>Media Queries + JavaScript</h3>
-<p id="design">...</p>
-
-<p id="js">...</p>
-
-</article>
-</section>
-
-<script src="js/mob_condjs.js"></script>
-
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/mob_layout.htm b/examples/webkit/webkit-guide/mob_layout.htm
deleted file mode 100644
index 1bd74800a2..0000000000
--- a/examples/webkit/webkit-guide/mob_layout.htm
+++ /dev/null
@@ -1,60 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<title>Media Query-Driven Layout</title>
-<meta name='viewport' content='width=device-width' />
-<title>media-driven layout</title>
-<link media='only screen and (min-device-width: 480px)' href='css/mqlayout_desktop.css' type='text/css' rel='stylesheet'/>
-<link media='only screen and (max-device-width: 480px)' href='css/mqlayout_touch.css' type='text/css' rel='stylesheet'/>
-<link media='handheld' href='css/mqlayout_mobile.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<header>HEADER</header>
-<nav>NAVIGATION</nav>
-<section id="main">MAIN CONTENT</section>
-<section id="sidebar">SIDEBAR</section>
-<footer>FOOTER</footer>
-
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/mob_mediaquery.htm b/examples/webkit/webkit-guide/mob_mediaquery.htm
deleted file mode 100644
index 222884f874..0000000000
--- a/examples/webkit/webkit-guide/mob_mediaquery.htm
+++ /dev/null
@@ -1,60 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Media Queries</title>
-<link media='only screen and (min-device-width: 481px)' href='css/mq_desktop.css' type='text/css' rel='stylesheet'/>
-<link media='only screen and (max-device-width: 480px)' href='css/mq_touch.css' type='text/css' rel='stylesheet'/>
-<link media='handheld' href='css/mq_mobile.css' type='text/css' rel='stylesheet'/>
-<link href='css/mob_mediaquery.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<article>
-<h3>Media Queries</h3>
-<p id="design">...</p>
-</article>
-</section>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/storage.htm b/examples/webkit/webkit-guide/storage.htm
deleted file mode 100644
index 5982a621fe..0000000000
--- a/examples/webkit/webkit-guide/storage.htm
+++ /dev/null
@@ -1,72 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Local/Session Storage</title>
-<link href='css/storage.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<h1>
-<img id="openform" src="img/icon_info_x24.png"/>
-Local/Session Storage</h1>
-
-<form id="cred" class="hide">
-
-<img id="dismiss" src="img/icon_dismiss.png"/>
-
-<div>login</div>
-<input id="login" required type="text"/>
-<br/>
-
-<div>password</div>
-<input id="password" required type="password"/>
-
-<div>credit card</div>
-<input id="credit" required type="number" min="999999999999999" max="9999999999999999"/>
-
-</form>
-
-<script src="js/storage.js"></script>
-
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/webkit-guide.pro b/examples/webkit/webkit-guide/webkit-guide.pro
deleted file mode 100644
index a2c2dd4a20..0000000000
--- a/examples/webkit/webkit-guide/webkit-guide.pro
+++ /dev/null
@@ -1,256 +0,0 @@
-#A simple .pro file to make Qt aware of the webkit-guide files.
-#For documentation generation
-#TEMPLATE += subdirs
-
-SOURCES = anim_accord.htm \
-anim_demo-rotate.htm \
-anim_demo-scale.htm \
-anim_demo-skew.htm \
-anim_gallery.htm \
-anim_panel.htm \
-anim_pulse.htm \
-anim_skew.htm \
-anim_slide1.htm \
-anim_slide2.htm \
-anim_slide3.htm \
-anim_tabbedSkew.htm \
-_copyright.txt \
-css3_backgrounds.htm \
-css3_border-img.htm \
-css3_gradientBack.htm \
-css3_gradientBackStop.htm \
-css3_gradientButton.htm \
-css3_grad-radial.htm \
-css3_mask-grad.htm \
-css3_mask-img.htm \
-css3_multicol.htm \
-css3_reflect.htm \
-css3_scroll.htm \
-css3_sel-nth.htm \
-css3_shadow.htm \
-css3_text-overflow.htm \
-css3_text-shadow.htm \
-css3_text-stroke.htm \
-form_tapper.htm \
-form_toggler.htm \
-_image_assets.htm \
-_index.html \
-layout_link-fmt.htm \
-layout_tbl-keyhole.htm \
-mob_condjs.htm \
-mob_layout.htm \
-mob_mediaquery.htm \
-storage.htm \
-css/anim_accord.css \
-css/anim_demo-rotate.css \
-css/anim_demo-scale.css \
-css/anim_demo-skew.css \
-css/anim_gallery.css \
-css/anim_panel.css \
-css/anim_pulse.css \
-css/anim_skew.css \
-css/anim_slide.css \
-css/anim_tabbedSkew.css \
-css/css3_backgrounds.css \
-css/css3_border-img.css \
-css/css3_gradientBack.css \
-css/css3_gradientBackStop.css \
-css/css3_gradientButton.css \
-css/css3_grad-radial.css \
-css/css3_mask-grad.css \
-css/css3_mask-img.css \
-css/css3_multicol.css \
-css/css3_reflect.css \
-css/css3_scroll.css \
-css/css3_sel-nth.css \
-css/css3_shadowBlur.css \
-css/css3_shadow.css \
-css/css3_text-overflow.css \
-css/css3_text-shadow.css \
-css/css3_text-stroke.css \
-css/form_tapper.css \
-css/form_toggler.css \
-css/layout_link-fmt.css \
-css/layout_tbl-keyhole.css \
-css/mob_condjs.css \
-css/mobile.css \
-css/mob_mediaquery.css \
-css/mq_desktop.css \
-css/mqlayout_desktop.css \
-css/mqlayout_mobile.css \
-css/mqlayout_touch.css \
-css/mq_mobile.css \
-css/mq_touch.css \
-css/storage.css \
-img/border-frame.png \
-img/gal1.jpg \
-img/gal2.jpg \
-img/gal3.jpg \
-img/gal4.jpg \
-img/gal5.jpg \
-img/gal6.jpg \
-img/gal7.jpg \
-img/gal8.jpg \
-img/gradient.jpg \
-img/gray_icon_close.png \
-img/ic_ag_016.png \
-img/ic_ag_032.png \
-img/ic_ag_036.png \
-img/ic_ag_048.png \
-img/ic_al_016.png \
-img/ic_al_032.png \
-img/ic_al_036.png \
-img/ic_al_048.png \
-img/ic_ar_016.png \
-img/ic_ar_032.png \
-img/ic_ar_036.png \
-img/ic_ar_048.png \
-img/ic_b_016.png \
-img/ic_b_032.png \
-img/ic_b_036.png \
-img/ic_b_048.png \
-img/ic_be_016.png \
-img/ic_be_032.png \
-img/ic_be_036.png \
-img/ic_be_048.png \
-img/ic_c_016.png \
-img/ic_c_032.png \
-img/ic_c_036.png \
-img/ic_c_048.png \
-img/ic_ca_016.png \
-img/ic_ca_032.png \
-img/ic_ca_036.png \
-img/ic_ca_048.png \
-img/ic_cl_016.png \
-img/ic_cl_032.png \
-img/ic_cl_036.png \
-img/ic_cl_048.png \
-img/ic_cu_016.png \
-img/ic_cu_032.png \
-img/ic_cu_036.png \
-img/ic_cu_048.png \
-img/ic_f_016.png \
-img/ic_f_032.png \
-img/ic_f_036.png \
-img/ic_f_048.png \
-img/ic_fe_016.png \
-img/ic_fe_032.png \
-img/ic_fe_036.png \
-img/ic_fe_048.png \
-img/ic_h_016.png \
-img/ic_h_032.png \
-img/ic_h_036.png \
-img/ic_h_048.png \
-img/ic_he_016.png \
-img/ic_he_032.png \
-img/ic_he_036.png \
-img/ic_he_048.png \
-img/ic_k_016.png \
-img/ic_k_032.png \
-img/ic_k_036.png \
-img/ic_k_048.png \
-img/ic_li_016.png \
-img/ic_li_032.png \
-img/ic_li_036.png \
-img/ic_li_048.png \
-img/ic_mg_016.png \
-img/ic_mg_032.png \
-img/ic_mg_036.png \
-img/ic_mg_048.png \
-img/ic_n_016.png \
-img/ic_n_032.png \
-img/ic_n_036.png \
-img/ic_n_048.png \
-img/ic_na_016.png \
-img/ic_na_032.png \
-img/ic_na_036.png \
-img/ic_na_048.png \
-img/ic_ne_016.png \
-img/ic_ne_032.png \
-img/ic_ne_036.png \
-img/ic_ne_048.png \
-img/ic_ni_016.png \
-img/ic_ni_032.png \
-img/ic_ni_036.png \
-img/ic_ni_048.png \
-img/ic_o_016.png \
-img/ic_o_032.png \
-img/ic_o_036.png \
-img/ic_o_048.png \
-img/icon_check.png \
-img/icon_check_x24green.png \
-img/icon_dismiss.png \
-img/icon_dismiss_x22.png \
-img/icon_drill-down.png \
-img/icon_drill-down_x32.png \
-img/icon_drill-up.png \
-img/icon_drill-up_x32.png \
-img/icon_expand-nav.png \
-img/icon_head-collapsed.png \
-img/icon_head-collapsed_x13.png \
-img/icon_head-expanded.png \
-img/icon_head-expanded_x13.png \
-img/icon_info.png \
-img/icon_info_x24.png \
-img/icon_link-doc.png \
-img/icon_link-email.png \
-img/icon_link-external.png \
-img/icon_link-pdf.png \
-img/icon_link-ppt.png \
-img/icon_link-rss.png \
-img/icon_link-sms.png \
-img/icon_link-tel.png \
-img/icon_link-xls.png \
-img/icon_list-all_circ.png \
-img/icon_list-all.png \
-img/icon_nav_end.png \
-img/icon_nav-start.png \
-img/icon_nav-top.png \
-img/icon_nav-up.png \
-img/icon_question.png \
-img/icon_scroll-left.png \
-img/icon_scroll-right.png \
-img/icon_trash.png \
-img/ic_pt_016.png \
-img/ic_pt_032.png \
-img/ic_pt_036.png \
-img/ic_pt_048.png \
-img/ic_si_016.png \
-img/ic_si_032.png \
-img/ic_si_036.png \
-img/ic_si_048.png \
-img/ic_zn_016.png \
-img/ic_zn_032.png \
-img/ic_zn_036.png \
-img/ic_zn_048.png \
-img/land1.jpg \
-img/land2.jpg \
-img/land3.jpg \
-img/land4.jpg \
-img/land5.jpg \
-img/land6.jpg \
-img/land7.jpg \
-img/land8.jpg \
-img/mask.png \
-img/tnail_gal1.png \
-img/tnail_gal2.png \
-img/tnail_gal3.png \
-img/tnail_gal4.png \
-img/tnail_gal5.png \
-img/tnail_gal6.png \
-img/tnail_gal7.png \
-img/tnail_gal8.png \
-js/anim_accord.js \
-js/anim_gallery.js \
-js/anim_panel.js \
-js/anim_skew.js \
-js/css3_backgrounds.js \
-js/css3_border-img.js \
-js/css3_grad-radial.js \
-js/css3_mask-grad.js \
-js/css3_mask-img.js \
-js/css3_text-overflow.js \
-js/form_tapper.js \
-js/mob_condjs.js \
-js/mobile.js \
-js/storage.js \
diff --git a/examples/widgets/desktop/screenshot/main.cpp b/examples/widgets/desktop/screenshot/main.cpp
index 788ebb3532..811562858a 100644
--- a/examples/widgets/desktop/screenshot/main.cpp
+++ b/examples/widgets/desktop/screenshot/main.cpp
@@ -39,13 +39,16 @@
****************************************************************************/
#include <QApplication>
+#include <QDesktopWidget>
#include "screenshot.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
+
Screenshot screenshot;
+ screenshot.move(QApplication::desktop()->availableGeometry(&screenshot).topLeft() + QPoint(20, 20));
screenshot.show();
return app.exec();
}
diff --git a/examples/widgets/desktop/screenshot/screenshot.cpp b/examples/widgets/desktop/screenshot/screenshot.cpp
index bfca5a45ae..354fe36369 100644
--- a/examples/widgets/desktop/screenshot/screenshot.cpp
+++ b/examples/widgets/desktop/screenshot/screenshot.cpp
@@ -44,20 +44,48 @@
//! [0]
Screenshot::Screenshot()
+ : screenshotLabel(new QLabel(this))
{
- screenshotLabel = new QLabel;
screenshotLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
screenshotLabel->setAlignment(Qt::AlignCenter);
- screenshotLabel->setMinimumSize(240, 160);
- createOptionsGroupBox();
- createButtonsLayout();
+ const QRect screenGeometry = QApplication::desktop()->screenGeometry(this);
+ screenshotLabel->setMinimumSize(screenGeometry.width() / 8, screenGeometry.height() / 8);
- mainLayout = new QVBoxLayout;
+ QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->addWidget(screenshotLabel);
+
+ QGroupBox *optionsGroupBox = new QGroupBox(tr("Options"), this);
+ delaySpinBox = new QSpinBox(optionsGroupBox);
+ delaySpinBox->setSuffix(tr(" s"));
+ delaySpinBox->setMaximum(60);
+
+ typedef void (QSpinBox::*QSpinBoxIntSignal)(int);
+ connect(delaySpinBox, static_cast<QSpinBoxIntSignal>(&QSpinBox::valueChanged),
+ this, &Screenshot::updateCheckBox);
+
+ hideThisWindowCheckBox = new QCheckBox(tr("Hide This Window"), optionsGroupBox);
+
+ QGridLayout *optionsGroupBoxLayout = new QGridLayout(optionsGroupBox);
+ optionsGroupBoxLayout->addWidget(new QLabel(tr("Screenshot Delay:"), this), 0, 0);
+ optionsGroupBoxLayout->addWidget(delaySpinBox, 0, 1);
+ optionsGroupBoxLayout->addWidget(hideThisWindowCheckBox, 1, 0, 1, 2);
+
mainLayout->addWidget(optionsGroupBox);
+
+ QHBoxLayout *buttonsLayout = new QHBoxLayout;
+ newScreenshotButton = new QPushButton(tr("New Screenshot"), this);
+ connect(newScreenshotButton, &QPushButton::clicked, this, &Screenshot::newScreenshot);
+ buttonsLayout->addWidget(newScreenshotButton);
+ QPushButton *saveScreenshotButton = new QPushButton(tr("Save Screenshot"), this);
+ connect(saveScreenshotButton, &QPushButton::clicked, this, &Screenshot::saveScreenshot);
+ buttonsLayout->addWidget(saveScreenshotButton);
+ QPushButton *quitScreenshotButton = new QPushButton(tr("Quit"), this);
+ quitScreenshotButton->setShortcut(Qt::CTRL + Qt::Key_Q);
+ connect(quitScreenshotButton, &QPushButton::clicked, this, &QWidget::close);
+ buttonsLayout->addWidget(quitScreenshotButton);
+ buttonsLayout->addStretch();
mainLayout->addLayout(buttonsLayout);
- setLayout(mainLayout);
shootScreen();
delaySpinBox->setValue(5);
@@ -84,44 +112,59 @@ void Screenshot::newScreenshot()
hide();
newScreenshotButton->setDisabled(true);
- QTimer::singleShot(delaySpinBox->value() * 1000, this, SLOT(shootScreen()));
+ QTimer::singleShot(delaySpinBox->value() * 1000, this, &Screenshot::shootScreen);
}
//! [2]
//! [3]
void Screenshot::saveScreenshot()
{
- QString format = "png";
- QString initialPath = QDir::currentPath() + tr("/untitled.") + format;
-
- QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"), initialPath,
- tr("%1 Files (*.%2);;All Files (*)")
- .arg(format.toUpper())
- .arg(format));
- if (!fileName.isEmpty())
- originalPixmap.save(fileName, format.toLatin1().constData());
+ const QString format = "png";
+ QString initialPath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
+ if (initialPath.isEmpty())
+ initialPath = QDir::currentPath();
+ initialPath += tr("/untitled.") + format;
+
+ QFileDialog fileDialog(this, tr("Save As"), initialPath);
+ fileDialog.setAcceptMode(QFileDialog::AcceptSave);
+ fileDialog.setFileMode(QFileDialog::AnyFile);
+ fileDialog.setDirectory(initialPath);
+ QStringList mimeTypes;
+ foreach (const QByteArray &bf, QImageWriter::supportedMimeTypes())
+ mimeTypes.append(QLatin1String(bf));
+ fileDialog.setMimeTypeFilters(mimeTypes);
+ fileDialog.selectMimeTypeFilter("image/" + format);
+ fileDialog.setDefaultSuffix(format);
+ if (fileDialog.exec() != QDialog::Accepted)
+ return;
+ const QString fileName = fileDialog.selectedFiles().first();
+ if (!originalPixmap.save(fileName)) {
+ QMessageBox::warning(this, tr("Save Error"), tr("The image could not be saved to \"%1\".")
+ .arg(QDir::toNativeSeparators(fileName)));
+ }
}
//! [3]
//! [4]
void Screenshot::shootScreen()
{
- if (delaySpinBox->value() != 0)
- qApp->beep();
-//! [4]
- originalPixmap = QPixmap(); // clear image for low memory situations
- // on embedded devices.
-//! [5]
QScreen *screen = QGuiApplication::primaryScreen();
- if (screen)
- originalPixmap = screen->grabWindow(0);
+ if (const QWindow *window = windowHandle())
+ screen = window->screen();
+ if (!screen)
+ return;
+
+ if (delaySpinBox->value() != 0)
+ QApplication::beep();
+
+ originalPixmap = screen->grabWindow(0);
updateScreenshotLabel();
newScreenshotButton->setDisabled(false);
if (hideThisWindowCheckBox->isChecked())
show();
}
-//! [5]
+//! [4]
//! [6]
void Screenshot::updateCheckBox()
@@ -135,52 +178,6 @@ void Screenshot::updateCheckBox()
}
//! [6]
-//! [7]
-void Screenshot::createOptionsGroupBox()
-{
- optionsGroupBox = new QGroupBox(tr("Options"));
-
- delaySpinBox = new QSpinBox;
- delaySpinBox->setSuffix(tr(" s"));
- delaySpinBox->setMaximum(60);
- connect(delaySpinBox, SIGNAL(valueChanged(int)), this, SLOT(updateCheckBox()));
-
- delaySpinBoxLabel = new QLabel(tr("Screenshot Delay:"));
-
- hideThisWindowCheckBox = new QCheckBox(tr("Hide This Window"));
-
- optionsGroupBoxLayout = new QGridLayout;
- optionsGroupBoxLayout->addWidget(delaySpinBoxLabel, 0, 0);
- optionsGroupBoxLayout->addWidget(delaySpinBox, 0, 1);
- optionsGroupBoxLayout->addWidget(hideThisWindowCheckBox, 1, 0, 1, 2);
- optionsGroupBox->setLayout(optionsGroupBoxLayout);
-}
-//! [7]
-
-//! [8]
-void Screenshot::createButtonsLayout()
-{
- newScreenshotButton = createButton(tr("New Screenshot"), this, SLOT(newScreenshot()));
- saveScreenshotButton = createButton(tr("Save Screenshot"), this, SLOT(saveScreenshot()));
- quitScreenshotButton = createButton(tr("Quit"), this, SLOT(close()));
-
- buttonsLayout = new QHBoxLayout;
- buttonsLayout->addStretch();
- buttonsLayout->addWidget(newScreenshotButton);
- buttonsLayout->addWidget(saveScreenshotButton);
- buttonsLayout->addWidget(quitScreenshotButton);
-}
-//! [8]
-
-//! [9]
-QPushButton *Screenshot::createButton(const QString &text, QWidget *receiver,
- const char *member)
-{
- QPushButton *button = new QPushButton(text);
- button->connect(button, SIGNAL(clicked()), receiver, member);
- return button;
-}
-//! [9]
//! [10]
void Screenshot::updateScreenshotLabel()
diff --git a/examples/widgets/desktop/screenshot/screenshot.h b/examples/widgets/desktop/screenshot/screenshot.h
index 352806cdba..f0e737e4c7 100644
--- a/examples/widgets/desktop/screenshot/screenshot.h
+++ b/examples/widgets/desktop/screenshot/screenshot.h
@@ -73,25 +73,14 @@ private slots:
void updateCheckBox();
private:
- void createOptionsGroupBox();
- void createButtonsLayout();
- QPushButton *createButton(const QString &text, QWidget *receiver, const char *member);
void updateScreenshotLabel();
QPixmap originalPixmap;
QLabel *screenshotLabel;
- QGroupBox *optionsGroupBox;
QSpinBox *delaySpinBox;
- QLabel *delaySpinBoxLabel;
QCheckBox *hideThisWindowCheckBox;
QPushButton *newScreenshotButton;
- QPushButton *saveScreenshotButton;
- QPushButton *quitScreenshotButton;
-
- QVBoxLayout *mainLayout;
- QGridLayout *optionsGroupBoxLayout;
- QHBoxLayout *buttonsLayout;
};
//! [0]
diff --git a/examples/widgets/desktop/systray/doc/src/systray.qdoc b/examples/widgets/desktop/systray/doc/src/systray.qdoc
index 074012b6a7..fa2dbb2721 100644
--- a/examples/widgets/desktop/systray/doc/src/systray.qdoc
+++ b/examples/widgets/desktop/systray/doc/src/systray.qdoc
@@ -173,7 +173,11 @@
We have reimplemented the QWidget::closeEvent() event handler to
receive widget close events, showing the above message to the
- users when they are closing the editor window.
+ users when they are closing the editor window. On OS X we need to
+ avoid showing the message and accepting the close event when the
+ user really intends to quit the application, that is, when the
+ user has triggered "Quit" in the menu bar or pressed the Command+Q
+ shortcut.
In addition to the functions and slots discussed above, we have
also implemented several convenience functions to simplify the
diff --git a/examples/widgets/desktop/systray/window.cpp b/examples/widgets/desktop/systray/window.cpp
index b212dc440d..d499f498af 100644
--- a/examples/widgets/desktop/systray/window.cpp
+++ b/examples/widgets/desktop/systray/window.cpp
@@ -42,11 +42,11 @@
#ifndef QT_NO_SYSTEMTRAYICON
-#include <QtGui>
-
#include <QAction>
#include <QCheckBox>
#include <QComboBox>
+#include <QCoreApplication>
+#include <QCloseEvent>
#include <QGroupBox>
#include <QLabel>
#include <QLineEdit>
@@ -68,12 +68,13 @@ Window::Window()
createActions();
createTrayIcon();
- connect(showMessageButton, SIGNAL(clicked()), this, SLOT(showMessage()));
- connect(showIconCheckBox, SIGNAL(toggled(bool)), trayIcon, SLOT(setVisible(bool)));
- connect(iconComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setIcon(int)));
- connect(trayIcon, SIGNAL(messageClicked()), this, SLOT(messageClicked()));
- connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
- this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
+ connect(showMessageButton, &QAbstractButton::clicked, this, &Window::showMessage);
+ connect(showIconCheckBox, &QAbstractButton::toggled, trayIcon, &QSystemTrayIcon::setVisible);
+ typedef void (QComboBox::*QComboIntSignal)(int);
+ connect(iconComboBox, static_cast<QComboIntSignal>(&QComboBox::currentIndexChanged),
+ this, &Window::setIcon);
+ connect(trayIcon, &QSystemTrayIcon::messageClicked, this, &Window::messageClicked);
+ connect(trayIcon, &QSystemTrayIcon::activated, this, &Window::iconActivated);
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addWidget(iconGroupBox);
@@ -101,6 +102,11 @@ void Window::setVisible(bool visible)
//! [2]
void Window::closeEvent(QCloseEvent *event)
{
+#ifdef Q_OS_OSX
+ if (!event->spontaneous() || !isVisible()) {
+ return;
+ }
+#endif
if (trayIcon->isVisible()) {
QMessageBox::information(this, tr("Systray"),
tr("The program will keep running in the "
@@ -245,16 +251,16 @@ void Window::createMessageGroupBox()
void Window::createActions()
{
minimizeAction = new QAction(tr("Mi&nimize"), this);
- connect(minimizeAction, SIGNAL(triggered()), this, SLOT(hide()));
+ connect(minimizeAction, &QAction::triggered, this, &QWidget::hide);
maximizeAction = new QAction(tr("Ma&ximize"), this);
- connect(maximizeAction, SIGNAL(triggered()), this, SLOT(showMaximized()));
+ connect(maximizeAction, &QAction::triggered, this, &QWidget::showMaximized);
restoreAction = new QAction(tr("&Restore"), this);
- connect(restoreAction, SIGNAL(triggered()), this, SLOT(showNormal()));
+ connect(restoreAction, &QAction::triggered, this, &QWidget::showNormal);
quitAction = new QAction(tr("&Quit"), this);
- connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
+ connect(quitAction, &QAction::triggered, qApp, &QCoreApplication::quit);
}
void Window::createTrayIcon()
diff --git a/examples/widgets/dialogs/classwizard/classwizard.cpp b/examples/widgets/dialogs/classwizard/classwizard.cpp
index 0f1a2a0869..d3e366efe6 100644
--- a/examples/widgets/dialogs/classwizard/classwizard.cpp
+++ b/examples/widgets/dialogs/classwizard/classwizard.cpp
@@ -79,31 +79,31 @@ void ClassWizard::accept()
if (field("comment").toBool()) {
block += "/*\n";
- block += " " + header.toLatin1() + "\n";
+ block += " " + header.toLatin1() + '\n';
block += "*/\n";
- block += "\n";
+ block += '\n';
}
if (field("protect").toBool()) {
- block += "#ifndef " + macroName + "\n";
- block += "#define " + macroName + "\n";
- block += "\n";
+ block += "#ifndef " + macroName + '\n';
+ block += "#define " + macroName + '\n';
+ block += '\n';
}
if (field("includeBase").toBool()) {
- block += "#include " + baseInclude + "\n";
- block += "\n";
+ block += "#include " + baseInclude + '\n';
+ block += '\n';
}
block += "class " + className;
if (!baseClass.isEmpty())
block += " : public " + baseClass;
- block += "\n";
+ block += '\n';
block += "{\n";
/* qmake ignore Q_OBJECT */
if (field("qobjectMacro").toBool()) {
block += " Q_OBJECT\n";
- block += "\n";
+ block += '\n';
}
block += "public:\n";
@@ -115,7 +115,7 @@ void ClassWizard::accept()
block += " " + className + "();\n";
if (field("copyCtor").toBool()) {
block += " " + className + "(const " + className + " &other);\n";
- block += "\n";
+ block += '\n';
block += " " + className + " &operator=" + "(const " + className
+ " &other);\n";
}
@@ -123,11 +123,11 @@ void ClassWizard::accept()
block += "};\n";
if (field("protect").toBool()) {
- block += "\n";
+ block += '\n';
block += "#endif\n";
}
- QFile headerFile(outputDir + "/" + header);
+ QFile headerFile(outputDir + '/' + header);
if (!headerFile.open(QFile::WriteOnly | QFile::Text)) {
QMessageBox::warning(0, QObject::tr("Simple Wizard"),
QObject::tr("Cannot write file %1:\n%2")
@@ -141,12 +141,12 @@ void ClassWizard::accept()
if (field("comment").toBool()) {
block += "/*\n";
- block += " " + implementation.toLatin1() + "\n";
+ block += " " + implementation.toLatin1() + '\n';
block += "*/\n";
- block += "\n";
+ block += '\n';
}
block += "#include \"" + header.toLatin1() + "\"\n";
- block += "\n";
+ block += '\n';
if (field("qobjectCtor").toBool()) {
block += className + "::" + className + "(QObject *parent)\n";
@@ -171,7 +171,7 @@ void ClassWizard::accept()
block += "{\n";
block += " *this = other;\n";
block += "}\n";
- block += "\n";
+ block += '\n';
block += className + " &" + className + "::operator=(const "
+ className + " &other)\n";
block += "{\n";
@@ -183,7 +183,7 @@ void ClassWizard::accept()
}
}
- QFile implementationFile(outputDir + "/" + implementation);
+ QFile implementationFile(outputDir + '/' + implementation);
if (!implementationFile.open(QFile::WriteOnly | QFile::Text)) {
QMessageBox::warning(0, QObject::tr("Simple Wizard"),
QObject::tr("Cannot write file %1:\n%2")
@@ -252,8 +252,8 @@ ClassInfoPage::ClassInfoPage(QWidget *parent)
defaultCtorRadioButton->setChecked(true);
- connect(defaultCtorRadioButton, SIGNAL(toggled(bool)),
- copyCtorCheckBox, SLOT(setEnabled(bool)));
+ connect(defaultCtorRadioButton, &QAbstractButton::toggled,
+ copyCtorCheckBox, &QWidget::setEnabled);
//! [11] //! [12]
registerField("className*", classNameLineEdit);
@@ -311,14 +311,14 @@ CodeStylePage::CodeStylePage(QWidget *parent)
baseIncludeLineEdit = new QLineEdit;
baseIncludeLabel->setBuddy(baseIncludeLineEdit);
- connect(protectCheckBox, SIGNAL(toggled(bool)),
- macroNameLabel, SLOT(setEnabled(bool)));
- connect(protectCheckBox, SIGNAL(toggled(bool)),
- macroNameLineEdit, SLOT(setEnabled(bool)));
- connect(includeBaseCheckBox, SIGNAL(toggled(bool)),
- baseIncludeLabel, SLOT(setEnabled(bool)));
- connect(includeBaseCheckBox, SIGNAL(toggled(bool)),
- baseIncludeLineEdit, SLOT(setEnabled(bool)));
+ connect(protectCheckBox, &QAbstractButton::toggled,
+ macroNameLabel, &QWidget::setEnabled);
+ connect(protectCheckBox, &QAbstractButton::toggled,
+ macroNameLineEdit, &QWidget::setEnabled);
+ connect(includeBaseCheckBox, &QAbstractButton::toggled,
+ baseIncludeLabel, &QWidget::setEnabled);
+ connect(includeBaseCheckBox, &QAbstractButton::toggled,
+ baseIncludeLineEdit, &QWidget::setEnabled);
registerField("comment", commentCheckBox);
registerField("protect", protectCheckBox);
@@ -356,9 +356,9 @@ void CodeStylePage::initializePage()
if (baseClass.isEmpty()) {
baseIncludeLineEdit->clear();
} else if (QRegExp("Q[A-Z].*").exactMatch(baseClass)) {
- baseIncludeLineEdit->setText("<" + baseClass + ">");
+ baseIncludeLineEdit->setText('<' + baseClass + '>');
} else {
- baseIncludeLineEdit->setText("\"" + baseClass.toLower() + ".h\"");
+ baseIncludeLineEdit->setText('"' + baseClass.toLower() + ".h\"");
}
}
//! [16]
diff --git a/examples/widgets/dialogs/configdialog/configdialog.cpp b/examples/widgets/dialogs/configdialog/configdialog.cpp
index 8e68940227..c4565a6407 100644
--- a/examples/widgets/dialogs/configdialog/configdialog.cpp
+++ b/examples/widgets/dialogs/configdialog/configdialog.cpp
@@ -62,7 +62,7 @@ ConfigDialog::ConfigDialog()
createIcons();
contentsWidget->setCurrentRow(0);
- connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
+ connect(closeButton, &QAbstractButton::clicked, this, &QWidget::close);
QHBoxLayout *horizontalLayout = new QHBoxLayout;
horizontalLayout->addWidget(contentsWidget);
@@ -102,9 +102,7 @@ void ConfigDialog::createIcons()
queryButton->setTextAlignment(Qt::AlignHCenter);
queryButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
- connect(contentsWidget,
- SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)),
- this, SLOT(changePage(QListWidgetItem*,QListWidgetItem*)));
+ connect(contentsWidget, &QListWidget::currentItemChanged, this, &ConfigDialog::changePage);
}
void ConfigDialog::changePage(QListWidgetItem *current, QListWidgetItem *previous)
diff --git a/examples/widgets/dialogs/extension/finddialog.cpp b/examples/widgets/dialogs/extension/finddialog.cpp
index 19eab195cb..895b0cf2ce 100644
--- a/examples/widgets/dialogs/extension/finddialog.cpp
+++ b/examples/widgets/dialogs/extension/finddialog.cpp
@@ -78,7 +78,7 @@ FindDialog::FindDialog(QWidget *parent)
buttonBox->addButton(findButton, QDialogButtonBox::ActionRole);
buttonBox->addButton(moreButton, QDialogButtonBox::ActionRole);
- connect(moreButton, SIGNAL(toggled(bool)), extension, SLOT(setVisible(bool)));
+ connect(moreButton, &QAbstractButton::toggled, extension, &QWidget::setVisible);
QVBoxLayout *extensionLayout = new QVBoxLayout;
extensionLayout->setMargin(0);
diff --git a/examples/widgets/dialogs/findfiles/window.cpp b/examples/widgets/dialogs/findfiles/window.cpp
index 86c34a6352..780c398ad5 100644
--- a/examples/widgets/dialogs/findfiles/window.cpp
+++ b/examples/widgets/dialogs/findfiles/window.cpp
@@ -46,8 +46,10 @@
Window::Window(QWidget *parent)
: QWidget(parent)
{
- browseButton = createButton(tr("&Browse..."), SLOT(browse()));
- findButton = createButton(tr("&Find"), SLOT(find()));
+ browseButton = new QPushButton(tr("&Browse..."), this);
+ connect(browseButton, &QAbstractButton::clicked, this, &Window::browse);
+ findButton = new QPushButton(tr("&Find"), this);
+ connect(findButton, &QAbstractButton::clicked, this, &Window::find);
fileComboBox = createComboBox(tr("*"));
textComboBox = createComboBox();
@@ -195,15 +197,6 @@ void Window::showFiles(const QStringList &files)
}
//! [8]
-//! [9]
-QPushButton *Window::createButton(const QString &text, const char *member)
-{
- QPushButton *button = new QPushButton(text);
- connect(button, SIGNAL(clicked()), this, member);
- return button;
-}
-//! [9]
-
//! [10]
QComboBox *Window::createComboBox(const QString &text)
{
@@ -228,8 +221,8 @@ void Window::createFilesTable()
filesTable->verticalHeader()->hide();
filesTable->setShowGrid(false);
- connect(filesTable, SIGNAL(cellActivated(int,int)),
- this, SLOT(openFileOfItem(int,int)));
+ connect(filesTable, &QTableWidget::cellActivated,
+ this, &Window::openFileOfItem);
}
//! [11]
diff --git a/examples/widgets/dialogs/findfiles/window.h b/examples/widgets/dialogs/findfiles/window.h
index 281c932e2f..89dd87b83b 100644
--- a/examples/widgets/dialogs/findfiles/window.h
+++ b/examples/widgets/dialogs/findfiles/window.h
@@ -68,7 +68,6 @@ private slots:
private:
QStringList findFiles(const QStringList &files, const QString &text);
void showFiles(const QStringList &files);
- QPushButton *createButton(const QString &text, const char *member);
QComboBox *createComboBox(const QString &text = QString());
void createFilesTable();
diff --git a/examples/widgets/dialogs/licensewizard/licensewizard.cpp b/examples/widgets/dialogs/licensewizard/licensewizard.cpp
index ace2e1229a..0f11f3ab7b 100644
--- a/examples/widgets/dialogs/licensewizard/licensewizard.cpp
+++ b/examples/widgets/dialogs/licensewizard/licensewizard.cpp
@@ -70,7 +70,7 @@ LicenseWizard::LicenseWizard(QWidget *parent)
setPixmap(QWizard::LogoPixmap, QPixmap(":/images/logo.png"));
//! [7]
- connect(this, SIGNAL(helpRequested()), this, SLOT(showHelp()));
+ connect(this, &QWizard::helpRequested, this, &LicenseWizard::showHelp);
//! [7]
setWindowTitle(tr("License Wizard"));
@@ -339,13 +339,13 @@ void ConclusionPage::setVisible(bool visible)
//! [29]
wizard()->setButtonText(QWizard::CustomButton1, tr("&Print"));
wizard()->setOption(QWizard::HaveCustomButton1, true);
- connect(wizard(), SIGNAL(customButtonClicked(int)),
- this, SLOT(printButtonClicked()));
+ connect(wizard(), &QWizard::customButtonClicked,
+ this, &ConclusionPage::printButtonClicked);
//! [29]
} else {
wizard()->setOption(QWizard::HaveCustomButton1, false);
- disconnect(wizard(), SIGNAL(customButtonClicked(int)),
- this, SLOT(printButtonClicked()));
+ disconnect(wizard(), &QWizard::customButtonClicked,
+ this, &ConclusionPage::printButtonClicked);
}
}
//! [28]
diff --git a/examples/widgets/dialogs/sipdialog/dialog.cpp b/examples/widgets/dialogs/sipdialog/dialog.cpp
index f57cd094ae..48859ec5ff 100644
--- a/examples/widgets/dialogs/sipdialog/dialog.cpp
+++ b/examples/widgets/dialogs/sipdialog/dialog.cpp
@@ -89,10 +89,9 @@ Dialog::Dialog()
//! [Dialog constructor part4]
//! [Dialog constructor part5]
- connect(button, SIGNAL(clicked()),
- qApp, SLOT(closeAllWindows()));
- connect(QApplication::desktop(), SIGNAL(workAreaResized(int)),
- this, SLOT(desktopResized(int)));
+ connect(button, &QAbstractButton::clicked, qApp, &QApplication::closeAllWindows);
+ connect(QApplication::desktop(), &QDesktopWidget::workAreaResized,
+ this, &Dialog::desktopResized);
}
//! [Dialog constructor part5]
diff --git a/examples/widgets/dialogs/standarddialogs/dialog.cpp b/examples/widgets/dialogs/standarddialogs/dialog.cpp
index 0a1532616c..b4232c36f6 100644
--- a/examples/widgets/dialogs/standarddialogs/dialog.cpp
+++ b/examples/widgets/dialogs/standarddialogs/dialog.cpp
@@ -180,27 +180,27 @@ Dialog::Dialog(QWidget *parent)
QPushButton *errorButton =
new QPushButton(tr("QErrorMessage::showM&essage()"));
- connect(integerButton, SIGNAL(clicked()), this, SLOT(setInteger()));
- connect(doubleButton, SIGNAL(clicked()), this, SLOT(setDouble()));
- connect(itemButton, SIGNAL(clicked()), this, SLOT(setItem()));
- connect(textButton, SIGNAL(clicked()), this, SLOT(setText()));
- connect(multiLineTextButton, SIGNAL(clicked()), this, SLOT(setMultiLineText()));
- connect(colorButton, SIGNAL(clicked()), this, SLOT(setColor()));
- connect(fontButton, SIGNAL(clicked()), this, SLOT(setFont()));
- connect(directoryButton, SIGNAL(clicked()),
- this, SLOT(setExistingDirectory()));
- connect(openFileNameButton, SIGNAL(clicked()),
- this, SLOT(setOpenFileName()));
- connect(openFileNamesButton, SIGNAL(clicked()),
- this, SLOT(setOpenFileNames()));
- connect(saveFileNameButton, SIGNAL(clicked()),
- this, SLOT(setSaveFileName()));
- connect(criticalButton, SIGNAL(clicked()), this, SLOT(criticalMessage()));
- connect(informationButton, SIGNAL(clicked()),
- this, SLOT(informationMessage()));
- connect(questionButton, SIGNAL(clicked()), this, SLOT(questionMessage()));
- connect(warningButton, SIGNAL(clicked()), this, SLOT(warningMessage()));
- connect(errorButton, SIGNAL(clicked()), this, SLOT(errorMessage()));
+ connect(integerButton, &QAbstractButton::clicked, this, &Dialog::setInteger);
+ connect(doubleButton, &QAbstractButton::clicked, this, &Dialog::setDouble);
+ connect(itemButton, &QAbstractButton::clicked, this, &Dialog::setItem);
+ connect(textButton, &QAbstractButton::clicked, this, &Dialog::setText);
+ connect(multiLineTextButton, &QAbstractButton::clicked, this, &Dialog::setMultiLineText);
+ connect(colorButton, &QAbstractButton::clicked, this, &Dialog::setColor);
+ connect(fontButton, &QAbstractButton::clicked, this, &Dialog::setFont);
+ connect(directoryButton, &QAbstractButton::clicked,
+ this, &Dialog::setExistingDirectory);
+ connect(openFileNameButton, &QAbstractButton::clicked,
+ this, &Dialog::setOpenFileName);
+ connect(openFileNamesButton, &QAbstractButton::clicked,
+ this, &Dialog::setOpenFileNames);
+ connect(saveFileNameButton, &QAbstractButton::clicked,
+ this, &Dialog::setSaveFileName);
+ connect(criticalButton, &QAbstractButton::clicked, this, &Dialog::criticalMessage);
+ connect(informationButton, &QAbstractButton::clicked,
+ this, &Dialog::informationMessage);
+ connect(questionButton, &QAbstractButton::clicked, this, &Dialog::questionMessage);
+ connect(warningButton, &QAbstractButton::clicked, this, &Dialog::warningMessage);
+ connect(errorButton, &QAbstractButton::clicked, this, &Dialog::errorMessage);
QWidget *page = new QWidget;
QGridLayout *layout = new QGridLayout(page);
@@ -242,6 +242,10 @@ Dialog::Dialog(QWidget *parent)
layout->addWidget(fontLabel, 0, 1);
fontDialogOptionsWidget = new DialogOptionsWidget;
fontDialogOptionsWidget->addCheckBox(doNotUseNativeDialog, QFontDialog::DontUseNativeDialog);
+ fontDialogOptionsWidget->addCheckBox(tr("Show scalable fonts"), QFontDialog::ScalableFonts);
+ fontDialogOptionsWidget->addCheckBox(tr("Show non scalable fonts"), QFontDialog::NonScalableFonts);
+ fontDialogOptionsWidget->addCheckBox(tr("Show monospaced fonts"), QFontDialog::MonospacedFonts);
+ fontDialogOptionsWidget->addCheckBox(tr("Show proportional fonts"), QFontDialog::ProportionalFonts);
fontDialogOptionsWidget->addCheckBox(tr("No buttons") , QFontDialog::NoButtons);
layout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding), 1, 0);
layout->addWidget(fontDialogOptionsWidget, 2, 0, 1 ,2);
@@ -266,6 +270,7 @@ Dialog::Dialog(QWidget *parent)
fileDialogOptionsWidget->addCheckBox(tr("Do not use sheet"), QFileDialog::DontUseSheet);
fileDialogOptionsWidget->addCheckBox(tr("Readonly"), QFileDialog::ReadOnly);
fileDialogOptionsWidget->addCheckBox(tr("Hide name filter details"), QFileDialog::HideNameFilterDetails);
+ fileDialogOptionsWidget->addCheckBox(tr("Do not use custom directory icons (Windows)"), QFileDialog::DontUseCustomDirectoryIcons);
layout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding), 4, 0);
layout->addWidget(fileDialogOptionsWidget, 5, 0, 1 ,2);
toolbox->addItem(page, tr("File Dialogs"));
diff --git a/examples/widgets/dialogs/standarddialogs/main.cpp b/examples/widgets/dialogs/standarddialogs/main.cpp
index eafd2271df..a13e37905c 100644
--- a/examples/widgets/dialogs/standarddialogs/main.cpp
+++ b/examples/widgets/dialogs/standarddialogs/main.cpp
@@ -39,6 +39,7 @@
****************************************************************************/
#include <QApplication>
+#include <QDesktopWidget>
#include <QTranslator>
#include <QLocale>
#include <QLibraryInfo>
@@ -58,6 +59,10 @@ int main(int argc, char *argv[])
#endif
Dialog dialog;
+ const QRect availableGeometry = QApplication::desktop()->availableGeometry(&dialog);
+ dialog.resize(availableGeometry.width() / 3, availableGeometry.height() * 2 / 3);
+ dialog.move((availableGeometry.width() - dialog.width()) / 2,
+ (availableGeometry.height() - dialog.height()) / 2);
dialog.show();
return app.exec();
diff --git a/examples/widgets/dialogs/tabdialog/tabdialog.cpp b/examples/widgets/dialogs/tabdialog/tabdialog.cpp
index ec1a6efbc8..75a7b85e3b 100644
--- a/examples/widgets/dialogs/tabdialog/tabdialog.cpp
+++ b/examples/widgets/dialogs/tabdialog/tabdialog.cpp
@@ -59,8 +59,8 @@ TabDialog::TabDialog(const QString &fileName, QWidget *parent)
//! [1] //! [3]
| QDialogButtonBox::Cancel);
- connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
- connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
+ connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
//! [2] //! [3]
//! [4]
diff --git a/examples/widgets/doc/images/regularexpression-example.png b/examples/widgets/doc/images/regularexpression-example.png
new file mode 100644
index 0000000000..d426d8514a
--- /dev/null
+++ b/examples/widgets/doc/images/regularexpression-example.png
Binary files differ
diff --git a/examples/widgets/doc/images/systemtray-editor.png b/examples/widgets/doc/images/systemtray-editor.png
new file mode 100644
index 0000000000..fb15dea8cb
--- /dev/null
+++ b/examples/widgets/doc/images/systemtray-editor.png
Binary files differ
diff --git a/examples/widgets/doc/images/systemtray-example.png b/examples/widgets/doc/images/systemtray-example.png
new file mode 100644
index 0000000000..98b5c8133e
--- /dev/null
+++ b/examples/widgets/doc/images/systemtray-example.png
Binary files differ
diff --git a/examples/widgets/doc/src/application.qdoc b/examples/widgets/doc/src/application.qdoc
index ac32c592fc..cd284ecba0 100644
--- a/examples/widgets/doc/src/application.qdoc
+++ b/examples/widgets/doc/src/application.qdoc
@@ -50,11 +50,10 @@
To keep the example simple, recently opened files aren't shown in
the \uicontrol{File} menu, even though this feature is desired in 90%
- of applications. The \l{mainwindows/recentfiles}{Recent Files}
- example shows how to implement this. Furthermore, this example
- can only load one file at a time. The \l{mainwindows/sdi}{SDI}
- and \l{mainwindows/mdi}{MDI} examples shows how to lift these
- restrictions.
+ of applications. Furthermore, this example can only load one file at a
+ time. The \l{mainwindows/sdi}{SDI} and \l{mainwindows/mdi}{MDI} examples
+ show how to lift these restrictions and how to implement recently opened files
+ handling.
\section1 MainWindow Class Definition
@@ -96,8 +95,7 @@
the widget that occupies the central area of the main window,
between the toolbars and the status bar.
- Then we call \c createActions(), \c createMenus(), \c
- createToolBars(), and \c createStatusBar(), four private
+ Then we call \c createActions() and \c createStatusBar(), two private
functions that set up the user interface. After that, we call \c
readSettings() to restore the user's preferences.
@@ -184,7 +182,8 @@
\snippet mainwindows/application/mainwindow.cpp 22
The \c createActions() private function, which is called from the
- \c MainWindow constructor, creates \l{QAction}s. The code is very
+ \c MainWindow constructor, creates \l{QAction}s and populates
+ the menus and two toolbars. The code is very
repetitive, so we show only the actions corresponding to
\uicontrol{File|New}, \uicontrol{File|Open}, and \uicontrol{Help|About Qt}.
@@ -198,13 +197,27 @@
a "What's This?" text, and more. It emits a
\l{QAction::triggered()}{triggered()} signal whenever the user
invokes the action (e.g., by clicking the associated menu item or
- toolbar button). We connect this signal to a slot that performs
- the actual action.
+ toolbar button).
+
+ Instances of QAction can be created by passing a parent QObject or
+ by using one of the convenience functions of QMenu, QMenuBar or QToolBar.
+ We create the actions that are in a menu as well as in a toolbar
+ parented on the window to prevent ownership issues. For actions
+ that are only in the menu, we use the convenience function
+ QMenu::addAction(), which allows us to pass text, icon and the
+ target object and its slot member function.
+
+ Creating toolbars is very similar to creating menus. The same
+ actions that we put in the menus can be reused in the toolbars.
+ After creating the action, we add it to the toolbar using
+ QToolBar::addAction().
The code above contains one more idiom that must be explained.
For some of the actions, we specify an icon as a QIcon to the
- QAction constructor. The QIcon constructor takes the file name
- of an image that it tries to load. Here, the file name starts
+ QAction constructor. We use QIcon::fromTheme() to obtain
+ the correct standard icon from the underlying window system.
+ If that fails due to the platform not supporting it, we
+ pass a file name as fallback. Here, the file name starts
with \c{:}. Such file names aren't ordinary file names, but
rather path in the executable's stored resources. We'll come back
to this when we review the \c application.qrc file that's part of
@@ -219,30 +232,12 @@
the QAction::setEnabled() slot, ensuring that the actions are
disabled when the text editor has no selection.
- \snippet mainwindows/application/mainwindow.cpp 25
- \snippet mainwindows/application/mainwindow.cpp 27
-
- Creating actions isn't sufficient to make them available to the
- user; we must also add them to the menu system. This is what \c
- createMenus() does. We create a \uicontrol{File}, an \uicontrol{Edit}, and
- a \uicontrol{Help} menu. QMainWindow::menuBar() lets us access the
- window's menu bar widget. We don't have to worry about creating
- the menu bar ourselves; the first time we call this function, the
- QMenuBar is created.
-
Just before we create the \uicontrol{Help} menu, we call
QMenuBar::addSeparator(). This has no effect for most widget
styles (e.g., Windows and OS X styles), but for some
styles this makes sure that \uicontrol{Help} is pushed to the right
side of the menu bar.
- Let's now review the toolbars:
-
- \snippet mainwindows/application/mainwindow.cpp 30
-
- Creating toolbars is very similar to creating menus. The same
- actions that we put in the menus can be reused in the toolbars.
-
\snippet mainwindows/application/mainwindow.cpp 32
\snippet mainwindows/application/mainwindow.cpp 33
@@ -265,15 +260,15 @@
company and the name of the product. This ensures that the
settings for different applications are kept separately.
- We use QSettings::value() to extract the value of the "pos" and
- "size" settings. The second argument to QSettings::value() is
+ We use QSettings::value() to extract the value of the geometry setting.
+ The second argument to QSettings::value() is
optional and specifies a default value for the setting if there
exists none. This value is used the first time the application is
run.
- When restoring the position and size of a window, it's important
- to call QWidget::resize() before QWidget::move(). The reason why
- is given in the \l{Window Geometry} overview.
+ We use QWidget::saveGeometry() and Widget::restoreGeometry() to
+ save the position. They use an opaque QByteArray to store
+ screen number, geometry and window state.
\snippet mainwindows/application/mainwindow.cpp 37
\snippet mainwindows/application/mainwindow.cpp 39
@@ -297,9 +292,9 @@
QMessageBox::Escape flag.
The \c maybeSave() function returns \c true in all cases, except
- when the user clicks \uicontrol{Cancel}. The caller must check the
- return value and stop whatever it was doing if the return value
- is \c false.
+ when the user clicks \uicontrol{Cancel} or saving the file fails.
+ The caller must check the return value and stop whatever it was
+ doing if the return value is \c false.
\snippet mainwindows/application/mainwindow.cpp 42
\snippet mainwindows/application/mainwindow.cpp 43
@@ -361,6 +356,10 @@
\snippet mainwindows/application/main.cpp 0
+ The main function uses QCommandLineParser to check whether some file
+ argument was passed to the application and loads it via
+ MainWindow::loadFile().
+
\section1 The Resource File
As you will probably recall, for some of the actions, we
diff --git a/examples/widgets/doc/src/codeeditor.qdoc b/examples/widgets/doc/src/codeeditor.qdoc
index 645854a58c..6c9e5921b8 100644
--- a/examples/widgets/doc/src/codeeditor.qdoc
+++ b/examples/widgets/doc/src/codeeditor.qdoc
@@ -192,6 +192,6 @@
fetched with QTextBlock::userData(). Matching parentheses can be
highlighted with an extra selection. The "Matching Parentheses
with QSyntaxHighlighter" article in Qt Quarterly 31 implements
- this. You find it here: \l{http://doc.qt.digia.com/qq/}.
+ this. You find it here: \l{http://doc.qt.io/archives/qq/}.
*/
diff --git a/examples/widgets/doc/src/findfiles.qdoc b/examples/widgets/doc/src/findfiles.qdoc
index 0a4fb8268d..dd06ed8bb4 100644
--- a/examples/widgets/doc/src/findfiles.qdoc
+++ b/examples/widgets/doc/src/findfiles.qdoc
@@ -200,13 +200,6 @@
We also update the total number of files found.
- \snippet dialogs/findfiles/window.cpp 9
-
- The private \c createButton() function is called from the
- constructor. We create a QPushButton with the provided text,
- connect it to the provided slot, and return a pointer to the
- button.
-
\snippet dialogs/findfiles/window.cpp 10
The private \c createComboBox() function is also called from the
diff --git a/examples/widgets/doc/src/icons.qdoc b/examples/widgets/doc/src/icons.qdoc
index 5a902e1d98..16cdb5abd0 100644
--- a/examples/widgets/doc/src/icons.qdoc
+++ b/examples/widgets/doc/src/icons.qdoc
@@ -254,6 +254,21 @@
generated pixmaps corresponding to an icon's possible states and
modes at a given size.
+ \snippet widgets/icons/iconpreviewarea.cpp 42
+
+ We would like the table columns to be in the order QIcon::Normal,
+ QIcon::Active, QIcon::Disabled, QIcon::Selected and the rows in the order
+ QIcon::Off, QIcon::On, which does not match the enumeration. The above code
+ provides arrays allowing to map from enumeration value to row/column
+ (by using QVector::indexOf()) and back by using the array index and lists
+ of the matching strings. Qt's containers can be easily populated by
+ using C++ 11 initializer lists. If the compiler does not provide that feature,
+ a pattern like
+
+ \snippet widgets/icons/iconpreviewarea.cpp 43
+
+ can be used.
+
We need two public functions to set the current icon and the
icon's size. In addition the class has three private functions: We
use the \c createHeaderLabel() and \c createPixmapLabel()
@@ -326,7 +341,12 @@
For each mode, and for each state, we retrieve a pixmap using the
QIcon::pixmap() function, which generates a pixmap corresponding
- to the given state, mode and size.
+ to the given state, mode and size. We pass the QWindows instance
+ obtained by calling QWidget::windowHandle() on the top level
+ widget (QWidget::nativeParentWidget()) in order to retrieve
+ the pixmap that matches best.
+ We format a tooltip displaying size, actual size and device pixel
+ ratio.
\section2 MainWindow Class Definition
@@ -347,8 +367,14 @@
\li The \c changeSize() slot changes the size of the preview area's icon.
\li The \c changeIcon() slot updates the set of pixmaps available to the
icon displayed in the preview area.
- \li The \c addImage() slot allows the user to load a new image into the
- application.
+ \li The \c addSampleImages() slot allows the user to load a new image
+ from the samples provided into the application.
+ \li The \c addOtherImages() slot allows the user to load a new image from
+ the directory obtained by calling
+ QStandardPaths::standardLocations(QStandardPaths::PicturesLocation).
+ \li The \c screenChanged() updates the display in the \uicontrol{High DPI}
+ group box to correctly display the parameters of the current screen
+ the window is located on.
\endlist
In addition we declare several private functions to simplify the
@@ -362,8 +388,7 @@
widget and its child widgets, and put them in a grid layout. Then
we create the menus with their associated entries and actions.
- Before we resize the application window to a suitable size, we set
- the window title and determine the current style for the
+ We set the window title and determine the current style for the
application. We also enable the icon size spin box by clicking the
associated radio button, making the current value of the spin box
the icon's initial size.
@@ -421,21 +446,27 @@
The \c changeSize() slot sets the size for the preview area's
icon.
- To determine the new size we first check if the spin box is
+ It is invoked by the QButtonGroup whose members are radio buttons for
+ controlling the icon size. In \c createIconSizeGroupBox(), each button is
+ assigned a QStyle::PixelMetric value as an id, which is passed as a
+ parameter to the slot.
+
+ The special value \c OtherSize indicates that the spin box is
enabled. If it is, we extract the extent of the new size from the
- box. If it's not, we search through the predefined size options,
- extract the QStyle::PixelMetric and use the QStyle::pixelMetric()
- function to determine the extent. Then we create a QSize object
- based on the extent, and use that object to set the size of the
- preview area's icon.
+ box. If it's not, we query the style for the metric. Then we create
+ a QSize object based on the extent, and use that object to set the
+ size of the preview area's icon.
\snippet widgets/icons/mainwindow.cpp 12
- The first thing we do when the \c addImage() slot is called, is to
- show a file dialog to the user. The easiest way to create a file
- dialog is to use QFileDialog's static functions. Here we use the
- \l {QFileDialog::getOpenFileNames()}{getOpenFileNames()} function
- that will return one or more existing files selected by the user.
+ The function \c addImages() is called by the slot addSampleImages()
+ passing the samples directory, or by the slot addOtherImages()
+ passing the directory obtained by querying
+ QStandardPaths::standardLocations().
+
+ The first thing we do is to show a file dialog to the user.
+ We initialize it to show the filters returned by
+ QImageReader::supportedMimeTypes().
For each of the files the file dialog returns, we add a row to the
table widget. The table widget is listing the images the user has
@@ -446,9 +477,13 @@
We retrieve the image name using the QFileInfo::baseName()
function that returns the base name of the file without the path,
- and create the first table widget item in the row. Then we add the
- file's complete name to the item's data. Since an item can hold
- several information pieces, we need to assign the file name a role
+ and create the first table widget item in the row.
+ We check if a high resolution version of the image exists (identified by
+ the suffix \c @2x on the base name) and display that along with the size
+ in the tooltip.
+
+ We add the file's complete name to the item's data. Since an item can
+ hold several information pieces, we need to assign the file name a role
that will distinguish it from other data. This role can be Qt::UserRole
or any value above it.
@@ -465,7 +500,7 @@
contains "_act", "_dis", or "_sel", the modes are changed to
Active, Disabled, or Selected. And if the file name contains
"_on", the state is changed to On. The sample files in the
- example's \c images subdirectory respect this naming convension.
+ example's \c images subdirectory respect this naming convention.
\snippet widgets/icons/mainwindow.cpp 18
\snippet widgets/icons/mainwindow.cpp 19
@@ -482,7 +517,6 @@
make sure that the new image's check box is enabled.
\snippet widgets/icons/mainwindow.cpp 6
- \snippet widgets/icons/mainwindow.cpp 7
The \c changeIcon() slot is called when the user alters the set
of images listed in the QTableWidget, to update the QIcon object
@@ -562,7 +596,7 @@
\snippet widgets/icons/mainwindow.cpp 25
At the end, we connect the QTableWidget::itemChanged() signal to
- the \c changeIcon() slot to ensuret that the preview area is in
+ the \c changeIcon() slot to ensure that the preview area is in
sync with the image table.
\image icons_size_groupbox.png Screenshot of the icon size group box
@@ -574,7 +608,14 @@
\snippet widgets/icons/mainwindow.cpp 26
First we create a group box that will contain all the widgets;
- then we create the radio buttons and the spin box.
+ then we create the radio buttons and the spin box. We add the
+ radio buttons to an instance of QButtonGroup, using the value
+ of the QStyle::PixelMetric they represent as an integer id.
+
+ \snippet widgets/icons/mainwindow.cpp 40
+
+ We introduce an enumeration constant \c OtherSize to represent
+ a custom size.
The spin box is not a regular QSpinBox but an \c IconSizeSpinBox.
The \c IconSizeSpinBox class inherits QSpinBox and reimplements
@@ -602,19 +643,16 @@
In particular we create the \c styleActionGroup based on the
currently available GUI styles using
QStyleFactory. QStyleFactory::keys() returns a list of valid keys,
- typically including "windows", "cleanlooks" and
- "plastique". Depending on the platform, "windowsxp", "windowsvista", "gtk" and
- "macintosh" may be available.
+ typically including "windows" and "fusion". Depending on the platform,
+ "windowsvista" and "macintosh" may be available.
We create one action for each key, and adds the action to the
action group. Also, for each action, we call QAction::setData()
with the style name. We will retrieve it later using
QAction::data().
- \snippet widgets/icons/mainwindow.cpp 29
-
- In the \c createMenu() function, we add the previously created
- actions to the \uicontrol File, \uicontrol View and \uicontrol Help menus.
+ As we go along, we create the \uicontrol File, \uicontrol View and
+ \uicontrol Help menus and add the actions to them.
The QMenu class provides a menu widget for use in menu bars,
context menus, and other popup menus. We put each menu in the
@@ -656,6 +694,13 @@
Q_ASSERT() macro to make sure that QStyleFactory::create()
returned a valid pointer.
+ \snippet widgets/icons/mainwindow.cpp 44
+
+ We overload the show() function to set up the updating of the
+ current screen in \c screenChanged(). After calling QWidget::show(),
+ the QWindow associated with the QWidget is created and we can
+ connect to its QWindow::screenChanged() signal.
+
\section2 IconSizeSpinBox Class Definition
\snippet widgets/icons/iconsizespinbox.h 0
@@ -690,7 +735,7 @@
reimplement the \c valueFromText() function to interpret the
parameter text and return the associated int value.
- We parse the text using a regular expression (a QRegExp). We
+ We parse the text using a regular expression (a QRegularExpression). We
define an expression that matches one or several digits,
optionally followed by whitespace, an "x" or the times symbol,
whitespace and one or several digits again.
@@ -748,7 +793,7 @@
index for editing. The parent widget and style option are used to
control the appearance of the editor widget.
- Our reimplementation create and populate a combobox instead of
+ Our reimplementation creates and populates a combobox instead of
the default line edit. The contents of the combobox depends on
the column in the table for which the editor is requested. Column
1 contains the QIcon modes, whereas column 2 contains the QIcon
@@ -786,4 +831,12 @@
triggered the slot. This signal must be emitted when the editor
widget has completed editing the data, and wants to write it back
into the model.
+
+ \section2 The Implementation of the Function main()
+
+ \snippet widgets/icons/main.cpp 45
+
+ We use QCommandLineParser to handle any command line options or parameters
+ passed to the application. Then, we resize the main window according
+ to the available screen geometry and show it.
*/
diff --git a/examples/widgets/doc/src/imageviewer.qdoc b/examples/widgets/doc/src/imageviewer.qdoc
index 91ae56b5d7..4457da9d6f 100644
--- a/examples/widgets/doc/src/imageviewer.qdoc
+++ b/examples/widgets/doc/src/imageviewer.qdoc
@@ -287,7 +287,8 @@
\snippet widgets/imageviewer/imageviewer.cpp 18
In the private \c createAction() function, we create the
- actions providing the application features.
+ actions providing the application features and populate
+ a menu with them.
We assign a short-cut key to each action and connect them to the
appropriate slots. We only enable the \c openAct and \c exitAct at
@@ -295,16 +296,10 @@
been loaded into the application. In addition we make the \c
fitToWindowAct \l {QAction::checkable}{checkable}.
- \snippet widgets/imageviewer/imageviewer.cpp 19
- \snippet widgets/imageviewer/imageviewer.cpp 20
-
- In the private \c createMenu() function, we add the previously
- created actions to the \uicontrol File, \uicontrol View and \uicontrol Help menus.
-
The QMenu class provides a menu widget for use in menu bars,
context menus, and other popup menus. The QMenuBar class provides
a horizontal menu bar that consists of a list of pull-down menu
- items. So at the end we put the menus in the \c {ImageViewer}'s
+ items. So we put the menus in the \c {ImageViewer}'s
menu bar which we retrieve with the QMainWindow::menuBar()
function.
diff --git a/examples/widgets/doc/src/plugandpaint.qdoc b/examples/widgets/doc/src/plugandpaint.qdoc
index cf83ea3507..b139de9fa1 100644
--- a/examples/widgets/doc/src/plugandpaint.qdoc
+++ b/examples/widgets/doc/src/plugandpaint.qdoc
@@ -285,9 +285,9 @@
\snippet tools/plugandpaint/main.cpp 0
- The argument to Q_IMPORT_PLUGIN() is the plugin's name, as
- specified with Q_PLUGIN_METADATA() in the \l{Exporting the
- Plugin}{plugin}.
+ The argument to Q_IMPORT_PLUGIN() is the plugin name, which corresponds
+ with the name of the class that declares metadata for the plugin with
+ Q_PLUGIN_METADATA().
In the \c .pro file, we need to specify the static library.
Here's the project file for building Plug & Paint:
diff --git a/examples/widgets/doc/src/recentfiles.qdoc b/examples/widgets/doc/src/regularexpression.qdoc
index b58c9a1f76..804867fb58 100644
--- a/examples/widgets/doc/src/recentfiles.qdoc
+++ b/examples/widgets/doc/src/regularexpression.qdoc
@@ -26,12 +26,23 @@
****************************************************************************/
/*!
- \example mainwindows/recentfiles
- \title Recent Files Example
- \ingroup examples-mainwindow
+ \example tools/regularexpression
+ \title QRegularExpression Example
+ \ingroup examples-widgets-tools
- \brief The Recent Files example shows how a standard File menu can be extended to show
- the most recent files loaded by a main window application.
+ \brief The QRegularExpression example shows how regular expressions in Qt are
+ applied to text by providing an environment in which new regular expressions can be
+ created and tested on custom text strings.
- \image recentfiles-example.png
+ The example makes usage of the QRegularExpression class, which has been
+ introduced in Qt 5.0. QRegularExpression implements Perl-compatible regular
+ expressions, supporting a number of advanced matching features, such as
+ case insensitive matching, multiline matching, Unicode properties selectors
+ and partial/incremental matching.
+
+ QRegularExpression is a big improvement over QRegExp in terms of features
+ and performance and should be used in all new code.
+
+ \image regularexpression-example.png
*/
+
diff --git a/examples/widgets/doc/src/screenshot.qdoc b/examples/widgets/doc/src/screenshot.qdoc
index 32c4df9ec2..b376b6ce0e 100644
--- a/examples/widgets/doc/src/screenshot.qdoc
+++ b/examples/widgets/doc/src/screenshot.qdoc
@@ -33,7 +33,7 @@
desktop.
\brief The Screenshot example shows how to take a screenshot of the
- desktop using QApplication and QDesktopWidget. It also shows how
+ desktop using QScreen. It also shows how
to use QTimer to provide a single-shot timer, and how to
reimplement the QWidget::resizeEvent() event handler to make sure
that an application resizes smoothly and without data loss.
@@ -73,12 +73,9 @@
\uicontrol {Hide This Window} option.
\endlist
- We also declare some private functions: We use the \c
- createOptionsGroupBox(), \c createButtonsLayout() and \c
- createButton() functions when we construct the widget. And we call
- the private \c updateScreenshotLabel() function whenever a new
- screenshot is taken or when a resize event changes the size of the
- screenshot preview label.
+ We also declare the private function \c updateScreenshotLabel() which
+ is called whenever a new screenshot is taken or when a resize event
+ changes the size of the screenshot preview label.
In addition we need to store the screenshot's original pixmap. The
reason is that when we display the preview of the screenshot, we
@@ -100,11 +97,18 @@
aligned in the center of the \c Screenshot widget, and set its
minimum size.
+ Next, we create a group box that will contain all of the options'
+ widgets. Then we create a QSpinBox and a QLabel for the \uicontrol
+ {Screenshot Delay} option, and connect the spinbox to the \c
+ updateCheckBox() slot. Finally, we create a QCheckBox for the \uicontrol
+ {Hide This Window} option, add all the options' widgets to a
+ QGridLayout installed on the group box.
+
We create the applications's buttons and the group box containing
the application's options, and put it all into a main
layout. Finally we take the initial screenshot, and set the initial
delay and the window title, before we resize the widget to a
- suitable size.
+ suitable size depending on the screen geometry.
\snippet desktop/screenshot/screenshot.cpp 1
@@ -151,34 +155,37 @@
QFileDialog enables a user to traverse the file system in order to
select one or many files or a directory. The easiest way to create
a QFileDialog is to use the convenience static
- functions.
+ functions. Here, we instantiate the dialog on the stack in order
+ to be able to set up the supported mime types of QImageWriter,
+ allowing the user to save in a variety of formats.
We define the default file format to be png, and we make the file
- dialog's initial path the path the application is run from. We
- create the file dialog using the static
- QFileDialog::getSaveFileName() function which returns a file name
- selected by the user. The file does not have to exist. If the file
+ dialog's initial path the location of pictures as obtained from
+ QStandardPaths, defaulting to the path the application is run from.
+
+ We run the dialog by invoking QDialog::exec() and return if the
+ user canceled the dialog. If the dialog has been accepted, we
+ obtain a file name by calling QFileDialog::selectedFiles().
+ The file does not have to exist. If the file
name is valid, we use the QPixmap::save() function to save the
screenshot's original pixmap in that file.
\snippet desktop/screenshot/screenshot.cpp 4
- The \c shootScreen() slot is called to take the screenshot. If the
- user has chosen to delay the screenshot, we make the application
- beep when the screenshot is taken using the static
- QApplication::beep() function.
-
- The QApplication class manages the GUI application's control flow
- and main settings. It contains the main event loop, where all
- events from the window system and other sources are processed and
- dispatched.
+ The \c shootScreen() slot is called to take the screenshot.
- \snippet desktop/screenshot/screenshot.cpp 5
+ First, we find the instance of QScreen the window is located
+ by retrieving the QWindow and its QScreen, defaulting
+ to the primary screen. If no screen can be found, we return.
+ Although this is unlikely to happen, applications should check
+ for null pointers since there might be situations in which no
+ screen is connected.
- Using the static function QApplication::primaryScreen(), we
- obtain the QScreen object for the application's main screen.
+ If the user has chosen to delay the screenshot, we make the application
+ beep when the screenshot is taken using the static
+ QApplication::beep() function.
- We take the screenshot using the QScreen::grabWindow()
+ We then take the screenshot using the QScreen::grabWindow()
function. The function grabs the contents of the window passed as
an argument, makes a pixmap out of it and returns that pixmap.
The window id can be obtained with QWidget::winId() or QWindow::winId().
@@ -200,37 +207,6 @@
The \c updateCheckBox() slot is called whenever the user changes
the delay using the \uicontrol {Screenshot Delay} option.
- \snippet desktop/screenshot/screenshot.cpp 7
-
- The private \c createOptionsGroupBox() function is called from the
- constructor.
-
- First we create a group box that will contain all of the options'
- widgets. Then we create a QSpinBox and a QLabel for the \uicontrol
- {Screenshot Delay} option, and connect the spinbox to the \c
- updateCheckBox() slot. Finally, we create a QCheckBox for the \uicontrol
- {Hide This Window} option, add all the options' widgets to a
- QGridLayout and install the layout on the group box.
-
- Note that we don't have to specify any parents for the widgets
- when we create them. The reason is that when we add a widget to a
- layout and install the layout on another widget, the layout's
- widgets are automatically reparented to the widget the layout is
- installed on.
-
- \snippet desktop/screenshot/screenshot.cpp 8
-
- The private \c createButtonsLayout() function is called from the
- constructor. We create the application's buttons using the private
- \c createButton() function, and add them to a QHBoxLayout.
-
- \snippet desktop/screenshot/screenshot.cpp 9
-
- The private \c createButton() function is called from the \c
- createButtonsLayout() function. It simply creates a QPushButton
- with the provided text, connects it to the provided receiver and
- slot, and returns a pointer to the button.
-
\snippet desktop/screenshot/screenshot.cpp 10
The private \c updateScreenshotLabel() function is called whenever
diff --git a/examples/widgets/doc/src/syntaxhighlighter.qdoc b/examples/widgets/doc/src/syntaxhighlighter.qdoc
index 2b283afe5e..7d33299c81 100644
--- a/examples/widgets/doc/src/syntaxhighlighter.qdoc
+++ b/examples/widgets/doc/src/syntaxhighlighter.qdoc
@@ -248,7 +248,7 @@
It is possible to implement parenthesis matching with
QSyntaxHighlighter. The "Matching Parentheses with
QSyntaxHighlighter" article in Qt Quarterly 31
- (\l{http://doc.qt.digia.com/qq/}) implements this. We also have
+ (\l{http://doc.qt.io/archives/qq/}) implements this. We also have
the \l{Code Editor Example}, which shows how to implement line
numbers and how to highlight the current line.
diff --git a/examples/widgets/doc/src/systray.qdoc b/examples/widgets/doc/src/systray.qdoc
new file mode 100644
index 0000000000..b05f999dfa
--- /dev/null
+++ b/examples/widgets/doc/src/systray.qdoc
@@ -0,0 +1,179 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** 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. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example desktop/systray
+ \title System Tray Icon Example
+ \ingroup examples-widgets
+ \brief The System Tray Icon example shows how to add an icon with a menu
+ and popup messages to a desktop environment's system tray.
+
+ \image systemtray-example.png Screenshot of the System Tray Icon.
+
+ Modern operating systems usually provide a special area on the
+ desktop, called the system tray or notification area, where
+ long-running applications can display icons and short messages.
+
+ This example consists of one single class, \c Window, providing
+ the main application window (i.e., an editor for the system tray
+ icon) and the associated icon.
+
+ \image systemtray-editor.png
+
+ The editor allows the user to choose the preferred icon as well as
+ set the balloon message's type and duration. The user can also
+ edit the message's title and body. Finally, the editor provides a
+ checkbox controlling whether the icon is actually shown in the
+ system tray, or not.
+
+ \section1 Window Class Definition
+
+ The \c Window class inherits QWidget:
+
+ \snippet desktop/systray/window.h 0
+
+ We implement several private slots to respond to user
+ interaction. The other private functions are only convenience
+ functions provided to simplify the constructor.
+
+ The tray icon is an instance of the QSystemTrayIcon class. To
+ check whether a system tray is present on the user's desktop, call
+ the static QSystemTrayIcon::isSystemTrayAvailable()
+ function. Associated with the icon, we provide a menu containing
+ the typical \uicontrol minimize, \uicontrol maximize, \uicontrol restore and
+ \uicontrol quit actions. We reimplement the QWidget::setVisible() function
+ to update the tray icon's menu whenever the editor's appearance
+ changes, e.g., when maximizing or minimizing the main application
+ window.
+
+ Finally, we reimplement QWidget's \l {QWidget::}{closeEvent()}
+ function to be able to inform the user (when closing the editor
+ window) that the program will keep running in the system tray
+ until the user chooses the \uicontrol Quit entry in the icon's context
+ menu.
+
+ \section1 Window Class Implementation
+
+ When constructing the editor widget, we first create the various
+ editor elements before we create the actual system tray icon:
+
+ \snippet desktop/systray/window.cpp 0
+
+ We ensure that the application responds to user input by
+ connecting most of the editor's input widgets (including the
+ system tray icon) to the application's private slots. But note the
+ visibility checkbox; its \l {QCheckBox::}{toggled()} signal is
+ connected to the \e {icon}'s \l {QSystemTrayIcon::}{setVisible()}
+ function instead.
+
+ \snippet desktop/systray/window.cpp 3
+
+ The \c setIcon() slot is triggered whenever the current index in
+ the icon combobox changes, i.e., whenever the user chooses another
+ icon in the editor. Note that it is also called when the user
+ activates the tray icon with the left mouse button, triggering the
+ icon's \l {QSystemTrayIcon::}{activated()} signal. We will come
+ back to this signal shortly.
+
+ The QSystemTrayIcon::setIcon() function sets the \l
+ {QSystemTrayIcon::}{icon} property that holds the actual system
+ tray icon. On Windows, the system tray icon size is 16x16; on X11,
+ the preferred size is 22x22. The icon will be scaled to the
+ appropriate size as necessary.
+
+ Note that on X11, due to a limitation in the system tray
+ specification, mouse clicks on transparent areas in the icon are
+ propagated to the system tray. If this behavior is unacceptable,
+ we suggest using an icon with no transparency.
+
+ \snippet desktop/systray/window.cpp 4
+
+ Whenever the user activates the system tray icon, it emits its \l
+ {QSystemTrayIcon::}{activated()} signal passing the triggering
+ reason as parameter. QSystemTrayIcon provides the \l
+ {QSystemTrayIcon::}{ActivationReason} enum to describe how the
+ icon was activated.
+
+ In the constructor, we connected our icon's \l
+ {QSystemTrayIcon::}{activated()} signal to our custom \c
+ iconActivated() slot: If the user has clicked the icon using the
+ left mouse button, this function changes the icon image by
+ incrementing the icon combobox's current index, triggering the \c
+ setIcon() slot as mentioned above. If the user activates the icon
+ using the middle mouse button, it calls the custom \c
+ showMessage() slot:
+
+ \snippet desktop/systray/window.cpp 5
+
+ When the \e showMessage() slot is triggered, we first retrieve the
+ message icon depending on the currently chosen message type. The
+ QSystemTrayIcon::MessageIcon enum describes the icon that is shown
+ when a balloon message is displayed. Then we call
+ QSystemTrayIcon's \l {QSystemTrayIcon::}{showMessage()} function
+ to show the message with the title, body, and icon for the time
+ specified in milliseconds.
+
+ QSystemTrayIcon also has the corresponding, \l {QSystemTrayIcon::}
+ {messageClicked()} signal, which is emitted when the user clicks a
+ message displayed by \l {QSystemTrayIcon::}{showMessage()}.
+
+ \snippet desktop/systray/window.cpp 6
+
+ In the constructor, we connected the \l
+ {QSystemTrayIcon::}{messageClicked()} signal to our custom \c
+ messageClicked() slot that simply displays a message using the
+ QMessageBox class.
+
+ QMessageBox provides a modal dialog with a short message, an icon,
+ and buttons laid out depending on the current style. It supports
+ four severity levels: "Question", "Information", "Warning" and
+ "Critical". The easiest way to pop up a message box in Qt is to
+ call one of the associated static functions, e.g.,
+ QMessageBox::information().
+
+ As we mentioned earlier, we reimplement a couple of QWidget's
+ virtual functions:
+
+ \snippet desktop/systray/window.cpp 1
+
+ Our reimplementation of the QWidget::setVisible() function updates
+ the tray icon's menu whenever the editor's appearance changes,
+ e.g., when maximizing or minimizing the main application window,
+ before calling the base class implementation.
+
+ \snippet desktop/systray/window.cpp 2
+
+ We have reimplemented the QWidget::closeEvent() event handler to
+ receive widget close events, showing the above message to the
+ users when they are closing the editor window.
+
+ In addition to the functions and slots discussed above, we have
+ also implemented several convenience functions to simplify the
+ constructor: \c createIconGroupBox(), \c createMessageGroupBox(),
+ \c createActions() and \c createTrayIcon(). See the \l
+ {desktop/systray/window.cpp}{window.cpp} file for details.
+*/
diff --git a/examples/widgets/doc/src/tablet.qdoc b/examples/widgets/doc/src/tablet.qdoc
index 1ab2917b7e..bc03d46332 100644
--- a/examples/widgets/doc/src/tablet.qdoc
+++ b/examples/widgets/doc/src/tablet.qdoc
@@ -259,24 +259,18 @@
\snippet widgets/tablet/tabletcanvas.cpp 5
- In this function we draw on the pixmap based on the movement of the
- device. If the device used on the tablet is a stylus we want to draw a
- line between the positions of the stylus recorded in \c polyLine. We
- also assume that this is a reasonable handling of any unknown device,
- but update the statusbar with a warning so that the user can see that
- for his tablet he might have to implement special handling.
- If it is an airbrush we want to draw a circle of points with a
- point density based on the tangential pressure, which is the position
- of the finger wheel on the airbrush. We use the Qt::BrushStyle to
- draw the points as it has styles that draw points with different
- density; we select the style based on the tangential pressure in
- \c brushPattern().
+ In this function we draw on the pixmap based on the movement of the device.
+ If the device used on the tablet is a stylus, we want to draw a line from
+ the last-known position to the current position. We also assume that this
+ is a reasonable handling of any unknown device, but update the status bar
+ with a warning. If it is an airbrush, we want to draw a circle filled with
+ a soft gradient, whose density can depend on various event parameters.
+ By default it depends on the tangential pressure, which is the position of
+ the finger wheel on the airbrush. If it is a rotation stylus, we simulate
+ a felt marker by drawing trapezoidal strokes.
\snippet widgets/tablet/tabletcanvas.cpp 6
- We return a brush style with a point density that increases with
- the tangential pressure.
-
In \c updateBrush() we set the pen and brush used for drawing
to match \c alphaChannelType, \c lineWidthType, \c
colorSaturationType, and \c myColor. We will examine the code to
diff --git a/examples/widgets/doc/src/tetrix.qdoc b/examples/widgets/doc/src/tetrix.qdoc
index f74d3c14d5..6050fe2356 100644
--- a/examples/widgets/doc/src/tetrix.qdoc
+++ b/examples/widgets/doc/src/tetrix.qdoc
@@ -108,7 +108,7 @@
We connect \l{QAbstractButton::}{clicked()} signals from the \uicontrol{Start}
and \uicontrol{Pause} buttons to the board, and from the \uicontrol{Quit} button to the
- application's \l{QApplication::}{quit()} slot.
+ application's \l{QCoreApplication::quit()} slot.
\snippet widgets/tetrix/tetrixwindow.cpp 4
\snippet widgets/tetrix/tetrixwindow.cpp 5
diff --git a/examples/widgets/draganddrop/draggableicons/main.cpp b/examples/widgets/draganddrop/draggableicons/main.cpp
index 165f71dbf7..44b4f848bf 100644
--- a/examples/widgets/draganddrop/draggableicons/main.cpp
+++ b/examples/widgets/draganddrop/draggableicons/main.cpp
@@ -50,11 +50,10 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
QWidget mainWidget;
- QHBoxLayout *horizontalLayout = new QHBoxLayout;
+ QHBoxLayout *horizontalLayout = new QHBoxLayout(&mainWidget);
horizontalLayout->addWidget(new DragWidget);
horizontalLayout->addWidget(new DragWidget);
- mainWidget.setLayout(horizontalLayout);
mainWidget.setWindowTitle(QObject::tr("Draggable Icons"));
mainWidget.show();
diff --git a/examples/widgets/draganddrop/draggabletext/draggabletext.pro b/examples/widgets/draganddrop/draggabletext/draggabletext.pro
index 2815be1613..1add2a270e 100644
--- a/examples/widgets/draganddrop/draggabletext/draggabletext.pro
+++ b/examples/widgets/draganddrop/draggabletext/draggabletext.pro
@@ -1,10 +1,8 @@
QT += widgets
-HEADERS = draglabel.h \
- dragwidget.h
+HEADERS = dragwidget.h
RESOURCES = draggabletext.qrc
-SOURCES = draglabel.cpp \
- dragwidget.cpp \
+SOURCES = dragwidget.cpp \
main.cpp
# install
diff --git a/examples/widgets/draganddrop/draggabletext/dragwidget.cpp b/examples/widgets/draganddrop/draggabletext/dragwidget.cpp
index 3b8bca3277..36c4df2e43 100644
--- a/examples/widgets/draganddrop/draggabletext/dragwidget.cpp
+++ b/examples/widgets/draganddrop/draggabletext/dragwidget.cpp
@@ -40,13 +40,23 @@
#include <QtWidgets>
-#include "draglabel.h"
#include "dragwidget.h"
+static QLabel *createDragLabel(const QString &text, QWidget *parent)
+{
+ QLabel *label = new QLabel(text, parent);
+ label->setAutoFillBackground(true);
+ label->setFrameShape(QFrame::Panel);
+ label->setFrameShadow(QFrame::Raised);
+ return label;
+}
+
+static QString hotSpotMimeDataKey() { return QStringLiteral("application/x-hotspot"); }
+
DragWidget::DragWidget(QWidget *parent)
: QWidget(parent)
{
- QFile dictionaryFile(":/dictionary/words.txt");
+ QFile dictionaryFile(QStringLiteral(":/dictionary/words.txt"));
dictionaryFile.open(QIODevice::ReadOnly);
QTextStream inputStream(&dictionaryFile);
@@ -57,7 +67,7 @@ DragWidget::DragWidget(QWidget *parent)
QString word;
inputStream >> word;
if (!word.isEmpty()) {
- DragLabel *wordLabel = new DragLabel(word, this);
+ QLabel *wordLabel = createDragLabel(word, this);
wordLabel->move(x, y);
wordLabel->show();
wordLabel->setAttribute(Qt::WA_DeleteOnClose);
@@ -69,12 +79,6 @@ DragWidget::DragWidget(QWidget *parent)
}
}
- /*
- QPalette newPalette = palette();
- newPalette.setColor(QPalette::Window, Qt::white);
- setPalette(newPalette);
- */
-
setAcceptDrops(true);
setMinimumSize(400, qMax(200, y));
setWindowTitle(tr("Draggable Text"));
@@ -98,19 +102,19 @@ void DragWidget::dropEvent(QDropEvent *event)
{
if (event->mimeData()->hasText()) {
const QMimeData *mime = event->mimeData();
- QStringList pieces = mime->text().split(QRegExp("\\s+"),
+ QStringList pieces = mime->text().split(QRegularExpression(QStringLiteral("\\s+")),
QString::SkipEmptyParts);
QPoint position = event->pos();
QPoint hotSpot;
- QList<QByteArray> hotSpotPos = mime->data("application/x-hotspot").split(' ');
+ QByteArrayList hotSpotPos = mime->data(hotSpotMimeDataKey()).split(' ');
if (hotSpotPos.size() == 2) {
hotSpot.setX(hotSpotPos.first().toInt());
hotSpot.setY(hotSpotPos.last().toInt());
}
- foreach (QString piece, pieces) {
- DragLabel *newLabel = new DragLabel(piece, this);
+ foreach (const QString &piece, pieces) {
+ QLabel *newLabel = createDragLabel(piece, this);
newLabel->move(position - hotSpot);
newLabel->show();
newLabel->setAttribute(Qt::WA_DeleteOnClose);
@@ -127,18 +131,15 @@ void DragWidget::dropEvent(QDropEvent *event)
} else {
event->ignore();
}
- foreach (QObject *child, children()) {
- if (child->inherits("QWidget")) {
- QWidget *widget = static_cast<QWidget *>(child);
- if (!widget->isVisible())
- widget->deleteLater();
- }
+ foreach (QWidget *widget, findChildren<QWidget *>()) {
+ if (!widget->isVisible())
+ widget->deleteLater();
}
}
void DragWidget::mousePressEvent(QMouseEvent *event)
{
- QLabel *child = static_cast<QLabel*>(childAt(event->pos()));
+ QLabel *child = qobject_cast<QLabel*>(childAt(event->pos()));
if (!child)
return;
@@ -146,8 +147,8 @@ void DragWidget::mousePressEvent(QMouseEvent *event)
QMimeData *mimeData = new QMimeData;
mimeData->setText(child->text());
- mimeData->setData("application/x-hotspot",
- QByteArray::number(hotSpot.x()) + " " + QByteArray::number(hotSpot.y()));
+ mimeData->setData(hotSpotMimeDataKey(),
+ QByteArray::number(hotSpot.x()) + ' ' + QByteArray::number(hotSpot.y()));
QPixmap pixmap(child->size());
child->render(&pixmap);
diff --git a/examples/widgets/draganddrop/dropsite/droparea.cpp b/examples/widgets/draganddrop/dropsite/droparea.cpp
index d3d2bb10ca..0016434cc3 100644
--- a/examples/widgets/draganddrop/dropsite/droparea.cpp
+++ b/examples/widgets/draganddrop/dropsite/droparea.cpp
@@ -92,10 +92,8 @@ void DropArea::dropEvent(QDropEvent *event)
} else if (mimeData->hasUrls()) {
QList<QUrl> urlList = mimeData->urls();
QString text;
- for (int i = 0; i < urlList.size() && i < 32; ++i) {
- QString url = urlList.at(i).path();
- text += url + QString("\n");
- }
+ for (int i = 0; i < urlList.size() && i < 32; ++i)
+ text += urlList.at(i).path() + QLatin1Char('\n');
setText(text);
} else {
setText(tr("Cannot display data"));
diff --git a/examples/widgets/draganddrop/dropsite/dropsitewindow.cpp b/examples/widgets/draganddrop/dropsite/dropsitewindow.cpp
index 5f0e689fc9..5d48be1c34 100644
--- a/examples/widgets/draganddrop/dropsite/dropsitewindow.cpp
+++ b/examples/widgets/draganddrop/dropsite/dropsitewindow.cpp
@@ -55,8 +55,8 @@ DropSiteWindow::DropSiteWindow()
//! [constructor part2]
dropArea = new DropArea;
- connect(dropArea, SIGNAL(changed(const QMimeData*)),
- this, SLOT(updateFormatsTable(const QMimeData*)));
+ connect(dropArea, &DropArea::changed,
+ this, &DropSiteWindow::updateFormatsTable);
//! [constructor part2]
//! [constructor part3]
@@ -78,17 +78,16 @@ DropSiteWindow::DropSiteWindow()
buttonBox->addButton(clearButton, QDialogButtonBox::ActionRole);
buttonBox->addButton(quitButton, QDialogButtonBox::RejectRole);
- connect(quitButton, SIGNAL(pressed()), this, SLOT(close()));
- connect(clearButton, SIGNAL(pressed()), dropArea, SLOT(clear()));
+ connect(quitButton, &QAbstractButton::pressed, this, &QWidget::close);
+ connect(clearButton, &QAbstractButton::pressed, dropArea, &DropArea::clear);
//! [constructor part4]
//! [constructor part5]
- QVBoxLayout *mainLayout = new QVBoxLayout;
+ QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->addWidget(abstractLabel);
mainLayout->addWidget(dropArea);
mainLayout->addWidget(formatsTable);
mainLayout->addWidget(buttonBox);
- setLayout(mainLayout);
setWindowTitle(tr("Drop Site"));
setMinimumSize(350, 500);
@@ -112,22 +111,18 @@ void DropSiteWindow::updateFormatsTable(const QMimeData *mimeData)
//! [updateFormatsTable() part3]
QString text;
- if (format == "text/plain") {
+ if (format == QLatin1String("text/plain")) {
text = mimeData->text().simplified();
- } else if (format == "text/html") {
+ } else if (format == QLatin1String("text/html")) {
text = mimeData->html().simplified();
- } else if (format == "text/uri-list") {
+ } else if (format == QLatin1String("text/uri-list")) {
QList<QUrl> urlList = mimeData->urls();
for (int i = 0; i < urlList.size() && i < 32; ++i)
- text.append(urlList[i].toString() + " ");
+ text.append(urlList.at(i).toString() + QLatin1Char(' '));
} else {
QByteArray data = mimeData->data(format);
- for (int i = 0; i < data.size() && i < 32; ++i) {
- QString hex = QString("%1").arg(uchar(data[i]), 2, 16,
- QChar('0'))
- .toUpper();
- text.append(hex + " ");
- }
+ for (int i = 0; i < data.size() && i < 32; ++i)
+ text.append(QStringLiteral("%1 ").arg(uchar(data[i]), 2, 16, QLatin1Char('0')).toUpper());
}
//! [updateFormatsTable() part3]
diff --git a/examples/widgets/draganddrop/fridgemagnets/dragwidget.cpp b/examples/widgets/draganddrop/fridgemagnets/dragwidget.cpp
index a591a29994..3a9ab5fa76 100644
--- a/examples/widgets/draganddrop/fridgemagnets/dragwidget.cpp
+++ b/examples/widgets/draganddrop/fridgemagnets/dragwidget.cpp
@@ -43,11 +43,13 @@
#include <QtWidgets>
+static inline QString fridgetMagnetsMimeType() { return QStringLiteral("application/x-fridgemagnet"); }
+
//! [0]
DragWidget::DragWidget(QWidget *parent)
: QWidget(parent)
{
- QFile dictionaryFile(":/dictionary/words.txt");
+ QFile dictionaryFile(QStringLiteral(":/dictionary/words.txt"));
dictionaryFile.open(QFile::ReadOnly);
QTextStream inputStream(&dictionaryFile);
//! [0]
@@ -74,7 +76,6 @@ DragWidget::DragWidget(QWidget *parent)
//! [1]
//! [2]
- //Fridge magnets is used for demoing Qt on S60 and themed backgrounds look better than white
QPalette newPalette = palette();
newPalette.setColor(QPalette::Window, Qt::white);
setPalette(newPalette);
@@ -90,7 +91,7 @@ DragWidget::DragWidget(QWidget *parent)
void DragWidget::dragEnterEvent(QDragEnterEvent *event)
{
//! [4] //! [5]
- if (event->mimeData()->hasFormat("application/x-fridgemagnet")) {
+ if (event->mimeData()->hasFormat(fridgetMagnetsMimeType())) {
if (children().contains(event->source())) {
event->setDropAction(Qt::MoveAction);
event->accept();
@@ -110,7 +111,7 @@ void DragWidget::dragEnterEvent(QDragEnterEvent *event)
//! [8]
void DragWidget::dragMoveEvent(QDragMoveEvent *event)
{
- if (event->mimeData()->hasFormat("application/x-fridgemagnet")) {
+ if (event->mimeData()->hasFormat(fridgetMagnetsMimeType())) {
if (children().contains(event->source())) {
event->setDropAction(Qt::MoveAction);
event->accept();
@@ -128,10 +129,10 @@ void DragWidget::dragMoveEvent(QDragMoveEvent *event)
//! [9]
void DragWidget::dropEvent(QDropEvent *event)
{
- if (event->mimeData()->hasFormat("application/x-fridgemagnet")) {
+ if (event->mimeData()->hasFormat(fridgetMagnetsMimeType())) {
const QMimeData *mime = event->mimeData();
//! [9] //! [10]
- QByteArray itemData = mime->data("application/x-fridgemagnet");
+ QByteArray itemData = mime->data(fridgetMagnetsMimeType());
QDataStream dataStream(&itemData, QIODevice::ReadOnly);
QString text;
@@ -152,11 +153,11 @@ void DragWidget::dropEvent(QDropEvent *event)
}
//! [11] //! [12]
} else if (event->mimeData()->hasText()) {
- QStringList pieces = event->mimeData()->text().split(QRegExp("\\s+"),
+ QStringList pieces = event->mimeData()->text().split(QRegularExpression(QStringLiteral("\\s+")),
QString::SkipEmptyParts);
QPoint position = event->pos();
- foreach (QString piece, pieces) {
+ foreach (const QString &piece, pieces) {
DragLabel *newLabel = new DragLabel(piece, this);
newLabel->move(position);
newLabel->show();
@@ -190,7 +191,7 @@ void DragWidget::mousePressEvent(QMouseEvent *event)
//! [15]
QMimeData *mimeData = new QMimeData;
- mimeData->setData("application/x-fridgemagnet", itemData);
+ mimeData->setData(fridgetMagnetsMimeType(), itemData);
mimeData->setText(child->labelText());
//! [15]
diff --git a/examples/widgets/draganddrop/fridgemagnets/main.cpp b/examples/widgets/draganddrop/fridgemagnets/main.cpp
index edff4486d6..a52ff8cabd 100644
--- a/examples/widgets/draganddrop/fridgemagnets/main.cpp
+++ b/examples/widgets/draganddrop/fridgemagnets/main.cpp
@@ -52,7 +52,7 @@ int main(int argc, char *argv[])
#endif
DragWidget window;
- bool smallScreen = QApplication::arguments().contains("-small-screen");
+ bool smallScreen = QApplication::arguments().contains(QStringLiteral("-small-screen"));
if (smallScreen)
window.showFullScreen();
else
diff --git a/examples/widgets/draganddrop/puzzle/main.cpp b/examples/widgets/draganddrop/puzzle/main.cpp
index 706ebe4d70..e8ecbe37db 100644
--- a/examples/widgets/draganddrop/puzzle/main.cpp
+++ b/examples/widgets/draganddrop/puzzle/main.cpp
@@ -48,7 +48,7 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
MainWindow window;
- window.openImage(":/images/example.jpg");
+ window.loadImage(QStringLiteral(":/images/example.jpg"));
window.show();
return app.exec();
}
diff --git a/examples/widgets/draganddrop/puzzle/mainwindow.cpp b/examples/widgets/draganddrop/puzzle/mainwindow.cpp
index 0fbdfc3f8d..48e79946e7 100644
--- a/examples/widgets/draganddrop/puzzle/mainwindow.cpp
+++ b/examples/widgets/draganddrop/puzzle/mainwindow.cpp
@@ -55,26 +55,27 @@ MainWindow::MainWindow(QWidget *parent)
setWindowTitle(tr("Puzzle"));
}
-void MainWindow::openImage(const QString &path)
+void MainWindow::openImage()
{
- QString fileName = path;
+ const QString fileName =
+ QFileDialog::getOpenFileName(this, tr("Open Image"), QString(),
+ tr("Image Files (*.png *.jpg *.bmp)"));
- if (fileName.isNull()) {
- fileName = QFileDialog::getOpenFileName(this,
- tr("Open Image"), "", "Image Files (*.png *.jpg *.bmp)");
- }
+ if (!fileName.isEmpty())
+ loadImage(fileName);
+}
- if (!fileName.isEmpty()) {
- QPixmap newImage;
- if (!newImage.load(fileName)) {
- QMessageBox::warning(this, tr("Open Image"),
- tr("The image file could not be loaded."),
- QMessageBox::Cancel);
- return;
- }
- puzzleImage = newImage;
- setupPuzzle();
+void MainWindow::loadImage(const QString &fileName)
+{
+ QPixmap newImage;
+ if (!newImage.load(fileName)) {
+ QMessageBox::warning(this, tr("Open Image"),
+ tr("The image file could not be loaded."),
+ QMessageBox::Close);
+ return;
}
+ puzzleImage = newImage;
+ setupPuzzle();
}
void MainWindow::setCompleted()
@@ -120,19 +121,15 @@ void MainWindow::setupMenus()
{
QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
- QAction *openAction = fileMenu->addAction(tr("&Open..."));
+ QAction *openAction = fileMenu->addAction(tr("&Open..."), this, &MainWindow::openImage);
openAction->setShortcuts(QKeySequence::Open);
- QAction *exitAction = fileMenu->addAction(tr("E&xit"));
+ QAction *exitAction = fileMenu->addAction(tr("E&xit"), qApp, &QCoreApplication::quit);
exitAction->setShortcuts(QKeySequence::Quit);
QMenu *gameMenu = menuBar()->addMenu(tr("&Game"));
- QAction *restartAction = gameMenu->addAction(tr("&Restart"));
-
- connect(openAction, SIGNAL(triggered()), this, SLOT(openImage()));
- connect(exitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
- connect(restartAction, SIGNAL(triggered()), this, SLOT(setupPuzzle()));
+ gameMenu->addAction(tr("&Restart"), this, &MainWindow::setupPuzzle);
}
void MainWindow::setupWidgets()
@@ -144,8 +141,8 @@ void MainWindow::setupWidgets()
piecesList = new PiecesList(puzzleWidget->pieceSize(), this);
- connect(puzzleWidget, SIGNAL(puzzleCompleted()),
- this, SLOT(setCompleted()), Qt::QueuedConnection);
+ connect(puzzleWidget, &PuzzleWidget::puzzleCompleted,
+ this, &MainWindow::setCompleted, Qt::QueuedConnection);
frameLayout->addWidget(piecesList);
frameLayout->addWidget(puzzleWidget);
diff --git a/examples/widgets/draganddrop/puzzle/mainwindow.h b/examples/widgets/draganddrop/puzzle/mainwindow.h
index 093a14472e..b5b7d0d903 100644
--- a/examples/widgets/draganddrop/puzzle/mainwindow.h
+++ b/examples/widgets/draganddrop/puzzle/mainwindow.h
@@ -56,9 +56,10 @@ class MainWindow : public QMainWindow
public:
MainWindow(QWidget *parent = 0);
+ void loadImage(const QString &path);
public slots:
- void openImage(const QString &path = QString());
+ void openImage();
void setupPuzzle();
private slots:
diff --git a/examples/widgets/draganddrop/puzzle/pieceslist.cpp b/examples/widgets/draganddrop/puzzle/pieceslist.cpp
index e60fd0a9ff..fb27aa2304 100644
--- a/examples/widgets/draganddrop/puzzle/pieceslist.cpp
+++ b/examples/widgets/draganddrop/puzzle/pieceslist.cpp
@@ -57,7 +57,7 @@ PiecesList::PiecesList(int pieceSize, QWidget *parent)
void PiecesList::dragEnterEvent(QDragEnterEvent *event)
{
- if (event->mimeData()->hasFormat("image/x-puzzle-piece"))
+ if (event->mimeData()->hasFormat(PiecesList::puzzleMimeType()))
event->accept();
else
event->ignore();
@@ -65,7 +65,7 @@ void PiecesList::dragEnterEvent(QDragEnterEvent *event)
void PiecesList::dragMoveEvent(QDragMoveEvent *event)
{
- if (event->mimeData()->hasFormat("image/x-puzzle-piece")) {
+ if (event->mimeData()->hasFormat(PiecesList::puzzleMimeType())) {
event->setDropAction(Qt::MoveAction);
event->accept();
} else {
@@ -75,8 +75,8 @@ void PiecesList::dragMoveEvent(QDragMoveEvent *event)
void PiecesList::dropEvent(QDropEvent *event)
{
- if (event->mimeData()->hasFormat("image/x-puzzle-piece")) {
- QByteArray pieceData = event->mimeData()->data("image/x-puzzle-piece");
+ if (event->mimeData()->hasFormat(PiecesList::puzzleMimeType())) {
+ QByteArray pieceData = event->mimeData()->data(PiecesList::puzzleMimeType());
QDataStream dataStream(&pieceData, QIODevice::ReadOnly);
QPixmap pixmap;
QPoint location;
@@ -112,7 +112,7 @@ void PiecesList::startDrag(Qt::DropActions /*supportedActions*/)
dataStream << pixmap << location;
QMimeData *mimeData = new QMimeData;
- mimeData->setData("image/x-puzzle-piece", itemData);
+ mimeData->setData(PiecesList::puzzleMimeType(), itemData);
QDrag *drag = new QDrag(this);
drag->setMimeData(mimeData);
diff --git a/examples/widgets/draganddrop/puzzle/pieceslist.h b/examples/widgets/draganddrop/puzzle/pieceslist.h
index 83c1ad8285..07fa504f41 100644
--- a/examples/widgets/draganddrop/puzzle/pieceslist.h
+++ b/examples/widgets/draganddrop/puzzle/pieceslist.h
@@ -51,6 +51,8 @@ public:
explicit PiecesList(int pieceSize, QWidget *parent = 0);
void addPiece(QPixmap pixmap, QPoint location);
+ static QString puzzleMimeType() { return QStringLiteral("image/x-puzzle-piece"); }
+
protected:
void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE;
void dragMoveEvent(QDragMoveEvent *event) Q_DECL_OVERRIDE;
diff --git a/examples/widgets/draganddrop/puzzle/puzzle.pro b/examples/widgets/draganddrop/puzzle/puzzle.pro
index 67fff21a26..404b75187d 100644
--- a/examples/widgets/draganddrop/puzzle/puzzle.pro
+++ b/examples/widgets/draganddrop/puzzle/puzzle.pro
@@ -18,5 +18,5 @@ INSTALLS += target
wince {
addFile.files = example.jpg
addFile.path = .
- DEPLOYMENT += addFile
+ INSTALLS += addFile
}
diff --git a/examples/widgets/draganddrop/puzzle/puzzlewidget.cpp b/examples/widgets/draganddrop/puzzle/puzzlewidget.cpp
index 69c0cbf0cc..29052da4fb 100644
--- a/examples/widgets/draganddrop/puzzle/puzzlewidget.cpp
+++ b/examples/widgets/draganddrop/puzzle/puzzlewidget.cpp
@@ -39,6 +39,7 @@
****************************************************************************/
#include "puzzlewidget.h"
+#include "pieceslist.h"
#include <QDrag>
#include <QDragEnterEvent>
@@ -65,7 +66,7 @@ void PuzzleWidget::clear()
void PuzzleWidget::dragEnterEvent(QDragEnterEvent *event)
{
- if (event->mimeData()->hasFormat("image/x-puzzle-piece"))
+ if (event->mimeData()->hasFormat(PiecesList::puzzleMimeType()))
event->accept();
else
event->ignore();
@@ -83,8 +84,8 @@ void PuzzleWidget::dragMoveEvent(QDragMoveEvent *event)
{
QRect updateRect = highlightedRect.united(targetSquare(event->pos()));
- if (event->mimeData()->hasFormat("image/x-puzzle-piece")
- && findPiece(targetSquare(event->pos())) == -1) {
+ if (event->mimeData()->hasFormat(PiecesList::puzzleMimeType())
+ && pieceRects.indexOf(targetSquare(event->pos())) == -1) {
highlightedRect = targetSquare(event->pos());
event->setDropAction(Qt::MoveAction);
@@ -99,10 +100,10 @@ void PuzzleWidget::dragMoveEvent(QDragMoveEvent *event)
void PuzzleWidget::dropEvent(QDropEvent *event)
{
- if (event->mimeData()->hasFormat("image/x-puzzle-piece")
- && findPiece(targetSquare(event->pos())) == -1) {
+ if (event->mimeData()->hasFormat(PiecesList::puzzleMimeType())
+ && pieceRects.indexOf(targetSquare(event->pos())) == -1) {
- QByteArray pieceData = event->mimeData()->data("image/x-puzzle-piece");
+ QByteArray pieceData = event->mimeData()->data(PiecesList::puzzleMimeType());
QDataStream dataStream(&pieceData, QIODevice::ReadOnly);
QRect square = targetSquare(event->pos());
QPixmap pixmap;
@@ -130,19 +131,10 @@ void PuzzleWidget::dropEvent(QDropEvent *event)
}
}
-int PuzzleWidget::findPiece(const QRect &pieceRect) const
-{
- for (int i = 0; i < pieceRects.size(); ++i) {
- if (pieceRect == pieceRects[i])
- return i;
- }
- return -1;
-}
-
void PuzzleWidget::mousePressEvent(QMouseEvent *event)
{
QRect square = targetSquare(event->pos());
- int found = findPiece(square);
+ int found = pieceRects.indexOf(square);
if (found == -1)
return;
@@ -164,7 +156,7 @@ void PuzzleWidget::mousePressEvent(QMouseEvent *event)
dataStream << pixmap << location;
QMimeData *mimeData = new QMimeData;
- mimeData->setData("image/x-puzzle-piece", itemData);
+ mimeData->setData(PiecesList::puzzleMimeType(), itemData);
QDrag *drag = new QDrag(this);
drag->setMimeData(mimeData);
diff --git a/examples/widgets/draganddrop/puzzle/puzzlewidget.h b/examples/widgets/draganddrop/puzzle/puzzlewidget.h
index 6bf264b5e0..eb8a3a29f9 100644
--- a/examples/widgets/draganddrop/puzzle/puzzlewidget.h
+++ b/examples/widgets/draganddrop/puzzle/puzzlewidget.h
@@ -75,7 +75,6 @@ protected:
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
private:
- int findPiece(const QRect &pieceRect) const;
const QRect targetSquare(const QPoint &position) const;
QList<QPixmap> piecePixmaps;
diff --git a/examples/widgets/gestures/imagegestures/imagewidget.cpp b/examples/widgets/gestures/imagegestures/imagewidget.cpp
index 440eb783c1..28c715c688 100644
--- a/examples/widgets/gestures/imagegestures/imagewidget.cpp
+++ b/examples/widgets/gestures/imagegestures/imagewidget.cpp
@@ -200,7 +200,6 @@ void ImageWidget::openDirectory(const QString &path)
QImage ImageWidget::loadImage(const QString &fileName)
{
- qDebug() << position << files << fileName;
QImageReader reader(fileName);
reader.setAutoTransform(true);
qCDebug(lcExample) << "loading" << QDir::toNativeSeparators(fileName) << position << '/' << files.size();
@@ -230,7 +229,7 @@ void ImageWidget::goNextImage()
prevImage = currentImage;
currentImage = nextImage;
if (position+1 < files.size())
- nextImage = loadImage(path+QLatin1String("/")+files.at(position+1));
+ nextImage = loadImage(path + QLatin1Char('/') + files.at(position+1));
else
nextImage = QImage();
}
@@ -247,7 +246,7 @@ void ImageWidget::goPrevImage()
nextImage = currentImage;
currentImage = prevImage;
if (position > 0)
- prevImage = loadImage(path+QLatin1String("/")+files.at(position-1));
+ prevImage = loadImage(path + QLatin1Char('/') + files.at(position-1));
else
prevImage = QImage();
}
@@ -277,12 +276,12 @@ void ImageWidget::goToImage(int index)
position = index;
if (index > 0)
- prevImage = loadImage(path+QLatin1String("/")+files.at(position-1));
+ prevImage = loadImage(path + QLatin1Char('/') + files.at(position-1));
else
prevImage = QImage();
- currentImage = loadImage(path+QLatin1String("/")+files.at(position));
+ currentImage = loadImage(path + QLatin1Char('/') + files.at(position));
if (position+1 < files.size())
- nextImage = loadImage(path+QLatin1String("/")+files.at(position+1));
+ nextImage = loadImage(path + QLatin1Char('/') + files.at(position+1));
else
nextImage = QImage();
update();
diff --git a/examples/widgets/gestures/imagegestures/imagewidget.h b/examples/widgets/gestures/imagegestures/imagewidget.h
index 1629516c0a..71ad2792d0 100644
--- a/examples/widgets/gestures/imagegestures/imagewidget.h
+++ b/examples/widgets/gestures/imagegestures/imagewidget.h
@@ -77,7 +77,6 @@ private:
void swipeTriggered(QSwipeGesture*);
//! [class definition begin]
- void updateImage();
QImage loadImage(const QString &fileName);
void loadImage();
void goNextImage();
diff --git a/examples/widgets/gestures/imagegestures/mainwidget.h b/examples/widgets/gestures/imagegestures/mainwidget.h
index 20e32d1afb..e37baa398c 100644
--- a/examples/widgets/gestures/imagegestures/mainwidget.h
+++ b/examples/widgets/gestures/imagegestures/mainwidget.h
@@ -57,8 +57,6 @@ public slots:
void openDirectory(const QString &path);
private:
- bool loadImage(const QString &fileName);
-
ImageWidget *imageWidget;
};
diff --git a/examples/widgets/graphicsview/boxes/scene.cpp b/examples/widgets/graphicsview/boxes/scene.cpp
index 48bdcb9d93..c9691704cb 100644
--- a/examples/widgets/graphicsview/boxes/scene.cpp
+++ b/examples/widgets/graphicsview/boxes/scene.cpp
@@ -319,9 +319,9 @@ RenderOptionsDialog::RenderOptionsDialog()
while (++it != tokens.end()) {
m_parameterNames << name;
if (!singleElement) {
- m_parameterNames.back() += "[";
+ m_parameterNames.back() += '[';
m_parameterNames.back() += counter + counterPos;
- m_parameterNames.back() += "]";
+ m_parameterNames.back() += ']';
int j = 8; // position of last digit
++counter[j];
while (j > 0 && counter[j] > '9') {
diff --git a/examples/widgets/itemviews/addressbook/adddialog.cpp b/examples/widgets/itemviews/addressbook/adddialog.cpp
index de5c7eaf87..d153381b56 100644
--- a/examples/widgets/itemviews/addressbook/adddialog.cpp
+++ b/examples/widgets/itemviews/addressbook/adddialog.cpp
@@ -72,8 +72,8 @@ AddDialog::AddDialog(QWidget *parent)
mainLayout->addLayout(gLayout);
setLayout(mainLayout);
- connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
- connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
+ connect(okButton, &QAbstractButton::clicked, this, &QDialog::accept);
+ connect(cancelButton, &QAbstractButton::clicked, this, &QDialog::reject);
setWindowTitle(tr("Add a Contact"));
}
diff --git a/examples/widgets/itemviews/addressbook/addresswidget.cpp b/examples/widgets/itemviews/addressbook/addresswidget.cpp
index 20589a9417..792d626a4e 100644
--- a/examples/widgets/itemviews/addressbook/addresswidget.cpp
+++ b/examples/widgets/itemviews/addressbook/addresswidget.cpp
@@ -49,8 +49,8 @@ AddressWidget::AddressWidget(QWidget *parent)
{
table = new TableModel(this);
newAddressTab = new NewAddressTab(this);
- connect(newAddressTab, SIGNAL(sendDetails(QString, QString)),
- this, SLOT(addEntry(QString, QString)));
+ connect(newAddressTab, &NewAddressTab::sendDetails,
+ this, &AddressWidget::addEntry);
addTab(newAddressTab, "Address Book");
@@ -59,7 +59,7 @@ AddressWidget::AddressWidget(QWidget *parent)
//! [0]
//! [2]
-void AddressWidget::addEntry()
+void AddressWidget::showAddEntryDialog()
{
AddDialog aDialog;
@@ -182,8 +182,8 @@ void AddressWidget::setupTabs()
tableView->setSortingEnabled(true);
connect(tableView->selectionModel(),
- SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
- this, SIGNAL(selectionChanged(QItemSelection)));
+ &QItemSelectionModel::selectionChanged,
+ this, &AddressWidget::selectionChanged);
addTab(tableView, str);
}
diff --git a/examples/widgets/itemviews/addressbook/addresswidget.h b/examples/widgets/itemviews/addressbook/addresswidget.h
index b990c47911..a2fc4bc03b 100644
--- a/examples/widgets/itemviews/addressbook/addresswidget.h
+++ b/examples/widgets/itemviews/addressbook/addresswidget.h
@@ -63,7 +63,7 @@ public:
void writeToFile(const QString &fileName);
public slots:
- void addEntry();
+ void showAddEntryDialog();
void addEntry(QString name, QString address);
void editEntry();
void removeEntry();
diff --git a/examples/widgets/itemviews/addressbook/mainwindow.cpp b/examples/widgets/itemviews/addressbook/mainwindow.cpp
index f729f43604..94b38ea2f6 100644
--- a/examples/widgets/itemviews/addressbook/mainwindow.cpp
+++ b/examples/widgets/itemviews/addressbook/mainwindow.cpp
@@ -61,40 +61,40 @@ void MainWindow::createMenus()
openAct = new QAction(tr("&Open..."), this);
fileMenu->addAction(openAct);
- connect(openAct, SIGNAL(triggered()), this, SLOT(openFile()));
+ connect(openAct, &QAction::triggered, this, &MainWindow::openFile);
//! [1a]
saveAct = new QAction(tr("&Save As..."), this);
fileMenu->addAction(saveAct);
- connect(saveAct, SIGNAL(triggered()), this, SLOT(saveFile()));
+ connect(saveAct, &QAction::triggered, this, &MainWindow::saveFile);
fileMenu->addSeparator();
exitAct = new QAction(tr("E&xit"), this);
fileMenu->addAction(exitAct);
- connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
+ connect(exitAct, &QAction::triggered, this, &QWidget::close);
toolMenu = menuBar()->addMenu(tr("&Tools"));
addAct = new QAction(tr("&Add Entry..."), this);
toolMenu->addAction(addAct);
- connect(addAct, SIGNAL(triggered()), addressWidget, SLOT(addEntry()));
+ connect(addAct, &QAction::triggered, addressWidget, &AddressWidget::showAddEntryDialog);
//! [1b]
editAct = new QAction(tr("&Edit Entry..."), this);
editAct->setEnabled(false);
toolMenu->addAction(editAct);
- connect(editAct, SIGNAL(triggered()), addressWidget, SLOT(editEntry()));
+ connect(editAct, &QAction::triggered, addressWidget, &AddressWidget::editEntry);
toolMenu->addSeparator();
removeAct = new QAction(tr("&Remove Entry"), this);
removeAct->setEnabled(false);
toolMenu->addAction(removeAct);
- connect(removeAct, SIGNAL(triggered()), addressWidget, SLOT(removeEntry()));
+ connect(removeAct, &QAction::triggered, addressWidget, &AddressWidget::removeEntry);
- connect(addressWidget, SIGNAL(selectionChanged(QItemSelection)),
- this, SLOT(updateActions(QItemSelection)));
+ connect(addressWidget, &AddressWidget::selectionChanged,
+ this, &MainWindow::updateActions);
}
//! [1b]
diff --git a/examples/widgets/itemviews/addressbook/newaddresstab.cpp b/examples/widgets/itemviews/addressbook/newaddresstab.cpp
index 012a19991c..af66636995 100644
--- a/examples/widgets/itemviews/addressbook/newaddresstab.cpp
+++ b/examples/widgets/itemviews/addressbook/newaddresstab.cpp
@@ -53,7 +53,7 @@ NewAddressTab::NewAddressTab(QWidget *parent)
addButton = new QPushButton(tr("Add"));
- connect(addButton, SIGNAL(clicked()), this, SLOT(addEntry()));
+ connect(addButton, &QAbstractButton::clicked, this, &NewAddressTab::addEntry);
mainLayout = new QVBoxLayout;
mainLayout->addWidget(descriptionLabel);
diff --git a/examples/widgets/itemviews/basicsortfiltermodel/window.cpp b/examples/widgets/itemviews/basicsortfiltermodel/window.cpp
index b518460230..0f5a434bcc 100644
--- a/examples/widgets/itemviews/basicsortfiltermodel/window.cpp
+++ b/examples/widgets/itemviews/basicsortfiltermodel/window.cpp
@@ -77,16 +77,18 @@ Window::Window()
filterColumnLabel = new QLabel(tr("Filter &column:"));
filterColumnLabel->setBuddy(filterColumnComboBox);
- connect(filterPatternLineEdit, SIGNAL(textChanged(QString)),
- this, SLOT(filterRegExpChanged()));
- connect(filterSyntaxComboBox, SIGNAL(currentIndexChanged(int)),
- this, SLOT(filterRegExpChanged()));
- connect(filterColumnComboBox, SIGNAL(currentIndexChanged(int)),
- this, SLOT(filterColumnChanged()));
- connect(filterCaseSensitivityCheckBox, SIGNAL(toggled(bool)),
- this, SLOT(filterRegExpChanged()));
- connect(sortCaseSensitivityCheckBox, SIGNAL(toggled(bool)),
- this, SLOT(sortChanged()));
+ connect(filterPatternLineEdit, &QLineEdit::textChanged,
+ this, &Window::filterRegExpChanged);
+
+ typedef void (QComboBox::*QComboIntSignal)(int);
+ connect(filterSyntaxComboBox, static_cast<QComboIntSignal>(&QComboBox::currentIndexChanged),
+ this, &Window::filterRegExpChanged);
+ connect(filterColumnComboBox, static_cast<QComboIntSignal>(&QComboBox::currentIndexChanged),
+ this, &Window::filterColumnChanged);
+ connect(filterCaseSensitivityCheckBox, &QAbstractButton::toggled,
+ this, &Window::filterRegExpChanged);
+ connect(sortCaseSensitivityCheckBox, &QAbstractButton::toggled,
+ this, &Window::sortChanged);
sourceGroupBox = new QGroupBox(tr("Original Model"));
proxyGroupBox = new QGroupBox(tr("Sorted/Filtered Model"));
diff --git a/examples/widgets/itemviews/chart/mainwindow.cpp b/examples/widgets/itemviews/chart/mainwindow.cpp
index 646b8a293a..a148c3036d 100644
--- a/examples/widgets/itemviews/chart/mainwindow.cpp
+++ b/examples/widgets/itemviews/chart/mainwindow.cpp
@@ -56,14 +56,14 @@ MainWindow::MainWindow()
setupModel();
setupViews();
- connect(openAction, SIGNAL(triggered()), this, SLOT(openFile()));
- connect(saveAction, SIGNAL(triggered()), this, SLOT(saveFile()));
- connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
+ connect(openAction, &QAction::triggered, this, &MainWindow::openFile);
+ connect(saveAction, &QAction::triggered, this, &MainWindow::saveFile);
+ connect(quitAction, &QAction::triggered, qApp, &QCoreApplication::quit);
menuBar()->addMenu(fileMenu);
statusBar();
- openFile(":/Charts/qtdata.cht");
+ loadFile(":/Charts/qtdata.cht");
setWindowTitle(tr("Chart"));
resize(870, 550);
@@ -99,17 +99,16 @@ void MainWindow::setupViews()
setCentralWidget(splitter);
}
-void MainWindow::openFile(const QString &path)
+void MainWindow::openFile()
{
- QString fileName;
- if (path.isNull())
- fileName = QFileDialog::getOpenFileName(this, tr("Choose a data file"), "", "*.cht");
- else
- fileName = path;
-
- if (fileName.isEmpty())
- return;
+ const QString fileName =
+ QFileDialog::getOpenFileName(this, tr("Choose a data file"), "", "*.cht");
+ if (!fileName.isEmpty())
+ loadFile(fileName);
+}
+void MainWindow::loadFile(const QString &fileName)
+{
QFile file(fileName);
if (!file.open(QFile::ReadOnly | QFile::Text))
return;
@@ -125,7 +124,7 @@ void MainWindow::openFile(const QString &path)
if (!line.isEmpty()) {
model->insertRows(row, 1, QModelIndex());
- QStringList pieces = line.split(",", QString::SkipEmptyParts);
+ QStringList pieces = line.split(',', QString::SkipEmptyParts);
model->setData(model->index(row, 0, QModelIndex()),
pieces.value(0));
model->setData(model->index(row, 1, QModelIndex()),
diff --git a/examples/widgets/itemviews/chart/mainwindow.h b/examples/widgets/itemviews/chart/mainwindow.h
index 2fc47bb75b..523ad70441 100644
--- a/examples/widgets/itemviews/chart/mainwindow.h
+++ b/examples/widgets/itemviews/chart/mainwindow.h
@@ -57,12 +57,13 @@ public:
MainWindow();
private slots:
- void openFile(const QString &path = QString());
+ void openFile();
void saveFile();
private:
void setupModel();
void setupViews();
+ void loadFile(const QString &path);
QAbstractItemModel *model;
QAbstractItemView *pieChart;
diff --git a/examples/widgets/itemviews/combowidgetmapper/window.cpp b/examples/widgets/itemviews/combowidgetmapper/window.cpp
index d135ffb33f..3a6f649856 100644
--- a/examples/widgets/itemviews/combowidgetmapper/window.cpp
+++ b/examples/widgets/itemviews/combowidgetmapper/window.cpp
@@ -72,12 +72,12 @@ Window::Window(QWidget *parent)
//! [Set up the mapper]
//! [Set up connections and layouts]
- connect(previousButton, SIGNAL(clicked()),
- mapper, SLOT(toPrevious()));
- connect(nextButton, SIGNAL(clicked()),
- mapper, SLOT(toNext()));
- connect(mapper, SIGNAL(currentIndexChanged(int)),
- this, SLOT(updateButtons(int)));
+ connect(previousButton, &QAbstractButton::clicked,
+ mapper, &QDataWidgetMapper::toPrevious);
+ connect(nextButton, &QAbstractButton::clicked,
+ mapper, &QDataWidgetMapper::toNext);
+ connect(mapper, &QDataWidgetMapper::currentIndexChanged,
+ this, &Window::updateButtons);
QGridLayout *layout = new QGridLayout();
layout->addWidget(nameLabel, 0, 0, 1, 1);
diff --git a/examples/widgets/itemviews/customsortfiltermodel/filterwidget.cpp b/examples/widgets/itemviews/customsortfiltermodel/filterwidget.cpp
index 6b5896f3c1..12019e606a 100644
--- a/examples/widgets/itemviews/customsortfiltermodel/filterwidget.cpp
+++ b/examples/widgets/itemviews/customsortfiltermodel/filterwidget.cpp
@@ -55,12 +55,12 @@ FilterWidget::FilterWidget(QWidget *parent)
, m_patternGroup(new QActionGroup(this))
{
setClearButtonEnabled(true);
- connect(this, SIGNAL(textChanged(QString)), this, SIGNAL(filterChanged()));
+ connect(this, &QLineEdit::textChanged, this, &FilterWidget::filterChanged);
QMenu *menu = new QMenu(this);
m_caseSensitivityAction = menu->addAction(tr("Case Sensitive"));
m_caseSensitivityAction->setCheckable(true);
- connect(m_caseSensitivityAction, SIGNAL(toggled(bool)), this, SIGNAL(filterChanged()));
+ connect(m_caseSensitivityAction, &QAction::toggled, this, &FilterWidget::filterChanged);
menu->addSeparator();
m_patternGroup->setExclusive(true);
@@ -77,7 +77,7 @@ FilterWidget::FilterWidget(QWidget *parent)
patternAction->setCheckable(true);
patternAction->setData(QVariant(int(QRegExp::Wildcard)));
m_patternGroup->addAction(patternAction);
- connect(m_patternGroup, SIGNAL(triggered(QAction*)), this, SIGNAL(filterChanged()));
+ connect(m_patternGroup, &QActionGroup::triggered, this, &FilterWidget::filterChanged);
const QIcon icon = QIcon(QPixmap(":/images/find.png"));
QToolButton *optionsButton = new QToolButton;
diff --git a/examples/widgets/itemviews/customsortfiltermodel/window.cpp b/examples/widgets/itemviews/customsortfiltermodel/window.cpp
index 8653df2a61..ff07dfe79c 100644
--- a/examples/widgets/itemviews/customsortfiltermodel/window.cpp
+++ b/examples/widgets/itemviews/customsortfiltermodel/window.cpp
@@ -66,7 +66,7 @@ Window::Window()
//! [3]
filterWidget = new FilterWidget;
filterWidget->setText("Grace|Sports");
- connect(filterWidget, SIGNAL(filterChanged()), this, SLOT(textFilterChanged()));
+ connect(filterWidget, &FilterWidget::filterChanged, this, &Window::textFilterChanged);
filterPatternLabel = new QLabel(tr("&Filter pattern:"));
filterPatternLabel->setBuddy(filterWidget);
@@ -81,13 +81,13 @@ Window::Window()
toLabel = new QLabel(tr("&To:"));
toLabel->setBuddy(toDateEdit);
- connect(filterWidget, SIGNAL(textChanged(QString)),
- this, SLOT(textFilterChanged()));
- connect(fromDateEdit, SIGNAL(dateChanged(QDate)),
- this, SLOT(dateFilterChanged()));
- connect(toDateEdit, SIGNAL(dateChanged(QDate)),
+ connect(filterWidget, &QLineEdit::textChanged,
+ this, &Window::textFilterChanged);
+ connect(fromDateEdit, &QDateTimeEdit::dateChanged,
+ this, &Window::dateFilterChanged);
+ connect(toDateEdit, &QDateTimeEdit::dateChanged,
//! [3] //! [4]
- this, SLOT(dateFilterChanged()));
+ this, &Window::dateFilterChanged);
//! [4]
//! [5]
diff --git a/examples/widgets/itemviews/editabletreemodel/mainwindow.cpp b/examples/widgets/itemviews/editabletreemodel/mainwindow.cpp
index c7abe59c77..f138e27095 100644
--- a/examples/widgets/itemviews/editabletreemodel/mainwindow.cpp
+++ b/examples/widgets/itemviews/editabletreemodel/mainwindow.cpp
@@ -60,19 +60,17 @@ MainWindow::MainWindow(QWidget *parent)
for (int column = 0; column < model->columnCount(); ++column)
view->resizeColumnToContents(column);
- connect(exitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
+ connect(exitAction, &QAction::triggered, qApp, &QCoreApplication::quit);
- connect(view->selectionModel(),
- SIGNAL(selectionChanged(const QItemSelection &,
- const QItemSelection &)),
- this, SLOT(updateActions()));
+ connect(view->selectionModel(), &QItemSelectionModel::selectionChanged,
+ this, &MainWindow::updateActions);
- connect(actionsMenu, SIGNAL(aboutToShow()), this, SLOT(updateActions()));
- connect(insertRowAction, SIGNAL(triggered()), this, SLOT(insertRow()));
- connect(insertColumnAction, SIGNAL(triggered()), this, SLOT(insertColumn()));
- connect(removeRowAction, SIGNAL(triggered()), this, SLOT(removeRow()));
- connect(removeColumnAction, SIGNAL(triggered()), this, SLOT(removeColumn()));
- connect(insertChildAction, SIGNAL(triggered()), this, SLOT(insertChild()));
+ connect(actionsMenu, &QMenu::aboutToShow, this, &MainWindow::updateActions);
+ connect(insertRowAction, &QAction::triggered, this, &MainWindow::insertRow);
+ connect(insertColumnAction, &QAction::triggered, this, &MainWindow::insertColumn);
+ connect(removeRowAction, &QAction::triggered, this, &MainWindow::removeRow);
+ connect(removeColumnAction, &QAction::triggered, this, &MainWindow::removeColumn);
+ connect(insertChildAction, &QAction::triggered, this, &MainWindow::insertChild);
updateActions();
}
@@ -102,13 +100,13 @@ void MainWindow::insertChild()
updateActions();
}
-bool MainWindow::insertColumn(const QModelIndex &parent)
+bool MainWindow::insertColumn()
{
QAbstractItemModel *model = view->model();
int column = view->selectionModel()->currentIndex().column();
// Insert a column in the parent item.
- bool changed = model->insertColumn(column + 1, parent);
+ bool changed = model->insertColumn(column + 1);
if (changed)
model->setHeaderData(column + 1, Qt::Horizontal, QVariant("[No header]"), Qt::EditRole);
@@ -133,15 +131,15 @@ void MainWindow::insertRow()
}
}
-bool MainWindow::removeColumn(const QModelIndex &parent)
+bool MainWindow::removeColumn()
{
QAbstractItemModel *model = view->model();
int column = view->selectionModel()->currentIndex().column();
// Insert columns in each child of the parent item.
- bool changed = model->removeColumn(column, parent);
+ bool changed = model->removeColumn(column);
- if (!parent.isValid() && changed)
+ if (changed)
updateActions();
return changed;
diff --git a/examples/widgets/itemviews/editabletreemodel/mainwindow.h b/examples/widgets/itemviews/editabletreemodel/mainwindow.h
index 4626ecbc2a..4c164f88c1 100644
--- a/examples/widgets/itemviews/editabletreemodel/mainwindow.h
+++ b/examples/widgets/itemviews/editabletreemodel/mainwindow.h
@@ -58,9 +58,9 @@ public slots:
private slots:
void insertChild();
- bool insertColumn(const QModelIndex &parent = QModelIndex());
+ bool insertColumn();
void insertRow();
- bool removeColumn(const QModelIndex &parent = QModelIndex());
+ bool removeColumn();
void removeRow();
};
diff --git a/examples/widgets/itemviews/editabletreemodel/treemodel.cpp b/examples/widgets/itemviews/editabletreemodel/treemodel.cpp
index 2903dd7d38..2b12c142cd 100644
--- a/examples/widgets/itemviews/editabletreemodel/treemodel.cpp
+++ b/examples/widgets/itemviews/editabletreemodel/treemodel.cpp
@@ -246,7 +246,7 @@ void TreeModel::setupModelData(const QStringList &lines, TreeItem *parent)
while (number < lines.count()) {
int position = 0;
while (position < lines[number].length()) {
- if (lines[number].mid(position, 1) != " ")
+ if (lines[number].at(position) != ' ')
break;
++position;
}
diff --git a/examples/widgets/itemviews/fetchmore/window.cpp b/examples/widgets/itemviews/fetchmore/window.cpp
index eefa09622d..aa4e0adc90 100644
--- a/examples/widgets/itemviews/fetchmore/window.cpp
+++ b/examples/widgets/itemviews/fetchmore/window.cpp
@@ -59,12 +59,12 @@ Window::Window(QWidget *parent)
logViewer = new QTextBrowser;
logViewer->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred));
- connect(lineEdit, SIGNAL(textChanged(QString)),
- model, SLOT(setDirPath(QString)));
- connect(lineEdit, SIGNAL(textChanged(QString)),
- logViewer, SLOT(clear()));
- connect(model, SIGNAL(numberPopulated(int)),
- this, SLOT(updateLog(int)));
+ connect(lineEdit, &QLineEdit::textChanged,
+ model, &FileListModel::setDirPath);
+ connect(lineEdit, &QLineEdit::textChanged,
+ logViewer, &QTextEdit::clear);
+ connect(model, &FileListModel::numberPopulated,
+ this, &Window::updateLog);
QGridLayout *layout = new QGridLayout;
layout->addWidget(label, 0, 0);
diff --git a/examples/widgets/itemviews/frozencolumn/freezetablewidget.cpp b/examples/widgets/itemviews/frozencolumn/freezetablewidget.cpp
index 254786b16e..c2233abcc2 100644
--- a/examples/widgets/itemviews/frozencolumn/freezetablewidget.cpp
+++ b/examples/widgets/itemviews/frozencolumn/freezetablewidget.cpp
@@ -52,15 +52,15 @@ FreezeTableWidget::FreezeTableWidget(QAbstractItemModel * model)
init();
//connect the headers and scrollbars of both tableviews together
- connect(horizontalHeader(),SIGNAL(sectionResized(int,int,int)), this,
- SLOT(updateSectionWidth(int,int,int)));
- connect(verticalHeader(),SIGNAL(sectionResized(int,int,int)), this,
- SLOT(updateSectionHeight(int,int,int)));
-
- connect(frozenTableView->verticalScrollBar(), SIGNAL(valueChanged(int)),
- verticalScrollBar(), SLOT(setValue(int)));
- connect(verticalScrollBar(), SIGNAL(valueChanged(int)),
- frozenTableView->verticalScrollBar(), SLOT(setValue(int)));
+ connect(horizontalHeader(),&QHeaderView::sectionResized, this,
+ &FreezeTableWidget::updateSectionWidth);
+ connect(verticalHeader(),&QHeaderView::sectionResized, this,
+ &FreezeTableWidget::updateSectionHeight);
+
+ connect(frozenTableView->verticalScrollBar(), &QAbstractSlider::valueChanged,
+ verticalScrollBar(), &QAbstractSlider::setValue);
+ connect(verticalScrollBar(), &QAbstractSlider::valueChanged,
+ frozenTableView->verticalScrollBar(), &QAbstractSlider::setValue);
}
diff --git a/examples/widgets/itemviews/frozencolumn/main.cpp b/examples/widgets/itemviews/frozencolumn/main.cpp
index cfdf57135c..1292a7f403 100644
--- a/examples/widgets/itemviews/frozencolumn/main.cpp
+++ b/examples/widgets/itemviews/frozencolumn/main.cpp
@@ -54,15 +54,15 @@ int main(int argc, char* argv[])
QFile file(":/grades.txt");
if (file.open(QFile::ReadOnly)) {
QString line = file.readLine(200);
- QStringList list = line.simplified().split(",");
+ QStringList list = line.simplified().split(',');
model->setHorizontalHeaderLabels(list);
int row = 0;
QStandardItem *newItem = 0;
while (file.canReadLine()) {
line = file.readLine(200);
- if (!line.startsWith("#") && line.contains(",")) {
- list= line.simplified().split(",");
+ if (!line.startsWith('#') && line.contains(',')) {
+ list = line.simplified().split(',');
for (int col = 0; col < list.length(); ++col){
newItem = new QStandardItem(list.at(col));
model->setItem(row, col, newItem);
diff --git a/examples/widgets/itemviews/interview/model.cpp b/examples/widgets/itemviews/interview/model.cpp
index ba65144cfa..efbb67486b 100644
--- a/examples/widgets/itemviews/interview/model.cpp
+++ b/examples/widgets/itemviews/interview/model.cpp
@@ -88,7 +88,7 @@ QVariant Model::data(const QModelIndex &index, int role) const
if (!index.isValid())
return QVariant();
if (role == Qt::DisplayRole)
- return QVariant("Item " + QString::number(index.row()) + ":" + QString::number(index.column()));
+ return QVariant("Item " + QString::number(index.row()) + ':' + QString::number(index.column()));
if (role == Qt::DecorationRole) {
if (index.column() == 0)
return iconProvider.icon(QFileIconProvider::Folder);
diff --git a/examples/widgets/itemviews/pixelator/mainwindow.cpp b/examples/widgets/itemviews/pixelator/mainwindow.cpp
index a05880225b..bab130a2b2 100644
--- a/examples/widgets/itemviews/pixelator/mainwindow.cpp
+++ b/examples/widgets/itemviews/pixelator/mainwindow.cpp
@@ -98,15 +98,16 @@ MainWindow::MainWindow()
menuBar()->addSeparator();
menuBar()->addMenu(helpMenu);
- connect(openAction, SIGNAL(triggered()), this, SLOT(chooseImage()));
- connect(printAction, SIGNAL(triggered()), this, SLOT(printImage()));
- connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
- connect(aboutAction, SIGNAL(triggered()), this, SLOT(showAboutBox()));
+ connect(openAction, &QAction::triggered, this, &MainWindow::chooseImage);
+ connect(printAction, &QAction::triggered, this, &MainWindow::printImage);
+ connect(quitAction, &QAction::triggered, qApp, &QCoreApplication::quit);
+ connect(aboutAction, &QAction::triggered, this, &MainWindow::showAboutBox);
//! [4]
- connect(pixelSizeSpinBox, SIGNAL(valueChanged(int)),
- delegate, SLOT(setPixelSize(int)));
- connect(pixelSizeSpinBox, SIGNAL(valueChanged(int)),
- this, SLOT(updateView()));
+ typedef void (QSpinBox::*QSpinBoxIntSignal)(int);
+ connect(pixelSizeSpinBox, static_cast<QSpinBoxIntSignal>(&QSpinBox::valueChanged),
+ delegate, &PixelDelegate::setPixelSize);
+ connect(pixelSizeSpinBox, static_cast<QSpinBoxIntSignal>(&QSpinBox::valueChanged),
+ this, &MainWindow::updateView);
//! [4]
QHBoxLayout *controlsLayout = new QHBoxLayout;
diff --git a/examples/widgets/itemviews/puzzle/main.cpp b/examples/widgets/itemviews/puzzle/main.cpp
index 866c6f0d8b..a7980489a8 100644
--- a/examples/widgets/itemviews/puzzle/main.cpp
+++ b/examples/widgets/itemviews/puzzle/main.cpp
@@ -48,7 +48,7 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
MainWindow window;
- window.openImage(":/images/example.jpg");
+ window.loadImage(":/images/example.jpg");
window.show();
return app.exec();
}
diff --git a/examples/widgets/itemviews/puzzle/mainwindow.cpp b/examples/widgets/itemviews/puzzle/mainwindow.cpp
index 2e2a1d0ab5..5cd9a7f0df 100644
--- a/examples/widgets/itemviews/puzzle/mainwindow.cpp
+++ b/examples/widgets/itemviews/puzzle/mainwindow.cpp
@@ -57,26 +57,27 @@ MainWindow::MainWindow(QWidget *parent)
setWindowTitle(tr("Puzzle"));
}
-void MainWindow::openImage(const QString &path)
+void MainWindow::openImage()
{
- QString fileName = path;
-
- if (fileName.isNull()) {
- fileName = QFileDialog::getOpenFileName(this,
- tr("Open Image"), "", tr("Image Files (*.png *.jpg *.bmp)"));
- }
+ const QString fileName =
+ QFileDialog::getOpenFileName(this,
+ tr("Open Image"), QString(),
+ tr("Image Files (*.png *.jpg *.bmp)"));
+ if (!fileName.isEmpty())
+ loadImage(fileName);
+}
- if (!fileName.isEmpty()) {
- QPixmap newImage;
- if (!newImage.load(fileName)) {
- QMessageBox::warning(this, tr("Open Image"),
- tr("The image file could not be loaded."),
- QMessageBox::Cancel);
- return;
- }
- puzzleImage = newImage;
- setupPuzzle();
+void MainWindow::loadImage(const QString &fileName)
+{
+ QPixmap newImage;
+ if (!newImage.load(fileName)) {
+ QMessageBox::warning(this, tr("Open Image"),
+ tr("The image file could not be loaded."),
+ QMessageBox::Cancel);
+ return;
}
+ puzzleImage = newImage;
+ setupPuzzle();
}
void MainWindow::setCompleted()
@@ -116,9 +117,9 @@ void MainWindow::setupMenus()
QAction *restartAction = gameMenu->addAction(tr("&Restart"));
- connect(openAction, SIGNAL(triggered()), this, SLOT(openImage()));
- connect(exitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
- connect(restartAction, SIGNAL(triggered()), this, SLOT(setupPuzzle()));
+ connect(openAction, &QAction::triggered, this, &MainWindow::openImage);
+ connect(exitAction, &QAction::triggered, qApp, &QCoreApplication::quit);
+ connect(restartAction, &QAction::triggered, this, &MainWindow::setupPuzzle);
}
void MainWindow::setupWidgets()
@@ -141,8 +142,8 @@ void MainWindow::setupWidgets()
PiecesModel *model = new PiecesModel(puzzleWidget->pieceSize(), this);
piecesList->setModel(model);
- connect(puzzleWidget, SIGNAL(puzzleCompleted()),
- this, SLOT(setCompleted()), Qt::QueuedConnection);
+ connect(puzzleWidget, &PuzzleWidget::puzzleCompleted,
+ this, &MainWindow::setCompleted, Qt::QueuedConnection);
frameLayout->addWidget(piecesList);
frameLayout->addWidget(puzzleWidget);
diff --git a/examples/widgets/itemviews/puzzle/mainwindow.h b/examples/widgets/itemviews/puzzle/mainwindow.h
index 86daf0af2d..440dd46377 100644
--- a/examples/widgets/itemviews/puzzle/mainwindow.h
+++ b/examples/widgets/itemviews/puzzle/mainwindow.h
@@ -58,7 +58,8 @@ public:
MainWindow(QWidget *parent = 0);
public slots:
- void openImage(const QString &path = QString());
+ void openImage();
+ void loadImage(const QString &path);
void setupPuzzle();
private slots:
diff --git a/examples/widgets/itemviews/simpledommodel/dommodel.cpp b/examples/widgets/itemviews/simpledommodel/dommodel.cpp
index f6450abc8b..531957f60b 100644
--- a/examples/widgets/itemviews/simpledommodel/dommodel.cpp
+++ b/examples/widgets/itemviews/simpledommodel/dommodel.cpp
@@ -88,7 +88,7 @@ QVariant DomModel::data(const QModelIndex &index, int role) const
for (int i = 0; i < attributeMap.count(); ++i) {
QDomNode attribute = attributeMap.item(i);
attributes << attribute.nodeName() + "=\""
- +attribute.nodeValue() + "\"";
+ +attribute.nodeValue() + '"';
}
return attributes.join(' ');
case 2:
diff --git a/examples/widgets/itemviews/simpledommodel/mainwindow.cpp b/examples/widgets/itemviews/simpledommodel/mainwindow.cpp
index 4dc87dac1a..c11fb40a0e 100644
--- a/examples/widgets/itemviews/simpledommodel/mainwindow.cpp
+++ b/examples/widgets/itemviews/simpledommodel/mainwindow.cpp
@@ -49,8 +49,8 @@
MainWindow::MainWindow() : QMainWindow(), model(0)
{
fileMenu = menuBar()->addMenu(tr("&File"));
- fileMenu->addAction(tr("&Open..."), this, SLOT(openFile()), QKeySequence::Open);
- fileMenu->addAction(tr("E&xit"), this, SLOT(close()), QKeySequence::Quit);
+ fileMenu->addAction(tr("&Open..."), this, &MainWindow::openFile, QKeySequence::Open);
+ fileMenu->addAction(tr("E&xit"), this, &QWidget::close, QKeySequence::Quit);
model = new DomModel(QDomDocument(), this);
view = new QTreeView(this);
diff --git a/examples/widgets/itemviews/simpletreemodel/treemodel.cpp b/examples/widgets/itemviews/simpletreemodel/treemodel.cpp
index aaa4685b27..f5cd1a160e 100644
--- a/examples/widgets/itemviews/simpletreemodel/treemodel.cpp
+++ b/examples/widgets/itemviews/simpletreemodel/treemodel.cpp
@@ -180,7 +180,7 @@ void TreeModel::setupModelData(const QStringList &lines, TreeItem *parent)
while (number < lines.count()) {
int position = 0;
while (position < lines[number].length()) {
- if (lines[number].mid(position, 1) != " ")
+ if (lines[number].at(position) != ' ')
break;
position++;
}
diff --git a/examples/widgets/itemviews/simplewidgetmapper/window.cpp b/examples/widgets/itemviews/simplewidgetmapper/window.cpp
index 9df004430b..0d99acc603 100644
--- a/examples/widgets/itemviews/simplewidgetmapper/window.cpp
+++ b/examples/widgets/itemviews/simplewidgetmapper/window.cpp
@@ -69,9 +69,9 @@ Window::Window(QWidget *parent)
mapper->addMapping(addressEdit, 1);
mapper->addMapping(ageSpinBox, 2);
- connect(previousButton, SIGNAL(clicked()), mapper, SLOT(toPrevious()));
- connect(nextButton, SIGNAL(clicked()), mapper, SLOT(toNext()));
- connect(mapper, SIGNAL(currentIndexChanged(int)), this, SLOT(updateButtons(int)));
+ connect(previousButton, &QAbstractButton::clicked, mapper, &QDataWidgetMapper::toPrevious);
+ connect(nextButton, &QAbstractButton::clicked, mapper, &QDataWidgetMapper::toNext);
+ connect(mapper, &QDataWidgetMapper::currentIndexChanged, this, &Window::updateButtons);
//! [Set up the mapper]
//! [Set up the layout]
diff --git a/examples/widgets/itemviews/spreadsheet/spreadsheet.cpp b/examples/widgets/itemviews/spreadsheet/spreadsheet.cpp
index 02e635b87a..41b51c1071 100644
--- a/examples/widgets/itemviews/spreadsheet/spreadsheet.cpp
+++ b/examples/widgets/itemviews/spreadsheet/spreadsheet.cpp
@@ -73,17 +73,17 @@ SpreadSheet::SpreadSheet(int rows, int cols, QWidget *parent)
setCentralWidget(table);
statusBar();
- connect(table, SIGNAL(currentItemChanged(QTableWidgetItem*,QTableWidgetItem*)),
- this, SLOT(updateStatus(QTableWidgetItem*)));
- connect(table, SIGNAL(currentItemChanged(QTableWidgetItem*,QTableWidgetItem*)),
- this, SLOT(updateColor(QTableWidgetItem*)));
- connect(table, SIGNAL(currentItemChanged(QTableWidgetItem*,QTableWidgetItem*)),
- this, SLOT(updateLineEdit(QTableWidgetItem*)));
- connect(table, SIGNAL(itemChanged(QTableWidgetItem*)),
- this, SLOT(updateStatus(QTableWidgetItem*)));
- connect(formulaInput, SIGNAL(returnPressed()), this, SLOT(returnPressed()));
- connect(table, SIGNAL(itemChanged(QTableWidgetItem*)),
- this, SLOT(updateLineEdit(QTableWidgetItem*)));
+ connect(table, &QTableWidget::currentItemChanged,
+ this, &SpreadSheet::updateStatus);
+ connect(table, &QTableWidget::currentItemChanged,
+ this, &SpreadSheet::updateColor);
+ connect(table, &QTableWidget::currentItemChanged,
+ this, &SpreadSheet::updateLineEdit);
+ connect(table, &QTableWidget::itemChanged,
+ this, &SpreadSheet::updateStatus);
+ connect(formulaInput, &QLineEdit::returnPressed, this, &SpreadSheet::returnPressed);
+ connect(table, &QTableWidget::itemChanged,
+ this, &SpreadSheet::updateLineEdit);
setWindowTitle(tr("Spreadsheet"));
}
@@ -91,43 +91,43 @@ SpreadSheet::SpreadSheet(int rows, int cols, QWidget *parent)
void SpreadSheet::createActions()
{
cell_sumAction = new QAction(tr("Sum"), this);
- connect(cell_sumAction, SIGNAL(triggered()), this, SLOT(actionSum()));
+ connect(cell_sumAction, &QAction::triggered, this, &SpreadSheet::actionSum);
cell_addAction = new QAction(tr("&Add"), this);
cell_addAction->setShortcut(Qt::CTRL | Qt::Key_Plus);
- connect(cell_addAction, SIGNAL(triggered()), this, SLOT(actionAdd()));
+ connect(cell_addAction, &QAction::triggered, this, &SpreadSheet::actionAdd);
cell_subAction = new QAction(tr("&Subtract"), this);
cell_subAction->setShortcut(Qt::CTRL | Qt::Key_Minus);
- connect(cell_subAction, SIGNAL(triggered()), this, SLOT(actionSubtract()));
+ connect(cell_subAction, &QAction::triggered, this, &SpreadSheet::actionSubtract);
cell_mulAction = new QAction(tr("&Multiply"), this);
cell_mulAction->setShortcut(Qt::CTRL | Qt::Key_multiply);
- connect(cell_mulAction, SIGNAL(triggered()), this, SLOT(actionMultiply()));
+ connect(cell_mulAction, &QAction::triggered, this, &SpreadSheet::actionMultiply);
cell_divAction = new QAction(tr("&Divide"), this);
cell_divAction->setShortcut(Qt::CTRL | Qt::Key_division);
- connect(cell_divAction, SIGNAL(triggered()), this, SLOT(actionDivide()));
+ connect(cell_divAction, &QAction::triggered, this, &SpreadSheet::actionDivide);
fontAction = new QAction(tr("Font..."), this);
fontAction->setShortcut(Qt::CTRL | Qt::Key_F);
- connect(fontAction, SIGNAL(triggered()), this, SLOT(selectFont()));
+ connect(fontAction, &QAction::triggered, this, &SpreadSheet::selectFont);
colorAction = new QAction(QPixmap(16, 16), tr("Background &Color..."), this);
- connect(colorAction, SIGNAL(triggered()), this, SLOT(selectColor()));
+ connect(colorAction, &QAction::triggered, this, &SpreadSheet::selectColor);
clearAction = new QAction(tr("Clear"), this);
clearAction->setShortcut(Qt::Key_Delete);
- connect(clearAction, SIGNAL(triggered()), this, SLOT(clear()));
+ connect(clearAction, &QAction::triggered, this, &SpreadSheet::clear);
aboutSpreadSheet = new QAction(tr("About Spreadsheet"), this);
- connect(aboutSpreadSheet, SIGNAL(triggered()), this, SLOT(showAbout()));
+ connect(aboutSpreadSheet, &QAction::triggered, this, &SpreadSheet::showAbout);
exitAction = new QAction(tr("E&xit"), this);
- connect(exitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
+ connect(exitAction, &QAction::triggered, qApp, &QCoreApplication::quit);
printAction = new QAction(tr("&Print"), this);
- connect(printAction, SIGNAL(triggered()), this, SLOT(print()));
+ connect(printAction, &QAction::triggered, this, &SpreadSheet::print);
firstSeparator = new QAction(this);
firstSeparator->setSeparator(true);
@@ -309,11 +309,11 @@ bool SpreadSheet::runInputDialog(const QString &title,
outColInput.setCurrentIndex(outCol);
QPushButton cancelButton(tr("Cancel"), &addDialog);
- connect(&cancelButton, SIGNAL(clicked()), &addDialog, SLOT(reject()));
+ connect(&cancelButton, &QAbstractButton::clicked, &addDialog, &QDialog::reject);
QPushButton okButton(tr("OK"), &addDialog);
okButton.setDefault(true);
- connect(&okButton, SIGNAL(clicked()), &addDialog, SLOT(accept()));
+ connect(&okButton, &QAbstractButton::clicked, &addDialog, &QDialog::accept);
QHBoxLayout *buttonsLayout = new QHBoxLayout;
buttonsLayout->addStretch(1);
@@ -625,7 +625,7 @@ void SpreadSheet::print()
QPrintPreviewDialog dlg(&printer);
PrintView view;
view.setModel(table->model());
- connect(&dlg, SIGNAL(paintRequested(QPrinter*)), &view, SLOT(print(QPrinter*)));
+ connect(&dlg, &QPrintPreviewDialog::paintRequested, &view, &PrintView::print);
dlg.exec();
#endif
}
diff --git a/examples/widgets/itemviews/spreadsheet/spreadsheetdelegate.cpp b/examples/widgets/itemviews/spreadsheet/spreadsheetdelegate.cpp
index d056e3f8e4..a7404fe159 100644
--- a/examples/widgets/itemviews/spreadsheet/spreadsheetdelegate.cpp
+++ b/examples/widgets/itemviews/spreadsheet/spreadsheetdelegate.cpp
@@ -63,7 +63,7 @@ QWidget *SpreadSheetDelegate::createEditor(QWidget *parent,
QCompleter *autoComplete = new QCompleter(allStrings);
editor->setCompleter(autoComplete);
- connect(editor, SIGNAL(editingFinished()), this, SLOT(commitAndCloseEditor()));
+ connect(editor, &QLineEdit::editingFinished, this, &SpreadSheetDelegate::commitAndCloseEditor);
return editor;
}
diff --git a/examples/widgets/itemviews/stardelegate/stardelegate.cpp b/examples/widgets/itemviews/stardelegate/stardelegate.cpp
index 48f6eb543b..a9e8f71699 100644
--- a/examples/widgets/itemviews/stardelegate/stardelegate.cpp
+++ b/examples/widgets/itemviews/stardelegate/stardelegate.cpp
@@ -83,8 +83,8 @@ QWidget *StarDelegate::createEditor(QWidget *parent,
{
if (index.data().canConvert<StarRating>()) {
StarEditor *editor = new StarEditor(parent);
- connect(editor, SIGNAL(editingFinished()),
- this, SLOT(commitAndCloseEditor()));
+ connect(editor, &StarEditor::editingFinished,
+ this, &StarDelegate::commitAndCloseEditor);
return editor;
} else {
return QStyledItemDelegate::createEditor(parent, option, index);
diff --git a/examples/widgets/mainwindows/application/main.cpp b/examples/widgets/mainwindows/application/main.cpp
index 41913db07e..73c1cf57d3 100644
--- a/examples/widgets/mainwindows/application/main.cpp
+++ b/examples/widgets/mainwindows/application/main.cpp
@@ -40,6 +40,8 @@
//! [0]
#include <QApplication>
+#include <QCommandLineParser>
+#include <QCommandLineOption>
#include "mainwindow.h"
@@ -48,9 +50,19 @@ int main(int argc, char *argv[])
Q_INIT_RESOURCE(application);
QApplication app(argc, argv);
- app.setOrganizationName("QtProject");
- app.setApplicationName("Application Example");
+ QCoreApplication::setOrganizationName("QtProject");
+ QCoreApplication::setApplicationName("Application Example");
+ QCoreApplication::setApplicationVersion(QT_VERSION_STR);
+ QCommandLineParser parser;
+ parser.setApplicationDescription(QCoreApplication::applicationName());
+ parser.addHelpOption();
+ parser.addVersionOption();
+ parser.addPositionalArgument("file", "The file to open.");
+ parser.process(app);
+
MainWindow mainWin;
+ if (!parser.positionalArguments().isEmpty())
+ mainWin.loadFile(parser.positionalArguments().first());
mainWin.show();
return app.exec();
}
diff --git a/examples/widgets/mainwindows/application/mainwindow.cpp b/examples/widgets/mainwindows/application/mainwindow.cpp
index d3f9c7645e..86dfae166f 100644
--- a/examples/widgets/mainwindows/application/mainwindow.cpp
+++ b/examples/widgets/mainwindows/application/mainwindow.cpp
@@ -46,22 +46,20 @@
//! [1]
MainWindow::MainWindow()
+ : textEdit(new QPlainTextEdit)
//! [1] //! [2]
{
- textEdit = new QPlainTextEdit;
setCentralWidget(textEdit);
createActions();
- createMenus();
- createToolBars();
createStatusBar();
readSettings();
- connect(textEdit->document(), SIGNAL(contentsChanged()),
- this, SLOT(documentWasModified()));
+ connect(textEdit->document(), &QTextDocument::contentsChanged,
+ this, &MainWindow::documentWasModified);
- setCurrentFile("");
+ setCurrentFile(QString());
setUnifiedTitleAndToolBarOnMac(true);
}
//! [2]
@@ -85,7 +83,7 @@ void MainWindow::newFile()
{
if (maybeSave()) {
textEdit->clear();
- setCurrentFile("");
+ setCurrentFile(QString());
}
}
//! [6]
@@ -121,13 +119,9 @@ bool MainWindow::saveAs()
QFileDialog dialog(this);
dialog.setWindowModality(Qt::WindowModal);
dialog.setAcceptMode(QFileDialog::AcceptSave);
- QStringList files;
- if (dialog.exec())
- files = dialog.selectedFiles();
- else
+ if (dialog.exec() != QDialog::Accepted)
return false;
-
- return saveFile(files.at(0));
+ return saveFile(dialog.selectedFiles().first());
}
//! [12]
@@ -154,121 +148,108 @@ void MainWindow::documentWasModified()
void MainWindow::createActions()
//! [17] //! [18]
{
- newAct = new QAction(QIcon(":/images/new.png"), tr("&New"), this);
+
+ QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
+ QToolBar *fileToolBar = addToolBar(tr("File"));
+ const QIcon newIcon = QIcon::fromTheme("document-new", QIcon(":/images/new.png"));
+ QAction *newAct = new QAction(newIcon, tr("&New"), this);
newAct->setShortcuts(QKeySequence::New);
newAct->setStatusTip(tr("Create a new file"));
- connect(newAct, SIGNAL(triggered()), this, SLOT(newFile()));
+ connect(newAct, &QAction::triggered, this, &MainWindow::newFile);
+ fileMenu->addAction(newAct);
+ fileToolBar->addAction(newAct);
//! [19]
- openAct = new QAction(QIcon(":/images/open.png"), tr("&Open..."), this);
+ const QIcon openIcon = QIcon::fromTheme("document-open", QIcon(":/images/open.png"));
+ QAction *openAct = new QAction(openIcon, tr("&Open..."), this);
openAct->setShortcuts(QKeySequence::Open);
openAct->setStatusTip(tr("Open an existing file"));
- connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
+ connect(openAct, &QAction::triggered, this, &MainWindow::open);
+ fileMenu->addAction(openAct);
+ fileToolBar->addAction(openAct);
//! [18] //! [19]
- saveAct = new QAction(QIcon(":/images/save.png"), tr("&Save"), this);
+ const QIcon saveIcon = QIcon::fromTheme("document-save", QIcon(":/images/save.png"));
+ QAction *saveAct = new QAction(saveIcon, tr("&Save"), this);
saveAct->setShortcuts(QKeySequence::Save);
saveAct->setStatusTip(tr("Save the document to disk"));
- connect(saveAct, SIGNAL(triggered()), this, SLOT(save()));
+ connect(saveAct, &QAction::triggered, this, &MainWindow::save);
+ fileMenu->addAction(saveAct);
+ fileToolBar->addAction(saveAct);
- saveAsAct = new QAction(tr("Save &As..."), this);
+ const QIcon saveAsIcon = QIcon::fromTheme("document-save-as");
+ QAction *saveAsAct = fileMenu->addAction(saveAsIcon, tr("Save &As..."), this, &MainWindow::saveAs);
saveAsAct->setShortcuts(QKeySequence::SaveAs);
saveAsAct->setStatusTip(tr("Save the document under a new name"));
- connect(saveAsAct, SIGNAL(triggered()), this, SLOT(saveAs()));
//! [20]
- exitAct = new QAction(tr("E&xit"), this);
+
+ fileMenu->addSeparator();
+
+ const QIcon exitIcon = QIcon::fromTheme("application-exit");
+ QAction *exitAct = fileMenu->addAction(exitIcon, tr("E&xit"), this, &QWidget::close);
exitAct->setShortcuts(QKeySequence::Quit);
//! [20]
exitAct->setStatusTip(tr("Exit the application"));
- connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
//! [21]
- cutAct = new QAction(QIcon(":/images/cut.png"), tr("Cu&t"), this);
+ QMenu *editMenu = menuBar()->addMenu(tr("&Edit"));
+ QToolBar *editToolBar = addToolBar(tr("Edit"));
+//!
+#ifndef QT_NO_CLIPBOARD
+ const QIcon cutIcon = QIcon::fromTheme("edit-cut", QIcon(":/images/cut.png"));
+ QAction *cutAct = new QAction(cutIcon, tr("Cu&t"), this);
//! [21]
cutAct->setShortcuts(QKeySequence::Cut);
cutAct->setStatusTip(tr("Cut the current selection's contents to the "
"clipboard"));
- connect(cutAct, SIGNAL(triggered()), textEdit, SLOT(cut()));
+ connect(cutAct, &QAction::triggered, textEdit, &QPlainTextEdit::cut);
+ editMenu->addAction(cutAct);
+ editToolBar->addAction(cutAct);
- copyAct = new QAction(QIcon(":/images/copy.png"), tr("&Copy"), this);
+ const QIcon copyIcon = QIcon::fromTheme("edit-copy", QIcon(":/images/copy.png"));
+ QAction *copyAct = new QAction(copyIcon, tr("&Copy"), this);
copyAct->setShortcuts(QKeySequence::Copy);
copyAct->setStatusTip(tr("Copy the current selection's contents to the "
"clipboard"));
- connect(copyAct, SIGNAL(triggered()), textEdit, SLOT(copy()));
+ connect(copyAct, &QAction::triggered, textEdit, &QPlainTextEdit::copy);
+ editMenu->addAction(copyAct);
+ editToolBar->addAction(copyAct);
- pasteAct = new QAction(QIcon(":/images/paste.png"), tr("&Paste"), this);
+ const QIcon pasteIcon = QIcon::fromTheme("edit-paste", QIcon(":/images/paste.png"));
+ QAction *pasteAct = new QAction(pasteIcon, tr("&Paste"), this);
pasteAct->setShortcuts(QKeySequence::Paste);
pasteAct->setStatusTip(tr("Paste the clipboard's contents into the current "
"selection"));
- connect(pasteAct, SIGNAL(triggered()), textEdit, SLOT(paste()));
+ connect(pasteAct, &QAction::triggered, textEdit, &QPlainTextEdit::paste);
+ editMenu->addAction(pasteAct);
+ editToolBar->addAction(pasteAct);
+
+ menuBar()->addSeparator();
+
+#endif // !QT_NO_CLIPBOARD
- aboutAct = new QAction(tr("&About"), this);
+ QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
+ QAction *aboutAct = helpMenu->addAction(tr("&About"), this, &MainWindow::about);
aboutAct->setStatusTip(tr("Show the application's About box"));
- connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
//! [22]
- aboutQtAct = new QAction(tr("About &Qt"), this);
+
+ QAction *aboutQtAct = helpMenu->addAction(tr("About &Qt"), qApp, &QApplication::aboutQt);
aboutQtAct->setStatusTip(tr("Show the Qt library's About box"));
- connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
//! [22]
//! [23]
+#ifndef QT_NO_CLIPBOARD
cutAct->setEnabled(false);
//! [23] //! [24]
copyAct->setEnabled(false);
- connect(textEdit, SIGNAL(copyAvailable(bool)),
- cutAct, SLOT(setEnabled(bool)));
- connect(textEdit, SIGNAL(copyAvailable(bool)),
- copyAct, SLOT(setEnabled(bool)));
+ connect(textEdit, &QPlainTextEdit::copyAvailable, cutAct, &QAction::setEnabled);
+ connect(textEdit, &QPlainTextEdit::copyAvailable, copyAct, &QAction::setEnabled);
+#endif // !QT_NO_CLIPBOARD
}
//! [24]
-//! [25] //! [26]
-void MainWindow::createMenus()
-//! [25] //! [27]
-{
- fileMenu = menuBar()->addMenu(tr("&File"));
- fileMenu->addAction(newAct);
-//! [28]
- fileMenu->addAction(openAct);
-//! [28]
- fileMenu->addAction(saveAct);
-//! [26]
- fileMenu->addAction(saveAsAct);
- fileMenu->addSeparator();
- fileMenu->addAction(exitAct);
-
- editMenu = menuBar()->addMenu(tr("&Edit"));
- editMenu->addAction(cutAct);
- editMenu->addAction(copyAct);
- editMenu->addAction(pasteAct);
-
- menuBar()->addSeparator();
-
- helpMenu = menuBar()->addMenu(tr("&Help"));
- helpMenu->addAction(aboutAct);
- helpMenu->addAction(aboutQtAct);
-}
-//! [27]
-
-//! [29] //! [30]
-void MainWindow::createToolBars()
-{
- fileToolBar = addToolBar(tr("File"));
- fileToolBar->addAction(newAct);
-//! [29] //! [31]
- fileToolBar->addAction(openAct);
-//! [31]
- fileToolBar->addAction(saveAct);
-
- editToolBar = addToolBar(tr("Edit"));
- editToolBar->addAction(cutAct);
- editToolBar->addAction(copyAct);
- editToolBar->addAction(pasteAct);
-}
-//! [30]
-
//! [32]
void MainWindow::createStatusBar()
//! [32] //! [33]
@@ -281,11 +262,16 @@ void MainWindow::createStatusBar()
void MainWindow::readSettings()
//! [34] //! [36]
{
- QSettings settings("QtProject", "Application Example");
- QPoint pos = settings.value("pos", QPoint(200, 200)).toPoint();
- QSize size = settings.value("size", QSize(400, 400)).toSize();
- resize(size);
- move(pos);
+ QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName());
+ const QByteArray geometry = settings.value("geometry", QByteArray()).toByteArray();
+ if (geometry.isEmpty()) {
+ const QRect availableGeometry = QApplication::desktop()->availableGeometry(this);
+ resize(availableGeometry.width() / 3, availableGeometry.height() / 2);
+ move((availableGeometry.width() - width()) / 2,
+ (availableGeometry.height() - height()) / 2);
+ } else {
+ restoreGeometry(geometry);
+ }
}
//! [35] //! [36]
@@ -293,9 +279,8 @@ void MainWindow::readSettings()
void MainWindow::writeSettings()
//! [37] //! [39]
{
- QSettings settings("QtProject", "Application Example");
- settings.setValue("pos", pos());
- settings.setValue("size", size());
+ QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName());
+ settings.setValue("geometry", saveGeometry());
}
//! [38] //! [39]
@@ -303,16 +288,20 @@ void MainWindow::writeSettings()
bool MainWindow::maybeSave()
//! [40] //! [41]
{
- if (textEdit->document()->isModified()) {
- QMessageBox::StandardButton ret;
- ret = QMessageBox::warning(this, tr("Application"),
- tr("The document has been modified.\n"
- "Do you want to save your changes?"),
- QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
- if (ret == QMessageBox::Save)
- return save();
- else if (ret == QMessageBox::Cancel)
- return false;
+ if (!textEdit->document()->isModified())
+ return true;
+ const QMessageBox::StandardButton ret
+ = QMessageBox::warning(this, tr("Application"),
+ tr("The document has been modified.\n"
+ "Do you want to save your changes?"),
+ QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
+ switch (ret) {
+ case QMessageBox::Save:
+ return save();
+ case QMessageBox::Cancel:
+ return false;
+ default:
+ break;
}
return true;
}
@@ -326,8 +315,7 @@ void MainWindow::loadFile(const QString &fileName)
if (!file.open(QFile::ReadOnly | QFile::Text)) {
QMessageBox::warning(this, tr("Application"),
tr("Cannot read file %1:\n%2.")
- .arg(fileName)
- .arg(file.errorString()));
+ .arg(QDir::toNativeSeparators(fileName), file.errorString()));
return;
}
@@ -353,8 +341,8 @@ bool MainWindow::saveFile(const QString &fileName)
if (!file.open(QFile::WriteOnly | QFile::Text)) {
QMessageBox::warning(this, tr("Application"),
tr("Cannot write file %1:\n%2.")
- .arg(fileName)
- .arg(file.errorString()));
+ .arg(QDir::toNativeSeparators(fileName),
+ file.errorString()));
return false;
}
diff --git a/examples/widgets/mainwindows/application/mainwindow.h b/examples/widgets/mainwindows/application/mainwindow.h
index cb791abf00..08b4aa17f5 100644
--- a/examples/widgets/mainwindows/application/mainwindow.h
+++ b/examples/widgets/mainwindows/application/mainwindow.h
@@ -57,6 +57,8 @@ class MainWindow : public QMainWindow
public:
MainWindow();
+ void loadFile(const QString &fileName);
+
protected:
void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
@@ -70,35 +72,16 @@ private slots:
private:
void createActions();
- void createMenus();
- void createToolBars();
void createStatusBar();
void readSettings();
void writeSettings();
bool maybeSave();
- void loadFile(const QString &fileName);
bool saveFile(const QString &fileName);
void setCurrentFile(const QString &fileName);
QString strippedName(const QString &fullFileName);
QPlainTextEdit *textEdit;
QString curFile;
-
- QMenu *fileMenu;
- QMenu *editMenu;
- QMenu *helpMenu;
- QToolBar *fileToolBar;
- QToolBar *editToolBar;
- QAction *newAct;
- QAction *openAct;
- QAction *saveAct;
- QAction *saveAsAct;
- QAction *exitAct;
- QAction *cutAct;
- QAction *copyAct;
- QAction *pasteAct;
- QAction *aboutAct;
- QAction *aboutQtAct;
};
//! [0]
diff --git a/examples/widgets/mainwindows/dockwidgets/mainwindow.cpp b/examples/widgets/mainwindows/dockwidgets/mainwindow.cpp
index 20c2bd1c70..c0472b537c 100644
--- a/examples/widgets/mainwindows/dockwidgets/mainwindow.cpp
+++ b/examples/widgets/mainwindows/dockwidgets/mainwindow.cpp
@@ -49,13 +49,11 @@
//! [1]
MainWindow::MainWindow()
+ : textEdit(new QTextEdit)
{
- textEdit = new QTextEdit;
setCentralWidget(textEdit);
createActions();
- createMenus();
- createToolBars();
createStatusBar();
createDockWindows();
@@ -135,17 +133,17 @@ void MainWindow::print()
//! [4]
void MainWindow::save()
{
+ QMimeDatabase mimeDatabase;
QString fileName = QFileDialog::getSaveFileName(this,
tr("Choose a file name"), ".",
- tr("HTML (*.html *.htm)"));
+ mimeDatabase.mimeTypeForName("text/html").filterString());
if (fileName.isEmpty())
return;
QFile file(fileName);
if (!file.open(QFile::WriteOnly | QFile::Text)) {
QMessageBox::warning(this, tr("Dock Widgets"),
tr("Cannot write file %1:\n%2.")
- .arg(fileName)
- .arg(file.errorString()));
+ .arg(QDir::toNativeSeparators(fileName), file.errorString()));
return;
}
@@ -222,71 +220,60 @@ void MainWindow::about()
void MainWindow::createActions()
{
- newLetterAct = new QAction(QIcon(":/images/new.png"), tr("&New Letter"),
- this);
+ QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
+ QToolBar *fileToolBar = addToolBar(tr("File"));
+
+ const QIcon newIcon = QIcon::fromTheme("document-new", QIcon(":/images/new.png"));
+ QAction *newLetterAct = new QAction(newIcon, tr("&New Letter"), this);
newLetterAct->setShortcuts(QKeySequence::New);
newLetterAct->setStatusTip(tr("Create a new form letter"));
- connect(newLetterAct, SIGNAL(triggered()), this, SLOT(newLetter()));
+ connect(newLetterAct, &QAction::triggered, this, &MainWindow::newLetter);
+ fileMenu->addAction(newLetterAct);
+ fileToolBar->addAction(newLetterAct);
- saveAct = new QAction(QIcon(":/images/save.png"), tr("&Save..."), this);
+ const QIcon saveIcon = QIcon::fromTheme("document-save", QIcon(":/images/save.png"));
+ QAction *saveAct = new QAction(saveIcon, tr("&Save..."), this);
saveAct->setShortcuts(QKeySequence::Save);
saveAct->setStatusTip(tr("Save the current form letter"));
- connect(saveAct, SIGNAL(triggered()), this, SLOT(save()));
+ connect(saveAct, &QAction::triggered, this, &MainWindow::save);
+ fileMenu->addAction(saveAct);
+ fileToolBar->addAction(saveAct);
- printAct = new QAction(QIcon(":/images/print.png"), tr("&Print..."), this);
+ const QIcon printIcon = QIcon::fromTheme("document-print", QIcon(":/images/print.png"));
+ QAction *printAct = new QAction(printIcon, tr("&Print..."), this);
printAct->setShortcuts(QKeySequence::Print);
printAct->setStatusTip(tr("Print the current form letter"));
- connect(printAct, SIGNAL(triggered()), this, SLOT(print()));
+ connect(printAct, &QAction::triggered, this, &MainWindow::print);
+ fileMenu->addAction(printAct);
+ fileToolBar->addAction(printAct);
- undoAct = new QAction(QIcon(":/images/undo.png"), tr("&Undo"), this);
- undoAct->setShortcuts(QKeySequence::Undo);
- undoAct->setStatusTip(tr("Undo the last editing action"));
- connect(undoAct, SIGNAL(triggered()), this, SLOT(undo()));
+ fileMenu->addSeparator();
- quitAct = new QAction(tr("&Quit"), this);
+ QAction *quitAct = fileMenu->addAction(tr("&Quit"), this, &QWidget::close);
quitAct->setShortcuts(QKeySequence::Quit);
quitAct->setStatusTip(tr("Quit the application"));
- connect(quitAct, SIGNAL(triggered()), this, SLOT(close()));
-
- aboutAct = new QAction(tr("&About"), this);
- aboutAct->setStatusTip(tr("Show the application's About box"));
- connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
-
- aboutQtAct = new QAction(tr("About &Qt"), this);
- aboutQtAct->setStatusTip(tr("Show the Qt library's About box"));
- connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
-}
-
-void MainWindow::createMenus()
-{
- fileMenu = menuBar()->addMenu(tr("&File"));
- fileMenu->addAction(newLetterAct);
- fileMenu->addAction(saveAct);
- fileMenu->addAction(printAct);
- fileMenu->addSeparator();
- fileMenu->addAction(quitAct);
- editMenu = menuBar()->addMenu(tr("&Edit"));
+ QMenu *editMenu = menuBar()->addMenu(tr("&Edit"));
+ QToolBar *editToolBar = addToolBar(tr("Edit"));
+ const QIcon undoIcon = QIcon::fromTheme("edit-undo", QIcon(":/images/undo.png"));
+ QAction *undoAct = new QAction(undoIcon, tr("&Undo"), this);
+ undoAct->setShortcuts(QKeySequence::Undo);
+ undoAct->setStatusTip(tr("Undo the last editing action"));
+ connect(undoAct, &QAction::triggered, this, &MainWindow::undo);
editMenu->addAction(undoAct);
+ editToolBar->addAction(undoAct);
viewMenu = menuBar()->addMenu(tr("&View"));
menuBar()->addSeparator();
- helpMenu = menuBar()->addMenu(tr("&Help"));
- helpMenu->addAction(aboutAct);
- helpMenu->addAction(aboutQtAct);
-}
+ QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
-void MainWindow::createToolBars()
-{
- fileToolBar = addToolBar(tr("File"));
- fileToolBar->addAction(newLetterAct);
- fileToolBar->addAction(saveAct);
- fileToolBar->addAction(printAct);
+ QAction *aboutAct = helpMenu->addAction(tr("&About"), this, &MainWindow::about);
+ aboutAct->setStatusTip(tr("Show the application's About box"));
- editToolBar = addToolBar(tr("Edit"));
- editToolBar->addAction(undoAct);
+ QAction *aboutQtAct = helpMenu->addAction(tr("About &Qt"), qApp, &QApplication::aboutQt);
+ aboutQtAct->setStatusTip(tr("Show the Qt library's About box"));
}
//! [8]
@@ -337,9 +324,9 @@ void MainWindow::createDockWindows()
addDockWidget(Qt::RightDockWidgetArea, dock);
viewMenu->addAction(dock->toggleViewAction());
- connect(customerList, SIGNAL(currentTextChanged(QString)),
- this, SLOT(insertCustomer(QString)));
- connect(paragraphsList, SIGNAL(currentTextChanged(QString)),
- this, SLOT(addParagraph(QString)));
+ connect(customerList, &QListWidget::currentTextChanged,
+ this, &MainWindow::insertCustomer);
+ connect(paragraphsList, &QListWidget::currentTextChanged,
+ this, &MainWindow::addParagraph);
}
//! [9]
diff --git a/examples/widgets/mainwindows/dockwidgets/mainwindow.h b/examples/widgets/mainwindows/dockwidgets/mainwindow.h
index 2fb161a20b..c244febf9a 100644
--- a/examples/widgets/mainwindows/dockwidgets/mainwindow.h
+++ b/examples/widgets/mainwindows/dockwidgets/mainwindow.h
@@ -69,8 +69,6 @@ private slots:
private:
void createActions();
- void createMenus();
- void createToolBars();
void createStatusBar();
void createDockWindows();
@@ -78,19 +76,7 @@ private:
QListWidget *customerList;
QListWidget *paragraphsList;
- QMenu *fileMenu;
- QMenu *editMenu;
QMenu *viewMenu;
- QMenu *helpMenu;
- QToolBar *fileToolBar;
- QToolBar *editToolBar;
- QAction *newLetterAct;
- QAction *saveAct;
- QAction *printAct;
- QAction *undoAct;
- QAction *aboutAct;
- QAction *aboutQtAct;
- QAction *quitAct;
};
//! [0]
diff --git a/examples/widgets/mainwindows/mainwindow/colorswatch.cpp b/examples/widgets/mainwindows/mainwindow/colorswatch.cpp
index 408f6c4b0f..d746bbe8d3 100644
--- a/examples/widgets/mainwindows/mainwindow/colorswatch.cpp
+++ b/examples/widgets/mainwindows/mainwindow/colorswatch.cpp
@@ -42,6 +42,7 @@
#include <QImage>
#include <QColor>
#include <QDialog>
+#include <QDialogButtonBox>
#include <QGridLayout>
#include <QSpinBox>
#include <QLabel>
@@ -57,15 +58,15 @@ QColor bgColorForName(const QString &name)
{
if (name == "Black")
return QColor("#D8D8D8");
- else if (name == "White")
+ if (name == "White")
return QColor("#F1F1F1");
- else if (name == "Red")
+ if (name == "Red")
return QColor("#F1D8D8");
- else if (name == "Green")
+ if (name == "Green")
return QColor("#D8E4D8");
- else if (name == "Blue")
+ if (name == "Blue")
return QColor("#D8D8F1");
- else if (name == "Yellow")
+ if (name == "Yellow")
return QColor("#F1F0D8");
return QColor(name).light(110);
}
@@ -74,15 +75,15 @@ QColor fgColorForName(const QString &name)
{
if (name == "Black")
return QColor("#6C6C6C");
- else if (name == "White")
+ if (name == "White")
return QColor("#F8F8F8");
- else if (name == "Red")
+ if (name == "Red")
return QColor("#F86C6C");
- else if (name == "Green")
+ if (name == "Green")
return QColor("#6CB26C");
- else if (name == "Blue")
+ if (name == "Blue")
return QColor("#6C6CF8");
- else if (name == "Yellow")
+ if (name == "Yellow")
return QColor("#F8F76C");
return QColor(name);
}
@@ -91,10 +92,10 @@ class ColorDock : public QFrame
{
Q_OBJECT
public:
- ColorDock(const QString &c, QWidget *parent);
+ explicit ColorDock(const QString &c, QWidget *parent);
- virtual QSize sizeHint() const Q_DECL_OVERRIDE;
- virtual QSize minimumSizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const Q_DECL_OVERRIDE { return szHint; }
+ QSize minimumSizeHint() const Q_DECL_OVERRIDE { return minSzHint; }
void setCustomSizeHint(const QSize &size);
@@ -103,28 +104,22 @@ public slots:
protected:
void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
- QString color;
- QSize szHint, minSzHint;
+
+private:
+ const QString color;
+ QSize szHint;
+ QSize minSzHint;
};
ColorDock::ColorDock(const QString &c, QWidget *parent)
- : QFrame(parent) , color(c)
+ : QFrame(parent)
+ , color(c)
+ , szHint(-1, -1)
+ , minSzHint(125, 75)
{
QFont font = this->font();
font.setPointSize(8);
setFont(font);
- szHint = QSize(-1, -1);
- minSzHint = QSize(125, 75);
-}
-
-QSize ColorDock::sizeHint() const
-{
- return szHint;
-}
-
-QSize ColorDock::minimumSizeHint() const
-{
- return minSzHint;
}
void ColorDock::paintEvent(QPaintEvent *)
@@ -178,6 +173,7 @@ static QSpinBox *createSpinBox(int value, QWidget *parent, int max = 1000)
void ColorDock::changeSizeHints()
{
QDialog dialog(this);
+ dialog.setWindowFlags(dialog.windowFlags() & ~Qt::WindowContextHelpButtonHint);
dialog.setWindowTitle(color);
QVBoxLayout *topLayout = new QVBoxLayout(&dialog);
@@ -188,7 +184,7 @@ void ColorDock::changeSizeHints()
inputLayout->addWidget(new QLabel(tr("Size Hint:"), &dialog), 0, 0);
inputLayout->addWidget(new QLabel(tr("Min Size Hint:"), &dialog), 1, 0);
inputLayout->addWidget(new QLabel(tr("Max Size:"), &dialog), 2, 0);
- inputLayout->addWidget(new QLabel(tr("Dockwgt Max Size:"), &dialog), 3, 0);
+ inputLayout->addWidget(new QLabel(tr("Dock Widget Max Size:"), &dialog), 3, 0);
QSpinBox *szHintW = createSpinBox(szHint.width(), &dialog);
inputLayout->addWidget(szHintW, 0, 1);
@@ -217,19 +213,13 @@ void ColorDock::changeSizeHints()
topLayout->addStretch();
- QHBoxLayout *buttonBox = new QHBoxLayout();
- topLayout->addLayout(buttonBox);
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
+ connect(buttonBox, &QDialogButtonBox::rejected, &dialog, &QDialog::reject);
+ connect(buttonBox, &QDialogButtonBox::accepted, &dialog, &QDialog::reject);
- QPushButton *okButton = new QPushButton(tr("Ok"), &dialog);
- QPushButton *cancelButton = new QPushButton(tr("Cancel"), &dialog);
- connect(okButton, SIGNAL(clicked()), &dialog, SLOT(accept()));
- connect(cancelButton, SIGNAL(clicked()), &dialog, SLOT(reject()));
- buttonBox->addStretch();
- buttonBox->addWidget(cancelButton);
- buttonBox->addWidget(okButton);
+ topLayout->addWidget(buttonBox);
-
- if (!dialog.exec())
+ if (dialog.exec() != QDialog::Accepted)
return;
szHint = QSize(szHintW->value(), szHintH->value());
@@ -244,63 +234,62 @@ void ColorDock::changeSizeHints()
void ColorDock::setCustomSizeHint(const QSize &size)
{
- szHint = size;
- updateGeometry();
+ if (szHint != size) {
+ szHint = size;
+ updateGeometry();
+ }
}
-ColorSwatch::ColorSwatch(const QString &colorName, QWidget *parent, Qt::WindowFlags flags)
- : QDockWidget(parent, flags)
+ColorSwatch::ColorSwatch(const QString &colorName, QMainWindow *parent, Qt::WindowFlags flags)
+ : QDockWidget(parent, flags), mainWindow(parent)
{
setObjectName(colorName + QLatin1String(" Dock Widget"));
setWindowTitle(objectName() + QLatin1String(" [*]"));
- QFrame *swatch = new ColorDock(colorName, this);
+ ColorDock *swatch = new ColorDock(colorName, this);
swatch->setFrameStyle(QFrame::Box | QFrame::Sunken);
setWidget(swatch);
- changeSizeHintsAction = new QAction(tr("Change Size Hints"), this);
- connect(changeSizeHintsAction, SIGNAL(triggered()), swatch, SLOT(changeSizeHints()));
-
closableAction = new QAction(tr("Closable"), this);
closableAction->setCheckable(true);
- connect(closableAction, SIGNAL(triggered(bool)), SLOT(changeClosable(bool)));
+ connect(closableAction, &QAction::triggered, this, &ColorSwatch::changeClosable);
movableAction = new QAction(tr("Movable"), this);
movableAction->setCheckable(true);
- connect(movableAction, SIGNAL(triggered(bool)), SLOT(changeMovable(bool)));
+ connect(movableAction, &QAction::triggered, this, &ColorSwatch::changeMovable);
floatableAction = new QAction(tr("Floatable"), this);
floatableAction->setCheckable(true);
- connect(floatableAction, SIGNAL(triggered(bool)), SLOT(changeFloatable(bool)));
+ connect(floatableAction, &QAction::triggered, this, &ColorSwatch::changeFloatable);
verticalTitleBarAction = new QAction(tr("Vertical title bar"), this);
verticalTitleBarAction->setCheckable(true);
- connect(verticalTitleBarAction, SIGNAL(triggered(bool)),
- SLOT(changeVerticalTitleBar(bool)));
+ connect(verticalTitleBarAction, &QAction::triggered,
+ this, &ColorSwatch::changeVerticalTitleBar);
floatingAction = new QAction(tr("Floating"), this);
floatingAction->setCheckable(true);
- connect(floatingAction, SIGNAL(triggered(bool)), SLOT(changeFloating(bool)));
+ connect(floatingAction, &QAction::triggered, this, &ColorSwatch::changeFloating);
allowedAreasActions = new QActionGroup(this);
allowedAreasActions->setExclusive(false);
allowLeftAction = new QAction(tr("Allow on Left"), this);
allowLeftAction->setCheckable(true);
- connect(allowLeftAction, SIGNAL(triggered(bool)), SLOT(allowLeft(bool)));
+ connect(allowLeftAction, &QAction::triggered, this, &ColorSwatch::allowLeft);
allowRightAction = new QAction(tr("Allow on Right"), this);
allowRightAction->setCheckable(true);
- connect(allowRightAction, SIGNAL(triggered(bool)), SLOT(allowRight(bool)));
+ connect(allowRightAction, &QAction::triggered, this, &ColorSwatch::allowRight);
allowTopAction = new QAction(tr("Allow on Top"), this);
allowTopAction->setCheckable(true);
- connect(allowTopAction, SIGNAL(triggered(bool)), SLOT(allowTop(bool)));
+ connect(allowTopAction, &QAction::triggered, this, &ColorSwatch::allowTop);
allowBottomAction = new QAction(tr("Allow on Bottom"), this);
allowBottomAction->setCheckable(true);
- connect(allowBottomAction, SIGNAL(triggered(bool)), SLOT(allowBottom(bool)));
+ connect(allowBottomAction, &QAction::triggered, this, &ColorSwatch::allowBottom);
allowedAreasActions->addAction(allowLeftAction);
allowedAreasActions->addAction(allowRightAction);
@@ -312,56 +301,56 @@ ColorSwatch::ColorSwatch(const QString &colorName, QWidget *parent, Qt::WindowFl
leftAction = new QAction(tr("Place on Left") , this);
leftAction->setCheckable(true);
- connect(leftAction, SIGNAL(triggered(bool)), SLOT(placeLeft(bool)));
+ connect(leftAction, &QAction::triggered, this, &ColorSwatch::placeLeft);
rightAction = new QAction(tr("Place on Right") , this);
rightAction->setCheckable(true);
- connect(rightAction, SIGNAL(triggered(bool)), SLOT(placeRight(bool)));
+ connect(rightAction, &QAction::triggered, this, &ColorSwatch::placeRight);
topAction = new QAction(tr("Place on Top") , this);
topAction->setCheckable(true);
- connect(topAction, SIGNAL(triggered(bool)), SLOT(placeTop(bool)));
+ connect(topAction, &QAction::triggered, this, &ColorSwatch::placeTop);
bottomAction = new QAction(tr("Place on Bottom") , this);
bottomAction->setCheckable(true);
- connect(bottomAction, SIGNAL(triggered(bool)), SLOT(placeBottom(bool)));
+ connect(bottomAction, &QAction::triggered, this, &ColorSwatch::placeBottom);
areaActions->addAction(leftAction);
areaActions->addAction(rightAction);
areaActions->addAction(topAction);
areaActions->addAction(bottomAction);
- connect(movableAction, SIGNAL(triggered(bool)), areaActions, SLOT(setEnabled(bool)));
+ connect(movableAction, &QAction::triggered, areaActions, &QActionGroup::setEnabled);
- connect(movableAction, SIGNAL(triggered(bool)), allowedAreasActions, SLOT(setEnabled(bool)));
+ connect(movableAction, &QAction::triggered, allowedAreasActions, &QActionGroup::setEnabled);
- connect(floatableAction, SIGNAL(triggered(bool)), floatingAction, SLOT(setEnabled(bool)));
+ connect(floatableAction, &QAction::triggered, floatingAction, &QAction::setEnabled);
- connect(floatingAction, SIGNAL(triggered(bool)), floatableAction, SLOT(setDisabled(bool)));
- connect(movableAction, SIGNAL(triggered(bool)), floatableAction, SLOT(setEnabled(bool)));
+ connect(floatingAction, &QAction::triggered, floatableAction, &QAction::setDisabled);
+ connect(movableAction, &QAction::triggered, floatableAction, &QAction::setEnabled);
tabMenu = new QMenu(this);
tabMenu->setTitle(tr("Tab into"));
- connect(tabMenu, SIGNAL(triggered(QAction*)), this, SLOT(tabInto(QAction*)));
+ connect(tabMenu, &QMenu::triggered, this, &ColorSwatch::tabInto);
splitHMenu = new QMenu(this);
splitHMenu->setTitle(tr("Split horizontally into"));
- connect(splitHMenu, SIGNAL(triggered(QAction*)), this, SLOT(splitInto(QAction*)));
+ connect(splitHMenu, &QMenu::triggered, this, &ColorSwatch::splitInto);
splitVMenu = new QMenu(this);
splitVMenu->setTitle(tr("Split vertically into"));
- connect(splitVMenu, SIGNAL(triggered(QAction*)), this, SLOT(splitInto(QAction*)));
+ connect(splitVMenu, &QMenu::triggered, this, &ColorSwatch::splitInto);
- windowModifiedAction = new QAction(tr("Modified"), this);
+ QAction *windowModifiedAction = new QAction(tr("Modified"), this);
windowModifiedAction->setCheckable(true);
windowModifiedAction->setChecked(false);
- connect(windowModifiedAction, SIGNAL(toggled(bool)), this, SLOT(setWindowModified(bool)));
+ connect(windowModifiedAction, &QAction::toggled, this, &QWidget::setWindowModified);
menu = new QMenu(colorName, this);
menu->addAction(toggleViewAction());
- QAction *action = menu->addAction(tr("Raise"));
- connect(action, SIGNAL(triggered()), this, SLOT(raise()));
- menu->addAction(changeSizeHintsAction);
+ menu->addAction(tr("Raise"), this, &QWidget::raise);
+ menu->addAction(tr("Change Size Hints..."), swatch, &ColorDock::changeSizeHints);
+
menu->addSeparator();
menu->addAction(closableAction);
menu->addAction(movableAction);
@@ -379,18 +368,17 @@ ColorSwatch::ColorSwatch(const QString &colorName, QWidget *parent, Qt::WindowFl
menu->addSeparator();
menu->addAction(windowModifiedAction);
- connect(menu, SIGNAL(aboutToShow()), this, SLOT(updateContextMenu()));
+ connect(menu, &QMenu::aboutToShow, this, &ColorSwatch::updateContextMenu);
- if(colorName == "Black") {
- leftAction->setShortcut(Qt::CTRL|Qt::Key_W);
- rightAction->setShortcut(Qt::CTRL|Qt::Key_E);
- toggleViewAction()->setShortcut(Qt::CTRL|Qt::Key_R);
+ if (colorName == QLatin1String("Black")) {
+ leftAction->setShortcut(Qt::CTRL | Qt::Key_W);
+ rightAction->setShortcut(Qt::CTRL | Qt::Key_E);
+ toggleViewAction()->setShortcut(Qt::CTRL | Qt::Key_R);
}
}
void ColorSwatch::updateContextMenu()
{
- QMainWindow *mainWindow = qobject_cast<QMainWindow *>(parentWidget());
const Qt::DockWidgetArea area = mainWindow->dockWidgetArea(this);
const Qt::DockWidgetAreas areas = allowedAreas();
@@ -448,48 +436,36 @@ void ColorSwatch::updateContextMenu()
splitVMenu->clear();
QList<ColorSwatch*> dock_list = mainWindow->findChildren<ColorSwatch*>();
foreach (ColorSwatch *dock, dock_list) {
-// if (!dock->isVisible() || dock->isFloating())
-// continue;
tabMenu->addAction(dock->objectName());
splitHMenu->addAction(dock->objectName());
splitVMenu->addAction(dock->objectName());
}
}
-void ColorSwatch::splitInto(QAction *action)
+static ColorSwatch *findByName(const QMainWindow *mainWindow, const QString &name)
{
- QMainWindow *mainWindow = qobject_cast<QMainWindow *>(parentWidget());
- QList<ColorSwatch*> dock_list = mainWindow->findChildren<ColorSwatch*>();
- ColorSwatch *target = 0;
- foreach (ColorSwatch *dock, dock_list) {
- if (action->text() == dock->objectName()) {
- target = dock;
- break;
- }
+ foreach (ColorSwatch *dock, mainWindow->findChildren<ColorSwatch*>()) {
+ if (name == dock->objectName())
+ return dock;
}
- if (target == 0)
+ return Q_NULLPTR;
+}
+
+void ColorSwatch::splitInto(QAction *action)
+{
+ ColorSwatch *target = findByName(mainWindow, action->text());
+ if (!target)
return;
- Qt::Orientation o = action->parent() == splitHMenu
- ? Qt::Horizontal : Qt::Vertical;
+ const Qt::Orientation o = action->parent() == splitHMenu
+ ? Qt::Horizontal : Qt::Vertical;
mainWindow->splitDockWidget(target, this, o);
}
void ColorSwatch::tabInto(QAction *action)
{
- QMainWindow *mainWindow = qobject_cast<QMainWindow *>(parentWidget());
- QList<ColorSwatch*> dock_list = mainWindow->findChildren<ColorSwatch*>();
- ColorSwatch *target = 0;
- foreach (ColorSwatch *dock, dock_list) {
- if (action->text() == dock->objectName()) {
- target = dock;
- break;
- }
- }
- if (target == 0)
- return;
-
- mainWindow->tabifyDockWidget(target, this);
+ if (ColorSwatch *target = findByName(mainWindow, action->text()))
+ mainWindow->tabifyDockWidget(target, this);
}
void ColorSwatch::contextMenuEvent(QContextMenuEvent *event)
@@ -506,7 +482,6 @@ void ColorSwatch::resizeEvent(QResizeEvent *e)
QDockWidget::resizeEvent(e);
}
-
void ColorSwatch::allow(Qt::DockWidgetArea area, bool a)
{
Qt::DockWidgetAreas areas = allowedAreas();
@@ -523,9 +498,9 @@ void ColorSwatch::allow(Qt::DockWidgetArea area, bool a)
void ColorSwatch::place(Qt::DockWidgetArea area, bool p)
{
- if (!p) return;
+ if (!p)
+ return;
- QMainWindow *mainWindow = qobject_cast<QMainWindow *>(parentWidget());
mainWindow->addDockWidget(area, this);
if (allowedAreasActions->isEnabled()) {
@@ -596,10 +571,10 @@ QSize BlueTitleBar::minimumSizeHint() const
BlueTitleBar::BlueTitleBar(QWidget *parent)
: QWidget(parent)
+ , leftPm(QPixmap(":/res/titlebarLeft.png"))
+ , centerPm(QPixmap(":/res/titlebarCenter.png"))
+ , rightPm(QPixmap(":/res/titlebarRight.png"))
{
- leftPm = QPixmap(":/res/titlebarLeft.png");
- centerPm = QPixmap(":/res/titlebarCenter.png");
- rightPm = QPixmap(":/res/titlebarRight.png");
}
void BlueTitleBar::paintEvent(QPaintEvent*)
@@ -687,7 +662,7 @@ void BlueTitleBar::updateMask()
{
QPainter painter(&bitmap);
- ///initialize to transparent
+ // initialize to transparent
painter.fillRect(rect, Qt::color0);
QRect contents = rect;
@@ -696,10 +671,7 @@ void BlueTitleBar::updateMask()
contents.setBottom(contents.bottom()-y());
painter.fillRect(contents, Qt::color1);
-
-
- //let's pait the titlebar
-
+ // let's paint the titlebar
QRect titleRect = this->geometry();
if (dw->features() & QDockWidget::DockWidgetVerticalTitleBar) {
@@ -722,7 +694,6 @@ void BlueTitleBar::updateMask()
QRect rect = titleRect;
-
painter.drawPixmap(rect.topLeft(), leftPm.mask());
painter.fillRect(rect.left() + leftPm.width(), rect.top(),
rect.width() - leftPm.width() - rightPm.width(),
diff --git a/examples/widgets/mainwindows/mainwindow/colorswatch.h b/examples/widgets/mainwindows/mainwindow/colorswatch.h
index 6d02592b22..8827a7dca7 100644
--- a/examples/widgets/mainwindows/mainwindow/colorswatch.h
+++ b/examples/widgets/mainwindows/mainwindow/colorswatch.h
@@ -44,45 +44,15 @@ class ColorSwatch : public QDockWidget
{
Q_OBJECT
- QAction *closableAction;
- QAction *movableAction;
- QAction *floatableAction;
- QAction *floatingAction;
- QAction *verticalTitleBarAction;
-
- QActionGroup *allowedAreasActions;
- QAction *allowLeftAction;
- QAction *allowRightAction;
- QAction *allowTopAction;
- QAction *allowBottomAction;
-
- QActionGroup *areaActions;
- QAction *leftAction;
- QAction *rightAction;
- QAction *topAction;
- QAction *bottomAction;
-
- QAction *changeSizeHintsAction;
-
- QMenu *tabMenu;
- QMenu *splitHMenu;
- QMenu *splitVMenu;
-
- QAction *windowModifiedAction;
-
public:
- explicit ColorSwatch(const QString &colorName, QWidget *parent = 0, Qt::WindowFlags flags = 0);
+ explicit ColorSwatch(const QString &colorName, QMainWindow *parent = Q_NULLPTR, Qt::WindowFlags flags = 0);
- QMenu *menu;
void setCustomSizeHint(const QSize &size);
+ QMenu *colorSwatchMenu() const { return menu; }
protected:
- virtual void contextMenuEvent(QContextMenuEvent *event) Q_DECL_OVERRIDE;
- virtual void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE;
-
-private:
- void allow(Qt::DockWidgetArea area, bool allow);
- void place(Qt::DockWidgetArea area, bool place);
+ void contextMenuEvent(QContextMenuEvent *event) Q_DECL_OVERRIDE;
+ void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE;
private slots:
void changeClosable(bool on);
@@ -104,25 +74,57 @@ private slots:
void splitInto(QAction *action);
void tabInto(QAction *action);
+
+private:
+ void allow(Qt::DockWidgetArea area, bool allow);
+ void place(Qt::DockWidgetArea area, bool place);
+
+ QAction *closableAction;
+ QAction *movableAction;
+ QAction *floatableAction;
+ QAction *floatingAction;
+ QAction *verticalTitleBarAction;
+
+ QActionGroup *allowedAreasActions;
+ QAction *allowLeftAction;
+ QAction *allowRightAction;
+ QAction *allowTopAction;
+ QAction *allowBottomAction;
+
+ QActionGroup *areaActions;
+ QAction *leftAction;
+ QAction *rightAction;
+ QAction *topAction;
+ QAction *bottomAction;
+
+ QMenu *tabMenu;
+ QMenu *splitHMenu;
+ QMenu *splitVMenu;
+ QMenu *menu;
+
+ QMainWindow *mainWindow;
};
class BlueTitleBar : public QWidget
{
Q_OBJECT
public:
- BlueTitleBar(QWidget *parent = 0);
+ explicit BlueTitleBar(QWidget *parent = Q_NULLPTR);
QSize sizeHint() const Q_DECL_OVERRIDE { return minimumSizeHint(); }
QSize minimumSizeHint() const Q_DECL_OVERRIDE;
+
protected:
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+
public slots:
void updateMask();
private:
- QPixmap leftPm, centerPm, rightPm;
+ const QPixmap leftPm;
+ const QPixmap centerPm;
+ const QPixmap rightPm;
};
-
-#endif
+#endif // COLORSWATCH_H
diff --git a/examples/widgets/mainwindows/mainwindow/main.cpp b/examples/widgets/mainwindows/mainwindow/main.cpp
index 2192074791..b32b595a2d 100644
--- a/examples/widgets/mainwindows/mainwindow/main.cpp
+++ b/examples/widgets/mainwindows/mainwindow/main.cpp
@@ -37,9 +37,10 @@
#include <QPainterPath>
#include <QPainter>
#include <QMap>
-#include <qdebug.h>
+#include <QDebug>
-void render_qt_text(QPainter *painter, int w, int h, const QColor &color) {
+void render_qt_text(QPainter *painter, int w, int h, const QColor &color)
+{
QPainterPath path;
path.moveTo(-0.083695, 0.283849);
path.cubicTo(-0.049581, 0.349613, -0.012720, 0.397969, 0.026886, 0.428917);
@@ -108,47 +109,67 @@ void render_qt_text(QPainter *painter, int w, int h, const QColor &color) {
painter->drawPath(path);
}
-void usage()
+static void usage()
{
qWarning() << "Usage: mainwindow [-SizeHint<color> <width>x<height>] ...";
exit(1);
}
-QMap<QString, QSize> parseCustomSizeHints(int argc, char **argv)
-{
- QMap<QString, QSize> result;
-
- for (int i = 1; i < argc; ++i) {
- QString arg = QString::fromLocal8Bit(argv[i]);
+enum ParseCommandLineArgumentsResult {
+ CommandLineArgumentsOk,
+ CommandLineArgumentsError,
+ HelpRequested
+};
+static ParseCommandLineArgumentsResult
+ parseCustomSizeHints(const QStringList &arguments, MainWindow::CustomSizeHintMap *result)
+{
+ result->clear();
+ const int argumentCount = arguments.size();
+ for (int i = 1; i < argumentCount; ++i) {
+ const QString &arg = arguments.at(i);
if (arg.startsWith(QLatin1String("-SizeHint"))) {
- QString name = arg.mid(9);
+ const QString name = arg.mid(9);
if (name.isEmpty())
- usage();
- if (++i == argc)
- usage();
- QString sizeStr = QString::fromLocal8Bit(argv[i]);
- int idx = sizeStr.indexOf(QLatin1Char('x'));
+ return CommandLineArgumentsError;
+ if (++i == argumentCount)
+ return CommandLineArgumentsError;
+ const QString sizeStr = arguments.at(i);
+ const int idx = sizeStr.indexOf(QLatin1Char('x'));
if (idx == -1)
- usage();
+ return CommandLineArgumentsError;
bool ok;
- int w = sizeStr.left(idx).toInt(&ok);
+ const int w = sizeStr.leftRef(idx).toInt(&ok);
if (!ok)
- usage();
- int h = sizeStr.mid(idx + 1).toInt(&ok);
+ return CommandLineArgumentsError;
+ const int h = sizeStr.midRef(idx + 1).toInt(&ok);
if (!ok)
- usage();
- result[name] = QSize(w, h);
+ return CommandLineArgumentsError;
+ result->insert(name, QSize(w, h));
+ } else if (arg == QLatin1String("-h") || arg == QLatin1String("--help")) {
+ return HelpRequested;
+ } else {
+ return CommandLineArgumentsError;
}
}
- return result;
+ return CommandLineArgumentsOk;
}
int main(int argc, char **argv)
{
QApplication app(argc, argv);
- QMap<QString, QSize> customSizeHints = parseCustomSizeHints(argc, argv);
+ MainWindow::CustomSizeHintMap customSizeHints;
+ switch (parseCustomSizeHints(QCoreApplication::arguments(), &customSizeHints)) {
+ case CommandLineArgumentsOk:
+ break;
+ case CommandLineArgumentsError:
+ usage();
+ return -1;
+ case HelpRequested:
+ usage();
+ return 0;
+ }
MainWindow mainWin(customSizeHints);
mainWin.resize(800, 600);
mainWin.show();
diff --git a/examples/widgets/mainwindows/mainwindow/mainwindow.cpp b/examples/widgets/mainwindows/mainwindow/mainwindow.cpp
index 6349f7aa2e..91579ae611 100644
--- a/examples/widgets/mainwindows/mainwindow/mainwindow.cpp
+++ b/examples/widgets/mainwindows/mainwindow/mainwindow.cpp
@@ -44,6 +44,7 @@
#include <QFile>
#include <QDataStream>
#include <QFileDialog>
+#include <QDialogButtonBox>
#include <QMessageBox>
#include <QSignalMapper>
#include <QApplication>
@@ -53,9 +54,10 @@
#include <QComboBox>
#include <QLabel>
#include <QPushButton>
-#include <qdebug.h>
+#include <QTextEdit>
+#include <QDebug>
-static const char * const message =
+static const char message[] =
"<p><b>Qt Main Window Example</b></p>"
"<p>This is a demonstration of the QMainWindow, QToolBar and "
@@ -75,14 +77,14 @@ static const char * const message =
Q_DECLARE_METATYPE(QDockWidget::DockWidgetFeatures)
-MainWindow::MainWindow(const QMap<QString, QSize> &customSizeHints,
- QWidget *parent, Qt::WindowFlags flags)
+MainWindow::MainWindow(const CustomSizeHintMap &customSizeHints,
+ QWidget *parent, Qt::WindowFlags flags)
: QMainWindow(parent, flags)
{
setObjectName("MainWindow");
setWindowTitle("Qt Main Window Example");
- center = new QTextEdit(this);
+ QTextEdit *center = new QTextEdit(this);
center->setReadOnly(true);
center->setMinimumSize(400, 205);
setCentralWidget(center);
@@ -116,49 +118,48 @@ void MainWindow::setupMenuBar()
{
QMenu *menu = menuBar()->addMenu(tr("&File"));
- QAction *action = menu->addAction(tr("Save layout..."));
- connect(action, SIGNAL(triggered()), this, SLOT(saveLayout()));
-
- action = menu->addAction(tr("Load layout..."));
- connect(action, SIGNAL(triggered()), this, SLOT(loadLayout()));
-
- action = menu->addAction(tr("Switch layout direction"));
- connect(action, SIGNAL(triggered()), this, SLOT(switchLayoutDirection()));
+ menu->addAction(tr("Save layout..."), this, &MainWindow::saveLayout);
+ menu->addAction(tr("Load layout..."), this, &MainWindow::loadLayout);
+ menu->addAction(tr("Switch layout direction"),this, &MainWindow::switchLayoutDirection);
menu->addSeparator();
-
- menu->addAction(tr("&Quit"), this, SLOT(close()));
+ menu->addAction(tr("&Quit"), this, &QWidget::close);
mainWindowMenu = menuBar()->addMenu(tr("Main window"));
- action = mainWindowMenu->addAction(tr("Animated docks"));
+ QAction *action = mainWindowMenu->addAction(tr("Animated docks"));
action->setCheckable(true);
action->setChecked(dockOptions() & AnimatedDocks);
- connect(action, SIGNAL(toggled(bool)), this, SLOT(setDockOptions()));
+ connect(action, &QAction::toggled, this, &MainWindow::setDockOptions);
action = mainWindowMenu->addAction(tr("Allow nested docks"));
action->setCheckable(true);
action->setChecked(dockOptions() & AllowNestedDocks);
- connect(action, SIGNAL(toggled(bool)), this, SLOT(setDockOptions()));
+ connect(action, &QAction::toggled, this, &MainWindow::setDockOptions);
action = mainWindowMenu->addAction(tr("Allow tabbed docks"));
action->setCheckable(true);
action->setChecked(dockOptions() & AllowTabbedDocks);
- connect(action, SIGNAL(toggled(bool)), this, SLOT(setDockOptions()));
+ connect(action, &QAction::toggled, this, &MainWindow::setDockOptions);
action = mainWindowMenu->addAction(tr("Force tabbed docks"));
action->setCheckable(true);
action->setChecked(dockOptions() & ForceTabbedDocks);
- connect(action, SIGNAL(toggled(bool)), this, SLOT(setDockOptions()));
+ connect(action, &QAction::toggled, this, &MainWindow::setDockOptions);
action = mainWindowMenu->addAction(tr("Vertical tabs"));
action->setCheckable(true);
action->setChecked(dockOptions() & VerticalTabs);
- connect(action, SIGNAL(toggled(bool)), this, SLOT(setDockOptions()));
+ connect(action, &QAction::toggled, this, &MainWindow::setDockOptions);
+
+ action = mainWindowMenu->addAction(tr("Grouped dragging"));
+ action->setCheckable(true);
+ action->setChecked(dockOptions() & GroupedDragging);
+ connect(action, &QAction::toggled, this, &MainWindow::setDockOptions);
QMenu *toolBarMenu = menuBar()->addMenu(tr("Tool bars"));
for (int i = 0; i < toolBars.count(); ++i)
- toolBarMenu->addMenu(toolBars.at(i)->menu);
+ toolBarMenu->addMenu(toolBars.at(i)->toolbarMenu());
#ifdef Q_OS_OSX
toolBarMenu->addSeparator();
@@ -166,7 +167,7 @@ void MainWindow::setupMenuBar()
action = toolBarMenu->addAction(tr("Unified"));
action->setCheckable(true);
action->setChecked(unifiedTitleAndToolBarOnMac());
- connect(action, SIGNAL(toggled(bool)), this, SLOT(setUnifiedTitleAndToolBarOnMac(bool)));
+ connect(action, &QAction::toggled, this, &QMainWindow::setUnifiedTitleAndToolBarOnMac);
#endif
dockWidgetMenu = menuBar()->addMenu(tr("&Dock Widgets"));
@@ -187,6 +188,8 @@ void MainWindow::setDockOptions()
opts |= ForceTabbedDocks;
if (actions.at(4)->isChecked())
opts |= VerticalTabs;
+ if (actions.at(5)->isChecked())
+ opts |= GroupedDragging;
QMainWindow::setDockOptions(opts);
}
@@ -200,8 +203,7 @@ void MainWindow::saveLayout()
QFile file(fileName);
if (!file.open(QFile::WriteOnly)) {
QString msg = tr("Failed to open %1\n%2")
- .arg(fileName)
- .arg(file.errorString());
+ .arg(QDir::toNativeSeparators(fileName), file.errorString());
QMessageBox::warning(this, tr("Error"), msg);
return;
}
@@ -217,8 +219,7 @@ void MainWindow::saveLayout()
if (!ok) {
QString msg = tr("Error writing to %1\n%2")
- .arg(fileName)
- .arg(file.errorString());
+ .arg(QDir::toNativeSeparators(fileName), file.errorString());
QMessageBox::warning(this, tr("Error"), msg);
return;
}
@@ -233,8 +234,7 @@ void MainWindow::loadLayout()
QFile file(fileName);
if (!file.open(QFile::ReadOnly)) {
QString msg = tr("Failed to open %1\n%2")
- .arg(fileName)
- .arg(file.errorString());
+ .arg(QDir::toNativeSeparators(fileName), file.errorString());
QMessageBox::warning(this, tr("Error"), msg);
return;
}
@@ -259,56 +259,65 @@ void MainWindow::loadLayout()
ok = restoreState(layout_data);
if (!ok) {
- QString msg = tr("Error reading %1")
- .arg(fileName);
+ QString msg = tr("Error reading %1").arg(QDir::toNativeSeparators(fileName));
QMessageBox::warning(this, tr("Error"), msg);
return;
}
}
-QAction *addAction(QMenu *menu, const QString &text, QActionGroup *group, QSignalMapper *mapper,
- int id)
+class DockWidgetAreaCornerFunctor {
+public:
+ explicit DockWidgetAreaCornerFunctor(QMainWindow *mw, Qt::Corner c, Qt::DockWidgetArea a)
+ : m_mainWindow(mw), m_area(a), m_corner(c) {}
+
+ void operator()() const { m_mainWindow->setCorner(m_corner, m_area); }
+
+private:
+ QMainWindow *m_mainWindow;
+ Qt::DockWidgetArea m_area;
+ Qt::Corner m_corner;
+};
+
+static QAction *addCornerAction(const QString &text, QMainWindow *mw, QMenu *menu, QActionGroup *group,
+ Qt::Corner c, Qt::DockWidgetArea a)
{
- bool first = group->actions().isEmpty();
- QAction *result = menu->addAction(text);
+ QAction *result = menu->addAction(text, mw, DockWidgetAreaCornerFunctor(mw, c, a));
result->setCheckable(true);
- result->setChecked(first);
group->addAction(result);
- QObject::connect(result, SIGNAL(triggered()), mapper, SLOT(map()));
- mapper->setMapping(result, id);
return result;
}
-void MainWindow::setupDockWidgets(const QMap<QString, QSize> &customSizeHints)
+void MainWindow::setupDockWidgets(const CustomSizeHintMap &customSizeHints)
{
qRegisterMetaType<QDockWidget::DockWidgetFeatures>();
- mapper = new QSignalMapper(this);
- connect(mapper, SIGNAL(mapped(int)), this, SLOT(setCorner(int)));
-
- QMenu *corner_menu = dockWidgetMenu->addMenu(tr("Top left corner"));
+ QMenu *cornerMenu = dockWidgetMenu->addMenu(tr("Top left corner"));
QActionGroup *group = new QActionGroup(this);
group->setExclusive(true);
- ::addAction(corner_menu, tr("Top dock area"), group, mapper, 0);
- ::addAction(corner_menu, tr("Left dock area"), group, mapper, 1);
+ QAction *cornerAction = addCornerAction(tr("Top dock area"), this, cornerMenu, group, Qt::TopLeftCorner, Qt::TopDockWidgetArea);
+ cornerAction->setChecked(true);
+ addCornerAction(tr("Left dock area"), this, cornerMenu, group, Qt::TopLeftCorner, Qt::LeftDockWidgetArea);
- corner_menu = dockWidgetMenu->addMenu(tr("Top right corner"));
+ cornerMenu = dockWidgetMenu->addMenu(tr("Top right corner"));
group = new QActionGroup(this);
group->setExclusive(true);
- ::addAction(corner_menu, tr("Top dock area"), group, mapper, 2);
- ::addAction(corner_menu, tr("Right dock area"), group, mapper, 3);
+ cornerAction = addCornerAction(tr("Top dock area"), this, cornerMenu, group, Qt::TopRightCorner, Qt::TopDockWidgetArea);
+ cornerAction->setChecked(true);
+ addCornerAction(tr("Right dock area"), this, cornerMenu, group, Qt::TopRightCorner, Qt::RightDockWidgetArea);
- corner_menu = dockWidgetMenu->addMenu(tr("Bottom left corner"));
+ cornerMenu = dockWidgetMenu->addMenu(tr("Bottom left corner"));
group = new QActionGroup(this);
group->setExclusive(true);
- ::addAction(corner_menu, tr("Bottom dock area"), group, mapper, 4);
- ::addAction(corner_menu, tr("Left dock area"), group, mapper, 5);
+ cornerAction = addCornerAction(tr("Bottom dock area"), this, cornerMenu, group, Qt::BottomLeftCorner, Qt::BottomDockWidgetArea);
+ cornerAction->setChecked(true);
+ addCornerAction(tr("Left dock area"), this, cornerMenu, group, Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
- corner_menu = dockWidgetMenu->addMenu(tr("Bottom right corner"));
+ cornerMenu = dockWidgetMenu->addMenu(tr("Bottom right corner"));
group = new QActionGroup(this);
group->setExclusive(true);
- ::addAction(corner_menu, tr("Bottom dock area"), group, mapper, 6);
- ::addAction(corner_menu, tr("Right dock area"), group, mapper, 7);
+ cornerAction = addCornerAction(tr("Bottom dock area"), this, cornerMenu, group, Qt::BottomRightCorner, Qt::BottomDockWidgetArea);
+ cornerAction->setChecked(true);
+ addCornerAction(tr("Right dock area"), this, cornerMenu, group, Qt::BottomRightCorner, Qt::RightDockWidgetArea);
dockWidgetMenu->addSeparator();
@@ -330,16 +339,16 @@ void MainWindow::setupDockWidgets(const QMap<QString, QSize> &customSizeHints)
};
const int setCount = sizeof(sets) / sizeof(Set);
+ const QIcon qtIcon(QPixmap(":/res/qt.png"));
for (int i = 0; i < setCount; ++i) {
ColorSwatch *swatch = new ColorSwatch(tr(sets[i].name), this, Qt::WindowFlags(sets[i].flags));
- if (i%2)
- swatch->setWindowIcon(QIcon(QPixmap(":/res/qt.png")));
+ if (i % 2)
+ swatch->setWindowIcon(qtIcon);
if (qstrcmp(sets[i].name, "Blue") == 0) {
BlueTitleBar *titlebar = new BlueTitleBar(swatch);
swatch->setTitleBarWidget(titlebar);
- connect(swatch, SIGNAL(topLevelChanged(bool)), titlebar, SLOT(updateMask()));
- connect(swatch, SIGNAL(featuresChanged(QDockWidget::DockWidgetFeatures)), titlebar, SLOT(updateMask()), Qt::QueuedConnection);
-
+ connect(swatch, &QDockWidget::topLevelChanged, titlebar, &BlueTitleBar::updateMask);
+ connect(swatch, &QDockWidget::featuresChanged, titlebar, &BlueTitleBar::updateMask, Qt::QueuedConnection);
}
QString name = QString::fromLatin1(sets[i].name);
@@ -347,69 +356,32 @@ void MainWindow::setupDockWidgets(const QMap<QString, QSize> &customSizeHints)
swatch->setCustomSizeHint(customSizeHints.value(name));
addDockWidget(sets[i].area, swatch);
- dockWidgetMenu->addMenu(swatch->menu);
+ dockWidgetMenu->addMenu(swatch->colorSwatchMenu());
}
- createDockWidgetAction = new QAction(tr("Add dock widget..."), this);
- connect(createDockWidgetAction, SIGNAL(triggered()), this, SLOT(createDockWidget()));
destroyDockWidgetMenu = new QMenu(tr("Destroy dock widget"), this);
destroyDockWidgetMenu->setEnabled(false);
- connect(destroyDockWidgetMenu, SIGNAL(triggered(QAction*)), this, SLOT(destroyDockWidget(QAction*)));
+ connect(destroyDockWidgetMenu, &QMenu::triggered, this, &MainWindow::destroyDockWidget);
dockWidgetMenu->addSeparator();
- dockWidgetMenu->addAction(createDockWidgetAction);
+ dockWidgetMenu->addAction(tr("Add dock widget..."), this, &MainWindow::createDockWidget);
dockWidgetMenu->addMenu(destroyDockWidgetMenu);
}
-void MainWindow::setCorner(int id)
-{
- switch (id) {
- case 0:
- QMainWindow::setCorner(Qt::TopLeftCorner, Qt::TopDockWidgetArea);
- break;
- case 1:
- QMainWindow::setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea);
- break;
- case 2:
- QMainWindow::setCorner(Qt::TopRightCorner, Qt::TopDockWidgetArea);
- break;
- case 3:
- QMainWindow::setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea);
- break;
- case 4:
- QMainWindow::setCorner(Qt::BottomLeftCorner, Qt::BottomDockWidgetArea);
- break;
- case 5:
- QMainWindow::setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
- break;
- case 6:
- QMainWindow::setCorner(Qt::BottomRightCorner, Qt::BottomDockWidgetArea);
- break;
- case 7:
- QMainWindow::setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);
- break;
- }
-}
-
-void MainWindow::showEvent(QShowEvent *event)
-{
- QMainWindow::showEvent(event);
-}
-
void MainWindow::switchLayoutDirection()
{
if (layoutDirection() == Qt::LeftToRight)
- qApp->setLayoutDirection(Qt::RightToLeft);
+ QApplication::setLayoutDirection(Qt::RightToLeft);
else
- qApp->setLayoutDirection(Qt::LeftToRight);
+ QApplication::setLayoutDirection(Qt::LeftToRight);
}
class CreateDockWidgetDialog : public QDialog
{
public:
- CreateDockWidgetDialog(QWidget *parent = 0);
+ explicit CreateDockWidgetDialog(QWidget *parent = Q_NULLPTR);
- QString objectName() const;
+ QString enteredObjectName() const { return m_objectName->text(); }
Qt::DockWidgetArea location() const;
private:
@@ -419,15 +391,17 @@ private:
CreateDockWidgetDialog::CreateDockWidgetDialog(QWidget *parent)
: QDialog(parent)
+ , m_objectName(new QLineEdit(this))
+ , m_location(new QComboBox(this))
{
+ setWindowTitle(tr("Add Dock Widget"));
+ setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
QGridLayout *layout = new QGridLayout(this);
layout->addWidget(new QLabel(tr("Object name:")), 0, 0);
- m_objectName = new QLineEdit;
layout->addWidget(m_objectName, 0, 1);
layout->addWidget(new QLabel(tr("Location:")), 1, 0);
- m_location = new QComboBox;
m_location->setEditable(false);
m_location->addItem(tr("Top"));
m_location->addItem(tr("Left"));
@@ -436,23 +410,10 @@ CreateDockWidgetDialog::CreateDockWidgetDialog(QWidget *parent)
m_location->addItem(tr("Restore"));
layout->addWidget(m_location, 1, 1);
- QHBoxLayout *buttonLayout = new QHBoxLayout;
- layout->addLayout(buttonLayout, 2, 0, 1, 2);
- buttonLayout->addStretch();
-
- QPushButton *cancelButton = new QPushButton(tr("Cancel"));
- connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
- buttonLayout->addWidget(cancelButton);
- QPushButton *okButton = new QPushButton(tr("Ok"));
- connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
- buttonLayout->addWidget(okButton);
-
- okButton->setDefault(true);
-}
-
-QString CreateDockWidgetDialog::objectName() const
-{
- return m_objectName->text();
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
+ connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
+ connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::reject);
+ layout->addWidget(buttonBox, 2, 0, 1, 2);
}
Qt::DockWidgetArea CreateDockWidgetDialog::location() const
@@ -471,13 +432,13 @@ Qt::DockWidgetArea CreateDockWidgetDialog::location() const
void MainWindow::createDockWidget()
{
CreateDockWidgetDialog dialog(this);
- int ret = dialog.exec();
- if (ret == QDialog::Rejected)
+ if (dialog.exec() == QDialog::Rejected)
return;
QDockWidget *dw = new QDockWidget;
- dw->setObjectName(dialog.objectName());
- dw->setWindowTitle(dialog.objectName());
+ const QString name = dialog.enteredObjectName();
+ dw->setObjectName(name);
+ dw->setWindowTitle(name);
dw->setWidget(new QTextEdit);
Qt::DockWidgetArea area = dialog.location();
@@ -499,7 +460,7 @@ void MainWindow::createDockWidget()
extraDockWidgets.append(dw);
destroyDockWidgetMenu->setEnabled(true);
- destroyDockWidgetMenu->addAction(new QAction(dialog.objectName(), this));
+ destroyDockWidgetMenu->addAction(new QAction(name, this));
}
void MainWindow::destroyDockWidget(QAction *action)
diff --git a/examples/widgets/mainwindows/mainwindow/mainwindow.h b/examples/widgets/mainwindows/mainwindow/mainwindow.h
index f9a6176b2d..162e977520 100644
--- a/examples/widgets/mainwindows/mainwindow/mainwindow.h
+++ b/examples/widgets/mainwindows/mainwindow/mainwindow.h
@@ -35,37 +35,25 @@
#define MAINWINDOW_H
#include <QMainWindow>
-#include <QTextEdit>
class ToolBar;
QT_FORWARD_DECLARE_CLASS(QMenu)
-QT_FORWARD_DECLARE_CLASS(QSignalMapper)
class MainWindow : public QMainWindow
{
Q_OBJECT
- QTextEdit *center;
- QList<ToolBar*> toolBars;
- QMenu *dockWidgetMenu;
- QMenu *mainWindowMenu;
- QSignalMapper *mapper;
- QList<QDockWidget*> extraDockWidgets;
- QAction *createDockWidgetAction;
- QMenu *destroyDockWidgetMenu;
-
public:
- MainWindow(const QMap<QString, QSize> &customSizeHints,
- QWidget *parent = 0, Qt::WindowFlags flags = 0);
+ typedef QMap<QString, QSize> CustomSizeHintMap;
-protected:
- void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
+ explicit MainWindow(const CustomSizeHintMap &customSizeHints,
+ QWidget *parent = Q_NULLPTR,
+ Qt::WindowFlags flags = 0);
public slots:
void actionTriggered(QAction *action);
void saveLayout();
void loadLayout();
- void setCorner(int id);
void switchLayoutDirection();
void setDockOptions();
@@ -75,8 +63,13 @@ public slots:
private:
void setupToolBar();
void setupMenuBar();
- void setupDockWidgets(const QMap<QString, QSize> &customSizeHints);
-};
+ void setupDockWidgets(const CustomSizeHintMap &customSizeHints);
+ QList<ToolBar*> toolBars;
+ QMenu *dockWidgetMenu;
+ QMenu *mainWindowMenu;
+ QList<QDockWidget *> extraDockWidgets;
+ QMenu *destroyDockWidgetMenu;
+};
-#endif
+#endif // MAINWINDOW_H
diff --git a/examples/widgets/mainwindows/mainwindow/toolbar.cpp b/examples/widgets/mainwindows/mainwindow/toolbar.cpp
index 280ba965d6..a9b308370a 100644
--- a/examples/widgets/mainwindows/mainwindow/toolbar.cpp
+++ b/examples/widgets/mainwindows/mainwindow/toolbar.cpp
@@ -63,15 +63,15 @@ static QPixmap genIcon(const QSize &iconSize, int number, const QColor &color)
{ return genIcon(iconSize, QString::number(number), color); }
ToolBar::ToolBar(const QString &title, QWidget *parent)
- : QToolBar(parent), spinbox(0), spinboxAction(0)
+ : QToolBar(parent)
+ , spinbox(Q_NULLPTR)
+ , spinboxAction(Q_NULLPTR)
{
- tip = 0;
setWindowTitle(title);
setObjectName(title);
setIconSize(QSize(32, 32));
- QColor bg(palette().background().color());
menu = new QMenu("One", this);
menu->setIcon(genIcon(iconSize(), 1, Qt::black));
menu->addAction(genIcon(iconSize(), "A", Qt::blue), "A");
@@ -90,43 +90,43 @@ ToolBar::ToolBar(const QString &title, QWidget *parent)
addAction(genIcon(iconSize(), 6, Qt::yellow), "Six");
orderAction = new QAction(this);
orderAction->setText(tr("Order Items in Tool Bar"));
- connect(orderAction, SIGNAL(triggered()), SLOT(order()));
+ connect(orderAction, &QAction::triggered, this, &ToolBar::order);
randomizeAction = new QAction(this);
randomizeAction->setText(tr("Randomize Items in Tool Bar"));
- connect(randomizeAction, SIGNAL(triggered()), SLOT(randomize()));
+ connect(randomizeAction, &QAction::triggered, this, &ToolBar::randomize);
addSpinBoxAction = new QAction(this);
addSpinBoxAction->setText(tr("Add Spin Box"));
- connect(addSpinBoxAction, SIGNAL(triggered()), SLOT(addSpinBox()));
+ connect(addSpinBoxAction, &QAction::triggered, this, &ToolBar::addSpinBox);
removeSpinBoxAction = new QAction(this);
removeSpinBoxAction->setText(tr("Remove Spin Box"));
removeSpinBoxAction->setEnabled(false);
- connect(removeSpinBoxAction, SIGNAL(triggered()), SLOT(removeSpinBox()));
+ connect(removeSpinBoxAction, &QAction::triggered, this, &ToolBar::removeSpinBox);
movableAction = new QAction(tr("Movable"), this);
movableAction->setCheckable(true);
- connect(movableAction, SIGNAL(triggered(bool)), SLOT(changeMovable(bool)));
+ connect(movableAction, &QAction::triggered, this, &ToolBar::changeMovable);
allowedAreasActions = new QActionGroup(this);
allowedAreasActions->setExclusive(false);
allowLeftAction = new QAction(tr("Allow on Left"), this);
allowLeftAction->setCheckable(true);
- connect(allowLeftAction, SIGNAL(triggered(bool)), SLOT(allowLeft(bool)));
+ connect(allowLeftAction, &QAction::triggered, this, &ToolBar::allowLeft);
allowRightAction = new QAction(tr("Allow on Right"), this);
allowRightAction->setCheckable(true);
- connect(allowRightAction, SIGNAL(triggered(bool)), SLOT(allowRight(bool)));
+ connect(allowRightAction, &QAction::triggered, this, &ToolBar::allowRight);
allowTopAction = new QAction(tr("Allow on Top"), this);
allowTopAction->setCheckable(true);
- connect(allowTopAction, SIGNAL(triggered(bool)), SLOT(allowTop(bool)));
+ connect(allowTopAction, &QAction::triggered, this, &ToolBar::allowTop);
allowBottomAction = new QAction(tr("Allow on Bottom"), this);
allowBottomAction->setCheckable(true);
- connect(allowBottomAction, SIGNAL(triggered(bool)), SLOT(allowBottom(bool)));
+ connect(allowBottomAction, &QAction::triggered, this, &ToolBar::allowBottom);
allowedAreasActions->addAction(allowLeftAction);
allowedAreasActions->addAction(allowRightAction);
@@ -138,31 +138,28 @@ ToolBar::ToolBar(const QString &title, QWidget *parent)
leftAction = new QAction(tr("Place on Left") , this);
leftAction->setCheckable(true);
- connect(leftAction, SIGNAL(triggered(bool)), SLOT(placeLeft(bool)));
+ connect(leftAction, &QAction::triggered, this, &ToolBar::placeLeft);
rightAction = new QAction(tr("Place on Right") , this);
rightAction->setCheckable(true);
- connect(rightAction, SIGNAL(triggered(bool)), SLOT(placeRight(bool)));
+ connect(rightAction, &QAction::triggered, this, &ToolBar::placeRight);
topAction = new QAction(tr("Place on Top") , this);
topAction->setCheckable(true);
- connect(topAction, SIGNAL(triggered(bool)), SLOT(placeTop(bool)));
+ connect(topAction, &QAction::triggered, this, &ToolBar::placeTop);
bottomAction = new QAction(tr("Place on Bottom") , this);
bottomAction->setCheckable(true);
- connect(bottomAction, SIGNAL(triggered(bool)), SLOT(placeBottom(bool)));
+ connect(bottomAction, &QAction::triggered, this, &ToolBar::placeBottom);
areaActions->addAction(leftAction);
areaActions->addAction(rightAction);
areaActions->addAction(topAction);
areaActions->addAction(bottomAction);
- toolBarBreakAction = new QAction(tr("Insert break"), this);
- connect(toolBarBreakAction, SIGNAL(triggered(bool)), this, SLOT(insertToolBarBreak()));
+ connect(movableAction, &QAction::triggered, areaActions, &QActionGroup::setEnabled);
- connect(movableAction, SIGNAL(triggered(bool)), areaActions, SLOT(setEnabled(bool)));
-
- connect(movableAction, SIGNAL(triggered(bool)), allowedAreasActions, SLOT(setEnabled(bool)));
+ connect(movableAction, &QAction::triggered, allowedAreasActions, &QActionGroup::setEnabled);
menu = new QMenu(title, this);
menu->addAction(toggleViewAction());
@@ -179,9 +176,9 @@ ToolBar::ToolBar(const QString &title, QWidget *parent)
menu->addSeparator();
menu->addActions(areaActions->actions());
menu->addSeparator();
- menu->addAction(toolBarBreakAction);
+ menu->addAction(tr("Insert break"), this, &ToolBar::insertToolBarBreak);
- connect(menu, SIGNAL(aboutToShow()), this, SLOT(updateMenu()));
+ connect(menu, &QMenu::aboutToShow, this, &ToolBar::updateMenu);
randomize();
}
@@ -223,10 +220,9 @@ void ToolBar::updateMenu()
void ToolBar::order()
{
- QList<QAction *> ordered, actions1 = actions(),
- actions2 = findChildren<QAction *>();
- while (!actions2.isEmpty()) {
- QAction *action = actions2.takeFirst();
+ QList<QAction *> ordered;
+ QList<QAction *> actions1 = actions();
+ foreach (QAction *action, findChildren<QAction *>()) {
if (!actions1.contains(action))
continue;
actions1.removeAll(action);
@@ -241,7 +237,8 @@ void ToolBar::order()
void ToolBar::randomize()
{
- QList<QAction *> randomized, actions = this->actions();
+ QList<QAction *> randomized;
+ QList<QAction *> actions = this->actions();
while (!actions.isEmpty()) {
QAction *action = actions.takeAt(rand() % actions.size());
randomized.append(action);
@@ -254,9 +251,8 @@ void ToolBar::randomize()
void ToolBar::addSpinBox()
{
- if (!spinbox) {
+ if (!spinbox)
spinbox = new QSpinBox(this);
- }
if (!spinboxAction)
spinboxAction = addWidget(spinbox);
else
@@ -341,35 +337,3 @@ void ToolBar::insertToolBarBreak()
mainWindow->insertToolBarBreak(this);
}
-
-void ToolBar::enterEvent(QEvent*)
-{
-/*
- These labels on top of toolbars look darn ugly
-
- if (tip == 0) {
- tip = new QLabel(windowTitle(), this);
- QPalette pal = tip->palette();
- QColor c = Qt::black;
- c.setAlpha(100);
- pal.setColor(QPalette::Window, c);
- pal.setColor(QPalette::Foreground, Qt::white);
- tip->setPalette(pal);
- tip->setAutoFillBackground(true);
- tip->setMargin(3);
- tip->setText(windowTitle());
- }
- QPoint c = rect().center();
- QSize hint = tip->sizeHint();
- tip->setGeometry(c.x() - hint.width()/2, c.y() - hint.height()/2,
- hint.width(), hint.height());
-
- tip->show();
-*/
-}
-
-void ToolBar::leaveEvent(QEvent*)
-{
- if (tip != 0)
- tip->hide();
-}
diff --git a/examples/widgets/mainwindows/mainwindow/toolbar.h b/examples/widgets/mainwindows/mainwindow/toolbar.h
index b1674a2034..2629d9d7a7 100644
--- a/examples/widgets/mainwindows/mainwindow/toolbar.h
+++ b/examples/widgets/mainwindows/mainwindow/toolbar.h
@@ -40,49 +40,15 @@ QT_FORWARD_DECLARE_CLASS(QAction)
QT_FORWARD_DECLARE_CLASS(QActionGroup)
QT_FORWARD_DECLARE_CLASS(QMenu)
QT_FORWARD_DECLARE_CLASS(QSpinBox)
-QT_FORWARD_DECLARE_CLASS(QLabel)
class ToolBar : public QToolBar
{
Q_OBJECT
- QSpinBox *spinbox;
- QAction *spinboxAction;
-
- QAction *orderAction;
- QAction *randomizeAction;
- QAction *addSpinBoxAction;
- QAction *removeSpinBoxAction;
-
- QAction *movableAction;
-
- QActionGroup *allowedAreasActions;
- QAction *allowLeftAction;
- QAction *allowRightAction;
- QAction *allowTopAction;
- QAction *allowBottomAction;
-
- QActionGroup *areaActions;
- QAction *leftAction;
- QAction *rightAction;
- QAction *topAction;
- QAction *bottomAction;
-
- QAction *toolBarBreakAction;
-
public:
- ToolBar(const QString &title, QWidget *parent);
-
- QMenu *menu;
+ explicit ToolBar(const QString &title, QWidget *parent);
-protected:
- void enterEvent(QEvent*) Q_DECL_OVERRIDE;
- void leaveEvent(QEvent*) Q_DECL_OVERRIDE;
-
-private:
- void allow(Qt::ToolBarArea area, bool allow);
- void place(Qt::ToolBarArea area, bool place);
- QLabel *tip;
+ QMenu *toolbarMenu() const { return menu; }
private slots:
void order();
@@ -105,6 +71,32 @@ private slots:
void updateMenu();
void insertToolBarBreak();
+private:
+ void allow(Qt::ToolBarArea area, bool allow);
+ void place(Qt::ToolBarArea area, bool place);
+
+ QSpinBox *spinbox;
+ QAction *spinboxAction;
+
+ QMenu *menu;
+ QAction *orderAction;
+ QAction *randomizeAction;
+ QAction *addSpinBoxAction;
+ QAction *removeSpinBoxAction;
+
+ QAction *movableAction;
+
+ QActionGroup *allowedAreasActions;
+ QAction *allowLeftAction;
+ QAction *allowRightAction;
+ QAction *allowTopAction;
+ QAction *allowBottomAction;
+
+ QActionGroup *areaActions;
+ QAction *leftAction;
+ QAction *rightAction;
+ QAction *topAction;
+ QAction *bottomAction;
};
-#endif
+#endif // TOOLBAR_H
diff --git a/examples/widgets/mainwindows/mainwindows.pro b/examples/widgets/mainwindows/mainwindows.pro
index 52179ec9bd..dcda89abaf 100644
--- a/examples/widgets/mainwindows/mainwindows.pro
+++ b/examples/widgets/mainwindows/mainwindows.pro
@@ -4,5 +4,4 @@ SUBDIRS = application \
mainwindow \
mdi \
menus \
- recentfiles \
sdi
diff --git a/examples/widgets/mainwindows/mdi/main.cpp b/examples/widgets/mainwindows/mdi/main.cpp
index 5976c85c1c..f02285d1cf 100644
--- a/examples/widgets/mainwindows/mdi/main.cpp
+++ b/examples/widgets/mainwindows/mdi/main.cpp
@@ -49,6 +49,8 @@ int main(int argc, char *argv[])
Q_INIT_RESOURCE(mdi);
QApplication app(argc, argv);
+ QCoreApplication::setApplicationName("MDI Example");
+ QCoreApplication::setOrganizationName("QtProject");
QCoreApplication::setApplicationVersion(QT_VERSION_STR);
QCommandLineParser parser;
parser.setApplicationDescription("Qt MDI Example");
diff --git a/examples/widgets/mainwindows/mdi/mainwindow.cpp b/examples/widgets/mainwindows/mdi/mainwindow.cpp
index 83ffbf6557..35136c81c4 100644
--- a/examples/widgets/mainwindows/mdi/mainwindow.cpp
+++ b/examples/widgets/mainwindows/mdi/mainwindow.cpp
@@ -44,20 +44,15 @@
#include "mdichild.h"
MainWindow::MainWindow()
+ : mdiArea(new QMdiArea)
{
- mdiArea = new QMdiArea;
mdiArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
mdiArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
setCentralWidget(mdiArea);
- connect(mdiArea, SIGNAL(subWindowActivated(QMdiSubWindow*)),
- this, SLOT(updateMenus()));
- windowMapper = new QSignalMapper(this);
- connect(windowMapper, SIGNAL(mapped(QWidget*)),
- this, SLOT(setActiveSubWindow(QWidget*)));
+ connect(mdiArea, &QMdiArea::subWindowActivated,
+ this, &MainWindow::updateMenus);
createActions();
- createMenus();
- createToolBars();
createStatusBar();
updateMenus();
@@ -87,20 +82,24 @@ void MainWindow::newFile()
void MainWindow::open()
{
- QString fileName = QFileDialog::getOpenFileName(this);
- if (!fileName.isEmpty()) {
- QMdiSubWindow *existing = findMdiChild(fileName);
- if (existing) {
- mdiArea->setActiveSubWindow(existing);
- return;
- }
+ const QString fileName = QFileDialog::getOpenFileName(this);
+ if (!fileName.isEmpty())
+ openFile(fileName);
+}
- if (openFile(fileName))
- statusBar()->showMessage(tr("File loaded"), 2000);
+bool MainWindow::openFile(const QString &fileName)
+{
+ if (QMdiSubWindow *existing = findMdiChild(fileName)) {
+ mdiArea->setActiveSubWindow(existing);
+ return true;
}
+ const bool succeeded = loadFile(fileName);
+ if (succeeded)
+ statusBar()->showMessage(tr("File loaded"), 2000);
+ return succeeded;
}
-bool MainWindow::openFile(const QString &fileName)
+bool MainWindow::loadFile(const QString &fileName)
{
MdiChild *child = createMdiChild();
const bool succeeded = child->loadFile(fileName);
@@ -108,9 +107,87 @@ bool MainWindow::openFile(const QString &fileName)
child->show();
else
child->close();
+ MainWindow::prependToRecentFiles(fileName);
return succeeded;
}
+static inline QString recentFilesKey() { return QStringLiteral("recentFileList"); }
+static inline QString fileKey() { return QStringLiteral("file"); }
+
+static QStringList readRecentFiles(QSettings &settings)
+{
+ QStringList result;
+ const int count = settings.beginReadArray(recentFilesKey());
+ for (int i = 0; i < count; ++i) {
+ settings.setArrayIndex(i);
+ result.append(settings.value(fileKey()).toString());
+ }
+ settings.endArray();
+ return result;
+}
+
+static void writeRecentFiles(const QStringList &files, QSettings &settings)
+{
+ const int count = files.size();
+ settings.beginWriteArray(recentFilesKey());
+ for (int i = 0; i < count; ++i) {
+ settings.setArrayIndex(i);
+ settings.setValue(fileKey(), files.at(i));
+ }
+ settings.endArray();
+}
+
+bool MainWindow::hasRecentFiles()
+{
+ QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName());
+ const int count = settings.beginReadArray(recentFilesKey());
+ settings.endArray();
+ return count > 0;
+}
+
+void MainWindow::prependToRecentFiles(const QString &fileName)
+{
+ QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName());
+
+ const QStringList oldRecentFiles = readRecentFiles(settings);
+ QStringList recentFiles = oldRecentFiles;
+ recentFiles.removeAll(fileName);
+ recentFiles.prepend(fileName);
+ if (oldRecentFiles != recentFiles)
+ writeRecentFiles(recentFiles, settings);
+
+ setRecentFilesVisible(!recentFiles.isEmpty());
+}
+
+void MainWindow::setRecentFilesVisible(bool visible)
+{
+ recentFileSubMenuAct->setVisible(visible);
+ recentFileSeparator->setVisible(visible);
+}
+
+void MainWindow::updateRecentFileActions()
+{
+ QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName());
+
+ const QStringList recentFiles = readRecentFiles(settings);
+ const int count = qMin(int(MaxRecentFiles), recentFiles.size());
+ int i = 0;
+ for ( ; i < count; ++i) {
+ const QString fileName = QFileInfo(recentFiles.at(i)).fileName();
+ recentFileActs[i]->setText(tr("&%1 %2").arg(i + 1).arg(fileName));
+ recentFileActs[i]->setData(recentFiles.at(i));
+ recentFileActs[i]->setVisible(true);
+ }
+ for ( ; i < MaxRecentFiles; ++i)
+ recentFileActs[i]->setVisible(false);
+}
+
+void MainWindow::openRecentFile()
+{
+ if (const QAction *action = qobject_cast<const QAction *>(sender()))
+ openFile(action->data().toString());
+}
+
void MainWindow::save()
{
if (activeMdiChild() && activeMdiChild()->save())
@@ -119,8 +196,11 @@ void MainWindow::save()
void MainWindow::saveAs()
{
- if (activeMdiChild() && activeMdiChild()->saveAs())
+ MdiChild *child = activeMdiChild();
+ if (child && child->saveAs()) {
statusBar()->showMessage(tr("File saved"), 2000);
+ MainWindow::prependToRecentFiles(child->currentFile());
+ }
}
#ifndef QT_NO_CLIPBOARD
@@ -164,7 +244,7 @@ void MainWindow::updateMenus()
cascadeAct->setEnabled(hasMdiChild);
nextAct->setEnabled(hasMdiChild);
previousAct->setEnabled(hasMdiChild);
- separatorAct->setVisible(hasMdiChild);
+ windowMenuSeparatorAct->setVisible(hasMdiChild);
#ifndef QT_NO_CLIPBOARD
bool hasSelection = (activeMdiChild() &&
@@ -174,6 +254,16 @@ void MainWindow::updateMenus()
#endif
}
+class ActiveMdiSubWindowFunctor {
+public:
+ explicit ActiveMdiSubWindowFunctor(QMdiArea *mdiArea, QMdiSubWindow *activeWindow) : m_mdiArea(mdiArea), m_activeWindow(activeWindow) {}
+ void operator()() const { m_mdiArea->setActiveSubWindow(m_activeWindow); }
+
+private:
+ QMdiArea *m_mdiArea;
+ QMdiSubWindow *m_activeWindow;
+};
+
void MainWindow::updateWindowMenu()
{
windowMenu->clear();
@@ -185,13 +275,14 @@ void MainWindow::updateWindowMenu()
windowMenu->addSeparator();
windowMenu->addAction(nextAct);
windowMenu->addAction(previousAct);
- windowMenu->addAction(separatorAct);
+ windowMenu->addAction(windowMenuSeparatorAct);
QList<QMdiSubWindow *> windows = mdiArea->subWindowList();
- separatorAct->setVisible(!windows.isEmpty());
+ windowMenuSeparatorAct->setVisible(!windows.isEmpty());
for (int i = 0; i < windows.size(); ++i) {
- MdiChild *child = qobject_cast<MdiChild *>(windows.at(i)->widget());
+ QMdiSubWindow *mdiSubWindow = windows.at(i);
+ MdiChild *child = qobject_cast<MdiChild *>(mdiSubWindow->widget());
QString text;
if (i < 9) {
@@ -201,11 +292,9 @@ void MainWindow::updateWindowMenu()
text = tr("%1 %2").arg(i + 1)
.arg(child->userFriendlyCurrentFile());
}
- QAction *action = windowMenu->addAction(text);
+ QAction *action = windowMenu->addAction(text, mdiSubWindow, ActiveMdiSubWindowFunctor(mdiArea, mdiSubWindow));
action->setCheckable(true);
action ->setChecked(child == activeMdiChild());
- connect(action, SIGNAL(triggered()), windowMapper, SLOT(map()));
- windowMapper->setMapping(action, windows.at(i));
}
}
@@ -215,10 +304,8 @@ MdiChild *MainWindow::createMdiChild()
mdiArea->addSubWindow(child);
#ifndef QT_NO_CLIPBOARD
- connect(child, SIGNAL(copyAvailable(bool)),
- cutAct, SLOT(setEnabled(bool)));
- connect(child, SIGNAL(copyAvailable(bool)),
- copyAct, SLOT(setEnabled(bool)));
+ connect(child, &QTextEdit::copyAvailable, cutAct, &QAction::setEnabled);
+ connect(child, &QTextEdit::copyAvailable, copyAct, &QAction::setEnabled);
#endif
return child;
@@ -226,139 +313,143 @@ MdiChild *MainWindow::createMdiChild()
void MainWindow::createActions()
{
- newAct = new QAction(QIcon(":/images/new.png"), tr("&New"), this);
+ QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
+ QToolBar *fileToolBar = addToolBar(tr("File"));
+
+ const QIcon newIcon = QIcon::fromTheme("document-new", QIcon(":/images/new.png"));
+ newAct = new QAction(newIcon, tr("&New"), this);
newAct->setShortcuts(QKeySequence::New);
newAct->setStatusTip(tr("Create a new file"));
- connect(newAct, SIGNAL(triggered()), this, SLOT(newFile()));
+ connect(newAct, &QAction::triggered, this, &MainWindow::newFile);
+ fileMenu->addAction(newAct);
+ fileToolBar->addAction(newAct);
- openAct = new QAction(QIcon(":/images/open.png"), tr("&Open..."), this);
+ const QIcon openIcon = QIcon::fromTheme("document-open", QIcon(":/images/open.png"));
+ QAction *openAct = new QAction(openIcon, tr("&Open..."), this);
openAct->setShortcuts(QKeySequence::Open);
openAct->setStatusTip(tr("Open an existing file"));
- connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
+ connect(openAct, &QAction::triggered, this, &MainWindow::open);
+ fileMenu->addAction(openAct);
+ fileToolBar->addAction(openAct);
- saveAct = new QAction(QIcon(":/images/save.png"), tr("&Save"), this);
+ const QIcon saveIcon = QIcon::fromTheme("document-save", QIcon(":/images/save.png"));
+ saveAct = new QAction(saveIcon, tr("&Save"), this);
saveAct->setShortcuts(QKeySequence::Save);
saveAct->setStatusTip(tr("Save the document to disk"));
- connect(saveAct, SIGNAL(triggered()), this, SLOT(save()));
+ connect(saveAct, &QAction::triggered, this, &MainWindow::save);
+ fileToolBar->addAction(saveAct);
- saveAsAct = new QAction(tr("Save &As..."), this);
+ const QIcon saveAsIcon = QIcon::fromTheme("document-save-as");
+ saveAsAct = new QAction(saveAsIcon, tr("Save &As..."), this);
saveAsAct->setShortcuts(QKeySequence::SaveAs);
saveAsAct->setStatusTip(tr("Save the document under a new name"));
- connect(saveAsAct, SIGNAL(triggered()), this, SLOT(saveAs()));
+ connect(saveAsAct, &QAction::triggered, this, &MainWindow::saveAs);
+ fileMenu->addAction(saveAsAct);
+
+ fileMenu->addSeparator();
+
+ QMenu *recentMenu = fileMenu->addMenu(tr("Recent..."));
+ connect(recentMenu, &QMenu::aboutToShow, this, &MainWindow::updateRecentFileActions);
+ recentFileSubMenuAct = recentMenu->menuAction();
+
+ for (int i = 0; i < MaxRecentFiles; ++i) {
+ recentFileActs[i] = recentMenu->addAction(QString(), this, &MainWindow::openRecentFile);
+ recentFileActs[i]->setVisible(false);
+ }
+
+ recentFileSeparator = fileMenu->addSeparator();
+
+ setRecentFilesVisible(MainWindow::hasRecentFiles());
+
+ fileMenu->addAction(tr("Switch layout direction"), this, &MainWindow::switchLayoutDirection);
+
+ fileMenu->addSeparator();
//! [0]
- exitAct = new QAction(tr("E&xit"), this);
+ const QIcon exitIcon = QIcon::fromTheme("application-exit");
+ QAction *exitAct = fileMenu->addAction(exitIcon, tr("E&xit"), qApp, &QApplication::closeAllWindows);
exitAct->setShortcuts(QKeySequence::Quit);
exitAct->setStatusTip(tr("Exit the application"));
- connect(exitAct, SIGNAL(triggered()), qApp, SLOT(closeAllWindows()));
+ fileMenu->addAction(exitAct);
//! [0]
#ifndef QT_NO_CLIPBOARD
- cutAct = new QAction(QIcon(":/images/cut.png"), tr("Cu&t"), this);
+ QMenu *editMenu = menuBar()->addMenu(tr("&Edit"));
+ QToolBar *editToolBar = addToolBar(tr("Edit"));
+
+ const QIcon cutIcon = QIcon::fromTheme("edit-cut", QIcon(":/images/cut.png"));
+ cutAct = new QAction(cutIcon, tr("Cu&t"), this);
cutAct->setShortcuts(QKeySequence::Cut);
cutAct->setStatusTip(tr("Cut the current selection's contents to the "
"clipboard"));
- connect(cutAct, SIGNAL(triggered()), this, SLOT(cut()));
+ connect(cutAct, &QAction::triggered, this, &MainWindow::cut);
+ editMenu->addAction(cutAct);
+ editToolBar->addAction(cutAct);
- copyAct = new QAction(QIcon(":/images/copy.png"), tr("&Copy"), this);
+ const QIcon copyIcon = QIcon::fromTheme("edit-copy", QIcon(":/images/copy.png"));
+ copyAct = new QAction(copyIcon, tr("&Copy"), this);
copyAct->setShortcuts(QKeySequence::Copy);
copyAct->setStatusTip(tr("Copy the current selection's contents to the "
"clipboard"));
- connect(copyAct, SIGNAL(triggered()), this, SLOT(copy()));
+ connect(copyAct, &QAction::triggered, this, &MainWindow::copy);
+ editMenu->addAction(copyAct);
+ editToolBar->addAction(copyAct);
- pasteAct = new QAction(QIcon(":/images/paste.png"), tr("&Paste"), this);
+ const QIcon pasteIcon = QIcon::fromTheme("edit-paste", QIcon(":/images/paste.png"));
+ pasteAct = new QAction(pasteIcon, tr("&Paste"), this);
pasteAct->setShortcuts(QKeySequence::Paste);
pasteAct->setStatusTip(tr("Paste the clipboard's contents into the current "
"selection"));
- connect(pasteAct, SIGNAL(triggered()), this, SLOT(paste()));
+ connect(pasteAct, &QAction::triggered, this, &MainWindow::paste);
+ editMenu->addAction(pasteAct);
+ editToolBar->addAction(pasteAct);
#endif
+ windowMenu = menuBar()->addMenu(tr("&Window"));
+ connect(windowMenu, &QMenu::aboutToShow, this, &MainWindow::updateWindowMenu);
+
closeAct = new QAction(tr("Cl&ose"), this);
closeAct->setStatusTip(tr("Close the active window"));
- connect(closeAct, SIGNAL(triggered()),
- mdiArea, SLOT(closeActiveSubWindow()));
+ connect(closeAct, &QAction::triggered,
+ mdiArea, &QMdiArea::closeActiveSubWindow);
closeAllAct = new QAction(tr("Close &All"), this);
closeAllAct->setStatusTip(tr("Close all the windows"));
- connect(closeAllAct, SIGNAL(triggered()),
- mdiArea, SLOT(closeAllSubWindows()));
+ connect(closeAllAct, &QAction::triggered, mdiArea, &QMdiArea::closeAllSubWindows);
tileAct = new QAction(tr("&Tile"), this);
tileAct->setStatusTip(tr("Tile the windows"));
- connect(tileAct, SIGNAL(triggered()), mdiArea, SLOT(tileSubWindows()));
+ connect(tileAct, &QAction::triggered, mdiArea, &QMdiArea::tileSubWindows);
cascadeAct = new QAction(tr("&Cascade"), this);
cascadeAct->setStatusTip(tr("Cascade the windows"));
- connect(cascadeAct, SIGNAL(triggered()), mdiArea, SLOT(cascadeSubWindows()));
+ connect(cascadeAct, &QAction::triggered, mdiArea, &QMdiArea::cascadeSubWindows);
nextAct = new QAction(tr("Ne&xt"), this);
nextAct->setShortcuts(QKeySequence::NextChild);
nextAct->setStatusTip(tr("Move the focus to the next window"));
- connect(nextAct, SIGNAL(triggered()),
- mdiArea, SLOT(activateNextSubWindow()));
+ connect(nextAct, &QAction::triggered, mdiArea, &QMdiArea::activateNextSubWindow);
previousAct = new QAction(tr("Pre&vious"), this);
previousAct->setShortcuts(QKeySequence::PreviousChild);
previousAct->setStatusTip(tr("Move the focus to the previous "
"window"));
- connect(previousAct, SIGNAL(triggered()),
- mdiArea, SLOT(activatePreviousSubWindow()));
-
- separatorAct = new QAction(this);
- separatorAct->setSeparator(true);
-
- aboutAct = new QAction(tr("&About"), this);
- aboutAct->setStatusTip(tr("Show the application's About box"));
- connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
-
- aboutQtAct = new QAction(tr("About &Qt"), this);
- aboutQtAct->setStatusTip(tr("Show the Qt library's About box"));
- connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
-}
-
-void MainWindow::createMenus()
-{
- fileMenu = menuBar()->addMenu(tr("&File"));
- fileMenu->addAction(newAct);
- fileMenu->addAction(openAct);
- fileMenu->addAction(saveAct);
- fileMenu->addAction(saveAsAct);
- fileMenu->addSeparator();
- QAction *action = fileMenu->addAction(tr("Switch layout direction"));
- connect(action, SIGNAL(triggered()), this, SLOT(switchLayoutDirection()));
- fileMenu->addAction(exitAct);
+ connect(previousAct, &QAction::triggered, mdiArea, &QMdiArea::activatePreviousSubWindow);
- editMenu = menuBar()->addMenu(tr("&Edit"));
-#ifndef QT_NO_CLIPBOARD
- editMenu->addAction(cutAct);
- editMenu->addAction(copyAct);
- editMenu->addAction(pasteAct);
-#endif
+ windowMenuSeparatorAct = new QAction(this);
+ windowMenuSeparatorAct->setSeparator(true);
- windowMenu = menuBar()->addMenu(tr("&Window"));
updateWindowMenu();
- connect(windowMenu, SIGNAL(aboutToShow()), this, SLOT(updateWindowMenu()));
menuBar()->addSeparator();
- helpMenu = menuBar()->addMenu(tr("&Help"));
- helpMenu->addAction(aboutAct);
- helpMenu->addAction(aboutQtAct);
-}
+ QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
-void MainWindow::createToolBars()
-{
- fileToolBar = addToolBar(tr("File"));
- fileToolBar->addAction(newAct);
- fileToolBar->addAction(openAct);
- fileToolBar->addAction(saveAct);
+ QAction *aboutAct = helpMenu->addAction(tr("&About"), this, &MainWindow::about);
+ aboutAct->setStatusTip(tr("Show the application's About box"));
-#ifndef QT_NO_CLIPBOARD
- editToolBar = addToolBar(tr("Edit"));
- editToolBar->addAction(cutAct);
- editToolBar->addAction(copyAct);
- editToolBar->addAction(pasteAct);
-#endif
+ QAction *aboutQtAct = helpMenu->addAction(tr("About &Qt"), qApp, &QApplication::aboutQt);
+ aboutQtAct->setStatusTip(tr("Show the Qt library's About box"));
}
void MainWindow::createStatusBar()
@@ -368,28 +459,32 @@ void MainWindow::createStatusBar()
void MainWindow::readSettings()
{
- QSettings settings("QtProject", "MDI Example");
- QPoint pos = settings.value("pos", QPoint(200, 200)).toPoint();
- QSize size = settings.value("size", QSize(400, 400)).toSize();
- move(pos);
- resize(size);
+ QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName());
+ const QByteArray geometry = settings.value("geometry", QByteArray()).toByteArray();
+ if (geometry.isEmpty()) {
+ const QRect availableGeometry = QApplication::desktop()->availableGeometry(this);
+ resize(availableGeometry.width() / 3, availableGeometry.height() / 2);
+ move((availableGeometry.width() - width()) / 2,
+ (availableGeometry.height() - height()) / 2);
+ } else {
+ restoreGeometry(geometry);
+ }
}
void MainWindow::writeSettings()
{
- QSettings settings("QtProject", "MDI Example");
- settings.setValue("pos", pos());
- settings.setValue("size", size());
+ QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName());
+ settings.setValue("geometry", saveGeometry());
}
-MdiChild *MainWindow::activeMdiChild()
+MdiChild *MainWindow::activeMdiChild() const
{
if (QMdiSubWindow *activeSubWindow = mdiArea->activeSubWindow())
return qobject_cast<MdiChild *>(activeSubWindow->widget());
return 0;
}
-QMdiSubWindow *MainWindow::findMdiChild(const QString &fileName)
+QMdiSubWindow *MainWindow::findMdiChild(const QString &fileName) const
{
QString canonicalFilePath = QFileInfo(fileName).canonicalFilePath();
@@ -404,14 +499,7 @@ QMdiSubWindow *MainWindow::findMdiChild(const QString &fileName)
void MainWindow::switchLayoutDirection()
{
if (layoutDirection() == Qt::LeftToRight)
- qApp->setLayoutDirection(Qt::RightToLeft);
+ QGuiApplication::setLayoutDirection(Qt::RightToLeft);
else
- qApp->setLayoutDirection(Qt::LeftToRight);
-}
-
-void MainWindow::setActiveSubWindow(QWidget *window)
-{
- if (!window)
- return;
- mdiArea->setActiveSubWindow(qobject_cast<QMdiSubWindow *>(window));
+ QGuiApplication::setLayoutDirection(Qt::LeftToRight);
}
diff --git a/examples/widgets/mainwindows/mdi/mainwindow.h b/examples/widgets/mainwindows/mdi/mainwindow.h
index fa8e0131e9..3ac60282fd 100644
--- a/examples/widgets/mainwindows/mdi/mainwindow.h
+++ b/examples/widgets/mainwindows/mdi/mainwindow.h
@@ -49,7 +49,6 @@ class QAction;
class QMenu;
class QMdiArea;
class QMdiSubWindow;
-class QSignalMapper;
QT_END_NAMESPACE
class MainWindow : public QMainWindow
@@ -69,6 +68,8 @@ private slots:
void open();
void save();
void saveAs();
+ void updateRecentFileActions();
+ void openRecentFile();
#ifndef QT_NO_CLIPBOARD
void cut();
void copy();
@@ -79,32 +80,30 @@ private slots:
void updateWindowMenu();
MdiChild *createMdiChild();
void switchLayoutDirection();
- void setActiveSubWindow(QWidget *window);
private:
+ enum { MaxRecentFiles = 5 };
+
void createActions();
- void createMenus();
- void createToolBars();
void createStatusBar();
void readSettings();
void writeSettings();
- MdiChild *activeMdiChild();
- QMdiSubWindow *findMdiChild(const QString &fileName);
+ bool loadFile(const QString &fileName);
+ static bool hasRecentFiles();
+ void prependToRecentFiles(const QString &fileName);
+ void setRecentFilesVisible(bool visible);
+ MdiChild *activeMdiChild() const;
+ QMdiSubWindow *findMdiChild(const QString &fileName) const;
QMdiArea *mdiArea;
- QSignalMapper *windowMapper;
- QMenu *fileMenu;
- QMenu *editMenu;
QMenu *windowMenu;
- QMenu *helpMenu;
- QToolBar *fileToolBar;
- QToolBar *editToolBar;
QAction *newAct;
- QAction *openAct;
QAction *saveAct;
QAction *saveAsAct;
- QAction *exitAct;
+ QAction *recentFileActs[MaxRecentFiles];
+ QAction *recentFileSeparator;
+ QAction *recentFileSubMenuAct;
#ifndef QT_NO_CLIPBOARD
QAction *cutAct;
QAction *copyAct;
@@ -116,9 +115,7 @@ private:
QAction *cascadeAct;
QAction *nextAct;
QAction *previousAct;
- QAction *separatorAct;
- QAction *aboutAct;
- QAction *aboutQtAct;
+ QAction *windowMenuSeparatorAct;
};
#endif
diff --git a/examples/widgets/mainwindows/mdi/mdichild.cpp b/examples/widgets/mainwindows/mdi/mdichild.cpp
index 242e8248a2..73364eb3ee 100644
--- a/examples/widgets/mainwindows/mdi/mdichild.cpp
+++ b/examples/widgets/mainwindows/mdi/mdichild.cpp
@@ -56,8 +56,8 @@ void MdiChild::newFile()
curFile = tr("document%1.txt").arg(sequenceNumber++);
setWindowTitle(curFile + "[*]");
- connect(document(), SIGNAL(contentsChanged()),
- this, SLOT(documentWasModified()));
+ connect(document(), &QTextDocument::contentsChanged,
+ this, &MdiChild::documentWasModified);
}
bool MdiChild::loadFile(const QString &fileName)
@@ -78,8 +78,8 @@ bool MdiChild::loadFile(const QString &fileName)
setCurrentFile(fileName);
- connect(document(), SIGNAL(contentsChanged()),
- this, SLOT(documentWasModified()));
+ connect(document(), &QTextDocument::contentsChanged,
+ this, &MdiChild::documentWasModified);
return true;
}
@@ -109,8 +109,7 @@ bool MdiChild::saveFile(const QString &fileName)
if (!file.open(QFile::WriteOnly | QFile::Text)) {
QMessageBox::warning(this, tr("MDI"),
tr("Cannot write file %1:\n%2.")
- .arg(fileName)
- .arg(file.errorString()));
+ .arg(QDir::toNativeSeparators(fileName), file.errorString()));
return false;
}
@@ -144,18 +143,22 @@ void MdiChild::documentWasModified()
bool MdiChild::maybeSave()
{
- if (document()->isModified()) {
- QMessageBox::StandardButton ret;
- ret = QMessageBox::warning(this, tr("MDI"),
- tr("'%1' has been modified.\n"
- "Do you want to save your changes?")
- .arg(userFriendlyCurrentFile()),
- QMessageBox::Save | QMessageBox::Discard
- | QMessageBox::Cancel);
- if (ret == QMessageBox::Save)
- return save();
- else if (ret == QMessageBox::Cancel)
- return false;
+ if (!document()->isModified())
+ return true;
+ const QMessageBox::StandardButton ret
+ = QMessageBox::warning(this, tr("MDI"),
+ tr("'%1' has been modified.\n"
+ "Do you want to save your changes?")
+ .arg(userFriendlyCurrentFile()),
+ QMessageBox::Save | QMessageBox::Discard
+ | QMessageBox::Cancel);
+ switch (ret) {
+ case QMessageBox::Save:
+ return save();
+ case QMessageBox::Cancel:
+ return false;
+ default:
+ break;
}
return true;
}
diff --git a/examples/widgets/mainwindows/menus/mainwindow.cpp b/examples/widgets/mainwindows/menus/mainwindow.cpp
index 31515394bd..d487e3a277 100644
--- a/examples/widgets/mainwindows/menus/mainwindow.cpp
+++ b/examples/widgets/mainwindows/menus/mainwindow.cpp
@@ -198,63 +198,63 @@ void MainWindow::createActions()
newAct = new QAction(tr("&New"), this);
newAct->setShortcuts(QKeySequence::New);
newAct->setStatusTip(tr("Create a new file"));
- connect(newAct, SIGNAL(triggered()), this, SLOT(newFile()));
+ connect(newAct, &QAction::triggered, this, &MainWindow::newFile);
//! [4]
openAct = new QAction(tr("&Open..."), this);
openAct->setShortcuts(QKeySequence::Open);
openAct->setStatusTip(tr("Open an existing file"));
- connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
+ connect(openAct, &QAction::triggered, this, &MainWindow::open);
//! [5]
saveAct = new QAction(tr("&Save"), this);
saveAct->setShortcuts(QKeySequence::Save);
saveAct->setStatusTip(tr("Save the document to disk"));
- connect(saveAct, SIGNAL(triggered()), this, SLOT(save()));
+ connect(saveAct, &QAction::triggered, this, &MainWindow::save);
printAct = new QAction(tr("&Print..."), this);
printAct->setShortcuts(QKeySequence::Print);
printAct->setStatusTip(tr("Print the document"));
- connect(printAct, SIGNAL(triggered()), this, SLOT(print()));
+ connect(printAct, &QAction::triggered, this, &MainWindow::print);
exitAct = new QAction(tr("E&xit"), this);
exitAct->setShortcuts(QKeySequence::Quit);
exitAct->setStatusTip(tr("Exit the application"));
- connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
+ connect(exitAct, &QAction::triggered, this, &QWidget::close);
undoAct = new QAction(tr("&Undo"), this);
undoAct->setShortcuts(QKeySequence::Undo);
undoAct->setStatusTip(tr("Undo the last operation"));
- connect(undoAct, SIGNAL(triggered()), this, SLOT(undo()));
+ connect(undoAct, &QAction::triggered, this, &MainWindow::undo);
redoAct = new QAction(tr("&Redo"), this);
redoAct->setShortcuts(QKeySequence::Redo);
redoAct->setStatusTip(tr("Redo the last operation"));
- connect(redoAct, SIGNAL(triggered()), this, SLOT(redo()));
+ connect(redoAct, &QAction::triggered, this, &MainWindow::redo);
cutAct = new QAction(tr("Cu&t"), this);
cutAct->setShortcuts(QKeySequence::Cut);
cutAct->setStatusTip(tr("Cut the current selection's contents to the "
"clipboard"));
- connect(cutAct, SIGNAL(triggered()), this, SLOT(cut()));
+ connect(cutAct, &QAction::triggered, this, &MainWindow::cut);
copyAct = new QAction(tr("&Copy"), this);
copyAct->setShortcuts(QKeySequence::Copy);
copyAct->setStatusTip(tr("Copy the current selection's contents to the "
"clipboard"));
- connect(copyAct, SIGNAL(triggered()), this, SLOT(copy()));
+ connect(copyAct, &QAction::triggered, this, &MainWindow::copy);
pasteAct = new QAction(tr("&Paste"), this);
pasteAct->setShortcuts(QKeySequence::Paste);
pasteAct->setStatusTip(tr("Paste the clipboard's contents into the current "
"selection"));
- connect(pasteAct, SIGNAL(triggered()), this, SLOT(paste()));
+ connect(pasteAct, &QAction::triggered, this, &MainWindow::paste);
boldAct = new QAction(tr("&Bold"), this);
boldAct->setCheckable(true);
boldAct->setShortcut(QKeySequence::Bold);
boldAct->setStatusTip(tr("Make the text bold"));
- connect(boldAct, SIGNAL(triggered()), this, SLOT(bold()));
+ connect(boldAct, &QAction::triggered, this, &MainWindow::bold);
QFont boldFont = boldAct->font();
boldFont.setBold(true);
@@ -264,7 +264,7 @@ void MainWindow::createActions()
italicAct->setCheckable(true);
italicAct->setShortcut(QKeySequence::Italic);
italicAct->setStatusTip(tr("Make the text italic"));
- connect(italicAct, SIGNAL(triggered()), this, SLOT(italic()));
+ connect(italicAct, &QAction::triggered, this, &MainWindow::italic);
QFont italicFont = italicAct->font();
italicFont.setItalic(true);
@@ -273,45 +273,45 @@ void MainWindow::createActions()
setLineSpacingAct = new QAction(tr("Set &Line Spacing..."), this);
setLineSpacingAct->setStatusTip(tr("Change the gap between the lines of a "
"paragraph"));
- connect(setLineSpacingAct, SIGNAL(triggered()), this, SLOT(setLineSpacing()));
+ connect(setLineSpacingAct, &QAction::triggered, this, &MainWindow::setLineSpacing);
setParagraphSpacingAct = new QAction(tr("Set &Paragraph Spacing..."), this);
setParagraphSpacingAct->setStatusTip(tr("Change the gap between paragraphs"));
- connect(setParagraphSpacingAct, SIGNAL(triggered()),
- this, SLOT(setParagraphSpacing()));
+ connect(setParagraphSpacingAct, &QAction::triggered,
+ this, &MainWindow::setParagraphSpacing);
aboutAct = new QAction(tr("&About"), this);
aboutAct->setStatusTip(tr("Show the application's About box"));
- connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
+ connect(aboutAct, &QAction::triggered, this, &MainWindow::about);
aboutQtAct = new QAction(tr("About &Qt"), this);
aboutQtAct->setStatusTip(tr("Show the Qt library's About box"));
- connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
- connect(aboutQtAct, SIGNAL(triggered()), this, SLOT(aboutQt()));
+ connect(aboutQtAct, &QAction::triggered, qApp, &QApplication::aboutQt);
+ connect(aboutQtAct, &QAction::triggered, this, &MainWindow::aboutQt);
leftAlignAct = new QAction(tr("&Left Align"), this);
leftAlignAct->setCheckable(true);
leftAlignAct->setShortcut(tr("Ctrl+L"));
leftAlignAct->setStatusTip(tr("Left align the selected text"));
- connect(leftAlignAct, SIGNAL(triggered()), this, SLOT(leftAlign()));
+ connect(leftAlignAct, &QAction::triggered, this, &MainWindow::leftAlign);
rightAlignAct = new QAction(tr("&Right Align"), this);
rightAlignAct->setCheckable(true);
rightAlignAct->setShortcut(tr("Ctrl+R"));
rightAlignAct->setStatusTip(tr("Right align the selected text"));
- connect(rightAlignAct, SIGNAL(triggered()), this, SLOT(rightAlign()));
+ connect(rightAlignAct, &QAction::triggered, this, &MainWindow::rightAlign);
justifyAct = new QAction(tr("&Justify"), this);
justifyAct->setCheckable(true);
justifyAct->setShortcut(tr("Ctrl+J"));
justifyAct->setStatusTip(tr("Justify the selected text"));
- connect(justifyAct, SIGNAL(triggered()), this, SLOT(justify()));
+ connect(justifyAct, &QAction::triggered, this, &MainWindow::justify);
centerAct = new QAction(tr("&Center"), this);
centerAct->setCheckable(true);
centerAct->setShortcut(tr("Ctrl+E"));
centerAct->setStatusTip(tr("Center the selected text"));
- connect(centerAct, SIGNAL(triggered()), this, SLOT(center()));
+ connect(centerAct, &QAction::triggered, this, &MainWindow::center);
//! [6] //! [7]
alignmentGroup = new QActionGroup(this);
diff --git a/examples/widgets/mainwindows/recentfiles/mainwindow.cpp b/examples/widgets/mainwindows/recentfiles/mainwindow.cpp
deleted file mode 100644
index b89797092a..0000000000
--- a/examples/widgets/mainwindows/recentfiles/mainwindow.cpp
+++ /dev/null
@@ -1,251 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd 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 <QtWidgets>
-
-#include "mainwindow.h"
-
-MainWindow::MainWindow()
-{
- setAttribute(Qt::WA_DeleteOnClose);
-
- textEdit = new QTextEdit;
- setCentralWidget(textEdit);
-
- createActions();
- createMenus();
- (void)statusBar();
-
- setWindowFilePath(QString());
- resize(400, 300);
-}
-
-void MainWindow::newFile()
-{
- MainWindow *other = new MainWindow;
- other->show();
-}
-
-void MainWindow::open()
-{
- QString fileName = QFileDialog::getOpenFileName(this);
- if (!fileName.isEmpty())
- loadFile(fileName);
-}
-
-void MainWindow::save()
-{
- if (curFile.isEmpty())
- saveAs();
- else
- saveFile(curFile);
-}
-
-void MainWindow::saveAs()
-{
- QString fileName = QFileDialog::getSaveFileName(this);
- if (fileName.isEmpty())
- return;
-
- saveFile(fileName);
-}
-
-void MainWindow::openRecentFile()
-{
- QAction *action = qobject_cast<QAction *>(sender());
- if (action)
- loadFile(action->data().toString());
-}
-
-void MainWindow::about()
-{
- QMessageBox::about(this, tr("About Recent Files"),
- tr("The <b>Recent Files</b> example demonstrates how to provide a "
- "recently used file menu in a Qt application."));
-}
-
-void MainWindow::createActions()
-{
- newAct = new QAction(tr("&New"), this);
- newAct->setShortcuts(QKeySequence::New);
- newAct->setStatusTip(tr("Create a new file"));
- connect(newAct, SIGNAL(triggered()), this, SLOT(newFile()));
-
- openAct = new QAction(tr("&Open..."), this);
- openAct->setShortcuts(QKeySequence::Open);
- openAct->setStatusTip(tr("Open an existing file"));
- connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
-
- saveAct = new QAction(tr("&Save"), this);
- saveAct->setShortcuts(QKeySequence::Save);
- saveAct->setStatusTip(tr("Save the document to disk"));
- connect(saveAct, SIGNAL(triggered()), this, SLOT(save()));
-
- saveAsAct = new QAction(tr("Save &As..."), this);
- saveAsAct->setShortcuts(QKeySequence::SaveAs);
- saveAsAct->setStatusTip(tr("Save the document under a new name"));
- connect(saveAsAct, SIGNAL(triggered()), this, SLOT(saveAs()));
-
- for (int i = 0; i < MaxRecentFiles; ++i) {
- recentFileActs[i] = new QAction(this);
- recentFileActs[i]->setVisible(false);
- connect(recentFileActs[i], SIGNAL(triggered()),
- this, SLOT(openRecentFile()));
- }
-
- exitAct = new QAction(tr("E&xit"), this);
- exitAct->setShortcuts(QKeySequence::Quit);
- exitAct->setStatusTip(tr("Exit the application"));
- connect(exitAct, SIGNAL(triggered()), qApp, SLOT(closeAllWindows()));
-
- aboutAct = new QAction(tr("&About"), this);
- aboutAct->setStatusTip(tr("Show the application's About box"));
- connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
-
- aboutQtAct = new QAction(tr("About &Qt"), this);
- aboutQtAct->setStatusTip(tr("Show the Qt library's About box"));
- connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
-}
-
-void MainWindow::createMenus()
-{
- fileMenu = menuBar()->addMenu(tr("&File"));
- fileMenu->addAction(newAct);
- fileMenu->addAction(openAct);
- fileMenu->addAction(saveAct);
- fileMenu->addAction(saveAsAct);
- separatorAct = fileMenu->addSeparator();
- for (int i = 0; i < MaxRecentFiles; ++i)
- fileMenu->addAction(recentFileActs[i]);
- fileMenu->addSeparator();
- fileMenu->addAction(exitAct);
- updateRecentFileActions();
-
- menuBar()->addSeparator();
-
- helpMenu = menuBar()->addMenu(tr("&Help"));
- helpMenu->addAction(aboutAct);
- helpMenu->addAction(aboutQtAct);
-}
-
-void MainWindow::loadFile(const QString &fileName)
-{
- QFile file(fileName);
- if (!file.open(QFile::ReadOnly | QFile::Text)) {
- QMessageBox::warning(this, tr("Recent Files"),
- tr("Cannot read file %1:\n%2.")
- .arg(fileName)
- .arg(file.errorString()));
- return;
- }
-
- QTextStream in(&file);
- QApplication::setOverrideCursor(Qt::WaitCursor);
- textEdit->setPlainText(in.readAll());
- QApplication::restoreOverrideCursor();
-
- setCurrentFile(fileName);
- statusBar()->showMessage(tr("File loaded"), 2000);
-}
-
-void MainWindow::saveFile(const QString &fileName)
-{
- QFile file(fileName);
- if (!file.open(QFile::WriteOnly | QFile::Text)) {
- QMessageBox::warning(this, tr("Recent Files"),
- tr("Cannot write file %1:\n%2.")
- .arg(fileName)
- .arg(file.errorString()));
- return;
- }
-
- QTextStream out(&file);
- QApplication::setOverrideCursor(Qt::WaitCursor);
- out << textEdit->toPlainText();
- QApplication::restoreOverrideCursor();
-
- setCurrentFile(fileName);
- statusBar()->showMessage(tr("File saved"), 2000);
-}
-
-void MainWindow::setCurrentFile(const QString &fileName)
-{
- curFile = fileName;
- setWindowFilePath(curFile);
-
- QSettings settings;
- QStringList files = settings.value("recentFileList").toStringList();
- files.removeAll(fileName);
- files.prepend(fileName);
- while (files.size() > MaxRecentFiles)
- files.removeLast();
-
- settings.setValue("recentFileList", files);
-
- foreach (QWidget *widget, QApplication::topLevelWidgets()) {
- MainWindow *mainWin = qobject_cast<MainWindow *>(widget);
- if (mainWin)
- mainWin->updateRecentFileActions();
- }
-}
-
-void MainWindow::updateRecentFileActions()
-{
- QSettings settings;
- QStringList files = settings.value("recentFileList").toStringList();
-
- int numRecentFiles = qMin(files.size(), (int)MaxRecentFiles);
-
- for (int i = 0; i < numRecentFiles; ++i) {
- QString text = tr("&%1 %2").arg(i + 1).arg(strippedName(files[i]));
- recentFileActs[i]->setText(text);
- recentFileActs[i]->setData(files[i]);
- recentFileActs[i]->setVisible(true);
- }
- for (int j = numRecentFiles; j < MaxRecentFiles; ++j)
- recentFileActs[j]->setVisible(false);
-
- separatorAct->setVisible(numRecentFiles > 0);
-}
-
-QString MainWindow::strippedName(const QString &fullFileName)
-{
- return QFileInfo(fullFileName).fileName();
-}
diff --git a/examples/widgets/mainwindows/recentfiles/recentfiles.pro b/examples/widgets/mainwindows/recentfiles/recentfiles.pro
deleted file mode 100644
index ccf948f560..0000000000
--- a/examples/widgets/mainwindows/recentfiles/recentfiles.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-QT += widgets
-
-HEADERS = mainwindow.h
-SOURCES = main.cpp \
- mainwindow.cpp
-
-# install
-target.path = $$[QT_INSTALL_EXAMPLES]/widgets/mainwindows/recentfiles
-INSTALLS += target
diff --git a/examples/widgets/mainwindows/sdi/main.cpp b/examples/widgets/mainwindows/sdi/main.cpp
index d3350da946..4b125722d8 100644
--- a/examples/widgets/mainwindows/sdi/main.cpp
+++ b/examples/widgets/mainwindows/sdi/main.cpp
@@ -39,6 +39,7 @@
****************************************************************************/
#include <QApplication>
+#include <QCommandLineParser>
#include "mainwindow.h"
@@ -46,9 +47,27 @@ int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(sdi);
QApplication app(argc, argv);
- app.setApplicationName("SDI Example");
- app.setOrganizationName("QtProject");
- MainWindow *mainWin = new MainWindow;
+ QCoreApplication::setApplicationName("SDI Example");
+ QCoreApplication::setOrganizationName("QtProject");
+ QCoreApplication::setApplicationVersion(QT_VERSION_STR);
+ QCommandLineParser parser;
+ parser.setApplicationDescription(QCoreApplication::applicationName());
+ parser.addHelpOption();
+ parser.addVersionOption();
+ parser.addPositionalArgument("file", "The file(s) to open.");
+ parser.process(app);
+
+ MainWindow *mainWin = Q_NULLPTR;
+ foreach (const QString &file, parser.positionalArguments()) {
+ MainWindow *newWin = new MainWindow(file);
+ newWin->tile(mainWin);
+ newWin->show();
+ mainWin = newWin;
+ }
+
+ if (!mainWin)
+ mainWin = new MainWindow;
mainWin->show();
+
return app.exec();
}
diff --git a/examples/widgets/mainwindows/sdi/mainwindow.cpp b/examples/widgets/mainwindows/sdi/mainwindow.cpp
index 1d6226e45c..f59172f172 100644
--- a/examples/widgets/mainwindows/sdi/mainwindow.cpp
+++ b/examples/widgets/mainwindows/sdi/mainwindow.cpp
@@ -45,7 +45,7 @@
MainWindow::MainWindow()
{
init();
- setCurrentFile("");
+ setCurrentFile(QString());
}
MainWindow::MainWindow(const QString &fileName)
@@ -67,44 +67,44 @@ void MainWindow::closeEvent(QCloseEvent *event)
void MainWindow::newFile()
{
MainWindow *other = new MainWindow;
- other->move(x() + 40, y() + 40);
+ other->tile(this);
other->show();
}
void MainWindow::open()
{
- QString fileName = QFileDialog::getOpenFileName(this);
- if (!fileName.isEmpty()) {
- MainWindow *existing = findMainWindow(fileName);
- if (existing) {
- existing->show();
- existing->raise();
- existing->activateWindow();
- return;
- }
-
- if (isUntitled && textEdit->document()->isEmpty()
- && !isWindowModified()) {
- loadFile(fileName);
- } else {
- MainWindow *other = new MainWindow(fileName);
- if (other->isUntitled) {
- delete other;
- return;
- }
- other->move(x() + 40, y() + 40);
- other->show();
- }
+ const QString fileName = QFileDialog::getOpenFileName(this);
+ if (!fileName.isEmpty())
+ openFile(fileName);
+}
+
+void MainWindow::openFile(const QString &fileName)
+{
+ MainWindow *existing = findMainWindow(fileName);
+ if (existing) {
+ existing->show();
+ existing->raise();
+ existing->activateWindow();
+ return;
+ }
+
+ if (isUntitled && textEdit->document()->isEmpty() && !isWindowModified()) {
+ loadFile(fileName);
+ return;
}
+
+ MainWindow *other = new MainWindow(fileName);
+ if (other->isUntitled) {
+ delete other;
+ return;
+ }
+ other->tile(this);
+ other->show();
}
bool MainWindow::save()
{
- if (isUntitled) {
- return saveAs();
- } else {
- return saveFile(curFile);
- }
+ return isUntitled ? saveAs() : saveFile(curFile);
}
bool MainWindow::saveAs()
@@ -139,123 +139,135 @@ void MainWindow::init()
setCentralWidget(textEdit);
createActions();
- createMenus();
- createToolBars();
createStatusBar();
readSettings();
- connect(textEdit->document(), SIGNAL(contentsChanged()),
- this, SLOT(documentWasModified()));
+ connect(textEdit->document(), &QTextDocument::contentsChanged,
+ this, &MainWindow::documentWasModified);
setUnifiedTitleAndToolBarOnMac(true);
}
+void MainWindow::tile(const QMainWindow *previous)
+{
+ if (!previous)
+ return;
+ int topFrameWidth = previous->geometry().top() - previous->pos().y();
+ if (!topFrameWidth)
+ topFrameWidth = 40;
+ const QPoint pos = previous->pos() + 2 * QPoint(topFrameWidth, topFrameWidth);
+ if (QApplication::desktop()->availableGeometry(this).contains(rect().bottomRight() + pos))
+ move(pos);
+}
+
+//! [implicit tr context]
void MainWindow::createActions()
{
- newAct = new QAction(QIcon(":/images/new.png"), tr("&New"), this);
+ QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
+//! [implicit tr context]
+ QToolBar *fileToolBar = addToolBar(tr("File"));
+
+ const QIcon newIcon = QIcon::fromTheme("document-new", QIcon(":/images/new.png"));
+ QAction *newAct = new QAction(newIcon, tr("&New"), this);
newAct->setShortcuts(QKeySequence::New);
newAct->setStatusTip(tr("Create a new file"));
- connect(newAct, SIGNAL(triggered()), this, SLOT(newFile()));
+ connect(newAct, &QAction::triggered, this, &MainWindow::newFile);
+ fileMenu->addAction(newAct);
+ fileToolBar->addAction(newAct);
- openAct = new QAction(QIcon(":/images/open.png"), tr("&Open..."), this);
+ const QIcon openIcon = QIcon::fromTheme("document-open", QIcon(":/images/open.png"));
+ QAction *openAct = new QAction(openIcon, tr("&Open..."), this);
openAct->setShortcuts(QKeySequence::Open);
openAct->setStatusTip(tr("Open an existing file"));
- connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
+ connect(openAct, &QAction::triggered, this, &MainWindow::open);
+ fileMenu->addAction(openAct);
+ fileToolBar->addAction(openAct);
- saveAct = new QAction(QIcon(":/images/save.png"), tr("&Save"), this);
+ const QIcon saveIcon = QIcon::fromTheme("document-save", QIcon(":/images/save.png"));
+ QAction *saveAct = new QAction(saveIcon, tr("&Save"), this);
saveAct->setShortcuts(QKeySequence::Save);
saveAct->setStatusTip(tr("Save the document to disk"));
- connect(saveAct, SIGNAL(triggered()), this, SLOT(save()));
+ connect(saveAct, &QAction::triggered, this, &MainWindow::save);
+ fileMenu->addAction(saveAct);
+ fileToolBar->addAction(saveAct);
- saveAsAct = new QAction(tr("Save &As..."), this);
+ const QIcon saveAsIcon = QIcon::fromTheme("document-save-as");
+ QAction *saveAsAct = fileMenu->addAction(saveAsIcon, tr("Save &As..."), this, &MainWindow::saveAs);
saveAsAct->setShortcuts(QKeySequence::SaveAs);
saveAsAct->setStatusTip(tr("Save the document under a new name"));
- connect(saveAsAct, SIGNAL(triggered()), this, SLOT(saveAs()));
- closeAct = new QAction(tr("&Close"), this);
+ fileMenu->addSeparator();
+
+ QMenu *recentMenu = fileMenu->addMenu(tr("Recent..."));
+ connect(recentMenu, &QMenu::aboutToShow, this, &MainWindow::updateRecentFileActions);
+ recentFileSubMenuAct = recentMenu->menuAction();
+
+ for (int i = 0; i < MaxRecentFiles; ++i) {
+ recentFileActs[i] = recentMenu->addAction(QString(), this, &MainWindow::openRecentFile);
+ recentFileActs[i]->setVisible(false);
+ }
+
+ recentFileSeparator = fileMenu->addSeparator();
+
+ setRecentFilesVisible(MainWindow::hasRecentFiles());
+
+ QAction *closeAct = fileMenu->addAction(tr("&Close"), this, &QWidget::close);
closeAct->setShortcut(tr("Ctrl+W"));
closeAct->setStatusTip(tr("Close this window"));
- connect(closeAct, SIGNAL(triggered()), this, SLOT(close()));
- exitAct = new QAction(tr("E&xit"), this);
+ const QIcon exitIcon = QIcon::fromTheme("application-exit");
+ QAction *exitAct = fileMenu->addAction(exitIcon, tr("E&xit"), qApp, &QApplication::closeAllWindows);
exitAct->setShortcuts(QKeySequence::Quit);
exitAct->setStatusTip(tr("Exit the application"));
- connect(exitAct, SIGNAL(triggered()), qApp, SLOT(closeAllWindows()));
- cutAct = new QAction(QIcon(":/images/cut.png"), tr("Cu&t"), this);
+ QMenu *editMenu = menuBar()->addMenu(tr("&Edit"));
+ QToolBar *editToolBar = addToolBar(tr("Edit"));
+
+#ifndef QT_NO_CLIPBOARD
+ const QIcon cutIcon = QIcon::fromTheme("edit-cut", QIcon(":/images/cut.png"));
+ QAction *cutAct = new QAction(cutIcon, tr("Cu&t"), this);
cutAct->setShortcuts(QKeySequence::Cut);
cutAct->setStatusTip(tr("Cut the current selection's contents to the "
"clipboard"));
- connect(cutAct, SIGNAL(triggered()), textEdit, SLOT(cut()));
+ connect(cutAct, &QAction::triggered, textEdit, &QTextEdit::cut);
+ editMenu->addAction(cutAct);
+ editToolBar->addAction(cutAct);
- copyAct = new QAction(QIcon(":/images/copy.png"), tr("&Copy"), this);
+ const QIcon copyIcon = QIcon::fromTheme("edit-copy", QIcon(":/images/copy.png"));
+ QAction *copyAct = new QAction(copyIcon, tr("&Copy"), this);
copyAct->setShortcuts(QKeySequence::Copy);
copyAct->setStatusTip(tr("Copy the current selection's contents to the "
"clipboard"));
- connect(copyAct, SIGNAL(triggered()), textEdit, SLOT(copy()));
+ connect(copyAct, &QAction::triggered, textEdit, &QTextEdit::copy);
+ editMenu->addAction(copyAct);
+ editToolBar->addAction(copyAct);
- pasteAct = new QAction(QIcon(":/images/paste.png"), tr("&Paste"), this);
+ const QIcon pasteIcon = QIcon::fromTheme("edit-paste", QIcon(":/images/paste.png"));
+ QAction *pasteAct = new QAction(pasteIcon, tr("&Paste"), this);
pasteAct->setShortcuts(QKeySequence::Paste);
pasteAct->setStatusTip(tr("Paste the clipboard's contents into the current "
"selection"));
- connect(pasteAct, SIGNAL(triggered()), textEdit, SLOT(paste()));
+ connect(pasteAct, &QAction::triggered, textEdit, &QTextEdit::paste);
+ editMenu->addAction(pasteAct);
+ editToolBar->addAction(pasteAct);
+
+ menuBar()->addSeparator();
+#endif // !QT_NO_CLIPBOARD
- aboutAct = new QAction(tr("&About"), this);
+ QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
+ QAction *aboutAct = helpMenu->addAction(tr("&About"), this, &MainWindow::about);
aboutAct->setStatusTip(tr("Show the application's About box"));
- connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
- aboutQtAct = new QAction(tr("About &Qt"), this);
+ QAction *aboutQtAct = helpMenu->addAction(tr("About &Qt"), qApp, &QApplication::aboutQt);
aboutQtAct->setStatusTip(tr("Show the Qt library's About box"));
- connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
-
+#ifndef QT_NO_CLIPBOARD
cutAct->setEnabled(false);
copyAct->setEnabled(false);
- connect(textEdit, SIGNAL(copyAvailable(bool)),
- cutAct, SLOT(setEnabled(bool)));
- connect(textEdit, SIGNAL(copyAvailable(bool)),
- copyAct, SLOT(setEnabled(bool)));
-}
-
-//! [implicit tr context]
-void MainWindow::createMenus()
-{
- fileMenu = menuBar()->addMenu(tr("&File"));
-//! [implicit tr context]
- fileMenu->addAction(newAct);
- fileMenu->addAction(openAct);
- fileMenu->addAction(saveAct);
- fileMenu->addAction(saveAsAct);
- fileMenu->addSeparator();
- fileMenu->addAction(closeAct);
- fileMenu->addAction(exitAct);
-
- editMenu = menuBar()->addMenu(tr("&Edit"));
- editMenu->addAction(cutAct);
- editMenu->addAction(copyAct);
- editMenu->addAction(pasteAct);
-
- menuBar()->addSeparator();
-
- helpMenu = menuBar()->addMenu(tr("&Help"));
- helpMenu->addAction(aboutAct);
- helpMenu->addAction(aboutQtAct);
-}
-
-void MainWindow::createToolBars()
-{
-//! [0]
- fileToolBar = addToolBar(tr("File"));
- fileToolBar->addAction(newAct);
- fileToolBar->addAction(openAct);
-//! [0]
- fileToolBar->addAction(saveAct);
-
- editToolBar = addToolBar(tr("Edit"));
- editToolBar->addAction(cutAct);
- editToolBar->addAction(copyAct);
- editToolBar->addAction(pasteAct);
+ connect(textEdit, &QTextEdit::copyAvailable, cutAct, &QAction::setEnabled);
+ connect(textEdit, &QTextEdit::copyAvailable, copyAct, &QAction::setEnabled);
+#endif // !QT_NO_CLIPBOARD
}
void MainWindow::createStatusBar()
@@ -265,33 +277,41 @@ void MainWindow::createStatusBar()
void MainWindow::readSettings()
{
- QSettings settings;
- QPoint pos = settings.value("pos", QPoint(200, 200)).toPoint();
- QSize size = settings.value("size", QSize(400, 400)).toSize();
- move(pos);
- resize(size);
+ QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName());
+ const QByteArray geometry = settings.value("geometry", QByteArray()).toByteArray();
+ if (geometry.isEmpty()) {
+ const QRect availableGeometry = QApplication::desktop()->availableGeometry(this);
+ resize(availableGeometry.width() / 3, availableGeometry.height() / 2);
+ move((availableGeometry.width() - width()) / 2,
+ (availableGeometry.height() - height()) / 2);
+ } else {
+ restoreGeometry(geometry);
+ }
}
void MainWindow::writeSettings()
{
- QSettings settings;
- settings.setValue("pos", pos());
- settings.setValue("size", size());
+ QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName());
+ settings.setValue("geometry", saveGeometry());
}
bool MainWindow::maybeSave()
{
- if (textEdit->document()->isModified()) {
- QMessageBox::StandardButton ret;
- ret = QMessageBox::warning(this, tr("SDI"),
- tr("The document has been modified.\n"
- "Do you want to save your changes?"),
- QMessageBox::Save | QMessageBox::Discard
- | QMessageBox::Cancel);
- if (ret == QMessageBox::Save)
- return save();
- else if (ret == QMessageBox::Cancel)
- return false;
+ if (!textEdit->document()->isModified())
+ return true;
+ const QMessageBox::StandardButton ret
+ = QMessageBox::warning(this, tr("SDI"),
+ tr("The document has been modified.\n"
+ "Do you want to save your changes?"),
+ QMessageBox::Save | QMessageBox::Discard
+ | QMessageBox::Cancel);
+ switch (ret) {
+ case QMessageBox::Save:
+ return save();
+ case QMessageBox::Cancel:
+ return false;
+ default:
+ break;
}
return true;
}
@@ -303,8 +323,7 @@ void MainWindow::loadFile(const QString &fileName)
if (!file.open(QFile::ReadOnly | QFile::Text)) {
QMessageBox::warning(this, tr("SDI"),
tr("Cannot read file %1:\n%2.")
- .arg(fileName)
- .arg(file.errorString()));
+ .arg(QDir::toNativeSeparators(fileName), file.errorString()));
return;
}
@@ -317,14 +336,90 @@ void MainWindow::loadFile(const QString &fileName)
statusBar()->showMessage(tr("File loaded"), 2000);
}
+void MainWindow::setRecentFilesVisible(bool visible)
+{
+ recentFileSubMenuAct->setVisible(visible);
+ recentFileSeparator->setVisible(visible);
+}
+
+static inline QString recentFilesKey() { return QStringLiteral("recentFileList"); }
+static inline QString fileKey() { return QStringLiteral("file"); }
+
+static QStringList readRecentFiles(QSettings &settings)
+{
+ QStringList result;
+ const int count = settings.beginReadArray(recentFilesKey());
+ for (int i = 0; i < count; ++i) {
+ settings.setArrayIndex(i);
+ result.append(settings.value(fileKey()).toString());
+ }
+ settings.endArray();
+ return result;
+}
+
+static void writeRecentFiles(const QStringList &files, QSettings &settings)
+{
+ const int count = files.size();
+ settings.beginWriteArray(recentFilesKey());
+ for (int i = 0; i < count; ++i) {
+ settings.setArrayIndex(i);
+ settings.setValue(fileKey(), files.at(i));
+ }
+ settings.endArray();
+}
+
+bool MainWindow::hasRecentFiles()
+{
+ QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName());
+ const int count = settings.beginReadArray(recentFilesKey());
+ settings.endArray();
+ return count > 0;
+}
+
+void MainWindow::prependToRecentFiles(const QString &fileName)
+{
+ QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName());
+
+ const QStringList oldRecentFiles = readRecentFiles(settings);
+ QStringList recentFiles = oldRecentFiles;
+ recentFiles.removeAll(fileName);
+ recentFiles.prepend(fileName);
+ if (oldRecentFiles != recentFiles)
+ writeRecentFiles(recentFiles, settings);
+
+ setRecentFilesVisible(!recentFiles.isEmpty());
+}
+
+void MainWindow::updateRecentFileActions()
+{
+ QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName());
+
+ const QStringList recentFiles = readRecentFiles(settings);
+ const int count = qMin(int(MaxRecentFiles), recentFiles.size());
+ int i = 0;
+ for ( ; i < count; ++i) {
+ const QString fileName = MainWindow::strippedName(recentFiles.at(i));
+ recentFileActs[i]->setText(tr("&%1 %2").arg(i + 1).arg(fileName));
+ recentFileActs[i]->setData(recentFiles.at(i));
+ recentFileActs[i]->setVisible(true);
+ }
+ for ( ; i < MaxRecentFiles; ++i)
+ recentFileActs[i]->setVisible(false);
+}
+
+void MainWindow::openRecentFile()
+{
+ if (const QAction *action = qobject_cast<const QAction *>(sender()))
+ openFile(action->data().toString());
+}
+
bool MainWindow::saveFile(const QString &fileName)
{
QFile file(fileName);
if (!file.open(QFile::WriteOnly | QFile::Text)) {
QMessageBox::warning(this, tr("SDI"),
tr("Cannot write file %1:\n%2.")
- .arg(fileName)
- .arg(file.errorString()));
+ .arg(QDir::toNativeSeparators(fileName), file.errorString()));
return false;
}
@@ -351,6 +446,10 @@ void MainWindow::setCurrentFile(const QString &fileName)
textEdit->document()->setModified(false);
setWindowModified(false);
+
+ if (!isUntitled && windowFilePath() != curFile)
+ MainWindow::prependToRecentFiles(curFile);
+
setWindowFilePath(curFile);
}
@@ -359,14 +458,15 @@ QString MainWindow::strippedName(const QString &fullFileName)
return QFileInfo(fullFileName).fileName();
}
-MainWindow *MainWindow::findMainWindow(const QString &fileName)
+MainWindow *MainWindow::findMainWindow(const QString &fileName) const
{
QString canonicalFilePath = QFileInfo(fileName).canonicalFilePath();
- foreach (QWidget *widget, qApp->topLevelWidgets()) {
+ foreach (QWidget *widget, QApplication::topLevelWidgets()) {
MainWindow *mainWin = qobject_cast<MainWindow *>(widget);
if (mainWin && mainWin->curFile == canonicalFilePath)
return mainWin;
}
+
return 0;
}
diff --git a/examples/widgets/mainwindows/sdi/mainwindow.h b/examples/widgets/mainwindows/sdi/mainwindow.h
index f1860a8511..66ac618c72 100644
--- a/examples/widgets/mainwindows/sdi/mainwindow.h
+++ b/examples/widgets/mainwindows/sdi/mainwindow.h
@@ -42,6 +42,7 @@
#define MAINWINDOW_H
#include <QMainWindow>
+#include <QList>
QT_BEGIN_NAMESPACE
class QAction;
@@ -57,7 +58,9 @@ class MainWindow : public QMainWindow
public:
MainWindow();
//! [class definition with macro]
- MainWindow(const QString &fileName);
+ explicit MainWindow(const QString &fileName);
+
+ void tile(const QMainWindow *previous);
protected:
void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
@@ -67,44 +70,38 @@ private slots:
void open();
bool save();
bool saveAs();
+ void updateRecentFileActions();
+ void openRecentFile();
void about();
void documentWasModified();
private:
+ enum { MaxRecentFiles = 5 };
+
void init();
void createActions();
- void createMenus();
- void createToolBars();
void createStatusBar();
void readSettings();
void writeSettings();
bool maybeSave();
+ void openFile(const QString &fileName);
void loadFile(const QString &fileName);
+ static bool hasRecentFiles();
+ void prependToRecentFiles(const QString &fileName);
+ void setRecentFilesVisible(bool visible);
bool saveFile(const QString &fileName);
void setCurrentFile(const QString &fileName);
- QString strippedName(const QString &fullFileName);
- MainWindow *findMainWindow(const QString &fileName);
+ static QString strippedName(const QString &fullFileName);
+ MainWindow *findMainWindow(const QString &fileName) const;
QTextEdit *textEdit;
+
+ QAction *recentFileActs[MaxRecentFiles];
+ QAction *recentFileSeparator;
+ QAction *recentFileSubMenuAct;
+
QString curFile;
bool isUntitled;
-
- QMenu *fileMenu;
- QMenu *editMenu;
- QMenu *helpMenu;
- QToolBar *fileToolBar;
- QToolBar *editToolBar;
- QAction *newAct;
- QAction *openAct;
- QAction *saveAct;
- QAction *saveAsAct;
- QAction *closeAct;
- QAction *exitAct;
- QAction *cutAct;
- QAction *copyAct;
- QAction *pasteAct;
- QAction *aboutAct;
- QAction *aboutQtAct;
};
#endif
diff --git a/examples/widgets/painting/fontsampler/mainwindow.cpp b/examples/widgets/painting/fontsampler/mainwindow.cpp
index bff8ae9c22..53a2aac82e 100644
--- a/examples/widgets/painting/fontsampler/mainwindow.cpp
+++ b/examples/widgets/painting/fontsampler/mainwindow.cpp
@@ -80,7 +80,7 @@ void MainWindow::setupFontTree()
QTreeWidgetItem *familyItem = new QTreeWidgetItem(fontTree);
familyItem->setText(0, family);
familyItem->setCheckState(0, Qt::Unchecked);
- familyItem->setFlags(familyItem->flags() | Qt::ItemIsTristate);
+ familyItem->setFlags(familyItem->flags() | Qt::ItemIsAutoTristate);
foreach (QString style, styles) {
QTreeWidgetItem *styleItem = new QTreeWidgetItem(familyItem);
diff --git a/examples/widgets/painting/shared/arthurstyle.cpp b/examples/widgets/painting/shared/arthurstyle.cpp
index d246336c5d..f03c05881d 100644
--- a/examples/widgets/painting/shared/arthurstyle.cpp
+++ b/examples/widgets/painting/shared/arthurstyle.cpp
@@ -156,8 +156,8 @@ void ArthurStyle::drawPrimitive(PrimitiveElement element, const QStyleOption *op
break;
case PE_FrameGroupBox:
- if (const QStyleOptionFrameV2 *group
- = qstyleoption_cast<const QStyleOptionFrameV2 *>(option)) {
+ if (const QStyleOptionFrame *group
+ = qstyleoption_cast<const QStyleOptionFrame *>(option)) {
const QRect &r = group->rect;
painter->save();
diff --git a/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pro b/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pro
index 19f471b5cf..93cd950b0b 100644
--- a/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pro
+++ b/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pro
@@ -14,5 +14,5 @@ INSTALLS += target
wince {
addFiles.files = main.cpp mainwindow.cpp
addFiles.path = .
- DEPLOYMENT += addFiles
+ INSTALLS += addFiles
}
diff --git a/examples/widgets/richtext/textedit/main.cpp b/examples/widgets/richtext/textedit/main.cpp
index 4dda7e6c75..1de6d994e6 100644
--- a/examples/widgets/richtext/textedit/main.cpp
+++ b/examples/widgets/richtext/textedit/main.cpp
@@ -32,15 +32,37 @@
****************************************************************************/
#include "textedit.h"
+
#include <QApplication>
+#include <QDesktopWidget>
+#include <QCommandLineParser>
+#include <QCommandLineOption>
int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(textedit);
QApplication a(argc, argv);
+ QCoreApplication::setOrganizationName("QtProject");
+ QCoreApplication::setApplicationName("Rich Text");
+ QCoreApplication::setApplicationVersion(QT_VERSION_STR);
+ QCommandLineParser parser;
+ parser.setApplicationDescription(QCoreApplication::applicationName());
+ parser.addHelpOption();
+ parser.addVersionOption();
+ parser.addPositionalArgument("file", "The file to open.");
+ parser.process(a);
+
TextEdit mw;
- mw.resize(700, 800);
+
+ const QRect availableGeometry = QApplication::desktop()->availableGeometry(&mw);
+ mw.resize(availableGeometry.width() / 2, (availableGeometry.height() * 2) / 3);
+ mw.move((availableGeometry.width() - mw.width()) / 2,
+ (availableGeometry.height() - mw.height()) / 2);
+
+ if (!mw.load(parser.positionalArguments().value(0, QLatin1String(":/example.html"))))
+ mw.fileNew();
+
mw.show();
return a.exec();
}
diff --git a/examples/widgets/richtext/textedit/textedit.cpp b/examples/widgets/richtext/textedit/textedit.cpp
index 6af436ba46..be46c4d008 100644
--- a/examples/widgets/richtext/textedit/textedit.cpp
+++ b/examples/widgets/richtext/textedit/textedit.cpp
@@ -45,6 +45,7 @@
#include <QMenuBar>
#include <QTextCodec>
#include <QTextEdit>
+#include <QStatusBar>
#include <QToolBar>
#include <QTextCursor>
#include <QTextDocumentWriter>
@@ -73,6 +74,14 @@ TextEdit::TextEdit(QWidget *parent)
#ifdef Q_OS_OSX
setUnifiedTitleAndToolBarOnMac(true);
#endif
+ setWindowTitle(QCoreApplication::applicationName());
+
+ textEdit = new QTextEdit(this);
+ connect(textEdit, &QTextEdit::currentCharFormatChanged,
+ this, &TextEdit::currentCharFormatChanged);
+ connect(textEdit, &QTextEdit::cursorPositionChanged,
+ this, &TextEdit::cursorPositionChanged);
+ setCentralWidget(textEdit);
setToolButtonStyle(Qt::ToolButtonFollowStyle);
setupFileActions();
@@ -80,22 +89,11 @@ TextEdit::TextEdit(QWidget *parent)
setupTextActions();
{
- QMenu *helpMenu = new QMenu(tr("Help"), this);
- menuBar()->addMenu(helpMenu);
- helpMenu->addAction(tr("About"), this, SLOT(about()));
- helpMenu->addAction(tr("About &Qt"), qApp, SLOT(aboutQt()));
+ QMenu *helpMenu = menuBar()->addMenu(tr("Help"));
+ helpMenu->addAction(tr("About"), this, &TextEdit::about);
+ helpMenu->addAction(tr("About &Qt"), qApp, &QApplication::aboutQt);
}
- textEdit = new QTextEdit(this);
- connect(textEdit, SIGNAL(currentCharFormatChanged(QTextCharFormat)),
- this, SLOT(currentCharFormatChanged(QTextCharFormat)));
- connect(textEdit, SIGNAL(cursorPositionChanged()),
- this, SLOT(cursorPositionChanged()));
-
- setCentralWidget(textEdit);
- textEdit->setFocus();
- setCurrentFileName(QString());
-
QFont textFont("Helvetica");
textFont.setStyleHint(QFont::SansSerif);
textEdit->setFont(textFont);
@@ -103,44 +101,29 @@ TextEdit::TextEdit(QWidget *parent)
colorChanged(textEdit->textColor());
alignmentChanged(textEdit->alignment());
- connect(textEdit->document(), SIGNAL(modificationChanged(bool)),
- actionSave, SLOT(setEnabled(bool)));
- connect(textEdit->document(), SIGNAL(modificationChanged(bool)),
- this, SLOT(setWindowModified(bool)));
- connect(textEdit->document(), SIGNAL(undoAvailable(bool)),
- actionUndo, SLOT(setEnabled(bool)));
- connect(textEdit->document(), SIGNAL(redoAvailable(bool)),
- actionRedo, SLOT(setEnabled(bool)));
+ connect(textEdit->document(), &QTextDocument::modificationChanged,
+ actionSave, &QAction::setEnabled);
+ connect(textEdit->document(), &QTextDocument::modificationChanged,
+ this, &QWidget::setWindowModified);
+ connect(textEdit->document(), &QTextDocument::undoAvailable,
+ actionUndo, &QAction::setEnabled);
+ connect(textEdit->document(), &QTextDocument::redoAvailable,
+ actionRedo, &QAction::setEnabled);
setWindowModified(textEdit->document()->isModified());
actionSave->setEnabled(textEdit->document()->isModified());
actionUndo->setEnabled(textEdit->document()->isUndoAvailable());
actionRedo->setEnabled(textEdit->document()->isRedoAvailable());
- connect(actionUndo, SIGNAL(triggered()), textEdit, SLOT(undo()));
- connect(actionRedo, SIGNAL(triggered()), textEdit, SLOT(redo()));
-
+#ifndef QT_NO_CLIPBOARD
actionCut->setEnabled(false);
actionCopy->setEnabled(false);
- connect(actionCut, SIGNAL(triggered()), textEdit, SLOT(cut()));
- connect(actionCopy, SIGNAL(triggered()), textEdit, SLOT(copy()));
- connect(actionPaste, SIGNAL(triggered()), textEdit, SLOT(paste()));
-
- connect(textEdit, SIGNAL(copyAvailable(bool)), actionCut, SLOT(setEnabled(bool)));
- connect(textEdit, SIGNAL(copyAvailable(bool)), actionCopy, SLOT(setEnabled(bool)));
-
-#ifndef QT_NO_CLIPBOARD
- connect(QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(clipboardDataChanged()));
+ connect(QApplication::clipboard(), &QClipboard::dataChanged, this, &TextEdit::clipboardDataChanged);
#endif
- QString initialFile = ":/example.html";
- const QStringList args = QCoreApplication::arguments();
- if (args.count() == 2)
- initialFile = args.at(1);
-
- if (!load(initialFile))
- fileNew();
+ textEdit->setFocus();
+ setCurrentFileName(QString());
}
void TextEdit::closeEvent(QCloseEvent *e)
@@ -153,117 +136,90 @@ void TextEdit::closeEvent(QCloseEvent *e)
void TextEdit::setupFileActions()
{
- QToolBar *tb = new QToolBar(this);
- tb->setWindowTitle(tr("File Actions"));
- addToolBar(tb);
-
- QMenu *menu = new QMenu(tr("&File"), this);
- menuBar()->addMenu(menu);
+ QToolBar *tb = addToolBar(tr("File Actions"));
+ QMenu *menu = menuBar()->addMenu(tr("&File"));
- QAction *a;
-
- QIcon newIcon = QIcon::fromTheme("document-new", QIcon(rsrcPath + "/filenew.png"));
- a = new QAction( newIcon, tr("&New"), this);
+ const QIcon newIcon = QIcon::fromTheme("document-new", QIcon(rsrcPath + "/filenew.png"));
+ QAction *a = menu->addAction(newIcon, tr("&New"), this, &TextEdit::fileNew);
+ tb->addAction(a);
a->setPriority(QAction::LowPriority);
a->setShortcut(QKeySequence::New);
- connect(a, SIGNAL(triggered()), this, SLOT(fileNew()));
- tb->addAction(a);
- menu->addAction(a);
- a = new QAction(QIcon::fromTheme("document-open", QIcon(rsrcPath + "/fileopen.png")),
- tr("&Open..."), this);
+ const QIcon openIcon = QIcon::fromTheme("document-open", QIcon(rsrcPath + "/fileopen.png"));
+ a = menu->addAction(openIcon, tr("&Open..."), this, &TextEdit::fileOpen);
a->setShortcut(QKeySequence::Open);
- connect(a, SIGNAL(triggered()), this, SLOT(fileOpen()));
tb->addAction(a);
- menu->addAction(a);
menu->addSeparator();
- actionSave = a = new QAction(QIcon::fromTheme("document-save", QIcon(rsrcPath + "/filesave.png")),
- tr("&Save"), this);
- a->setShortcut(QKeySequence::Save);
- connect(a, SIGNAL(triggered()), this, SLOT(fileSave()));
- a->setEnabled(false);
- tb->addAction(a);
- menu->addAction(a);
+ const QIcon saveIcon = QIcon::fromTheme("document-save", QIcon(rsrcPath + "/filesave.png"));
+ actionSave = menu->addAction(saveIcon, tr("&Save"), this, &TextEdit::fileSave);
+ actionSave->setShortcut(QKeySequence::Save);
+ actionSave->setEnabled(false);
+ tb->addAction(actionSave);
- a = new QAction(tr("Save &As..."), this);
+ a = menu->addAction(tr("Save &As..."), this, &TextEdit::fileSaveAs);
a->setPriority(QAction::LowPriority);
- connect(a, SIGNAL(triggered()), this, SLOT(fileSaveAs()));
- menu->addAction(a);
menu->addSeparator();
#ifndef QT_NO_PRINTER
- a = new QAction(QIcon::fromTheme("document-print", QIcon(rsrcPath + "/fileprint.png")),
- tr("&Print..."), this);
+ const QIcon printIcon = QIcon::fromTheme("document-print", QIcon(rsrcPath + "/fileprint.png"));
+ a = menu->addAction(printIcon, tr("&Print..."), this, &TextEdit::filePrint);
a->setPriority(QAction::LowPriority);
a->setShortcut(QKeySequence::Print);
- connect(a, SIGNAL(triggered()), this, SLOT(filePrint()));
tb->addAction(a);
- menu->addAction(a);
- a = new QAction(QIcon::fromTheme("fileprint", QIcon(rsrcPath + "/fileprint.png")),
- tr("Print Preview..."), this);
- connect(a, SIGNAL(triggered()), this, SLOT(filePrintPreview()));
- menu->addAction(a);
+ const QIcon filePrintIcon = QIcon::fromTheme("fileprint", QIcon(rsrcPath + "/fileprint.png"));
+ menu->addAction(filePrintIcon, tr("Print Preview..."), this, &TextEdit::filePrintPreview);
- a = new QAction(QIcon::fromTheme("exportpdf", QIcon(rsrcPath + "/exportpdf.png")),
- tr("&Export PDF..."), this);
+ const QIcon exportPdfIcon = QIcon::fromTheme("exportpdf", QIcon(rsrcPath + "/exportpdf.png"));
+ a = menu->addAction(exportPdfIcon, tr("&Export PDF..."), this, &TextEdit::filePrintPdf);
a->setPriority(QAction::LowPriority);
a->setShortcut(Qt::CTRL + Qt::Key_D);
- connect(a, SIGNAL(triggered()), this, SLOT(filePrintPdf()));
tb->addAction(a);
- menu->addAction(a);
menu->addSeparator();
#endif
- a = new QAction(tr("&Quit"), this);
+ a = menu->addAction(tr("&Quit"), this, &QWidget::close);
a->setShortcut(Qt::CTRL + Qt::Key_Q);
- connect(a, SIGNAL(triggered()), this, SLOT(close()));
- menu->addAction(a);
}
void TextEdit::setupEditActions()
{
- QToolBar *tb = new QToolBar(this);
- tb->setWindowTitle(tr("Edit Actions"));
- addToolBar(tb);
- QMenu *menu = new QMenu(tr("&Edit"), this);
- menuBar()->addMenu(menu);
+ QToolBar *tb = addToolBar(tr("Edit Actions"));
+ QMenu *menu = menuBar()->addMenu(tr("&Edit"));
- QAction *a;
- a = actionUndo = new QAction(QIcon::fromTheme("edit-undo", QIcon(rsrcPath + "/editundo.png")),
- tr("&Undo"), this);
- a->setShortcut(QKeySequence::Undo);
- tb->addAction(a);
- menu->addAction(a);
- a = actionRedo = new QAction(QIcon::fromTheme("edit-redo", QIcon(rsrcPath + "/editredo.png")),
- tr("&Redo"), this);
- a->setPriority(QAction::LowPriority);
- a->setShortcut(QKeySequence::Redo);
- tb->addAction(a);
- menu->addAction(a);
+ const QIcon undoIcon = QIcon::fromTheme("edit-undo", QIcon(rsrcPath + "/editundo.png"));
+ actionUndo = menu->addAction(undoIcon, tr("&Undo"), textEdit, &QTextEdit::undo);
+ actionUndo->setShortcut(QKeySequence::Undo);
+ tb->addAction(actionUndo);
+
+ const QIcon redoIcon = QIcon::fromTheme("edit-redo", QIcon(rsrcPath + "/editredo.png"));
+ actionRedo = menu->addAction(redoIcon, tr("&Redo"), textEdit, &QTextEdit::redo);
+ actionRedo->setPriority(QAction::LowPriority);
+ actionRedo->setShortcut(QKeySequence::Redo);
+ tb->addAction(actionRedo);
menu->addSeparator();
- a = actionCut = new QAction(QIcon::fromTheme("edit-cut", QIcon(rsrcPath + "/editcut.png")),
- tr("Cu&t"), this);
- a->setPriority(QAction::LowPriority);
- a->setShortcut(QKeySequence::Cut);
- tb->addAction(a);
- menu->addAction(a);
- a = actionCopy = new QAction(QIcon::fromTheme("edit-copy", QIcon(rsrcPath + "/editcopy.png")),
- tr("&Copy"), this);
- a->setPriority(QAction::LowPriority);
- a->setShortcut(QKeySequence::Copy);
- tb->addAction(a);
- menu->addAction(a);
- a = actionPaste = new QAction(QIcon::fromTheme("edit-paste", QIcon(rsrcPath + "/editpaste.png")),
- tr("&Paste"), this);
- a->setPriority(QAction::LowPriority);
- a->setShortcut(QKeySequence::Paste);
- tb->addAction(a);
- menu->addAction(a);
+
#ifndef QT_NO_CLIPBOARD
+ const QIcon cutIcon = QIcon::fromTheme("edit-cut", QIcon(rsrcPath + "/editcut.png"));
+ actionCut = menu->addAction(cutIcon, tr("Cu&t"), textEdit, &QTextEdit::cut);
+ actionCut->setPriority(QAction::LowPriority);
+ actionCut->setShortcut(QKeySequence::Cut);
+ tb->addAction(actionCut);
+
+ const QIcon copyIcon = QIcon::fromTheme("edit-copy", QIcon(rsrcPath + "/editcopy.png"));
+ actionCopy = menu->addAction(copyIcon, tr("&Copy"), textEdit, &QTextEdit::copy);
+ actionCopy->setPriority(QAction::LowPriority);
+ actionCopy->setShortcut(QKeySequence::Copy);
+ tb->addAction(actionCopy);
+
+ const QIcon pasteIcon = QIcon::fromTheme("edit-paste", QIcon(rsrcPath + "/editpaste.png"));
+ actionPaste = menu->addAction(pasteIcon, tr("&Paste"), textEdit, &QTextEdit::paste);
+ actionPaste->setPriority(QAction::LowPriority);
+ actionPaste->setShortcut(QKeySequence::Paste);
+ tb->addAction(actionPaste);
if (const QMimeData *md = QApplication::clipboard()->mimeData())
actionPaste->setEnabled(md->hasText());
#endif
@@ -271,110 +227,89 @@ void TextEdit::setupEditActions()
void TextEdit::setupTextActions()
{
- QToolBar *tb = new QToolBar(this);
- tb->setWindowTitle(tr("Format Actions"));
- addToolBar(tb);
-
- QMenu *menu = new QMenu(tr("F&ormat"), this);
- menuBar()->addMenu(menu);
+ QToolBar *tb = addToolBar(tr("Format Actions"));
+ QMenu *menu = menuBar()->addMenu(tr("F&ormat"));
- actionTextBold = new QAction(QIcon::fromTheme("format-text-bold", QIcon(rsrcPath + "/textbold.png")),
- tr("&Bold"), this);
+ const QIcon boldIcon = QIcon::fromTheme("format-text-bold", QIcon(rsrcPath + "/textbold.png"));
+ actionTextBold = menu->addAction(boldIcon, tr("&Bold"), this, &TextEdit::textBold);
actionTextBold->setShortcut(Qt::CTRL + Qt::Key_B);
actionTextBold->setPriority(QAction::LowPriority);
QFont bold;
bold.setBold(true);
actionTextBold->setFont(bold);
- connect(actionTextBold, SIGNAL(triggered()), this, SLOT(textBold()));
tb->addAction(actionTextBold);
- menu->addAction(actionTextBold);
actionTextBold->setCheckable(true);
- actionTextItalic = new QAction(QIcon::fromTheme("format-text-italic",
- QIcon(rsrcPath + "/textitalic.png")),
- tr("&Italic"), this);
+ const QIcon italicIcon = QIcon::fromTheme("format-text-italic", QIcon(rsrcPath + "/textitalic.png"));
+ actionTextItalic = menu->addAction(italicIcon, tr("&Italic"), this, &TextEdit::textItalic);
actionTextItalic->setPriority(QAction::LowPriority);
actionTextItalic->setShortcut(Qt::CTRL + Qt::Key_I);
QFont italic;
italic.setItalic(true);
actionTextItalic->setFont(italic);
- connect(actionTextItalic, SIGNAL(triggered()), this, SLOT(textItalic()));
tb->addAction(actionTextItalic);
- menu->addAction(actionTextItalic);
actionTextItalic->setCheckable(true);
- actionTextUnderline = new QAction(QIcon::fromTheme("format-text-underline",
- QIcon(rsrcPath + "/textunder.png")),
- tr("&Underline"), this);
+ const QIcon underlineIcon = QIcon::fromTheme("format-text-underline", QIcon(rsrcPath + "/textunder.png"));
+ actionTextUnderline = menu->addAction(underlineIcon, tr("&Underline"), this, &TextEdit::textUnderline);
actionTextUnderline->setShortcut(Qt::CTRL + Qt::Key_U);
actionTextUnderline->setPriority(QAction::LowPriority);
QFont underline;
underline.setUnderline(true);
actionTextUnderline->setFont(underline);
- connect(actionTextUnderline, SIGNAL(triggered()), this, SLOT(textUnderline()));
tb->addAction(actionTextUnderline);
- menu->addAction(actionTextUnderline);
actionTextUnderline->setCheckable(true);
menu->addSeparator();
- QActionGroup *grp = new QActionGroup(this);
- connect(grp, SIGNAL(triggered(QAction*)), this, SLOT(textAlign(QAction*)));
-
- // Make sure the alignLeft is always left of the alignRight
- if (QApplication::isLeftToRight()) {
- actionAlignLeft = new QAction(QIcon::fromTheme("format-justify-left",
- QIcon(rsrcPath + "/textleft.png")),
- tr("&Left"), grp);
- actionAlignCenter = new QAction(QIcon::fromTheme("format-justify-center",
- QIcon(rsrcPath + "/textcenter.png")),
- tr("C&enter"), grp);
- actionAlignRight = new QAction(QIcon::fromTheme("format-justify-right",
- QIcon(rsrcPath + "/textright.png")),
- tr("&Right"), grp);
- } else {
- actionAlignRight = new QAction(QIcon::fromTheme("format-justify-right",
- QIcon(rsrcPath + "/textright.png")),
- tr("&Right"), grp);
- actionAlignCenter = new QAction(QIcon::fromTheme("format-justify-center",
- QIcon(rsrcPath + "/textcenter.png")),
- tr("C&enter"), grp);
- actionAlignLeft = new QAction(QIcon::fromTheme("format-justify-left",
- QIcon(rsrcPath + "/textleft.png")),
- tr("&Left"), grp);
- }
- actionAlignJustify = new QAction(QIcon::fromTheme("format-justify-fill",
- QIcon(rsrcPath + "/textjustify.png")),
- tr("&Justify"), grp);
-
+ const QIcon leftIcon = QIcon::fromTheme("format-justify-left", QIcon(rsrcPath + "/textleft.png"));
+ actionAlignLeft = new QAction(leftIcon, tr("&Left"), this);
actionAlignLeft->setShortcut(Qt::CTRL + Qt::Key_L);
actionAlignLeft->setCheckable(true);
actionAlignLeft->setPriority(QAction::LowPriority);
+ const QIcon centerIcon = QIcon::fromTheme("format-justify-center", QIcon(rsrcPath + "/textcenter.png"));
+ actionAlignCenter = new QAction(centerIcon, tr("C&enter"), this);
actionAlignCenter->setShortcut(Qt::CTRL + Qt::Key_E);
actionAlignCenter->setCheckable(true);
actionAlignCenter->setPriority(QAction::LowPriority);
+ const QIcon rightIcon = QIcon::fromTheme("format-justify-right", QIcon(rsrcPath + "/textright.png"));
+ actionAlignRight = new QAction(rightIcon, tr("&Right"), this);
actionAlignRight->setShortcut(Qt::CTRL + Qt::Key_R);
actionAlignRight->setCheckable(true);
actionAlignRight->setPriority(QAction::LowPriority);
+ const QIcon fillIcon = QIcon::fromTheme("format-justify-fill", QIcon(rsrcPath + "/textjustify.png"));
+ actionAlignJustify = new QAction(fillIcon, tr("&Justify"), this);
actionAlignJustify->setShortcut(Qt::CTRL + Qt::Key_J);
actionAlignJustify->setCheckable(true);
actionAlignJustify->setPriority(QAction::LowPriority);
- tb->addActions(grp->actions());
- menu->addActions(grp->actions());
+ // Make sure the alignLeft is always left of the alignRight
+ QActionGroup *alignGroup = new QActionGroup(this);
+ connect(alignGroup, &QActionGroup::triggered, this, &TextEdit::textAlign);
+
+ if (QApplication::isLeftToRight()) {
+ alignGroup->addAction(actionAlignLeft);
+ alignGroup->addAction(actionAlignCenter);
+ alignGroup->addAction(actionAlignRight);
+ } else {
+ alignGroup->addAction(actionAlignRight);
+ alignGroup->addAction(actionAlignCenter);
+ alignGroup->addAction(actionAlignLeft);
+ }
+ alignGroup->addAction(actionAlignJustify);
+
+ tb->addActions(alignGroup->actions());
+ menu->addActions(alignGroup->actions());
menu->addSeparator();
QPixmap pix(16, 16);
pix.fill(Qt::black);
- actionTextColor = new QAction(pix, tr("&Color..."), this);
- connect(actionTextColor, SIGNAL(triggered()), this, SLOT(textColor()));
+ actionTextColor = menu->addAction(pix, tr("&Color..."), this, &TextEdit::textColor);
tb->addAction(actionTextColor);
- menu->addAction(actionTextColor);
- tb = new QToolBar(this);
+ tb = addToolBar(tr("Format Actions"));
tb->setAllowedAreas(Qt::TopToolBarArea | Qt::BottomToolBarArea);
- tb->setWindowTitle(tr("Format Actions"));
addToolBarBreak(Qt::TopToolBarArea);
addToolBar(tb);
@@ -389,24 +324,26 @@ void TextEdit::setupTextActions()
comboStyle->addItem("Ordered List (Alpha upper)");
comboStyle->addItem("Ordered List (Roman lower)");
comboStyle->addItem("Ordered List (Roman upper)");
- connect(comboStyle, SIGNAL(activated(int)), this, SLOT(textStyle(int)));
+ typedef void (QComboBox::*QComboIntSignal)(int);
+ connect(comboStyle, static_cast<QComboIntSignal>(&QComboBox::activated), this, &TextEdit::textStyle);
+
+ typedef void (QComboBox::*QComboStringSignal)(const QString &);
comboFont = new QFontComboBox(tb);
tb->addWidget(comboFont);
- connect(comboFont, SIGNAL(activated(QString)), this, SLOT(textFamily(QString)));
+ connect(comboFont, static_cast<QComboStringSignal>(&QComboBox::activated), this, &TextEdit::textFamily);
comboSize = new QComboBox(tb);
comboSize->setObjectName("comboSize");
tb->addWidget(comboSize);
comboSize->setEditable(true);
- QFontDatabase db;
- foreach(int size, db.standardSizes())
+ const QList<int> standardSizes = QFontDatabase::standardSizes();
+ foreach (int size, standardSizes)
comboSize->addItem(QString::number(size));
+ comboSize->setCurrentIndex(standardSizes.indexOf(QApplication::font().pointSize()));
- connect(comboSize, SIGNAL(activated(QString)), this, SLOT(textSize(QString)));
- comboSize->setCurrentIndex(comboSize->findText(QString::number(QApplication::font()
- .pointSize())));
+ connect(comboSize, static_cast<QComboStringSignal>(&QComboBox::activated), this, &TextEdit::textSize);
}
bool TextEdit::load(const QString &f)
@@ -436,11 +373,11 @@ bool TextEdit::maybeSave()
if (!textEdit->document()->isModified())
return true;
- QMessageBox::StandardButton ret;
- ret = QMessageBox::warning(this, tr("Application"),
- tr("The document has been modified.\n"
- "Do you want to save your changes?"),
- QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
+ const QMessageBox::StandardButton ret =
+ QMessageBox::warning(this, QCoreApplication::applicationName(),
+ tr("The document has been modified.\n"
+ "Do you want to save your changes?"),
+ QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
if (ret == QMessageBox::Save)
return fileSave();
else if (ret == QMessageBox::Cancel)
@@ -459,7 +396,7 @@ void TextEdit::setCurrentFileName(const QString &fileName)
else
shownName = QFileInfo(fileName).fileName();
- setWindowTitle(tr("%1[*] - %2").arg(shownName).arg(tr("Rich Text")));
+ setWindowTitle(tr("%1[*] - %2").arg(shownName, QCoreApplication::applicationName()));
setWindowModified(false);
}
@@ -473,10 +410,17 @@ void TextEdit::fileNew()
void TextEdit::fileOpen()
{
- QString fn = QFileDialog::getOpenFileName(this, tr("Open File..."),
- QString(), tr("HTML-Files (*.htm *.html);;All Files (*)"));
- if (!fn.isEmpty())
- load(fn);
+ QFileDialog fileDialog(this, tr("Open File..."));
+ fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
+ fileDialog.setFileMode(QFileDialog::ExistingFile);
+ fileDialog.setMimeTypeFilters(QStringList() << "text/html" << "text/plain");
+ if (fileDialog.exec() != QDialog::Accepted)
+ return;
+ const QString fn = fileDialog.selectedFiles().first();
+ if (load(fn))
+ statusBar()->showMessage(tr("Opened \"%1\"").arg(QDir::toNativeSeparators(fn)));
+ else
+ statusBar()->showMessage(tr("Could not open \"%1\"").arg(QDir::toNativeSeparators(fn)));
}
bool TextEdit::fileSave()
@@ -488,23 +432,27 @@ bool TextEdit::fileSave()
QTextDocumentWriter writer(fileName);
bool success = writer.write(textEdit->document());
- if (success)
+ if (success) {
textEdit->document()->setModified(false);
+ statusBar()->showMessage(tr("Wrote \"%1\"").arg(QDir::toNativeSeparators(fileName)));
+ } else {
+ statusBar()->showMessage(tr("Could not write to file \"%1\"")
+ .arg(QDir::toNativeSeparators(fileName)));
+ }
return success;
}
bool TextEdit::fileSaveAs()
{
- QString fn = QFileDialog::getSaveFileName(this, tr("Save as..."), QString(),
- tr("ODF files (*.odt);;HTML-Files "
- "(*.htm *.html);;All Files (*)"));
- if (fn.isEmpty())
+ QFileDialog fileDialog(this, tr("Save as..."));
+ fileDialog.setAcceptMode(QFileDialog::AcceptSave);
+ QStringList mimeTypes;
+ mimeTypes << "application/vnd.oasis.opendocument.text" << "text/html" << "text/plain";
+ fileDialog.setMimeTypeFilters(mimeTypes);
+ fileDialog.setDefaultSuffix("odt");
+ if (fileDialog.exec() != QDialog::Accepted)
return false;
- if (!(fn.endsWith(".odt", Qt::CaseInsensitive)
- || fn.endsWith(".htm", Qt::CaseInsensitive)
- || fn.endsWith(".html", Qt::CaseInsensitive))) {
- fn += ".odt"; // default
- }
+ const QString fn = fileDialog.selectedFiles().first();
setCurrentFileName(fn);
return fileSave();
}
@@ -528,7 +476,7 @@ void TextEdit::filePrintPreview()
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
QPrinter printer(QPrinter::HighResolution);
QPrintPreviewDialog preview(&printer, this);
- connect(&preview, SIGNAL(paintRequested(QPrinter*)), SLOT(printPreview(QPrinter*)));
+ connect(&preview, &QPrintPreviewDialog::paintRequested, this, &TextEdit::printPreview);
preview.exec();
#endif
}
@@ -547,16 +495,19 @@ void TextEdit::filePrintPdf()
{
#ifndef QT_NO_PRINTER
//! [0]
- QString fileName = QFileDialog::getSaveFileName(this, "Export PDF",
- QString(), "*.pdf");
- if (!fileName.isEmpty()) {
- if (QFileInfo(fileName).suffix().isEmpty())
- fileName.append(".pdf");
- QPrinter printer(QPrinter::HighResolution);
- printer.setOutputFormat(QPrinter::PdfFormat);
- printer.setOutputFileName(fileName);
- textEdit->document()->print(&printer);
- }
+ QFileDialog fileDialog(this, tr("Export PDF"));
+ fileDialog.setAcceptMode(QFileDialog::AcceptSave);
+ fileDialog.setMimeTypeFilters(QStringList("application/pdf"));
+ fileDialog.setDefaultSuffix("pdf");
+ if (fileDialog.exec() != QDialog::Accepted)
+ return;
+ QString fileName = fileDialog.selectedFiles().first();
+ QPrinter printer(QPrinter::HighResolution);
+ printer.setOutputFormat(QPrinter::PdfFormat);
+ printer.setOutputFileName(fileName);
+ textEdit->document()->print(&printer);
+ statusBar()->showMessage(tr("Exported \"%1\"")
+ .arg(QDir::toNativeSeparators(fileName)));
//! [0]
#endif
}
diff --git a/examples/widgets/richtext/textedit/textedit.h b/examples/widgets/richtext/textedit/textedit.h
index dade2b9edf..ca2fb86b29 100644
--- a/examples/widgets/richtext/textedit/textedit.h
+++ b/examples/widgets/richtext/textedit/textedit.h
@@ -55,19 +55,15 @@ class TextEdit : public QMainWindow
public:
TextEdit(QWidget *parent = 0);
+ bool load(const QString &f);
+
+public slots:
+ void fileNew();
+
protected:
virtual void closeEvent(QCloseEvent *e) Q_DECL_OVERRIDE;
-private:
- void setupFileActions();
- void setupEditActions();
- void setupTextActions();
- bool load(const QString &f);
- bool maybeSave();
- void setCurrentFileName(const QString &fileName);
-
private slots:
- void fileNew();
void fileOpen();
bool fileSave();
bool fileSaveAs();
@@ -92,6 +88,12 @@ private slots:
void printPreview(QPrinter *);
private:
+ void setupFileActions();
+ void setupEditActions();
+ void setupTextActions();
+ bool maybeSave();
+ void setCurrentFileName(const QString &fileName);
+
void mergeFormatOnWordOrSelection(const QTextCharFormat &format);
void fontChanged(const QFont &f);
void colorChanged(const QColor &c);
@@ -108,9 +110,11 @@ private:
QAction *actionAlignJustify;
QAction *actionUndo;
QAction *actionRedo;
+#ifndef QT_NO_CLIPBOARD
QAction *actionCut;
QAction *actionCopy;
QAction *actionPaste;
+#endif
QComboBox *comboStyle;
QFontComboBox *comboFont;
diff --git a/examples/widgets/tools/regexp/regexpdialog.cpp b/examples/widgets/tools/regexp/regexpdialog.cpp
index 32df8a4b91..8ed1e790fb 100644
--- a/examples/widgets/tools/regexp/regexpdialog.cpp
+++ b/examples/widgets/tools/regexp/regexpdialog.cpp
@@ -153,8 +153,8 @@ void RegExpDialog::refresh()
QString escaped = pattern;
escaped.replace("\\", "\\\\");
escaped.replace("\"", "\\\"");
- escaped.prepend("\"");
- escaped.append("\"");
+ escaped.prepend('"');
+ escaped.append('"');
escapedPatternLineEdit->setText(escaped);
QRegExp rx(pattern);
diff --git a/examples/widgets/tools/regularexpression/images/copy.png b/examples/widgets/tools/regularexpression/images/copy.png
new file mode 100644
index 0000000000..2aeb28288f
--- /dev/null
+++ b/examples/widgets/tools/regularexpression/images/copy.png
Binary files differ
diff --git a/examples/widgets/mainwindows/recentfiles/main.cpp b/examples/widgets/tools/regularexpression/main.cpp
index 23ff3eda16..a5ef410688 100644
--- a/examples/widgets/mainwindows/recentfiles/main.cpp
+++ b/examples/widgets/tools/regularexpression/main.cpp
@@ -38,16 +38,14 @@
**
****************************************************************************/
-#include <QApplication>
+#include "regularexpressiondialog.h"
-#include "mainwindow.h"
+#include <QApplication>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
- app.setOrganizationName("QtProject");
- app.setApplicationName("Recent Files Example");
- MainWindow *mainWin = new MainWindow;
- mainWin->show();
+ RegularExpressionDialog dialog;
+ dialog.show();
return app.exec();
}
diff --git a/examples/widgets/tools/regularexpression/regularexpression.pro b/examples/widgets/tools/regularexpression/regularexpression.pro
new file mode 100644
index 0000000000..8e72e171b8
--- /dev/null
+++ b/examples/widgets/tools/regularexpression/regularexpression.pro
@@ -0,0 +1,11 @@
+QT += widgets
+
+HEADERS = regularexpressiondialog.h
+SOURCES = regularexpressiondialog.cpp \
+ main.cpp
+
+RESOURCES += regularexpression.qrc
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tools/regularexpression
+INSTALLS += target
diff --git a/examples/widgets/tools/regularexpression/regularexpression.qrc b/examples/widgets/tools/regularexpression/regularexpression.qrc
new file mode 100644
index 0000000000..ce7e104af3
--- /dev/null
+++ b/examples/widgets/tools/regularexpression/regularexpression.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>images/copy.png</file>
+</qresource>
+</RCC>
diff --git a/examples/widgets/tools/regularexpression/regularexpressiondialog.cpp b/examples/widgets/tools/regularexpression/regularexpressiondialog.cpp
new file mode 100644
index 0000000000..6cddc1f6c1
--- /dev/null
+++ b/examples/widgets/tools/regularexpression/regularexpressiondialog.cpp
@@ -0,0 +1,349 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
+** Copyright (C) 2015 Samuel Gaist <samuel.gaist@edeltech.ch>
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd 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 "regularexpressiondialog.h"
+
+#include <QApplication>
+
+#include <QCheckBox>
+#include <QComboBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QSpinBox>
+#include <QPlainTextEdit>
+#include <QTreeWidget>
+
+#include <QAction>
+#include <QClipboard>
+
+#include <QHBoxLayout>
+#include <QGridLayout>
+#include <QFormLayout>
+
+#include <QRegularExpression>
+#include <QRegularExpressionMatch>
+#include <QRegularExpressionMatchIterator>
+
+Q_DECLARE_METATYPE(QRegularExpression::MatchType)
+
+RegularExpressionDialog::RegularExpressionDialog(QWidget *parent)
+ : QDialog(parent)
+{
+ setupUi();
+ setWindowTitle(tr("QRegularExpression Example"));
+
+ connect(patternLineEdit, &QLineEdit::textChanged, this, &RegularExpressionDialog::refresh);
+ connect(subjectTextEdit, &QPlainTextEdit::textChanged, this, &RegularExpressionDialog::refresh);
+
+ connect(caseInsensitiveOptionCheckBox, &QCheckBox::toggled, this, &RegularExpressionDialog::refresh);
+ connect(dotMatchesEverythingOptionCheckBox, &QCheckBox::toggled, this, &RegularExpressionDialog::refresh);
+ connect(multilineOptionCheckBox, &QCheckBox::toggled, this, &RegularExpressionDialog::refresh);
+ connect(extendedPatternSyntaxOptionCheckBox, &QCheckBox::toggled, this, &RegularExpressionDialog::refresh);
+ connect(invertedGreedinessOptionCheckBox, &QCheckBox::toggled, this, &RegularExpressionDialog::refresh);
+ connect(dontCaptureOptionCheckBox, &QCheckBox::toggled, this, &RegularExpressionDialog::refresh);
+ connect(useUnicodePropertiesOptionCheckBox, &QCheckBox::toggled, this, &RegularExpressionDialog::refresh);
+ connect(optimizeOnFirstUsageOptionCheckBox, &QCheckBox::toggled, this, &RegularExpressionDialog::refresh);
+ connect(dontAutomaticallyOptimizeOptionCheckBox, &QCheckBox::toggled, this, &RegularExpressionDialog::refresh);
+
+ connect(offsetSpinBox, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
+ this, &RegularExpressionDialog::refresh);
+
+ connect(matchTypeComboBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
+ this, &RegularExpressionDialog::refresh);
+
+ connect(anchoredMatchOptionCheckBox, &QCheckBox::toggled, this, &RegularExpressionDialog::refresh);
+ connect(dontCheckSubjectStringMatchOptionCheckBox, &QCheckBox::toggled, this, &RegularExpressionDialog::refresh);
+
+ patternLineEdit->setText(tr("(\\+?\\d+)-(?<prefix>\\d+)-(?<number>\\w+)"));
+ subjectTextEdit->setPlainText(tr("My office number is +43-152-0123456, my mobile is 001-41-255512 instead."));
+
+ refresh();
+}
+
+void RegularExpressionDialog::refresh()
+{
+ setUpdatesEnabled(false);
+
+ const QString pattern = patternLineEdit->text();
+ const QString text = subjectTextEdit->toPlainText();
+
+ offsetSpinBox->setMaximum(qMax(0, text.length() - 1));
+
+ QString escaped = pattern;
+ escaped.replace(QLatin1String("\\"), QLatin1String("\\\\"));
+ escaped.replace(QLatin1String("\""), QLatin1String("\\\""));
+ escaped.prepend(QLatin1Char('"'));
+ escaped.append(QLatin1Char('"'));
+ escapedPatternLineEdit->setText(escaped);
+
+ QRegularExpression rx(pattern);
+ QRegularExpression::MatchType matchType = matchTypeComboBox->currentData().value<QRegularExpression::MatchType>();
+ QRegularExpression::PatternOptions patternOptions = QRegularExpression::NoPatternOption;
+ QRegularExpression::MatchOptions matchOptions = QRegularExpression::NoMatchOption;
+
+ if (anchoredMatchOptionCheckBox->isChecked())
+ matchOptions |= QRegularExpression::AnchoredMatchOption;
+ if (dontCheckSubjectStringMatchOptionCheckBox->isChecked())
+ matchOptions |= QRegularExpression::DontCheckSubjectStringMatchOption;
+
+ if (caseInsensitiveOptionCheckBox->isChecked())
+ patternOptions |= QRegularExpression::CaseInsensitiveOption;
+ if (dotMatchesEverythingOptionCheckBox->isChecked())
+ patternOptions |= QRegularExpression::DotMatchesEverythingOption;
+ if (multilineOptionCheckBox->isChecked())
+ patternOptions |= QRegularExpression::MultilineOption;
+ if (extendedPatternSyntaxOptionCheckBox->isChecked())
+ patternOptions |= QRegularExpression::ExtendedPatternSyntaxOption;
+ if (invertedGreedinessOptionCheckBox->isChecked())
+ patternOptions |= QRegularExpression::InvertedGreedinessOption;
+ if (dontCaptureOptionCheckBox->isChecked())
+ patternOptions |= QRegularExpression::DontCaptureOption;
+ if (useUnicodePropertiesOptionCheckBox->isChecked())
+ patternOptions |= QRegularExpression::UseUnicodePropertiesOption;
+ if (optimizeOnFirstUsageOptionCheckBox->isChecked())
+ patternOptions |= QRegularExpression::OptimizeOnFirstUsageOption;
+ if (dontAutomaticallyOptimizeOptionCheckBox->isChecked())
+ patternOptions |= QRegularExpression::DontAutomaticallyOptimizeOption;
+
+ rx.setPatternOptions(patternOptions);
+
+ QPalette palette = patternLineEdit->palette();
+ if (rx.isValid())
+ palette.setColor(QPalette::Text, subjectTextEdit->palette().color(QPalette::Text));
+ else
+ palette.setColor(QPalette::Text, Qt::red);
+ patternLineEdit->setPalette(palette);
+
+ matchDetailsTreeWidget->clear();
+ matchDetailsTreeWidget->setEnabled(rx.isValid());
+
+ if (rx.isValid()) {
+ const int capturingGroupsCount = rx.captureCount() + 1;
+
+ QRegularExpressionMatchIterator iterator = rx.globalMatch(text, offsetSpinBox->value(), matchType, matchOptions);
+ int i = 0;
+
+ while (iterator.hasNext()) {
+ QRegularExpressionMatch match = iterator.next();
+
+ QTreeWidgetItem *matchDetailTopItem = new QTreeWidgetItem(matchDetailsTreeWidget);
+ matchDetailTopItem->setText(0, QString::number(i));
+
+ for (int captureGroupIndex = 0; captureGroupIndex < capturingGroupsCount; ++captureGroupIndex) {
+ QTreeWidgetItem *matchDetailItem = new QTreeWidgetItem(matchDetailTopItem);
+ matchDetailItem->setText(1, QString::number(captureGroupIndex));
+ matchDetailItem->setText(2, match.captured(captureGroupIndex));
+ }
+
+ ++i;
+ }
+ }
+
+ matchDetailsTreeWidget->expandAll();
+
+ namedGroupsTreeWidget->clear();
+ namedGroupsTreeWidget->setEnabled(rx.isValid());
+
+ if (rx.isValid()) {
+ regexpStatusLabel->setText(tr("Valid"));
+
+ const QStringList namedCaptureGroups = rx.namedCaptureGroups();
+ for (int i = 0; i < namedCaptureGroups.size(); ++i) {
+ const QString currentNamedCaptureGroup = namedCaptureGroups.at(i);
+
+ QTreeWidgetItem *namedGroupItem = new QTreeWidgetItem(namedGroupsTreeWidget);
+ namedGroupItem->setText(0, QString::number(i));
+ namedGroupItem->setText(1, currentNamedCaptureGroup.isNull() ? tr("<no name>") : currentNamedCaptureGroup);
+ }
+ } else {
+ regexpStatusLabel->setText(tr("Invalid: syntax error at position %1 (%2)")
+ .arg(rx.patternErrorOffset())
+ .arg(rx.errorString()));
+ }
+
+ setUpdatesEnabled(true);
+}
+
+void RegularExpressionDialog::copyEscapedPatternToClipboard()
+{
+#ifndef QT_NO_CLIPBOARD
+ QClipboard *clipboard = QGuiApplication::clipboard();
+ if (clipboard)
+ clipboard->setText(escapedPatternLineEdit->text());
+#endif
+}
+
+void RegularExpressionDialog::setupUi()
+{
+ QWidget *leftHalfContainer = setupLeftUi();
+
+ QFrame *verticalSeparator = new QFrame;
+ verticalSeparator->setFrameStyle(QFrame::VLine | QFrame::Sunken);
+
+ QWidget *rightHalfContainer = setupRightUi();
+
+ QHBoxLayout *mainLayout = new QHBoxLayout;
+ mainLayout->addWidget(leftHalfContainer);
+ mainLayout->addWidget(verticalSeparator);
+ mainLayout->addWidget(rightHalfContainer);
+
+ setLayout(mainLayout);
+}
+
+QWidget *RegularExpressionDialog::setupLeftUi()
+{
+ QWidget *container = new QWidget;
+
+ QFormLayout *layout = new QFormLayout(container);
+ layout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
+ layout->setMargin(0);
+
+ QLabel *regexpAndSubjectLabel = new QLabel(tr("<h3>Regular expression and text input</h3>"));
+ layout->addRow(regexpAndSubjectLabel);
+
+ patternLineEdit = new QLineEdit;
+ patternLineEdit->setClearButtonEnabled(true);
+ layout->addRow(tr("&Pattern:"), patternLineEdit);
+
+ escapedPatternLineEdit = new QLineEdit;
+ escapedPatternLineEdit->setReadOnly(true);
+ QPalette palette = escapedPatternLineEdit->palette();
+ palette.setBrush(QPalette::Base, palette.brush(QPalette::Disabled, QPalette::Base));
+ escapedPatternLineEdit->setPalette(palette);
+
+#ifndef QT_NO_CLIPBOARD
+ QAction *copyEscapedPatternAction = new QAction(this);
+ copyEscapedPatternAction->setText(tr("Copy to clipboard"));
+ copyEscapedPatternAction->setIcon(QIcon(QStringLiteral(":/images/copy.png")));
+ connect(copyEscapedPatternAction, &QAction::triggered, this, &RegularExpressionDialog::copyEscapedPatternToClipboard);
+ escapedPatternLineEdit->addAction(copyEscapedPatternAction, QLineEdit::TrailingPosition);
+#endif
+
+ layout->addRow(tr("&Escaped pattern:"), escapedPatternLineEdit);
+
+ subjectTextEdit = new QPlainTextEdit;
+ layout->addRow(tr("&Subject text:"), subjectTextEdit);
+
+ caseInsensitiveOptionCheckBox = new QCheckBox(tr("Case insensitive (/i)"));
+ dotMatchesEverythingOptionCheckBox = new QCheckBox(tr("Dot matches everything (/s)"));
+ multilineOptionCheckBox = new QCheckBox(tr("Multiline (/m)"));
+ extendedPatternSyntaxOptionCheckBox = new QCheckBox(tr("Extended pattern (/x)"));
+ invertedGreedinessOptionCheckBox = new QCheckBox(tr("Inverted greediness"));
+ dontCaptureOptionCheckBox = new QCheckBox(tr("Don't capture"));
+ useUnicodePropertiesOptionCheckBox = new QCheckBox(tr("Use unicode properties (/u)"));
+ optimizeOnFirstUsageOptionCheckBox = new QCheckBox(tr("Optimize on first usage"));
+ dontAutomaticallyOptimizeOptionCheckBox = new QCheckBox(tr("Don't automatically optimize"));
+
+ QGridLayout *patternOptionsCheckBoxLayout = new QGridLayout;
+ int gridRow = 0;
+ patternOptionsCheckBoxLayout->addWidget(caseInsensitiveOptionCheckBox, gridRow, 1);
+ patternOptionsCheckBoxLayout->addWidget(dotMatchesEverythingOptionCheckBox, gridRow, 2);
+ ++gridRow;
+ patternOptionsCheckBoxLayout->addWidget(multilineOptionCheckBox, gridRow, 1);
+ patternOptionsCheckBoxLayout->addWidget(extendedPatternSyntaxOptionCheckBox, gridRow, 2);
+ ++gridRow;
+ patternOptionsCheckBoxLayout->addWidget(invertedGreedinessOptionCheckBox, gridRow, 1);
+ patternOptionsCheckBoxLayout->addWidget(dontCaptureOptionCheckBox, gridRow, 2);
+ ++gridRow;
+ patternOptionsCheckBoxLayout->addWidget(useUnicodePropertiesOptionCheckBox, gridRow, 1);
+ patternOptionsCheckBoxLayout->addWidget(optimizeOnFirstUsageOptionCheckBox, gridRow, 2);
+ ++gridRow;
+ patternOptionsCheckBoxLayout->addWidget(dontAutomaticallyOptimizeOptionCheckBox, gridRow, 1);
+
+ layout->addRow(tr("Pattern options:"), patternOptionsCheckBoxLayout);
+
+ offsetSpinBox = new QSpinBox;
+ layout->addRow(tr("Match &offset:"), offsetSpinBox);
+
+ matchTypeComboBox = new QComboBox;
+ matchTypeComboBox->addItem(tr("Normal"), QVariant::fromValue(QRegularExpression::NormalMatch));
+ matchTypeComboBox->addItem(tr("Partial prefer complete"), QVariant::fromValue(QRegularExpression::PartialPreferCompleteMatch));
+ matchTypeComboBox->addItem(tr("Partial prefer first"), QVariant::fromValue(QRegularExpression::PartialPreferFirstMatch));
+ matchTypeComboBox->addItem(tr("No match"), QVariant::fromValue(QRegularExpression::NoMatch));
+ layout->addRow(tr("Match &type:"), matchTypeComboBox);
+
+ dontCheckSubjectStringMatchOptionCheckBox = new QCheckBox(tr("Don't check subject string"));
+ anchoredMatchOptionCheckBox = new QCheckBox(tr("Anchored match"));
+
+ QGridLayout *matchOptionsCheckBoxLayout = new QGridLayout;
+ matchOptionsCheckBoxLayout->addWidget(dontCheckSubjectStringMatchOptionCheckBox, 0, 0);
+ matchOptionsCheckBoxLayout->addWidget(anchoredMatchOptionCheckBox, 0, 1);
+ layout->addRow(tr("Match options:"), matchOptionsCheckBoxLayout);
+
+ return container;
+}
+
+QWidget *RegularExpressionDialog::setupRightUi()
+{
+ QWidget *container = new QWidget;
+
+ QFormLayout *layout = new QFormLayout(container);
+ layout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
+ layout->setMargin(0);
+
+ QLabel *matchInfoLabel = new QLabel(tr("<h3>Match information</h3>"));
+ layout->addRow(matchInfoLabel);
+
+ matchDetailsTreeWidget = new QTreeWidget;
+ matchDetailsTreeWidget->setHeaderLabels(QStringList() << tr("Match index") << tr("Group index") << tr("Captured string"));
+ matchDetailsTreeWidget->setSizeAdjustPolicy(QTreeWidget::AdjustToContents);
+ layout->addRow(tr("Match details:"), matchDetailsTreeWidget);
+
+ QFrame *horizontalSeparator = new QFrame;
+ horizontalSeparator->setFrameStyle(QFrame::HLine | QFrame::Sunken);
+ layout->addRow(horizontalSeparator);
+
+ QLabel *regexpInfoLabel = new QLabel(tr("<h3>Regular expression information</h3>"));
+ layout->addRow(regexpInfoLabel);
+
+ regexpStatusLabel = new QLabel(tr("Valid"));
+ regexpStatusLabel->setWordWrap(true);
+ layout->addRow(tr("Pattern status:"), regexpStatusLabel);
+
+ namedGroupsTreeWidget = new QTreeWidget;
+ namedGroupsTreeWidget->setHeaderLabels(QStringList() << tr("Index") << tr("Named group"));
+ namedGroupsTreeWidget->setSizeAdjustPolicy(QTreeWidget::AdjustToContents);
+ namedGroupsTreeWidget->setRootIsDecorated(false);
+ layout->addRow(tr("Named groups:"), namedGroupsTreeWidget);
+
+ return container;
+}
diff --git a/examples/widgets/draganddrop/draggabletext/draglabel.cpp b/examples/widgets/tools/regularexpression/regularexpressiondialog.h
index 4e741fb6c8..1b3b147c14 100644
--- a/examples/widgets/draganddrop/draggabletext/draglabel.cpp
+++ b/examples/widgets/tools/regularexpression/regularexpressiondialog.h
@@ -1,5 +1,7 @@
/****************************************************************************
**
+** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
+** Copyright (C) 2015 Samuel Gaist <samuel.gaist@edeltech.ch>
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
@@ -38,12 +40,61 @@
**
****************************************************************************/
-#include "draglabel.h"
+#ifndef REGULAREXPRESSIONDIALOG_H
+#define REGULAREXPRESSIONDIALOG_H
-DragLabel::DragLabel(const QString &text, QWidget *parent)
- : QLabel(text, parent)
+#include <QDialog>
+
+QT_BEGIN_NAMESPACE
+class QCheckBox;
+class QComboBox;
+class QLabel;
+class QLineEdit;
+class QSpinBox;
+class QPlainTextEdit;
+class QTreeWidget;
+QT_END_NAMESPACE
+
+class RegularExpressionDialog : public QDialog
{
- setAutoFillBackground(true);
- setFrameShape(QFrame::Panel);
- setFrameShadow(QFrame::Raised);
-}
+ Q_OBJECT
+
+public:
+ RegularExpressionDialog(QWidget *parent = 0);
+
+private:
+ void refresh();
+ void copyEscapedPatternToClipboard();
+ void setupUi();
+ QWidget *setupLeftUi();
+ QWidget *setupRightUi();
+
+ QLineEdit *patternLineEdit;
+ QLineEdit *escapedPatternLineEdit;
+
+ QPlainTextEdit *subjectTextEdit;
+
+ QCheckBox *caseInsensitiveOptionCheckBox;
+ QCheckBox *dotMatchesEverythingOptionCheckBox;
+ QCheckBox *multilineOptionCheckBox;
+ QCheckBox *extendedPatternSyntaxOptionCheckBox;
+ QCheckBox *invertedGreedinessOptionCheckBox;
+ QCheckBox *dontCaptureOptionCheckBox;
+ QCheckBox *useUnicodePropertiesOptionCheckBox;
+ QCheckBox *optimizeOnFirstUsageOptionCheckBox;
+ QCheckBox *dontAutomaticallyOptimizeOptionCheckBox;
+
+ QSpinBox *offsetSpinBox;
+
+ QComboBox *matchTypeComboBox;
+
+ QCheckBox *anchoredMatchOptionCheckBox;
+ QCheckBox *dontCheckSubjectStringMatchOptionCheckBox;
+
+ QTreeWidget *matchDetailsTreeWidget;
+
+ QLabel *regexpStatusLabel;
+ QTreeWidget *namedGroupsTreeWidget;
+};
+
+#endif
diff --git a/examples/widgets/tools/settingseditor/locationdialog.cpp b/examples/widgets/tools/settingseditor/locationdialog.cpp
index 31c221f5d9..ad7f7e2ce5 100644
--- a/examples/widgets/tools/settingseditor/locationdialog.cpp
+++ b/examples/widgets/tools/settingseditor/locationdialog.cpp
@@ -54,17 +54,18 @@ LocationDialog::LocationDialog(QWidget *parent)
scopeComboBox->addItem(tr("System"));
organizationComboBox = new QComboBox;
- organizationComboBox->addItem(tr("Qt"));
+ organizationComboBox->addItem(tr("QtProject"));
organizationComboBox->setEditable(true);
applicationComboBox = new QComboBox;
applicationComboBox->addItem(tr("Any"));
+ applicationComboBox->addItem(tr("Qt Creator"));
applicationComboBox->addItem(tr("Application Example"));
applicationComboBox->addItem(tr("Assistant"));
applicationComboBox->addItem(tr("Designer"));
applicationComboBox->addItem(tr("Linguist"));
applicationComboBox->setEditable(true);
- applicationComboBox->setCurrentIndex(3);
+ applicationComboBox->setCurrentIndex(1);
formatLabel = new QLabel(tr("&Format:"));
formatLabel->setBuddy(formatComboBox);
@@ -91,28 +92,30 @@ LocationDialog::LocationDialog(QWidget *parent)
locationsTable->setHorizontalHeaderLabels(labels);
locationsTable->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
locationsTable->horizontalHeader()->resizeSection(1, 180);
+ connect(locationsTable, &QTableWidget::itemActivated, this, &LocationDialog::itemActivated);
- buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok
- | QDialogButtonBox::Cancel);
+ buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
- connect(formatComboBox, SIGNAL(activated(int)),
- this, SLOT(updateLocationsTable()));
- connect(scopeComboBox, SIGNAL(activated(int)),
- this, SLOT(updateLocationsTable()));
+ typedef void (QComboBox::*QComboIntSignal)(int);
+ connect(formatComboBox, static_cast<QComboIntSignal>(&QComboBox::activated),
+ this, &LocationDialog::updateLocationsTable);
+ connect(scopeComboBox, static_cast<QComboIntSignal>(&QComboBox::activated),
+ this, &LocationDialog::updateLocationsTable);
connect(organizationComboBox->lineEdit(),
- SIGNAL(editingFinished()),
- this, SLOT(updateLocationsTable()));
+ &QLineEdit::editingFinished,
+ this, &LocationDialog::updateLocationsTable);
connect(applicationComboBox->lineEdit(),
- SIGNAL(editingFinished()),
- this, SLOT(updateLocationsTable()));
- connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
- connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
-
- QVBoxLayout *locationsLayout = new QVBoxLayout;
+ &QLineEdit::editingFinished,
+ this, &LocationDialog::updateLocationsTable);
+ connect(applicationComboBox, static_cast<QComboIntSignal>(&QComboBox::activated),
+ this, &LocationDialog::updateLocationsTable);
+ connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
+ connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
+
+ QVBoxLayout *locationsLayout = new QVBoxLayout(locationsGroupBox);
locationsLayout->addWidget(locationsTable);
- locationsGroupBox->setLayout(locationsLayout);
- QGridLayout *mainLayout = new QGridLayout;
+ QGridLayout *mainLayout = new QGridLayout(this);
mainLayout->addWidget(formatLabel, 0, 0);
mainLayout->addWidget(formatComboBox, 0, 1);
mainLayout->addWidget(scopeLabel, 1, 0);
@@ -123,7 +126,6 @@ LocationDialog::LocationDialog(QWidget *parent)
mainLayout->addWidget(applicationComboBox, 3, 1);
mainLayout->addWidget(locationsGroupBox, 4, 0, 1, 2);
mainLayout->addWidget(buttonBox, 5, 0, 1, 2);
- setLayout(mainLayout);
updateLocationsTable();
@@ -155,11 +157,16 @@ QString LocationDialog::organization() const
QString LocationDialog::application() const
{
if (applicationComboBox->currentText() == tr("Any"))
- return "";
+ return QString();
else
return applicationComboBox->currentText();
}
+void LocationDialog::itemActivated(QTableWidgetItem *)
+{
+ buttonBox->button(QDialogButtonBox::Ok)->animateClick();
+}
+
void LocationDialog::updateLocationsTable()
{
locationsTable->setUpdatesEnabled(false);
@@ -184,8 +191,7 @@ void LocationDialog::updateLocationsTable()
int row = locationsTable->rowCount();
locationsTable->setRowCount(row + 1);
- QTableWidgetItem *item0 = new QTableWidgetItem;
- item0->setText(settings.fileName());
+ QTableWidgetItem *item0 = new QTableWidgetItem(QDir::toNativeSeparators(settings.fileName()));
QTableWidgetItem *item1 = new QTableWidgetItem;
bool disable = (settings.childKeys().isEmpty()
diff --git a/examples/widgets/tools/settingseditor/locationdialog.h b/examples/widgets/tools/settingseditor/locationdialog.h
index 5bb68d54df..d6f0225a31 100644
--- a/examples/widgets/tools/settingseditor/locationdialog.h
+++ b/examples/widgets/tools/settingseditor/locationdialog.h
@@ -50,6 +50,7 @@ class QDialogButtonBox;
class QGroupBox;
class QLabel;
class QTableWidget;
+class QTableWidgetItem;
QT_END_NAMESPACE
class LocationDialog : public QDialog
@@ -66,6 +67,7 @@ public:
private slots:
void updateLocationsTable();
+ void itemActivated(QTableWidgetItem *);
private:
QLabel *formatLabel;
diff --git a/examples/widgets/tools/settingseditor/main.cpp b/examples/widgets/tools/settingseditor/main.cpp
index 842a474405..0947efd817 100644
--- a/examples/widgets/tools/settingseditor/main.cpp
+++ b/examples/widgets/tools/settingseditor/main.cpp
@@ -45,6 +45,9 @@
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
+ QCoreApplication::setApplicationName("Settings Editor");
+ QCoreApplication::setApplicationVersion(QT_VERSION_STR);
+
MainWindow mainWin;
mainWin.show();
return app.exec();
diff --git a/examples/widgets/tools/settingseditor/mainwindow.cpp b/examples/widgets/tools/settingseditor/mainwindow.cpp
index 078a84576d..dbc8309eef 100644
--- a/examples/widgets/tools/settingseditor/mainwindow.cpp
+++ b/examples/widgets/tools/settingseditor/mainwindow.cpp
@@ -45,20 +45,20 @@
#include "settingstree.h"
MainWindow::MainWindow()
+ : settingsTree(new SettingsTree)
+ , locationDialog(Q_NULLPTR)
{
- settingsTree = new SettingsTree;
setCentralWidget(settingsTree);
- locationDialog = 0;
-
createActions();
- createMenus();
autoRefreshAct->setChecked(true);
fallbacksAct->setChecked(true);
- setWindowTitle(tr("Settings Editor"));
- resize(500, 600);
+ setWindowTitle(QCoreApplication::applicationName());
+ const QRect availableGeometry = QApplication::desktop()->availableGeometry(this);
+ adjustSize();
+ move((availableGeometry.width() - width()) / 2, (availableGeometry.height() - height()) / 2);
}
void MainWindow::openSettings()
@@ -66,49 +66,60 @@ void MainWindow::openSettings()
if (!locationDialog)
locationDialog = new LocationDialog(this);
- if (locationDialog->exec()) {
- QSettings *settings = new QSettings(locationDialog->format(),
- locationDialog->scope(),
- locationDialog->organization(),
- locationDialog->application());
- setSettingsObject(settings);
- fallbacksAct->setEnabled(true);
- }
+ if (locationDialog->exec() != QDialog::Accepted)
+ return;
+
+ SettingsPtr settings(new QSettings(locationDialog->format(),
+ locationDialog->scope(),
+ locationDialog->organization(),
+ locationDialog->application()));
+
+ setSettingsObject(settings);
+ fallbacksAct->setEnabled(true);
}
void MainWindow::openIniFile()
{
- QString fileName = QFileDialog::getOpenFileName(this, tr("Open INI File"),
- "", tr("INI Files (*.ini *.conf)"));
- if (!fileName.isEmpty()) {
- QSettings *settings = new QSettings(fileName, QSettings::IniFormat);
- setSettingsObject(settings);
- fallbacksAct->setEnabled(false);
- }
+ const QString directory = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation);
+ const QString fileName =
+ QFileDialog::getOpenFileName(this, tr("Open INI File"),
+ directory, tr("INI Files (*.ini *.conf)"));
+ if (fileName.isEmpty())
+ return;
+
+ SettingsPtr settings(new QSettings(fileName, QSettings::IniFormat));
+
+ setSettingsObject(settings);
+ fallbacksAct->setEnabled(false);
}
void MainWindow::openPropertyList()
{
- QString fileName = QFileDialog::getOpenFileName(this,
- tr("Open Property List"),
- "", tr("Property List Files (*.plist)"));
- if (!fileName.isEmpty()) {
- QSettings *settings = new QSettings(fileName, QSettings::NativeFormat);
- setSettingsObject(settings);
- fallbacksAct->setEnabled(false);
- }
+ const QString directory = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation);
+ const QString fileName =
+ QFileDialog::getOpenFileName(this, tr("Open Property List"),
+ directory, tr("Property List Files (*.plist)"));
+ if (fileName.isEmpty())
+ return;
+
+ SettingsPtr settings(new QSettings(fileName, QSettings::NativeFormat));
+ setSettingsObject(settings);
+ fallbacksAct->setEnabled(false);
}
void MainWindow::openRegistryPath()
{
- QString path = QInputDialog::getText(this, tr("Open Registry Path"),
- tr("Enter the path in the Windows registry:"),
- QLineEdit::Normal, "HKEY_CURRENT_USER\\");
- if (!path.isEmpty()) {
- QSettings *settings = new QSettings(path, QSettings::NativeFormat);
- setSettingsObject(settings);
- fallbacksAct->setEnabled(false);
- }
+ const QString path =
+ QInputDialog::getText(this, tr("Open Registry Path"),
+ tr("Enter the path in the Windows registry:"),
+ QLineEdit::Normal, "HKEY_CURRENT_USER\\");
+ if (path.isEmpty())
+ return;
+
+ SettingsPtr settings(new QSettings(path, QSettings::NativeFormat));
+
+ setSettingsObject(settings);
+ fallbacksAct->setEnabled(false);
}
void MainWindow::about()
@@ -120,88 +131,59 @@ void MainWindow::about()
void MainWindow::createActions()
{
- openSettingsAct = new QAction(tr("&Open Application Settings..."), this);
+ QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
+
+ QAction *openSettingsAct = fileMenu->addAction(tr("&Open Application Settings..."), this, &MainWindow::openSettings);
openSettingsAct->setShortcuts(QKeySequence::Open);
- connect(openSettingsAct, SIGNAL(triggered()), this, SLOT(openSettings()));
- openIniFileAct = new QAction(tr("Open I&NI File..."), this);
+ QAction *openIniFileAct = fileMenu->addAction(tr("Open I&NI File..."), this, &MainWindow::openIniFile);
openIniFileAct->setShortcut(tr("Ctrl+N"));
- connect(openIniFileAct, SIGNAL(triggered()), this, SLOT(openIniFile()));
- openPropertyListAct = new QAction(tr("Open Mac &Property List..."), this);
+#ifdef Q_OS_OSX
+ QAction *openPropertyListAct = fileMenu->addAction(tr("Open Apple &Property List..."), this, &MainWindow::openPropertyList);
openPropertyListAct->setShortcut(tr("Ctrl+P"));
- connect(openPropertyListAct, SIGNAL(triggered()),
- this, SLOT(openPropertyList()));
+#endif // Q_OS_OSX
- openRegistryPathAct = new QAction(tr("Open Windows &Registry Path..."),
- this);
+#ifdef Q_OS_WIN
+ QAction *openRegistryPathAct = fileMenu->addAction(tr("Open Windows &Registry Path..."), this, &MainWindow::openRegistryPath);
openRegistryPathAct->setShortcut(tr("Ctrl+G"));
- connect(openRegistryPathAct, SIGNAL(triggered()),
- this, SLOT(openRegistryPath()));
+#endif // Q_OS_WIN
+
+ fileMenu->addSeparator();
- refreshAct = new QAction(tr("&Refresh"), this);
+ refreshAct = fileMenu->addAction(tr("&Refresh"), settingsTree, &SettingsTree::refresh);
refreshAct->setShortcut(tr("Ctrl+R"));
refreshAct->setEnabled(false);
- connect(refreshAct, SIGNAL(triggered()), settingsTree, SLOT(refresh()));
- exitAct = new QAction(tr("E&xit"), this);
+ fileMenu->addSeparator();
+
+ QAction *exitAct = fileMenu->addAction(tr("E&xit"), this, &QWidget::close);
exitAct->setShortcuts(QKeySequence::Quit);
- connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
- autoRefreshAct = new QAction(tr("&Auto-Refresh"), this);
+ QMenu *optionsMenu = menuBar()->addMenu(tr("&Options"));
+
+ autoRefreshAct = optionsMenu->addAction(tr("&Auto-Refresh"));
autoRefreshAct->setShortcut(tr("Ctrl+A"));
autoRefreshAct->setCheckable(true);
autoRefreshAct->setEnabled(false);
- connect(autoRefreshAct, SIGNAL(triggered(bool)),
- settingsTree, SLOT(setAutoRefresh(bool)));
- connect(autoRefreshAct, SIGNAL(triggered(bool)),
- refreshAct, SLOT(setDisabled(bool)));
+ connect(autoRefreshAct, &QAction::triggered,
+ settingsTree, &SettingsTree::setAutoRefresh);
+ connect(autoRefreshAct, &QAction::triggered,
+ refreshAct, &QAction::setDisabled);
- fallbacksAct = new QAction(tr("&Fallbacks"), this);
+ fallbacksAct = optionsMenu->addAction(tr("&Fallbacks"));
fallbacksAct->setShortcut(tr("Ctrl+F"));
fallbacksAct->setCheckable(true);
fallbacksAct->setEnabled(false);
- connect(fallbacksAct, SIGNAL(triggered(bool)),
- settingsTree, SLOT(setFallbacksEnabled(bool)));
-
- aboutAct = new QAction(tr("&About"), this);
- connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
-
- aboutQtAct = new QAction(tr("About &Qt"), this);
- connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
-
-#ifndef Q_OS_MAC
- openPropertyListAct->setEnabled(false);
-#endif
-#ifndef Q_OS_WIN
- openRegistryPathAct->setEnabled(false);
-#endif
-}
-
-void MainWindow::createMenus()
-{
- fileMenu = menuBar()->addMenu(tr("&File"));
- fileMenu->addAction(openSettingsAct);
- fileMenu->addAction(openIniFileAct);
- fileMenu->addAction(openPropertyListAct);
- fileMenu->addAction(openRegistryPathAct);
- fileMenu->addSeparator();
- fileMenu->addAction(refreshAct);
- fileMenu->addSeparator();
- fileMenu->addAction(exitAct);
-
- optionsMenu = menuBar()->addMenu(tr("&Options"));
- optionsMenu->addAction(autoRefreshAct);
- optionsMenu->addAction(fallbacksAct);
-
- menuBar()->addSeparator();
+ connect(fallbacksAct, &QAction::triggered,
+ settingsTree, &SettingsTree::setFallbacksEnabled);
- helpMenu = menuBar()->addMenu(tr("&Help"));
- helpMenu->addAction(aboutAct);
- helpMenu->addAction(aboutQtAct);
+ QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
+ helpMenu->addAction(tr("&About"), this, &MainWindow::about);
+ helpMenu->addAction(tr("About &Qt"), qApp, &QCoreApplication::quit);
}
-void MainWindow::setSettingsObject(QSettings *settings)
+void MainWindow::setSettingsObject(const SettingsPtr &settings)
{
settings->setFallbacksEnabled(fallbacksAct->isChecked());
settingsTree->setSettingsObject(settings);
@@ -209,14 +191,14 @@ void MainWindow::setSettingsObject(QSettings *settings)
refreshAct->setEnabled(true);
autoRefreshAct->setEnabled(true);
- QString niceName = settings->fileName();
- niceName.replace("\\", "/");
- int pos = niceName.lastIndexOf("/");
+ QString niceName = QDir::cleanPath(settings->fileName());
+ int pos = niceName.lastIndexOf(QLatin1Char('/'));
if (pos != -1)
niceName.remove(0, pos + 1);
if (!settings->isWritable())
niceName = tr("%1 (read only)").arg(niceName);
- setWindowTitle(tr("%1 - %2").arg(niceName).arg(tr("Settings Editor")));
+ setWindowTitle(tr("%1 - %2").arg(niceName, QCoreApplication::applicationName()));
+ statusBar()->showMessage(tr("Opened \"%1\"").arg(QDir::toNativeSeparators(settings->fileName())));
}
diff --git a/examples/widgets/tools/settingseditor/mainwindow.h b/examples/widgets/tools/settingseditor/mainwindow.h
index 55180c3771..4b1a28dfba 100644
--- a/examples/widgets/tools/settingseditor/mainwindow.h
+++ b/examples/widgets/tools/settingseditor/mainwindow.h
@@ -42,10 +42,10 @@
#define MAINWINDOW_H
#include <QMainWindow>
+#include <QSharedPointer>
QT_BEGIN_NAMESPACE
class QAction;
-class QMenu;
class QSettings;
QT_END_NAMESPACE
class LocationDialog;
@@ -56,6 +56,8 @@ class MainWindow : public QMainWindow
Q_OBJECT
public:
+ typedef QSharedPointer<QSettings> SettingsPtr;
+
MainWindow();
private slots:
@@ -67,25 +69,13 @@ private slots:
private:
void createActions();
- void createMenus();
- void setSettingsObject(QSettings *settings);
+ void setSettingsObject(const SettingsPtr &settings);
SettingsTree *settingsTree;
LocationDialog *locationDialog;
-
- QMenu *fileMenu;
- QMenu *optionsMenu;
- QMenu *helpMenu;
- QAction *openSettingsAct;
- QAction *openIniFileAct;
- QAction *openPropertyListAct;
- QAction *openRegistryPathAct;
QAction *refreshAct;
- QAction *exitAct;
QAction *autoRefreshAct;
QAction *fallbacksAct;
- QAction *aboutAct;
- QAction *aboutQtAct;
};
#endif
diff --git a/examples/widgets/tools/settingseditor/settingstree.cpp b/examples/widgets/tools/settingseditor/settingstree.cpp
index d9d53968ef..b75e3bdc54 100644
--- a/examples/widgets/tools/settingseditor/settingstree.cpp
+++ b/examples/widgets/tools/settingseditor/settingstree.cpp
@@ -45,18 +45,18 @@
SettingsTree::SettingsTree(QWidget *parent)
: QTreeWidget(parent)
+ , autoRefresh(false)
{
setItemDelegate(new VariantDelegate(this));
QStringList labels;
labels << tr("Setting") << tr("Type") << tr("Value");
setHeaderLabels(labels);
- header()->setSectionResizeMode(0, QHeaderView::Stretch);
+ header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
+ header()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
header()->setSectionResizeMode(2, QHeaderView::Stretch);
- settings = 0;
refreshTimer.setInterval(2000);
- autoRefresh = false;
groupIcon.addPixmap(style()->standardPixmap(QStyle::SP_DirClosedIcon),
QIcon::Normal, QIcon::Off);
@@ -64,34 +64,37 @@ SettingsTree::SettingsTree(QWidget *parent)
QIcon::Normal, QIcon::On);
keyIcon.addPixmap(style()->standardPixmap(QStyle::SP_FileIcon));
- connect(&refreshTimer, SIGNAL(timeout()), this, SLOT(maybeRefresh()));
+ connect(&refreshTimer, &QTimer::timeout, this, &SettingsTree::maybeRefresh);
}
-void SettingsTree::setSettingsObject(QSettings *settings)
+SettingsTree::~SettingsTree()
{
- delete this->settings;
- this->settings = settings;
+}
+
+void SettingsTree::setSettingsObject(const SettingsPtr &newSettings)
+{
+ settings = newSettings;
clear();
- if (settings) {
- settings->setParent(this);
+ if (settings.isNull()) {
+ refreshTimer.stop();
+ } else {
refresh();
if (autoRefresh)
refreshTimer.start();
- } else {
- refreshTimer.stop();
}
}
QSize SettingsTree::sizeHint() const
{
- return QSize(800, 600);
+ const QRect availableGeometry = QApplication::desktop()->availableGeometry(this);
+ return QSize(availableGeometry.width() * 2 / 3, availableGeometry.height() * 2 / 3);
}
void SettingsTree::setAutoRefresh(bool autoRefresh)
{
this->autoRefresh = autoRefresh;
- if (settings) {
+ if (!settings.isNull()) {
if (autoRefresh) {
maybeRefresh();
refreshTimer.start();
@@ -103,7 +106,7 @@ void SettingsTree::setAutoRefresh(bool autoRefresh)
void SettingsTree::setFallbacksEnabled(bool enabled)
{
- if (settings) {
+ if (!settings.isNull()) {
settings->setFallbacksEnabled(enabled);
refresh();
}
@@ -117,17 +120,17 @@ void SettingsTree::maybeRefresh()
void SettingsTree::refresh()
{
- if (!settings)
+ if (settings.isNull())
return;
- disconnect(this, SIGNAL(itemChanged(QTreeWidgetItem*,int)),
- this, SLOT(updateSetting(QTreeWidgetItem*)));
+ disconnect(this, &QTreeWidget::itemChanged,
+ this, &SettingsTree::updateSetting);
settings->sync();
updateChildItems(0);
- connect(this, SIGNAL(itemChanged(QTreeWidgetItem*,int)),
- this, SLOT(updateSetting(QTreeWidgetItem*)));
+ connect(this, &QTreeWidget::itemChanged,
+ this, &SettingsTree::updateSetting);
}
bool SettingsTree::event(QEvent *event)
@@ -144,7 +147,7 @@ void SettingsTree::updateSetting(QTreeWidgetItem *item)
QString key = item->text(0);
QTreeWidgetItem *ancestor = item->parent();
while (ancestor) {
- key.prepend(ancestor->text(0) + "/");
+ key.prepend(ancestor->text(0) + QLatin1Char('/'));
ancestor = ancestor->parent();
}
@@ -162,8 +165,8 @@ void SettingsTree::updateChildItems(QTreeWidgetItem *parent)
int childIndex = findChild(parent, group, dividerIndex);
if (childIndex != -1) {
child = childAt(parent, childIndex);
- child->setText(1, "");
- child->setText(2, "");
+ child->setText(1, QString());
+ child->setText(2, QString());
child->setData(2, Qt::UserRole, QVariant());
moveItemForward(parent, childIndex, dividerIndex);
} else {
@@ -177,7 +180,7 @@ void SettingsTree::updateChildItems(QTreeWidgetItem *parent)
settings->endGroup();
}
- foreach (QString key, settings->childKeys()) {
+ foreach (const QString &key, settings->childKeys()) {
QTreeWidgetItem *child;
int childIndex = findChild(parent, key, 0);
diff --git a/examples/widgets/tools/settingseditor/settingstree.h b/examples/widgets/tools/settingseditor/settingstree.h
index 2a64a5a496..4f542d2543 100644
--- a/examples/widgets/tools/settingseditor/settingstree.h
+++ b/examples/widgets/tools/settingseditor/settingstree.h
@@ -44,6 +44,7 @@
#include <QIcon>
#include <QTimer>
#include <QTreeWidget>
+#include <QSharedPointer>
QT_BEGIN_NAMESPACE
class QSettings;
@@ -54,9 +55,12 @@ class SettingsTree : public QTreeWidget
Q_OBJECT
public:
+ typedef QSharedPointer<QSettings> SettingsPtr;
+
SettingsTree(QWidget *parent = 0);
+ ~SettingsTree();
- void setSettingsObject(QSettings *settings);
+ void setSettingsObject(const SettingsPtr &settings);
QSize sizeHint() const Q_DECL_OVERRIDE;
public slots:
@@ -80,7 +84,7 @@ private:
int findChild(QTreeWidgetItem *parent, const QString &text, int startIndex);
void moveItemForward(QTreeWidgetItem *parent, int oldIndex, int newIndex);
- QSettings *settings;
+ SettingsPtr settings;
QTimer refreshTimer;
bool autoRefresh;
QIcon groupIcon;
diff --git a/examples/widgets/tools/settingseditor/variantdelegate.cpp b/examples/widgets/tools/settingseditor/variantdelegate.cpp
index f68082c660..fe2391762b 100644
--- a/examples/widgets/tools/settingseditor/variantdelegate.cpp
+++ b/examples/widgets/tools/settingseditor/variantdelegate.cpp
@@ -60,7 +60,7 @@ VariantDelegate::VariantDelegate(QObject *parent)
dateExp.setPattern("([0-9]{,4})-([0-9]{,2})-([0-9]{,2})");
timeExp.setPattern("([0-9]{,2}):([0-9]{,2}):([0-9]{,2})");
- dateTimeExp.setPattern(dateExp.pattern() + "T" + timeExp.pattern());
+ dateTimeExp.setPattern(dateExp.pattern() + 'T' + timeExp.pattern());
}
void VariantDelegate::paint(QPainter *painter,
@@ -217,7 +217,7 @@ void VariantDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
value = QSize(sizeExp.cap(1).toInt(), sizeExp.cap(2).toInt());
break;
case QVariant::StringList:
- value = text.split(",");
+ value = text.split(',');
break;
case QVariant::Time:
{
diff --git a/examples/widgets/tools/tools.pro b/examples/widgets/tools/tools.pro
index 7178411110..282f8dedea 100644
--- a/examples/widgets/tools/tools.pro
+++ b/examples/widgets/tools/tools.pro
@@ -8,6 +8,7 @@ SUBDIRS = \
plugandpaintplugins \
plugandpaint \
regexp \
+ regularexpression \
settingseditor \
styleplugin \
treemodelcompleter \
diff --git a/examples/widgets/tutorials/addressbook/part7/addressbook.cpp b/examples/widgets/tutorials/addressbook/part7/addressbook.cpp
index 45ded876a7..2953ecd7de 100644
--- a/examples/widgets/tutorials/addressbook/part7/addressbook.cpp
+++ b/examples/widgets/tutorials/addressbook/part7/addressbook.cpp
@@ -370,7 +370,6 @@ void AddressBook::loadFromFile()
QDataStream in(&file);
in.setVersion(QDataStream::Qt_4_3);
- contacts.empty(); // empty existing contacts
in >> contacts;
QMap<QString, QString>::iterator i = contacts.begin();
@@ -422,23 +421,23 @@ void AddressBook::exportAsVCard()
//! [export function part2]
//! [export function part3]
- out << "BEGIN:VCARD" << "\n";
- out << "VERSION:2.1" << "\n";
- out << "N:" << lastName << ";" << firstName << "\n";
+ out << "BEGIN:VCARD" << '\n';
+ out << "VERSION:2.1" << '\n';
+ out << "N:" << lastName << ';' << firstName << '\n';
if (!nameList.isEmpty())
- out << "FN:" << nameList.join(' ') << "\n";
+ out << "FN:" << nameList.join(' ') << '\n';
else
- out << "FN:" << firstName << "\n";
+ out << "FN:" << firstName << '\n';
//! [export function part3]
//! [export function part4]
address.replace(";", "\\;", Qt::CaseInsensitive);
- address.replace("\n", ";", Qt::CaseInsensitive);
+ address.replace('\n', ";", Qt::CaseInsensitive);
address.replace(",", " ", Qt::CaseInsensitive);
- out << "ADR;HOME:;" << address << "\n";
- out << "END:VCARD" << "\n";
+ out << "ADR;HOME:;" << address << '\n';
+ out << "END:VCARD" << '\n';
QMessageBox::information(this, tr("Export Successful"),
tr("\"%1\" has been exported as a vCard.").arg(name));
diff --git a/examples/widgets/tutorials/modelview/5_edit/mymodel.cpp b/examples/widgets/tutorials/modelview/5_edit/mymodel.cpp
index 5eb677bb9d..c04c77772f 100644
--- a/examples/widgets/tutorials/modelview/5_edit/mymodel.cpp
+++ b/examples/widgets/tutorials/modelview/5_edit/mymodel.cpp
@@ -83,7 +83,7 @@ bool MyModel::setData(const QModelIndex & index, const QVariant & value, int rol
{
for(int col= 0; col < COLS; col++)
{
- result += m_gridData[row][col] + " ";
+ result += m_gridData[row][col] + ' ';
}
}
emit editCompleted( result );
diff --git a/examples/widgets/widgets/calculator/calculator.cpp b/examples/widgets/widgets/calculator/calculator.cpp
index e76011ee0d..87061a9868 100644
--- a/examples/widgets/widgets/calculator/calculator.cpp
+++ b/examples/widgets/widgets/calculator/calculator.cpp
@@ -276,7 +276,7 @@ void Calculator::pointClicked()
{
if (waitingForOperand)
display->setText("0");
- if (!display->text().contains("."))
+ if (!display->text().contains('.'))
display->setText(display->text() + tr("."));
waitingForOperand = false;
}
diff --git a/examples/widgets/widgets/icons/iconpreviewarea.cpp b/examples/widgets/widgets/icons/iconpreviewarea.cpp
index 0736261a02..090615e64d 100644
--- a/examples/widgets/widgets/icons/iconpreviewarea.cpp
+++ b/examples/widgets/widgets/icons/iconpreviewarea.cpp
@@ -46,33 +46,95 @@
IconPreviewArea::IconPreviewArea(QWidget *parent)
: QWidget(parent)
{
- QGridLayout *mainLayout = new QGridLayout;
- setLayout(mainLayout);
+ QGridLayout *mainLayout = new QGridLayout(this);
- stateLabels[0] = createHeaderLabel(tr("Off"));
- stateLabels[1] = createHeaderLabel(tr("On"));
+ for (int row = 0; row < NumStates; ++row) {
+ stateLabels[row] = createHeaderLabel(IconPreviewArea::iconStateNames().at(row));
+ mainLayout->addWidget(stateLabels[row], row + 1, 0);
+ }
Q_ASSERT(NumStates == 2);
- modeLabels[0] = createHeaderLabel(tr("Normal"));
- modeLabels[1] = createHeaderLabel(tr("Active"));
- modeLabels[2] = createHeaderLabel(tr("Disabled"));
- modeLabels[3] = createHeaderLabel(tr("Selected"));
+ for (int column = 0; column < NumModes; ++column) {
+ modeLabels[column] = createHeaderLabel(IconPreviewArea::iconModeNames().at(column));
+ mainLayout->addWidget(modeLabels[column], 0, column + 1);
+ }
Q_ASSERT(NumModes == 4);
- for (int j = 0; j < NumStates; ++j)
- mainLayout->addWidget(stateLabels[j], j + 1, 0);
-
- for (int i = 0; i < NumModes; ++i) {
- mainLayout->addWidget(modeLabels[i], 0, i + 1);
-
- for (int j = 0; j < NumStates; ++j) {
- pixmapLabels[i][j] = createPixmapLabel();
- mainLayout->addWidget(pixmapLabels[i][j], j + 1, i + 1);
+ for (int column = 0; column < NumModes; ++column) {
+ for (int row = 0; row < NumStates; ++row) {
+ pixmapLabels[column][row] = createPixmapLabel();
+ mainLayout->addWidget(pixmapLabels[column][row], row + 1, column + 1);
}
}
}
//! [0]
+#ifdef Q_COMPILER_INITIALIZER_LISTS
+
+//! [42]
+QVector<QIcon::Mode> IconPreviewArea::iconModes()
+{
+ static const QVector<QIcon::Mode> result = {QIcon::Normal, QIcon::Active, QIcon::Disabled, QIcon::Selected};
+ return result;
+}
+
+QVector<QIcon::State> IconPreviewArea::iconStates()
+{
+ static const QVector<QIcon::State> result = {QIcon::Off, QIcon::On};
+ return result;
+}
+
+QStringList IconPreviewArea::iconModeNames()
+{
+ static const QStringList result = {tr("Normal"), tr("Active"), tr("Disabled"), tr("Selected")};
+ return result;
+}
+
+QStringList IconPreviewArea::iconStateNames()
+{
+ static const QStringList result = {tr("Off"), tr("On")};
+ return result;
+}
+//! [42]
+
+#else // Q_COMPILER_INITIALIZER_LISTS
+
+//! [43]
+QVector<QIcon::Mode> IconPreviewArea::iconModes()
+{
+ static QVector<QIcon::Mode> result;
+ if (result.isEmpty())
+ result << QIcon::Normal << QIcon::Active << QIcon::Disabled << QIcon::Selected;
+ return result;
+}
+//! [43]
+
+QVector<QIcon::State> IconPreviewArea::iconStates()
+{
+ static QVector<QIcon::State> result;
+ if (result.isEmpty())
+ result << QIcon::Off << QIcon::On;
+ return result;
+}
+
+QStringList IconPreviewArea::iconModeNames()
+{
+ static QStringList result;
+ if (result.isEmpty())
+ result << tr("Normal") << tr("Active") << tr("Disabled") << tr("Selected");
+ return result;
+}
+
+QStringList IconPreviewArea::iconStateNames()
+{
+ static QStringList result;
+ if (result.isEmpty())
+ result << tr("Off") << tr("On");
+ return result;
+}
+
+#endif // !Q_COMPILER_INITIALIZER_LISTS
+
//! [1]
void IconPreviewArea::setIcon(const QIcon &icon)
{
@@ -118,23 +180,27 @@ QLabel *IconPreviewArea::createPixmapLabel()
//! [5]
void IconPreviewArea::updatePixmapLabels()
{
- for (int i = 0; i < NumModes; ++i) {
- QIcon::Mode mode;
- if (i == 0) {
- mode = QIcon::Normal;
- } else if (i == 1) {
- mode = QIcon::Active;
- } else if (i == 2) {
- mode = QIcon::Disabled;
- } else {
- mode = QIcon::Selected;
- }
-
- for (int j = 0; j < NumStates; ++j) {
- QIcon::State state = (j == 0) ? QIcon::Off : QIcon::On;
- QPixmap pixmap = icon.pixmap(size, mode, state);
- pixmapLabels[i][j]->setPixmap(pixmap);
- pixmapLabels[i][j]->setEnabled(!pixmap.isNull());
+ QWindow *window = Q_NULLPTR;
+ if (const QWidget *nativeParent = nativeParentWidget())
+ window = nativeParent->windowHandle();
+ for (int column = 0; column < NumModes; ++column) {
+ for (int row = 0; row < NumStates; ++row) {
+ const QPixmap pixmap =
+ icon.pixmap(window, size, IconPreviewArea::iconModes().at(column),
+ IconPreviewArea::iconStates().at(row));
+ QLabel *pixmapLabel = pixmapLabels[column][row];
+ pixmapLabel->setPixmap(pixmap);
+ pixmapLabel->setEnabled(!pixmap.isNull());
+ QString toolTip;
+ if (!pixmap.isNull()) {
+ const QSize actualSize = icon.actualSize(size);
+ toolTip =
+ tr("Size: %1x%2\nActual size: %3x%4\nDevice pixel ratio: %5")
+ .arg(size.width()).arg(size.height())
+ .arg(actualSize.width()).arg(actualSize.height())
+ .arg(pixmap.devicePixelRatioF());
+ }
+ pixmapLabel->setToolTip(toolTip);
}
}
}
diff --git a/examples/widgets/widgets/icons/iconpreviewarea.h b/examples/widgets/widgets/icons/iconpreviewarea.h
index c2e0a7b79d..693f8811d8 100644
--- a/examples/widgets/widgets/icons/iconpreviewarea.h
+++ b/examples/widgets/widgets/icons/iconpreviewarea.h
@@ -43,6 +43,8 @@
#include <QIcon>
#include <QWidget>
+#include <QStringList>
+#include <QVector>
QT_BEGIN_NAMESPACE
class QLabel;
@@ -54,11 +56,16 @@ class IconPreviewArea : public QWidget
Q_OBJECT
public:
- IconPreviewArea(QWidget *parent = 0);
+ explicit IconPreviewArea(QWidget *parent = Q_NULLPTR);
void setIcon(const QIcon &icon);
void setSize(const QSize &size);
+ static QVector<QIcon::Mode> iconModes();
+ static QVector<QIcon::State> iconStates();
+ static QStringList iconModeNames();
+ static QStringList iconStateNames();
+
private:
QLabel *createHeaderLabel(const QString &text);
QLabel *createPixmapLabel();
diff --git a/examples/widgets/widgets/icons/icons.pro b/examples/widgets/widgets/icons/icons.pro
index 21165163aa..4ee95592c8 100644
--- a/examples/widgets/widgets/icons/icons.pro
+++ b/examples/widgets/widgets/icons/icons.pro
@@ -10,6 +10,8 @@ SOURCES = iconpreviewarea.cpp \
main.cpp \
mainwindow.cpp
+DEFINES += SRCDIR=\\\"$$PWD/\\\"
+
EXAMPLE_FILES = images/*
# install
@@ -24,5 +26,5 @@ wince {
} else {
imageFiles.path = images
}
- DEPLOYMENT += imageFiles
+ INSTALLS += imageFiles
}
diff --git a/examples/widgets/widgets/icons/iconsizespinbox.cpp b/examples/widgets/widgets/icons/iconsizespinbox.cpp
index f3796040b3..1916803eea 100644
--- a/examples/widgets/widgets/icons/iconsizespinbox.cpp
+++ b/examples/widgets/widgets/icons/iconsizespinbox.cpp
@@ -52,13 +52,13 @@ IconSizeSpinBox::IconSizeSpinBox(QWidget *parent)
//! [1]
int IconSizeSpinBox::valueFromText(const QString &text) const
{
- QRegExp regExp(tr("(\\d+)(\\s*[xx]\\s*\\d+)?"));
+ static const QRegularExpression regExp(tr("(\\d+)(\\s*[xx]\\s*\\d+)?"));
+ Q_ASSERT(regExp.isValid());
- if (regExp.exactMatch(text)) {
- return regExp.cap(1).toInt();
- } else {
- return 0;
- }
+ const QRegularExpressionMatch match = regExp.match(text);
+ if (match.isValid())
+ return match.captured(1).toInt();
+ return 0;
}
//! [1]
diff --git a/examples/widgets/widgets/icons/iconsizespinbox.h b/examples/widgets/widgets/icons/iconsizespinbox.h
index 08105c771c..96b277de39 100644
--- a/examples/widgets/widgets/icons/iconsizespinbox.h
+++ b/examples/widgets/widgets/icons/iconsizespinbox.h
@@ -49,7 +49,7 @@ class IconSizeSpinBox : public QSpinBox
Q_OBJECT
public:
- IconSizeSpinBox(QWidget *parent = 0);
+ explicit IconSizeSpinBox(QWidget *parent = Q_NULLPTR);
int valueFromText(const QString &text) const Q_DECL_OVERRIDE;
QString textFromValue(int value) const Q_DECL_OVERRIDE;
diff --git a/examples/widgets/widgets/icons/imagedelegate.cpp b/examples/widgets/widgets/icons/imagedelegate.cpp
index a6df8f3b04..7c393594ca 100644
--- a/examples/widgets/widgets/icons/imagedelegate.cpp
+++ b/examples/widgets/widgets/icons/imagedelegate.cpp
@@ -41,6 +41,7 @@
#include <QtWidgets>
#include "imagedelegate.h"
+#include "iconpreviewarea.h"
//! [0]
ImageDelegate::ImageDelegate(QObject *parent)
@@ -55,17 +56,14 @@ QWidget *ImageDelegate::createEditor(QWidget *parent,
const QModelIndex &index) const
{
QComboBox *comboBox = new QComboBox(parent);
- if (index.column() == 1) {
- comboBox->addItem(tr("Normal"));
- comboBox->addItem(tr("Active"));
- comboBox->addItem(tr("Disabled"));
- comboBox->addItem(tr("Selected"));
- } else if (index.column() == 2) {
- comboBox->addItem(tr("Off"));
- comboBox->addItem(tr("On"));
- }
+ if (index.column() == 1)
+ comboBox->addItems(IconPreviewArea::iconModeNames());
+ else if (index.column() == 2)
+ comboBox->addItems(IconPreviewArea::iconStateNames());
- connect(comboBox, SIGNAL(activated(int)), this, SLOT(emitCommitData()));
+ typedef void (QComboBox::*QComboBoxIntSignal)(int);
+ connect(comboBox, static_cast<QComboBoxIntSignal>(&QComboBox::activated),
+ this, &ImageDelegate::emitCommitData);
return comboBox;
}
diff --git a/examples/widgets/widgets/icons/imagedelegate.h b/examples/widgets/widgets/icons/imagedelegate.h
index a828251013..ed1d8210d5 100644
--- a/examples/widgets/widgets/icons/imagedelegate.h
+++ b/examples/widgets/widgets/icons/imagedelegate.h
@@ -49,7 +49,7 @@ class ImageDelegate : public QItemDelegate
Q_OBJECT
public:
- ImageDelegate(QObject *parent = 0);
+ explicit ImageDelegate(QObject *parent = Q_NULLPTR);
//! [0]
//! [1]
diff --git a/examples/widgets/widgets/icons/main.cpp b/examples/widgets/widgets/icons/main.cpp
index 842a474405..d6a823f1c7 100644
--- a/examples/widgets/widgets/icons/main.cpp
+++ b/examples/widgets/widgets/icons/main.cpp
@@ -39,13 +39,39 @@
****************************************************************************/
#include <QApplication>
+#include <QCommandLineParser>
+#include <QDesktopWidget>
#include "mainwindow.h"
+//! [45]
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
+ QCoreApplication::setApplicationName(MainWindow::tr("Icons"));
+ QCoreApplication::setApplicationVersion(QT_VERSION_STR);
+ QCommandLineParser commandLineParser;
+ commandLineParser.setSingleDashWordOptionMode(QCommandLineParser::ParseAsLongOptions);
+ commandLineParser.addHelpOption();
+ commandLineParser.addVersionOption();
+ QCommandLineOption noHighDpiPixmapOption("no-highdpi-pixmaps",
+ "Disable High DPI image loading (Qt::AA_UseHighDpiPixmaps)");
+ commandLineParser.addOption(noHighDpiPixmapOption);
+ commandLineParser.addPositionalArgument(MainWindow::tr("[file]"), MainWindow::tr("Icon file(s) to open."));
+ commandLineParser.process(QCoreApplication::arguments());
+
+ if (!commandLineParser.isSet(noHighDpiPixmapOption))
+ QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
+
MainWindow mainWin;
+ if (!commandLineParser.positionalArguments().isEmpty())
+ mainWin.loadImages(commandLineParser.positionalArguments());
+
+ const QRect availableGeometry = QApplication::desktop()->availableGeometry(&mainWin);
+ mainWin.resize(availableGeometry.width() / 2, availableGeometry.height() * 2 / 3);
+ mainWin.move((availableGeometry.width() - mainWin.width()) / 2, (availableGeometry.height() - mainWin.height()) / 2);
+
mainWin.show();
return app.exec();
}
+//! [45]
diff --git a/examples/widgets/widgets/icons/mainwindow.cpp b/examples/widgets/widgets/icons/mainwindow.cpp
index 86d18cd62a..4c76b0ee16 100644
--- a/examples/widgets/widgets/icons/mainwindow.cpp
+++ b/examples/widgets/widgets/icons/mainwindow.cpp
@@ -45,34 +45,49 @@
#include "imagedelegate.h"
#include "mainwindow.h"
+//! [40]
+enum { OtherSize = QStyle::PM_CustomBase };
+//! [40]
+
//! [0]
MainWindow::MainWindow()
{
- centralWidget = new QWidget;
+ QWidget *centralWidget = new QWidget(this);
setCentralWidget(centralWidget);
- createPreviewGroupBox();
- createImagesGroupBox();
- createIconSizeGroupBox();
-
createActions();
- createMenus();
- createContextMenu();
- QGridLayout *mainLayout = new QGridLayout;
+ QGridLayout *mainLayout = new QGridLayout(centralWidget);
+
+ QGroupBox *previewGroupBox = new QGroupBox(tr("Preview"));
+ previewArea = new IconPreviewArea(previewGroupBox);
+ QVBoxLayout *previewLayout = new QVBoxLayout(previewGroupBox);
+ previewLayout->addWidget(previewArea);
+
mainLayout->addWidget(previewGroupBox, 0, 0, 1, 2);
- mainLayout->addWidget(imagesGroupBox, 1, 0);
- mainLayout->addWidget(iconSizeGroupBox, 1, 1);
- centralWidget->setLayout(mainLayout);
+ mainLayout->addWidget(createImagesGroupBox(), 1, 0);
+ QVBoxLayout *vBox = new QVBoxLayout;
+ vBox->addWidget(createIconSizeGroupBox());
+ vBox->addWidget(createHighDpiIconSizeGroupBox());
+ vBox->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding));
+ mainLayout->addLayout(vBox, 1, 1);
+ createContextMenu();
setWindowTitle(tr("Icons"));
checkCurrentStyle();
- otherRadioButton->click();
-
- resize(minimumSizeHint());
+ sizeButtonGroup->button(OtherSize)->click();
}
//! [0]
+//! [44]
+void MainWindow::show()
+{
+ QMainWindow::show();
+ connect(windowHandle(), &QWindow::screenChanged, this, &MainWindow::screenChanged);
+ screenChanged();
+}
+//! [44]
+
//! [1]
void MainWindow::about()
{
@@ -89,60 +104,62 @@ void MainWindow::changeStyle(bool checked)
if (!checked)
return;
- QAction *action = qobject_cast<QAction *>(sender());
+ const QAction *action = qobject_cast<QAction *>(sender());
//! [2] //! [3]
QStyle *style = QStyleFactory::create(action->data().toString());
//! [3] //! [4]
Q_ASSERT(style);
QApplication::setStyle(style);
- smallRadioButton->setText(tr("Small (%1 x %1)")
- .arg(style->pixelMetric(QStyle::PM_SmallIconSize)));
- largeRadioButton->setText(tr("Large (%1 x %1)")
- .arg(style->pixelMetric(QStyle::PM_LargeIconSize)));
- toolBarRadioButton->setText(tr("Toolbars (%1 x %1)")
- .arg(style->pixelMetric(QStyle::PM_ToolBarIconSize)));
- listViewRadioButton->setText(tr("List views (%1 x %1)")
- .arg(style->pixelMetric(QStyle::PM_ListViewIconSize)));
- iconViewRadioButton->setText(tr("Icon views (%1 x %1)")
- .arg(style->pixelMetric(QStyle::PM_IconViewIconSize)));
- tabBarRadioButton->setText(tr("Tab bars (%1 x %1)")
- .arg(style->pixelMetric(QStyle::PM_TabBarIconSize)));
-
- changeSize();
+ foreach (QAbstractButton *button, sizeButtonGroup->buttons()) {
+ const QStyle::PixelMetric metric = static_cast<QStyle::PixelMetric>(sizeButtonGroup->id(button));
+ const int value = style->pixelMetric(metric);
+ switch (metric) {
+ case QStyle::PM_SmallIconSize:
+ button->setText(tr("Small (%1 x %1)").arg(value));
+ break;
+ case QStyle::PM_LargeIconSize:
+ button->setText(tr("Large (%1 x %1)").arg(value));
+ break;
+ case QStyle::PM_ToolBarIconSize:
+ button->setText(tr("Toolbars (%1 x %1)").arg(value));
+ break;
+ case QStyle::PM_ListViewIconSize:
+ button->setText(tr("List views (%1 x %1)").arg(value));
+ break;
+ case QStyle::PM_IconViewIconSize:
+ button->setText(tr("Icon views (%1 x %1)").arg(value));
+ break;
+ case QStyle::PM_TabBarIconSize:
+ button->setText(tr("Tab bars (%1 x %1)").arg(value));
+ break;
+ default:
+ break;
+ }
+ }
+
+ triggerChangeSize();
}
//! [4]
//! [5]
-void MainWindow::changeSize(bool checked)
+void MainWindow::changeSize(int id, bool checked)
{
if (!checked)
return;
- int extent;
-
- if (otherRadioButton->isChecked()) {
- extent = otherSpinBox->value();
- } else {
- QStyle::PixelMetric metric;
-
- if (smallRadioButton->isChecked()) {
- metric = QStyle::PM_SmallIconSize;
- } else if (largeRadioButton->isChecked()) {
- metric = QStyle::PM_LargeIconSize;
- } else if (toolBarRadioButton->isChecked()) {
- metric = QStyle::PM_ToolBarIconSize;
- } else if (listViewRadioButton->isChecked()) {
- metric = QStyle::PM_ListViewIconSize;
- } else if (iconViewRadioButton->isChecked()) {
- metric = QStyle::PM_IconViewIconSize;
- } else {
- metric = QStyle::PM_TabBarIconSize;
- }
- extent = QApplication::style()->pixelMetric(metric);
- }
+ const bool other = id == int(OtherSize);
+ const int extent = other
+ ? otherSpinBox->value()
+ : QApplication::style()->pixelMetric(static_cast<QStyle::PixelMetric>(id));
+
previewArea->setSize(QSize(extent, extent));
- otherSpinBox->setEnabled(otherRadioButton->isChecked());
+ otherSpinBox->setEnabled(other);
+}
+
+void MainWindow::triggerChangeSize()
+{
+ changeSize(sizeButtonGroup->checkedId(), true);
}
//! [5]
@@ -152,33 +169,21 @@ void MainWindow::changeIcon()
QIcon icon;
for (int row = 0; row < imagesTable->rowCount(); ++row) {
- QTableWidgetItem *item0 = imagesTable->item(row, 0);
- QTableWidgetItem *item1 = imagesTable->item(row, 1);
- QTableWidgetItem *item2 = imagesTable->item(row, 2);
-
- if (item0->checkState() == Qt::Checked) {
- QIcon::Mode mode;
- if (item1->text() == tr("Normal")) {
- mode = QIcon::Normal;
- } else if (item1->text() == tr("Active")) {
- mode = QIcon::Active;
- } else if (item1->text() == tr("Disabled")) {
- mode = QIcon::Disabled;
- } else {
- mode = QIcon::Selected;
- }
-
- QIcon::State state;
- if (item2->text() == tr("On")) {
- state = QIcon::On;
- } else {
- state = QIcon::Off;
-//! [6] //! [7]
- }
-//! [7]
+ const QTableWidgetItem *fileItem = imagesTable->item(row, 0);
+ const QTableWidgetItem *modeItem = imagesTable->item(row, 1);
+ const QTableWidgetItem *stateItem = imagesTable->item(row, 2);
+
+ if (fileItem->checkState() == Qt::Checked) {
+ const int modeIndex = IconPreviewArea::iconModeNames().indexOf(modeItem->text());
+ Q_ASSERT(modeIndex >= 0);
+ const int stateIndex = IconPreviewArea::iconStateNames().indexOf(stateItem->text());
+ Q_ASSERT(stateIndex >= 0);
+ const QIcon::Mode mode = IconPreviewArea::iconModes().at(modeIndex);
+ const QIcon::State state = IconPreviewArea::iconStates().at(stateIndex);
+//! [6]
//! [8]
- QString fileName = item0->data(Qt::UserRole).toString();
+ const QString fileName = fileItem->data(Qt::UserRole).toString();
QImage image(fileName);
if (!image.isNull())
icon.addPixmap(QPixmap::fromImage(image), mode, state);
@@ -193,61 +198,109 @@ void MainWindow::changeIcon()
}
//! [11]
+void MainWindow::addSampleImages()
+{
+ addImages(QLatin1String(SRCDIR) + QLatin1String("/images"));
+}
+
+void MainWindow::addOtherImages()
+{
+ static bool firstInvocation = true;
+ QString directory;
+ if (firstInvocation) {
+ firstInvocation = false;
+ directory = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation).value(0, QString());
+ }
+ addImages(directory);
+}
+
//! [12]
-void MainWindow::addImages()
+void MainWindow::addImages(const QString &directory)
{
- QStringList fileNames = QFileDialog::getOpenFileNames(this,
- tr("Open Images"), "",
- tr("Images (*.png *.xpm *.jpg);;"
- "All Files (*)"));
- if (!fileNames.isEmpty()) {
- foreach (QString fileName, fileNames) {
- int row = imagesTable->rowCount();
- imagesTable->setRowCount(row + 1);
+ QFileDialog fileDialog(this, tr("Open Images"), directory);
+ QStringList mimeTypeFilters;
+ foreach (const QByteArray &mimeTypeName, QImageReader::supportedMimeTypes())
+ mimeTypeFilters.append(mimeTypeName);
+ mimeTypeFilters.sort();
+ fileDialog.setMimeTypeFilters(mimeTypeFilters);
+ fileDialog.selectMimeTypeFilter(QLatin1String("image/png"));
+ fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
+ fileDialog.setFileMode(QFileDialog::ExistingFiles);
+ if (!nativeFileDialogAct->isChecked())
+ fileDialog.setOption(QFileDialog::DontUseNativeDialog);
+ if (fileDialog.exec() == QDialog::Accepted)
+ loadImages(fileDialog.selectedFiles());
//! [12]
+}
+void MainWindow::loadImages(const QStringList &fileNames)
+{
+ foreach (const QString &fileName, fileNames) {
+ const int row = imagesTable->rowCount();
+ imagesTable->setRowCount(row + 1);
//! [13]
- QString imageName = QFileInfo(fileName).baseName();
+ const QFileInfo fileInfo(fileName);
+ const QString imageName = fileInfo.baseName();
+ const QString fileName2x = fileInfo.absolutePath()
+ + QLatin1Char('/') + imageName + QLatin1String("@2x.") + fileInfo.suffix();
+ const QFileInfo fileInfo2x(fileName2x);
+ const QImage image(fileName);
+ const QString toolTip =
+ tr("Directory: %1\nFile: %2\nFile@2x: %3\nSize: %4x%5")
+ .arg(QDir::toNativeSeparators(fileInfo.absolutePath()), fileInfo.fileName())
+ .arg(fileInfo2x.exists() ? fileInfo2x.fileName() : tr("<None>"))
+ .arg(image.width()).arg(image.height());
//! [13] //! [14]
- QTableWidgetItem *item0 = new QTableWidgetItem(imageName);
- item0->setData(Qt::UserRole, fileName);
- item0->setFlags(item0->flags() & ~Qt::ItemIsEditable);
+ QTableWidgetItem *fileItem = new QTableWidgetItem(imageName);
+ fileItem->setData(Qt::UserRole, fileName);
+ fileItem->setIcon(QPixmap::fromImage(image));
+ fileItem->setFlags((fileItem->flags() | Qt::ItemIsUserCheckable) & ~Qt::ItemIsEditable);
+ fileItem->setToolTip(toolTip);
//! [14]
//! [15]
- QTableWidgetItem *item1 = new QTableWidgetItem(tr("Normal"));
+ QIcon::Mode mode = QIcon::Normal;
//! [15] //! [16]
- QTableWidgetItem *item2 = new QTableWidgetItem(tr("Off"));
-
- if (guessModeStateAct->isChecked()) {
- if (fileName.contains("_act")) {
- item1->setText(tr("Active"));
- } else if (fileName.contains("_dis")) {
- item1->setText(tr("Disabled"));
- } else if (fileName.contains("_sel")) {
- item1->setText(tr("Selected"));
- }
-
- if (fileName.contains("_on"))
- item2->setText(tr("On"));
+ QIcon::State state = QIcon::Off;
+ if (guessModeStateAct->isChecked()) {
+ if (imageName.contains(QLatin1String("_act"), Qt::CaseInsensitive))
+ mode = QIcon::Active;
+ else if (imageName.contains(QLatin1String("_dis"), Qt::CaseInsensitive))
+ mode = QIcon::Disabled;
+ else if (imageName.contains(QLatin1String("_sel"), Qt::CaseInsensitive))
+ mode = QIcon::Selected;
+
+ if (imageName.contains(QLatin1String("_on"), Qt::CaseInsensitive))
+ state = QIcon::On;
//! [16] //! [17]
- }
+ }
//! [17]
//! [18]
- imagesTable->setItem(row, 0, item0);
+ imagesTable->setItem(row, 0, fileItem);
//! [18] //! [19]
- imagesTable->setItem(row, 1, item1);
- imagesTable->setItem(row, 2, item2);
- imagesTable->openPersistentEditor(item1);
- imagesTable->openPersistentEditor(item2);
-
- item0->setCheckState(Qt::Checked);
- }
+ QTableWidgetItem *modeItem =
+ new QTableWidgetItem(IconPreviewArea::iconModeNames().at(IconPreviewArea::iconModes().indexOf(mode)));
+ modeItem->setToolTip(toolTip);
+ imagesTable->setItem(row, 1, modeItem);
+ QTableWidgetItem *stateItem =
+ new QTableWidgetItem(IconPreviewArea::iconStateNames().at(IconPreviewArea::iconStates().indexOf(state)));
+ stateItem->setToolTip(toolTip);
+ imagesTable->setItem(row, 2, stateItem);
+ imagesTable->openPersistentEditor(modeItem);
+ imagesTable->openPersistentEditor(stateItem);
+
+ fileItem->setCheckState(Qt::Checked);
}
}
//! [19]
+void MainWindow::useHighDpiPixmapsChanged(int checkState)
+{
+ QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, checkState == Qt::Checked);
+ changeIcon();
+}
+
//! [20]
void MainWindow::removeAllImages()
{
@@ -256,21 +309,10 @@ void MainWindow::removeAllImages()
}
//! [20]
-void MainWindow::createPreviewGroupBox()
-{
- previewGroupBox = new QGroupBox(tr("Preview"));
-
- previewArea = new IconPreviewArea;
-
- QVBoxLayout *layout = new QVBoxLayout;
- layout->addWidget(previewArea);
- previewGroupBox->setLayout(layout);
-}
-
//! [21]
-void MainWindow::createImagesGroupBox()
+QWidget *MainWindow::createImagesGroupBox()
{
- imagesGroupBox = new QGroupBox(tr("Images"));
+ QGroupBox *imagesGroupBox = new QGroupBox(tr("Images"));
imagesTable = new QTableWidget;
imagesTable->setSelectionMode(QAbstractItemView::NoSelection);
@@ -292,57 +334,63 @@ void MainWindow::createImagesGroupBox()
//! [23]
//! [24]
- connect(imagesTable, SIGNAL(itemChanged(QTableWidgetItem*)),
+ connect(imagesTable, &QTableWidget::itemChanged,
//! [24] //! [25]
- this, SLOT(changeIcon()));
+ this, &MainWindow::changeIcon);
- QVBoxLayout *layout = new QVBoxLayout;
+ QVBoxLayout *layout = new QVBoxLayout(imagesGroupBox);
layout->addWidget(imagesTable);
- imagesGroupBox->setLayout(layout);
+ return imagesGroupBox;
}
//! [25]
//! [26]
-void MainWindow::createIconSizeGroupBox()
+QWidget *MainWindow::createIconSizeGroupBox()
{
- iconSizeGroupBox = new QGroupBox(tr("Icon Size"));
-
- smallRadioButton = new QRadioButton;
- largeRadioButton = new QRadioButton;
- toolBarRadioButton = new QRadioButton;
- listViewRadioButton = new QRadioButton;
- iconViewRadioButton = new QRadioButton;
- tabBarRadioButton = new QRadioButton;
- otherRadioButton = new QRadioButton(tr("Other:"));
-
+ QGroupBox *iconSizeGroupBox = new QGroupBox(tr("Icon Size"));
+
+ sizeButtonGroup = new QButtonGroup(this);
+ sizeButtonGroup->setExclusive(true);
+
+ typedef void (QButtonGroup::*QButtonGroupIntBoolSignal)(int, bool);
+ connect(sizeButtonGroup, static_cast<QButtonGroupIntBoolSignal>(&QButtonGroup::buttonToggled),
+ this, &MainWindow::changeSize);
+
+ QRadioButton *smallRadioButton = new QRadioButton;
+ sizeButtonGroup->addButton(smallRadioButton, QStyle::PM_SmallIconSize);
+ QRadioButton *largeRadioButton = new QRadioButton;
+ sizeButtonGroup->addButton(largeRadioButton, QStyle::PM_LargeIconSize);
+ QRadioButton *toolBarRadioButton = new QRadioButton;
+ sizeButtonGroup->addButton(toolBarRadioButton, QStyle::PM_ToolBarIconSize);
+ QRadioButton *listViewRadioButton = new QRadioButton;
+ sizeButtonGroup->addButton(listViewRadioButton, QStyle::PM_ListViewIconSize);
+ QRadioButton *iconViewRadioButton = new QRadioButton;
+ sizeButtonGroup->addButton(iconViewRadioButton, QStyle::PM_IconViewIconSize);
+ QRadioButton *tabBarRadioButton = new QRadioButton;
+ sizeButtonGroup->addButton(tabBarRadioButton, QStyle::PM_TabBarIconSize);
+ QRadioButton *otherRadioButton = new QRadioButton(tr("Other:"));
+ sizeButtonGroup->addButton(otherRadioButton, OtherSize);
otherSpinBox = new IconSizeSpinBox;
- otherSpinBox->setRange(8, 128);
+ otherSpinBox->setRange(8, 256);
+ const QString spinBoxToolTip =
+ tr("Enter a custom size within %1..%2")
+ .arg(otherSpinBox->minimum()).arg(otherSpinBox->maximum());
otherSpinBox->setValue(64);
+ otherSpinBox->setToolTip(spinBoxToolTip);
+ otherRadioButton->setToolTip(spinBoxToolTip);
//! [26]
//! [27]
- connect(smallRadioButton, SIGNAL(toggled(bool)),
- this, SLOT(changeSize(bool)));
- connect(largeRadioButton, SIGNAL(toggled(bool)),
- this, SLOT(changeSize(bool)));
- connect(toolBarRadioButton, SIGNAL(toggled(bool)),
- this, SLOT(changeSize(bool)));
- connect(listViewRadioButton, SIGNAL(toggled(bool)),
- this, SLOT(changeSize(bool)));
- connect(iconViewRadioButton, SIGNAL(toggled(bool)),
- this, SLOT(changeSize(bool)));
- connect(tabBarRadioButton, SIGNAL(toggled(bool)),
- this, SLOT(changeSize(bool)));
- connect(otherRadioButton, SIGNAL(toggled(bool)),
- this, SLOT(changeSize(bool)));
- connect(otherSpinBox, SIGNAL(valueChanged(int)), this, SLOT(changeSize()));
+ typedef void (QSpinBox::*QSpinBoxIntSignal)(int);
+ connect(otherSpinBox, static_cast<QSpinBoxIntSignal>(&QSpinBox::valueChanged),
+ this, &MainWindow::triggerChangeSize);
QHBoxLayout *otherSizeLayout = new QHBoxLayout;
otherSizeLayout->addWidget(otherRadioButton);
otherSizeLayout->addWidget(otherSpinBox);
otherSizeLayout->addStretch();
- QGridLayout *layout = new QGridLayout;
+ QGridLayout *layout = new QGridLayout(iconSizeGroupBox);
layout->addWidget(smallRadioButton, 0, 0);
layout->addWidget(largeRadioButton, 1, 0);
layout->addWidget(toolBarRadioButton, 2, 0);
@@ -351,75 +399,99 @@ void MainWindow::createIconSizeGroupBox()
layout->addWidget(tabBarRadioButton, 2, 1);
layout->addLayout(otherSizeLayout, 3, 0, 1, 2);
layout->setRowStretch(4, 1);
- iconSizeGroupBox->setLayout(layout);
+ return iconSizeGroupBox;
}
//! [27]
+void MainWindow::screenChanged()
+{
+ devicePixelRatioLabel->setText(QString::number(devicePixelRatioF()));
+ if (const QWindow *window = windowHandle()) {
+ const QScreen *screen = window->screen();
+ const QString screenDescription =
+ tr("\"%1\" (%2x%3)").arg(screen->name())
+ .arg(screen->geometry().width()).arg(screen->geometry().height());
+ screenNameLabel->setText(screenDescription);
+ }
+ changeIcon();
+}
+
+QWidget *MainWindow::createHighDpiIconSizeGroupBox()
+{
+ QGroupBox *highDpiGroupBox = new QGroupBox(tr("High DPI Scaling"));
+ QFormLayout *layout = new QFormLayout(highDpiGroupBox);
+ devicePixelRatioLabel = new QLabel(highDpiGroupBox);
+ screenNameLabel = new QLabel(highDpiGroupBox);
+ layout->addRow(tr("Screen:"), screenNameLabel);
+ layout->addRow(tr("Device pixel ratio:"), devicePixelRatioLabel);
+ QCheckBox *highDpiPixmapsCheckBox = new QCheckBox(QLatin1String("Qt::AA_UseHighDpiPixmaps"));
+ highDpiPixmapsCheckBox->setChecked(QCoreApplication::testAttribute(Qt::AA_UseHighDpiPixmaps));
+ connect(highDpiPixmapsCheckBox, &QCheckBox::stateChanged, this, &MainWindow::useHighDpiPixmapsChanged);
+ layout->addRow(highDpiPixmapsCheckBox);
+ return highDpiGroupBox;
+}
+
//! [28]
void MainWindow::createActions()
{
- addImagesAct = new QAction(tr("&Add Images..."), this);
- addImagesAct->setShortcut(tr("Ctrl+A"));
- connect(addImagesAct, SIGNAL(triggered()), this, SLOT(addImages()));
+ QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
+
+ addSampleImagesAct = new QAction(tr("Add &Sample Images..."), this);
+ addSampleImagesAct->setShortcut(tr("Ctrl+A"));
+ connect(addSampleImagesAct, &QAction::triggered, this, &MainWindow::addSampleImages);
+ fileMenu->addAction(addSampleImagesAct);
+
+ addOtherImagesAct = new QAction(tr("&Add Images..."), this);
+ addOtherImagesAct->setShortcut(QKeySequence::Open);
+ connect(addOtherImagesAct, &QAction::triggered, this, &MainWindow::addOtherImages);
+ fileMenu->addAction(addOtherImagesAct);
removeAllImagesAct = new QAction(tr("&Remove All Images"), this);
removeAllImagesAct->setShortcut(tr("Ctrl+R"));
- connect(removeAllImagesAct, SIGNAL(triggered()),
- this, SLOT(removeAllImages()));
+ connect(removeAllImagesAct, &QAction::triggered,
+ this, &MainWindow::removeAllImages);
+ fileMenu->addAction(removeAllImagesAct);
- exitAct = new QAction(tr("&Quit"), this);
+ fileMenu->addSeparator();
+
+ QAction *exitAct = fileMenu->addAction(tr("&Quit"), this, &QWidget::close);
exitAct->setShortcuts(QKeySequence::Quit);
- connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
+
+ QMenu *viewMenu = menuBar()->addMenu(tr("&View"));
styleActionGroup = new QActionGroup(this);
- foreach (QString styleName, QStyleFactory::keys()) {
- QAction *action = new QAction(styleActionGroup);
- action->setText(tr("%1 Style").arg(styleName));
+ foreach (const QString &styleName, QStyleFactory::keys()) {
+ QAction *action = new QAction(tr("%1 Style").arg(styleName), styleActionGroup);
action->setData(styleName);
action->setCheckable(true);
- connect(action, SIGNAL(triggered(bool)), this, SLOT(changeStyle(bool)));
+ connect(action, &QAction::triggered, this, &MainWindow::changeStyle);
+ viewMenu->addAction(action);
}
+ QMenu *settingsMenu = menuBar()->addMenu(tr("&Settings"));
+
guessModeStateAct = new QAction(tr("&Guess Image Mode/State"), this);
guessModeStateAct->setCheckable(true);
guessModeStateAct->setChecked(true);
+ settingsMenu->addAction(guessModeStateAct);
- aboutAct = new QAction(tr("&About"), this);
- connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
+ nativeFileDialogAct = new QAction(tr("&Use Native File Dialog"), this);
+ nativeFileDialogAct->setCheckable(true);
+ nativeFileDialogAct->setChecked(true);
+ settingsMenu->addAction(nativeFileDialogAct);
- aboutQtAct = new QAction(tr("About &Qt"), this);
- connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
+ QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
+ helpMenu->addAction(tr("&About"), this, &MainWindow::about);
+ helpMenu->addAction(tr("About &Qt"), qApp, &QApplication::aboutQt);
}
//! [28]
-//! [29]
-void MainWindow::createMenus()
-{
- fileMenu = menuBar()->addMenu(tr("&File"));
- fileMenu->addAction(addImagesAct);
- fileMenu->addAction(removeAllImagesAct);
- fileMenu->addSeparator();
- fileMenu->addAction(exitAct);
-
- viewMenu = menuBar()->addMenu(tr("&View"));
- foreach (QAction *action, styleActionGroup->actions())
- viewMenu->addAction(action);
- viewMenu->addSeparator();
- viewMenu->addAction(guessModeStateAct);
-
- menuBar()->addSeparator();
-
- helpMenu = menuBar()->addMenu(tr("&Help"));
- helpMenu->addAction(aboutAct);
- helpMenu->addAction(aboutQtAct);
-}
-//! [29]
-
//! [30]
void MainWindow::createContextMenu()
{
imagesTable->setContextMenuPolicy(Qt::ActionsContextMenu);
- imagesTable->addAction(addImagesAct);
+ imagesTable->addAction(addSampleImagesAct);
+ imagesTable->addAction(addOtherImagesAct);
imagesTable->addAction(removeAllImagesAct);
}
//! [30]
@@ -429,14 +501,13 @@ void MainWindow::checkCurrentStyle()
{
foreach (QAction *action, styleActionGroup->actions()) {
QString styleName = action->data().toString();
- QStyle *candidate = QStyleFactory::create(styleName);
- Q_ASSERT(candidate);
+ QScopedPointer<QStyle> candidate(QStyleFactory::create(styleName));
+ Q_ASSERT(!candidate.isNull());
if (candidate->metaObject()->className()
== QApplication::style()->metaObject()->className()) {
action->trigger();
return;
}
- delete candidate;
}
}
//! [31]
diff --git a/examples/widgets/widgets/icons/mainwindow.h b/examples/widgets/widgets/icons/mainwindow.h
index 3628038878..207986f741 100644
--- a/examples/widgets/widgets/icons/mainwindow.h
+++ b/examples/widgets/widgets/icons/mainwindow.h
@@ -49,9 +49,10 @@
QT_BEGIN_NAMESPACE
class QAction;
class QActionGroup;
-class QGroupBox;
+class QLabel;
class QMenu;
class QRadioButton;
+class QButtonGroup;
class QTableWidget;
QT_END_NAMESPACE
class IconPreviewArea;
@@ -65,51 +66,47 @@ class MainWindow : public QMainWindow
public:
MainWindow();
+ void loadImages(const QStringList &fileNames);
+
+ void show();
+
private slots:
void about();
void changeStyle(bool checked);
- void changeSize(bool checked = true);
+ void changeSize(int, bool);
+ void triggerChangeSize();
void changeIcon();
- void addImages();
+ void addSampleImages();
+ void addOtherImages();
void removeAllImages();
+ void useHighDpiPixmapsChanged(int checkState);
+ void screenChanged();
private:
- void createPreviewGroupBox();
- void createImagesGroupBox();
- void createIconSizeGroupBox();
+ QWidget *createImagesGroupBox();
+ QWidget *createIconSizeGroupBox();
+ QWidget *createHighDpiIconSizeGroupBox();
void createActions();
- void createMenus();
void createContextMenu();
void checkCurrentStyle();
+ void addImages(const QString &directory);
- QWidget *centralWidget;
-
- QGroupBox *previewGroupBox;
IconPreviewArea *previewArea;
- QGroupBox *imagesGroupBox;
QTableWidget *imagesTable;
- QGroupBox *iconSizeGroupBox;
- QRadioButton *smallRadioButton;
- QRadioButton *largeRadioButton;
- QRadioButton *toolBarRadioButton;
- QRadioButton *listViewRadioButton;
- QRadioButton *iconViewRadioButton;
- QRadioButton *tabBarRadioButton;
- QRadioButton *otherRadioButton;
+ QButtonGroup *sizeButtonGroup;
IconSizeSpinBox *otherSpinBox;
- QMenu *fileMenu;
- QMenu *viewMenu;
- QMenu *helpMenu;
- QAction *addImagesAct;
+ QLabel *devicePixelRatioLabel;
+ QLabel *screenNameLabel;
+
+ QAction *addOtherImagesAct;
+ QAction *addSampleImagesAct;
QAction *removeAllImagesAct;
- QAction *exitAct;
QAction *guessModeStateAct;
+ QAction *nativeFileDialogAct;
QActionGroup *styleActionGroup;
- QAction *aboutAct;
- QAction *aboutQtAct;
};
//! [0]
diff --git a/examples/widgets/widgets/imageviewer/imageviewer.cpp b/examples/widgets/widgets/imageviewer/imageviewer.cpp
index 93b88e9c18..844acbd62f 100644
--- a/examples/widgets/widgets/imageviewer/imageviewer.cpp
+++ b/examples/widgets/widgets/imageviewer/imageviewer.cpp
@@ -47,19 +47,20 @@
//! [0]
ImageViewer::ImageViewer()
+ : imageLabel(new QLabel)
+ , scrollArea(new QScrollArea)
+ , scaleFactor(1)
{
- imageLabel = new QLabel;
imageLabel->setBackgroundRole(QPalette::Base);
imageLabel->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
imageLabel->setScaledContents(true);
- scrollArea = new QScrollArea;
scrollArea->setBackgroundRole(QPalette::Dark);
scrollArea->setWidget(imageLabel);
+ scrollArea->setVisible(false);
setCentralWidget(scrollArea);
createActions();
- createMenus();
resize(QGuiApplication::primaryScreen()->availableSize() * 3 / 5);
}
@@ -71,53 +72,99 @@ bool ImageViewer::loadFile(const QString &fileName)
{
QImageReader reader(fileName);
reader.setAutoTransform(true);
- const QImage image = reader.read();
- if (image.isNull()) {
+ const QImage newImage = reader.read();
+ if (newImage.isNull()) {
QMessageBox::information(this, QGuiApplication::applicationDisplayName(),
- tr("Cannot load %1.").arg(QDir::toNativeSeparators(fileName)));
- setWindowFilePath(QString());
- imageLabel->setPixmap(QPixmap());
- imageLabel->adjustSize();
+ tr("Cannot load %1: %2")
+ .arg(QDir::toNativeSeparators(fileName), reader.errorString()));
return false;
}
-//! [2] //! [3]
+//! [2]
+
+ setImage(newImage);
+
+ setWindowFilePath(fileName);
+
+ const QString message = tr("Opened \"%1\", %2x%3, Depth: %4")
+ .arg(QDir::toNativeSeparators(fileName)).arg(image.width()).arg(image.height()).arg(image.depth());
+ statusBar()->showMessage(message);
+ return true;
+}
+
+void ImageViewer::setImage(const QImage &newImage)
+{
+ image = newImage;
imageLabel->setPixmap(QPixmap::fromImage(image));
-//! [3] //! [4]
+//! [4]
scaleFactor = 1.0;
+ scrollArea->setVisible(true);
printAct->setEnabled(true);
fitToWindowAct->setEnabled(true);
updateActions();
if (!fitToWindowAct->isChecked())
imageLabel->adjustSize();
-
- setWindowFilePath(fileName);
- return true;
}
//! [4]
-//! [2]
+bool ImageViewer::saveFile(const QString &fileName)
+{
+ QImageWriter writer(fileName);
+
+ if (!writer.write(image)) {
+ QMessageBox::information(this, QGuiApplication::applicationDisplayName(),
+ tr("Cannot write %1: %2")
+ .arg(QDir::toNativeSeparators(fileName)), writer.errorString());
+ return false;
+ }
+ const QString message = tr("Wrote \"%1\"").arg(QDir::toNativeSeparators(fileName));
+ statusBar()->showMessage(message);
+ return true;
+}
//! [1]
-void ImageViewer::open()
+
+static void initializeImageFileDialog(QFileDialog &dialog, QFileDialog::AcceptMode acceptMode)
{
+ static bool firstDialog = true;
+
+ if (firstDialog) {
+ firstDialog = false;
+ const QStringList picturesLocations = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation);
+ dialog.setDirectory(picturesLocations.isEmpty() ? QDir::currentPath() : picturesLocations.last());
+ }
+
QStringList mimeTypeFilters;
- foreach (const QByteArray &mimeTypeName, QImageReader::supportedMimeTypes())
+ const QByteArrayList supportedMimeTypes = acceptMode == QFileDialog::AcceptOpen
+ ? QImageReader::supportedMimeTypes() : QImageWriter::supportedMimeTypes();
+ foreach (const QByteArray &mimeTypeName, supportedMimeTypes)
mimeTypeFilters.append(mimeTypeName);
mimeTypeFilters.sort();
- const QStringList picturesLocations = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation);
- QFileDialog dialog(this, tr("Open File"),
- picturesLocations.isEmpty() ? QDir::currentPath() : picturesLocations.last());
- dialog.setAcceptMode(QFileDialog::AcceptOpen);
dialog.setMimeTypeFilters(mimeTypeFilters);
dialog.selectMimeTypeFilter("image/jpeg");
+ if (acceptMode == QFileDialog::AcceptSave)
+ dialog.setDefaultSuffix("jpg");
+}
+
+void ImageViewer::open()
+{
+ QFileDialog dialog(this, tr("Open File"));
+ initializeImageFileDialog(dialog, QFileDialog::AcceptOpen);
while (dialog.exec() == QDialog::Accepted && !loadFile(dialog.selectedFiles().first())) {}
}
//! [1]
+void ImageViewer::saveAs()
+{
+ QFileDialog dialog(this, tr("Save File As"));
+ initializeImageFileDialog(dialog, QFileDialog::AcceptSave);
+
+ while (dialog.exec() == QDialog::Accepted && !saveFile(dialog.selectedFiles().first())) {}
+}
+
//! [5]
void ImageViewer::print()
//! [5] //! [6]
@@ -140,6 +187,43 @@ void ImageViewer::print()
}
//! [8]
+void ImageViewer::copy()
+{
+#ifndef QT_NO_CLIPBOARD
+ QGuiApplication::clipboard()->setImage(image);
+#endif // !QT_NO_CLIPBOARD
+}
+
+#ifndef QT_NO_CLIPBOARD
+static QImage clipboardImage()
+{
+ if (const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData()) {
+ if (mimeData->hasImage()) {
+ const QImage image = qvariant_cast<QImage>(mimeData->imageData());
+ if (!image.isNull())
+ return image;
+ }
+ }
+ return QImage();
+}
+#endif // !QT_NO_CLIPBOARD
+
+void ImageViewer::paste()
+{
+#ifndef QT_NO_CLIPBOARD
+ const QImage newImage = clipboardImage();
+ if (newImage.isNull()) {
+ statusBar()->showMessage(tr("No image in clipboard"));
+ } else {
+ setImage(newImage);
+ setWindowFilePath(QString());
+ const QString message = tr("Obtained image from clipboard, %1x%2, Depth: %3")
+ .arg(newImage.width()).arg(newImage.height()).arg(newImage.depth());
+ statusBar()->showMessage(message);
+ }
+#endif // !QT_NO_CLIPBOARD
+}
+
//! [9]
void ImageViewer::zoomIn()
//! [9] //! [10]
@@ -167,9 +251,8 @@ void ImageViewer::fitToWindow()
{
bool fitToWindow = fitToWindowAct->isChecked();
scrollArea->setWidgetResizable(fitToWindow);
- if (!fitToWindow) {
+ if (!fitToWindow)
normalSize();
- }
updateActions();
}
//! [14]
@@ -199,79 +282,66 @@ void ImageViewer::about()
void ImageViewer::createActions()
//! [17] //! [18]
{
- openAct = new QAction(tr("&Open..."), this);
- openAct->setShortcut(tr("Ctrl+O"));
- connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
+ QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
+
+ QAction *openAct = fileMenu->addAction(tr("&Open..."), this, &ImageViewer::open);
+ openAct->setShortcut(QKeySequence::Open);
+
+ saveAsAct = fileMenu->addAction(tr("&Save As..."), this, &ImageViewer::saveAs);
+ saveAsAct->setEnabled(false);
- printAct = new QAction(tr("&Print..."), this);
- printAct->setShortcut(tr("Ctrl+P"));
+ printAct = fileMenu->addAction(tr("&Print..."), this, &ImageViewer::print);
+ printAct->setShortcut(QKeySequence::Print);
printAct->setEnabled(false);
- connect(printAct, SIGNAL(triggered()), this, SLOT(print()));
- exitAct = new QAction(tr("E&xit"), this);
+ fileMenu->addSeparator();
+
+ QAction *exitAct = fileMenu->addAction(tr("E&xit"), this, &QWidget::close);
exitAct->setShortcut(tr("Ctrl+Q"));
- connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
- zoomInAct = new QAction(tr("Zoom &In (25%)"), this);
- zoomInAct->setShortcut(tr("Ctrl++"));
+ QMenu *editMenu = menuBar()->addMenu(tr("&Edit"));
+
+ copyAct = editMenu->addAction(tr("&Copy"), this, &ImageViewer::copy);
+ copyAct->setShortcut(QKeySequence::Copy);
+ copyAct->setEnabled(false);
+
+ QAction *pasteAct = editMenu->addAction(tr("&Paste"), this, &ImageViewer::paste);
+ pasteAct->setShortcut(QKeySequence::Paste);
+
+ QMenu *viewMenu = menuBar()->addMenu(tr("&View"));
+
+ zoomInAct = viewMenu->addAction(tr("Zoom &In (25%)"), this, &ImageViewer::zoomIn);
+ zoomInAct->setShortcut(QKeySequence::ZoomIn);
zoomInAct->setEnabled(false);
- connect(zoomInAct, SIGNAL(triggered()), this, SLOT(zoomIn()));
- zoomOutAct = new QAction(tr("Zoom &Out (25%)"), this);
- zoomOutAct->setShortcut(tr("Ctrl+-"));
+ zoomOutAct = viewMenu->addAction(tr("Zoom &Out (25%)"), this, &ImageViewer::zoomOut);
+ zoomOutAct->setShortcut(QKeySequence::ZoomOut);
zoomOutAct->setEnabled(false);
- connect(zoomOutAct, SIGNAL(triggered()), this, SLOT(zoomOut()));
- normalSizeAct = new QAction(tr("&Normal Size"), this);
+ normalSizeAct = viewMenu->addAction(tr("&Normal Size"), this, &ImageViewer::normalSize);
normalSizeAct->setShortcut(tr("Ctrl+S"));
normalSizeAct->setEnabled(false);
- connect(normalSizeAct, SIGNAL(triggered()), this, SLOT(normalSize()));
- fitToWindowAct = new QAction(tr("&Fit to Window"), this);
+ viewMenu->addSeparator();
+
+ fitToWindowAct = viewMenu->addAction(tr("&Fit to Window"), this, &ImageViewer::fitToWindow);
fitToWindowAct->setEnabled(false);
fitToWindowAct->setCheckable(true);
fitToWindowAct->setShortcut(tr("Ctrl+F"));
- connect(fitToWindowAct, SIGNAL(triggered()), this, SLOT(fitToWindow()));
- aboutAct = new QAction(tr("&About"), this);
- connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
+ QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
- aboutQtAct = new QAction(tr("About &Qt"), this);
- connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
+ helpMenu->addAction(tr("&About"), this, &ImageViewer::about);
+ helpMenu->addAction(tr("About &Qt"), &QApplication::aboutQt);
}
//! [18]
-//! [19]
-void ImageViewer::createMenus()
-//! [19] //! [20]
-{
- fileMenu = new QMenu(tr("&File"), this);
- fileMenu->addAction(openAct);
- fileMenu->addAction(printAct);
- fileMenu->addSeparator();
- fileMenu->addAction(exitAct);
-
- viewMenu = new QMenu(tr("&View"), this);
- viewMenu->addAction(zoomInAct);
- viewMenu->addAction(zoomOutAct);
- viewMenu->addAction(normalSizeAct);
- viewMenu->addSeparator();
- viewMenu->addAction(fitToWindowAct);
-
- helpMenu = new QMenu(tr("&Help"), this);
- helpMenu->addAction(aboutAct);
- helpMenu->addAction(aboutQtAct);
-
- menuBar()->addMenu(fileMenu);
- menuBar()->addMenu(viewMenu);
- menuBar()->addMenu(helpMenu);
-}
-//! [20]
-
//! [21]
void ImageViewer::updateActions()
//! [21] //! [22]
{
+ saveAsAct->setEnabled(!image.isNull());
+ copyAct->setEnabled(!image.isNull());
zoomInAct->setEnabled(!fitToWindowAct->isChecked());
zoomOutAct->setEnabled(!fitToWindowAct->isChecked());
normalSizeAct->setEnabled(!fitToWindowAct->isChecked());
diff --git a/examples/widgets/widgets/imageviewer/imageviewer.h b/examples/widgets/widgets/imageviewer/imageviewer.h
index 7b35e3ee9e..7084bf98d1 100644
--- a/examples/widgets/widgets/imageviewer/imageviewer.h
+++ b/examples/widgets/widgets/imageviewer/imageviewer.h
@@ -42,6 +42,7 @@
#define IMAGEVIEWER_H
#include <QMainWindow>
+#include <QImage>
#ifndef QT_NO_PRINTER
#include <QPrinter>
#endif
@@ -65,7 +66,10 @@ public:
private slots:
void open();
+ void saveAs();
void print();
+ void copy();
+ void paste();
void zoomIn();
void zoomOut();
void normalSize();
@@ -76,9 +80,12 @@ private:
void createActions();
void createMenus();
void updateActions();
+ bool saveFile(const QString &fileName);
+ void setImage(const QImage &newImage);
void scaleImage(double factor);
void adjustScrollBar(QScrollBar *scrollBar, double factor);
+ QImage image;
QLabel *imageLabel;
QScrollArea *scrollArea;
double scaleFactor;
@@ -87,19 +94,13 @@ private:
QPrinter printer;
#endif
- QAction *openAct;
+ QAction *saveAsAct;
QAction *printAct;
- QAction *exitAct;
+ QAction *copyAct;
QAction *zoomInAct;
QAction *zoomOutAct;
QAction *normalSizeAct;
QAction *fitToWindowAct;
- QAction *aboutAct;
- QAction *aboutQtAct;
-
- QMenu *fileMenu;
- QMenu *viewMenu;
- QMenu *helpMenu;
};
//! [0]
diff --git a/examples/widgets/widgets/movie/movie.pro b/examples/widgets/widgets/movie/movie.pro
index 86d85552c2..94d86454d8 100644
--- a/examples/widgets/widgets/movie/movie.pro
+++ b/examples/widgets/widgets/movie/movie.pro
@@ -14,5 +14,5 @@ INSTALLS += target
wince {
addFiles.files += *.gif
addFiles.path = .
- DEPLOYMENT += addFiles
+ INSTALLS += addFiles
}
diff --git a/examples/widgets/widgets/stylesheet/mainwindow.cpp b/examples/widgets/widgets/stylesheet/mainwindow.cpp
index a49c06dfd2..6d84897c77 100644
--- a/examples/widgets/widgets/stylesheet/mainwindow.cpp
+++ b/examples/widgets/widgets/stylesheet/mainwindow.cpp
@@ -67,7 +67,7 @@ void MainWindow::on_aboutAction_triggered()
{
QMessageBox::about(this, tr("About Style sheet"),
tr("The <b>Style Sheet</b> example shows how widgets can be styled "
- "using <a href=\"http://doc.qt.digia.com/4.5/stylesheet.html\">Qt "
+ "using <a href=\"http://doc.qt.io/qt-5/stylesheet.html\">Qt "
"Style Sheets</a>. Click <b>File|Edit Style Sheet</b> to pop up the "
"style editor, and either choose an existing style sheet or design "
"your own."));
diff --git a/examples/widgets/widgets/tablet/images.qrc b/examples/widgets/widgets/tablet/images.qrc
new file mode 100644
index 0000000000..eb3eabbace
--- /dev/null
+++ b/examples/widgets/widgets/tablet/images.qrc
@@ -0,0 +1,8 @@
+<RCC>
+ <qresource>
+ <file>images/cursor-airbrush.png</file>
+ <file>images/cursor-eraser.png</file>
+ <file>images/cursor-felt-marker.png</file>
+ <file>images/cursor-pencil.png</file>
+ </qresource>
+</RCC>
diff --git a/examples/widgets/widgets/tablet/images/cursor-airbrush.png b/examples/widgets/widgets/tablet/images/cursor-airbrush.png
new file mode 100644
index 0000000000..bea756ed6f
--- /dev/null
+++ b/examples/widgets/widgets/tablet/images/cursor-airbrush.png
Binary files differ
diff --git a/examples/widgets/widgets/tablet/images/cursor-eraser.png b/examples/widgets/widgets/tablet/images/cursor-eraser.png
new file mode 100644
index 0000000000..e5488a89f2
--- /dev/null
+++ b/examples/widgets/widgets/tablet/images/cursor-eraser.png
Binary files differ
diff --git a/examples/widgets/widgets/tablet/images/cursor-felt-marker.png b/examples/widgets/widgets/tablet/images/cursor-felt-marker.png
new file mode 100644
index 0000000000..132f09aa39
--- /dev/null
+++ b/examples/widgets/widgets/tablet/images/cursor-felt-marker.png
Binary files differ
diff --git a/examples/widgets/widgets/tablet/images/cursor-pencil.png b/examples/widgets/widgets/tablet/images/cursor-pencil.png
new file mode 100644
index 0000000000..cc2f447d02
--- /dev/null
+++ b/examples/widgets/widgets/tablet/images/cursor-pencil.png
Binary files differ
diff --git a/examples/widgets/widgets/tablet/mainwindow.cpp b/examples/widgets/widgets/tablet/mainwindow.cpp
index aed84c50df..5e84f5b6a2 100644
--- a/examples/widgets/widgets/tablet/mainwindow.cpp
+++ b/examples/widgets/widgets/tablet/mainwindow.cpp
@@ -52,7 +52,7 @@ MainWindow::MainWindow(TabletCanvas *canvas)
myCanvas->setColor(Qt::red);
myCanvas->setLineWidthType(TabletCanvas::LineWidthPressure);
- myCanvas->setAlphaChannelType(TabletCanvas::NoAlpha);
+ myCanvas->setAlphaChannelType(TabletCanvas::AlphaTangentialPressure);
myCanvas->setColorSaturationType(TabletCanvas::NoSaturation);
setWindowTitle(tr("Tablet Example"));
@@ -75,6 +75,8 @@ void MainWindow::alphaActionTriggered(QAction *action)
{
if (action == alphaChannelPressureAction) {
myCanvas->setAlphaChannelType(TabletCanvas::AlphaPressure);
+ } else if (action == alphaChannelTangentialPressureAction) {
+ myCanvas->setAlphaChannelType(TabletCanvas::AlphaTangentialPressure);
} else if (action == alphaChannelTiltAction) {
myCanvas->setAlphaChannelType(TabletCanvas::AlphaTilt);
} else {
@@ -157,15 +159,19 @@ void MainWindow::createActions()
alphaChannelPressureAction = new QAction(tr("&Pressure"), this);
alphaChannelPressureAction->setCheckable(true);
+ alphaChannelTangentialPressureAction = new QAction(tr("T&angential Pressure"), this);
+ alphaChannelTangentialPressureAction->setCheckable(true);
+ alphaChannelTangentialPressureAction->setChecked(true);
+
alphaChannelTiltAction = new QAction(tr("&Tilt"), this);
alphaChannelTiltAction->setCheckable(true);
noAlphaChannelAction = new QAction(tr("No Alpha Channel"), this);
noAlphaChannelAction->setCheckable(true);
- noAlphaChannelAction->setChecked(true);
alphaChannelGroup = new QActionGroup(this);
alphaChannelGroup->addAction(alphaChannelPressureAction);
+ alphaChannelGroup->addAction(alphaChannelTangentialPressureAction);
alphaChannelGroup->addAction(alphaChannelTiltAction);
alphaChannelGroup->addAction(noAlphaChannelAction);
connect(alphaChannelGroup, SIGNAL(triggered(QAction*)),
@@ -259,6 +265,7 @@ void MainWindow::createMenus()
alphaChannelMenu = tabletMenu->addMenu(tr("&Alpha Channel"));
alphaChannelMenu->addAction(alphaChannelPressureAction);
+ alphaChannelMenu->addAction(alphaChannelTangentialPressureAction);
alphaChannelMenu->addAction(alphaChannelTiltAction);
alphaChannelMenu->addAction(noAlphaChannelAction);
diff --git a/examples/widgets/widgets/tablet/mainwindow.h b/examples/widgets/widgets/tablet/mainwindow.h
index 5e77ea1acf..c6ac2e6026 100644
--- a/examples/widgets/widgets/tablet/mainwindow.h
+++ b/examples/widgets/widgets/tablet/mainwindow.h
@@ -79,6 +79,7 @@ private:
QActionGroup *alphaChannelGroup;
QAction *alphaChannelPressureAction;
+ QAction *alphaChannelTangentialPressureAction;
QAction *alphaChannelTiltAction;
QAction *noAlphaChannelAction;
diff --git a/examples/widgets/widgets/tablet/tablet.pro b/examples/widgets/widgets/tablet/tablet.pro
index de81e7b198..9b8927f483 100644
--- a/examples/widgets/widgets/tablet/tablet.pro
+++ b/examples/widgets/widgets/tablet/tablet.pro
@@ -1,12 +1,13 @@
QT += widgets
HEADERS = mainwindow.h \
- tabletcanvas.h \
- tabletapplication.h
+ tabletcanvas.h \
+ tabletapplication.h
SOURCES = mainwindow.cpp \
- main.cpp \
- tabletcanvas.cpp \
- tabletapplication.cpp
+ main.cpp \
+ tabletcanvas.cpp \
+ tabletapplication.cpp
+RESOURCES += images.qrc
# install
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/widgets/tablet
diff --git a/examples/widgets/widgets/tablet/tabletapplication.cpp b/examples/widgets/widgets/tablet/tabletapplication.cpp
index c3210f822c..3e1356ee9c 100644
--- a/examples/widgets/widgets/tablet/tabletapplication.cpp
+++ b/examples/widgets/widgets/tablet/tabletapplication.cpp
@@ -47,8 +47,7 @@ bool TabletApplication::event(QEvent *event)
{
if (event->type() == QEvent::TabletEnterProximity ||
event->type() == QEvent::TabletLeaveProximity) {
- myCanvas->setTabletDevice(
- static_cast<QTabletEvent *>(event)->device());
+ myCanvas->setTabletDevice(static_cast<QTabletEvent *>(event));
return true;
}
return QApplication::event(event);
diff --git a/examples/widgets/widgets/tablet/tabletcanvas.cpp b/examples/widgets/widgets/tablet/tabletcanvas.cpp
index 20d6291292..8ff3d41e0e 100644
--- a/examples/widgets/widgets/tablet/tabletcanvas.cpp
+++ b/examples/widgets/widgets/tablet/tabletcanvas.cpp
@@ -47,14 +47,13 @@
TabletCanvas::TabletCanvas()
{
resize(500, 500);
- myBrush = QBrush();
- myPen = QPen();
+ myColor = Qt::red;
+ myBrush = QBrush(myColor);
+ myPen = QPen(myBrush, 1.0, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin);
initPixmap();
setAutoFillBackground(true);
deviceDown = false;
- myColor = Qt::red;
- myTabletDevice = QTabletEvent::Stylus;
- alphaChannelType = NoAlpha;
+ alphaChannelType = AlphaTangentialPressure;
colorSaturationType = NoSaturation;
lineWidthType = LineWidthPressure;
}
@@ -99,24 +98,25 @@ void TabletCanvas::tabletEvent(QTabletEvent *event)
case QEvent::TabletPress:
if (!deviceDown) {
deviceDown = true;
- polyLine[0] = polyLine[1] = polyLine[2] = event->pos();
+ lastPoint.pos = event->posF();
+ lastPoint.rotation = event->rotation();
}
break;
- case QEvent::TabletRelease:
- if (deviceDown)
- deviceDown = false;
- break;
case QEvent::TabletMove:
- polyLine[2] = polyLine[1];
- polyLine[1] = polyLine[0];
- polyLine[0] = event->pos();
-
+ if (event->device() == QTabletEvent::RotationStylus)
+ updateCursor(event);
if (deviceDown) {
updateBrush(event);
QPainter painter(&pixmap);
paintPixmap(painter, event);
+ lastPoint.pos = event->posF();
+ lastPoint.rotation = event->rotation();
}
break;
+ case QEvent::TabletRelease:
+ if (deviceDown && event->buttons() == Qt::NoButton)
+ deviceDown = false;
+ break;
default:
break;
}
@@ -135,23 +135,44 @@ void TabletCanvas::paintEvent(QPaintEvent *)
//! [5]
void TabletCanvas::paintPixmap(QPainter &painter, QTabletEvent *event)
{
- QPoint brushAdjust(10, 10);
+ painter.setRenderHint(QPainter::Antialiasing);
- switch (myTabletDevice) {
+ switch (event->device()) {
+//! [6]
case QTabletEvent::Airbrush:
- myBrush.setColor(myColor);
- myBrush.setStyle(brushPattern(event->pressure()));
- painter.setPen(Qt::NoPen);
- painter.setBrush(myBrush);
-
- for (int i = 0; i < 3; ++i) {
- painter.drawEllipse(QRect(polyLine[i] - brushAdjust,
- polyLine[i] + brushAdjust));
+ {
+ painter.setPen(Qt::NoPen);
+ QRadialGradient grad(lastPoint.pos, myPen.widthF() * 10.0);
+ QColor color = myBrush.color();
+ color.setAlphaF(color.alphaF() * 0.25);
+ grad.setColorAt(0, myBrush.color());
+ grad.setColorAt(0.5, Qt::transparent);
+ painter.setBrush(grad);
+ qreal radius = grad.radius();
+ painter.drawEllipse(event->posF(), radius, radius);
+ }
+ break;
+ case QTabletEvent::RotationStylus:
+ {
+ myBrush.setStyle(Qt::SolidPattern);
+ painter.setPen(Qt::NoPen);
+ painter.setBrush(myBrush);
+ QPolygonF poly;
+ qreal halfWidth = myPen.widthF();
+ QPointF brushAdjust(qSin(qDegreesToRadians(lastPoint.rotation)) * halfWidth,
+ qCos(qDegreesToRadians(lastPoint.rotation)) * halfWidth);
+ poly << lastPoint.pos + brushAdjust;
+ poly << lastPoint.pos - brushAdjust;
+ brushAdjust = QPointF(qSin(qDegreesToRadians(event->rotation())) * halfWidth,
+ qCos(qDegreesToRadians(event->rotation())) * halfWidth);
+ poly << event->posF() - brushAdjust;
+ poly << event->posF() + brushAdjust;
+ painter.drawConvexPolygon(poly);
}
break;
+//! [6]
case QTabletEvent::Puck:
case QTabletEvent::FourDMouse:
- case QTabletEvent::RotationStylus:
{
const QString error(tr("This input device is not supported by the example."));
#ifndef QT_NO_STATUSTIP
@@ -174,42 +195,15 @@ void TabletCanvas::paintPixmap(QPainter &painter, QTabletEvent *event)
}
// FALL-THROUGH
case QTabletEvent::Stylus:
- painter.setBrush(myBrush);
painter.setPen(myPen);
- painter.drawLine(polyLine[1], event->pos());
+ painter.drawLine(lastPoint.pos, event->posF());
break;
}
}
//! [5]
-//! [6]
-Qt::BrushStyle TabletCanvas::brushPattern(qreal value)
-{
- int pattern = int((value) * 100.0) % 7;
-
- switch (pattern) {
- case 0:
- return Qt::SolidPattern;
- case 1:
- return Qt::Dense1Pattern;
- case 2:
- return Qt::Dense2Pattern;
- case 3:
- return Qt::Dense3Pattern;
- case 4:
- return Qt::Dense4Pattern;
- case 5:
- return Qt::Dense5Pattern;
- case 6:
- return Qt::Dense6Pattern;
- default:
- return Qt::Dense7Pattern;
- }
-}
-//! [6]
-
//! [7]
-void TabletCanvas::updateBrush(QTabletEvent *event)
+void TabletCanvas::updateBrush(const QTabletEvent *event)
{
int hue, saturation, value, alpha;
myColor.getHsv(&hue, &saturation, &value, &alpha);
@@ -220,7 +214,13 @@ void TabletCanvas::updateBrush(QTabletEvent *event)
switch (alphaChannelType) {
case AlphaPressure:
- myColor.setAlpha(int(event->pressure() * 255.0));
+ myColor.setAlphaF(event->pressure());
+ break;
+ case AlphaTangentialPressure:
+ if (event->device() == QTabletEvent::Airbrush)
+ myColor.setAlphaF(qMax(0.01, (event->tangentialPressure() + 1.0) / 2.0));
+ else
+ myColor.setAlpha(255);
break;
case AlphaTilt:
myColor.setAlpha(maximum(abs(vValue - 127), abs(hValue - 127)));
@@ -268,8 +268,47 @@ void TabletCanvas::updateBrush(QTabletEvent *event)
}
//! [11]
+void TabletCanvas::updateCursor(const QTabletEvent *event)
+{
+ QCursor cursor;
+ if (event->type() != QEvent::TabletLeaveProximity) {
+ if (event->pointerType() == QTabletEvent::Eraser) {
+ cursor = QCursor(QPixmap(":/images/cursor-eraser.png"), 3, 28);
+ } else {
+ switch (event->device()) {
+ case QTabletEvent::Stylus:
+ cursor = QCursor(QPixmap(":/images/cursor-pencil.png"), 0, 0);
+ break;
+ case QTabletEvent::Airbrush:
+ cursor = QCursor(QPixmap(":/images/cursor-airbrush.png"), 3, 4);
+ break;
+ case QTabletEvent::RotationStylus: {
+ QImage origImg(QLatin1String(":/images/cursor-felt-marker.png"));
+ QImage img(32, 32, QImage::Format_ARGB32);
+ QColor solid = myColor;
+ solid.setAlpha(255);
+ img.fill(solid);
+ QPainter painter(&img);
+ QTransform transform = painter.transform();
+ transform.translate(16, 16);
+ transform.rotate(-event->rotation());
+ painter.setTransform(transform);
+ painter.setCompositionMode(QPainter::CompositionMode_DestinationIn);
+ painter.drawImage(-24, -24, origImg);
+ painter.setCompositionMode(QPainter::CompositionMode_HardLight);
+ painter.drawImage(-24, -24, origImg);
+ painter.end();
+ cursor = QCursor(QPixmap::fromImage(img), 16, 16);
+ } break;
+ default:
+ break;
+ }
+ }
+ }
+ setCursor(cursor);
+}
+
void TabletCanvas::resizeEvent(QResizeEvent *)
{
initPixmap();
- polyLine[0] = polyLine[1] = polyLine[2] = QPoint();
}
diff --git a/examples/widgets/widgets/tablet/tabletcanvas.h b/examples/widgets/widgets/tablet/tabletcanvas.h
index 873f3a7ab0..a7335dbaf0 100644
--- a/examples/widgets/widgets/tablet/tabletcanvas.h
+++ b/examples/widgets/widgets/tablet/tabletcanvas.h
@@ -61,7 +61,7 @@ class TabletCanvas : public QWidget
Q_OBJECT
public:
- enum AlphaChannelType { AlphaPressure, AlphaTilt, NoAlpha };
+ enum AlphaChannelType { AlphaPressure, AlphaTangentialPressure, AlphaTilt, NoAlpha };
enum ColorSaturationType { SaturationVTilt, SaturationHTilt,
SaturationPressure, NoSaturation };
enum LineWidthType { LineWidthPressure, LineWidthTilt, NoLineWidth };
@@ -80,8 +80,8 @@ public:
{ myColor = color; }
QColor color() const
{ return myColor; }
- void setTabletDevice(QTabletEvent::TabletDevice device)
- { myTabletDevice = device; }
+ void setTabletDevice(QTabletEvent *event)
+ { myTabletDevice = event->device(); updateCursor(event); }
int maximum(int a, int b)
{ return a > b ? a : b; }
@@ -94,7 +94,8 @@ private:
void initPixmap();
void paintPixmap(QPainter &painter, QTabletEvent *event);
Qt::BrushStyle brushPattern(qreal value);
- void updateBrush(QTabletEvent *event);
+ void updateBrush(const QTabletEvent *event);
+ void updateCursor(const QTabletEvent *event);
AlphaChannelType alphaChannelType;
ColorSaturationType colorSaturationType;
@@ -107,7 +108,11 @@ private:
QBrush myBrush;
QPen myPen;
bool deviceDown;
- QPoint polyLine[3];
+
+ struct Point {
+ QPointF pos;
+ qreal rotation;
+ } lastPoint;
};
//! [0]
diff --git a/examples/xml/dombookmarks/dombookmarks.pro b/examples/xml/dombookmarks/dombookmarks.pro
index baf63fa191..0ab4f0266d 100644
--- a/examples/xml/dombookmarks/dombookmarks.pro
+++ b/examples/xml/dombookmarks/dombookmarks.pro
@@ -14,6 +14,6 @@ INSTALLS += target
wince {
addFiles.files = frank.xbel jennifer.xbel
addFiles.path = "\\My Documents"
- DEPLOYMENT += addFiles
+ INSTALLS += addFiles
}
diff --git a/examples/xml/htmlinfo/htmlinfo.pro b/examples/xml/htmlinfo/htmlinfo.pro
index c0b82965ee..8adaa780b8 100644
--- a/examples/xml/htmlinfo/htmlinfo.pro
+++ b/examples/xml/htmlinfo/htmlinfo.pro
@@ -9,7 +9,7 @@ win32: CONFIG += console
wince {
htmlfiles.files = *.html
htmlfiles.path = .
- DEPLOYMENT += htmlfiles
+ INSTALLS += htmlfiles
}
# install
diff --git a/examples/xml/htmlinfo/main.cpp b/examples/xml/htmlinfo/main.cpp
index 3869ca5472..1424cfca67 100644
--- a/examples/xml/htmlinfo/main.cpp
+++ b/examples/xml/htmlinfo/main.cpp
@@ -79,7 +79,7 @@ void parseHtmlFile(QTextStream &out, const QString &fileName) {
}
//! [2]
- out << " Title: \"" << title << "\"" << endl
+ out << " Title: \"" << title << '"' << endl
<< " Number of paragraphs: " << paragraphCount << endl
<< " Number of links: " << links.size() << endl
<< " Showing first few links:" << endl;
diff --git a/examples/xml/saxbookmarks/saxbookmarks.pro b/examples/xml/saxbookmarks/saxbookmarks.pro
index 353e1559cc..96a48ef5d4 100644
--- a/examples/xml/saxbookmarks/saxbookmarks.pro
+++ b/examples/xml/saxbookmarks/saxbookmarks.pro
@@ -16,5 +16,5 @@ INSTALLS += target
wince {
addFiles.files = frank.xbel jennifer.xbel
addFiles.path = "\\My Documents"
- DEPLOYMENT += addFiles
+ INSTALLS += addFiles
}
diff --git a/examples/xml/saxbookmarks/xbelgenerator.cpp b/examples/xml/saxbookmarks/xbelgenerator.cpp
index 24612c132c..5f1ec62e7e 100644
--- a/examples/xml/saxbookmarks/xbelgenerator.cpp
+++ b/examples/xml/saxbookmarks/xbelgenerator.cpp
@@ -81,8 +81,8 @@ QString XbelGenerator::escapedAttribute(const QString &str)
{
QString result = escapedText(str);
result.replace("\"", "&quot;");
- result.prepend("\"");
- result.append("\"");
+ result.prepend(QLatin1Char('"'));
+ result.append(QLatin1Char('"'));
return result;
}