summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/CMakeLists.txt54
-rw-r--r--examples/corelib/CMakeLists.txt10
-rw-r--r--examples/corelib/ipc/CMakeLists.txt14
-rw-r--r--examples/corelib/ipc/localfortuneclient/CMakeLists.txt34
-rw-r--r--examples/corelib/ipc/localfortuneserver/CMakeLists.txt34
-rw-r--r--examples/corelib/ipc/sharedmemory/CMakeLists.txt32
-rw-r--r--examples/corelib/mimetypes/CMakeLists.txt6
-rw-r--r--examples/corelib/mimetypes/mimetypebrowser/CMakeLists.txt33
-rw-r--r--examples/corelib/serialization/CMakeLists.txt5
-rw-r--r--examples/corelib/serialization/cbordump/CMakeLists.txt27
-rw-r--r--examples/corelib/serialization/convert/CMakeLists.txt34
-rw-r--r--examples/corelib/serialization/savegame/CMakeLists.txt30
-rw-r--r--examples/corelib/threads/CMakeLists.txt9
-rw-r--r--examples/corelib/threads/mandelbrot/CMakeLists.txt39
-rw-r--r--examples/corelib/threads/queuedcustomtype/CMakeLists.txt34
-rw-r--r--examples/corelib/threads/semaphores/CMakeLists.txt27
-rw-r--r--examples/corelib/threads/waitconditions/CMakeLists.txt27
-rw-r--r--examples/corelib/tools/CMakeLists.txt5
-rw-r--r--examples/corelib/tools/contiguouscache/CMakeLists.txt32
-rw-r--r--examples/corelib/tools/customtype/CMakeLists.txt32
-rw-r--r--examples/corelib/tools/customtypesending/CMakeLists.txt33
-rw-r--r--examples/dbus/CMakeLists.txt13
-rw-r--r--examples/dbus/chat/.prev_CMakeLists.txt35
-rw-r--r--examples/dbus/chat/CMakeLists.txt49
-rw-r--r--examples/dbus/complexpingpong/CMakeLists.txt27
-rw-r--r--examples/dbus/listnames/CMakeLists.txt29
-rw-r--r--examples/dbus/pingpong/CMakeLists.txt28
-rw-r--r--examples/dbus/remotecontrolledcar/CMakeLists.txt4
-rw-r--r--examples/dbus/remotecontrolledcar/car/.prev_CMakeLists.txt34
-rw-r--r--examples/dbus/remotecontrolledcar/car/CMakeLists.txt44
-rw-r--r--examples/dbus/remotecontrolledcar/controller/.prev_CMakeLists.txt34
-rw-r--r--examples/dbus/remotecontrolledcar/controller/CMakeLists.txt42
-rw-r--r--examples/embedded/CMakeLists.txt8
-rw-r--r--examples/embedded/digiflip/CMakeLists.txt31
-rw-r--r--examples/embedded/flickable/CMakeLists.txt32
-rw-r--r--examples/embedded/flightinfo/.prev_CMakeLists.txt47
-rw-r--r--examples/embedded/flightinfo/CMakeLists.txt47
-rw-r--r--examples/embedded/lightmaps/CMakeLists.txt36
-rw-r--r--examples/embedded/raycasting/CMakeLists.txt44
-rw-r--r--examples/embedded/styleexample/.prev_CMakeLists.txt52
-rw-r--r--examples/embedded/styleexample/CMakeLists.txt52
-rw-r--r--examples/gui/CMakeLists.txt7
-rw-r--r--examples/gui/analogclock/.prev_CMakeLists.txt34
-rw-r--r--examples/gui/analogclock/CMakeLists.txt41
-rw-r--r--examples/gui/gui.pro2
-rw-r--r--examples/gui/rasterwindow/.prev_CMakeLists.txt34
-rw-r--r--examples/gui/rasterwindow/CMakeLists.txt35
-rw-r--r--examples/network/CMakeLists.txt44
-rw-r--r--examples/network/blockingfortuneclient/CMakeLists.txt35
-rw-r--r--examples/network/broadcastreceiver/CMakeLists.txt34
-rw-r--r--examples/network/broadcastsender/CMakeLists.txt34
-rw-r--r--examples/network/dnslookup/CMakeLists.txt29
-rw-r--r--examples/network/download/CMakeLists.txt29
-rw-r--r--examples/network/downloadmanager/CMakeLists.txt31
-rw-r--r--examples/network/fortuneclient/CMakeLists.txt34
-rw-r--r--examples/network/fortuneserver/CMakeLists.txt34
-rw-r--r--examples/network/googlesuggest/CMakeLists.txt35
-rw-r--r--examples/network/http/CMakeLists.txt45
-rw-r--r--examples/network/loopback/CMakeLists.txt34
-rw-r--r--examples/network/multicastreceiver/CMakeLists.txt34
-rw-r--r--examples/network/multicastsender/CMakeLists.txt34
-rw-r--r--examples/network/multicastsender/sender.cpp2
-rw-r--r--examples/network/multistreamclient/CMakeLists.txt38
-rw-r--r--examples/network/multistreamserver/CMakeLists.txt38
-rw-r--r--examples/network/network-chat/CMakeLists.txt38
-rw-r--r--examples/network/securesocketclient/CMakeLists.txt49
-rw-r--r--examples/network/securesocketclient/certificateinfo.cpp2
-rw-r--r--examples/network/secureudpclient/CMakeLists.txt36
-rw-r--r--examples/network/secureudpserver/CMakeLists.txt36
-rw-r--r--examples/network/threadedfortuneserver/CMakeLists.txt36
-rw-r--r--examples/network/torrent/.prev_CMakeLists.txt65
-rw-r--r--examples/network/torrent/CMakeLists.txt66
-rw-r--r--examples/opengl/2dpainting/2dpainting.pro2
-rw-r--r--examples/opengl/2dpainting/CMakeLists.txt39
-rw-r--r--examples/opengl/CMakeLists.txt17
-rw-r--r--examples/opengl/computegles31/CMakeLists.txt45
-rw-r--r--examples/opengl/computegles31/computegles31.pro2
-rw-r--r--examples/opengl/contextinfo/CMakeLists.txt35
-rw-r--r--examples/opengl/contextinfo/contextinfo.pro2
-rw-r--r--examples/opengl/contextinfo/renderwindow.cpp2
-rw-r--r--examples/opengl/cube/CMakeLists.txt61
-rw-r--r--examples/opengl/cube/cube.pro2
-rw-r--r--examples/opengl/doc/src/2dpainting.qdoc27
-rw-r--r--examples/opengl/doc/src/cube.qdoc10
-rw-r--r--examples/opengl/hellogl2/CMakeLists.txt39
-rw-r--r--examples/opengl/hellogl2/hellogl2.pro2
-rw-r--r--examples/opengl/hellogles3/CMakeLists.txt46
-rw-r--r--examples/opengl/hellogles3/hellogles3.pro2
-rw-r--r--examples/opengl/hellowindow/CMakeLists.txt34
-rw-r--r--examples/opengl/hellowindow/hellowindow.h2
-rw-r--r--examples/opengl/hellowindow/hellowindow.pro2
-rw-r--r--examples/opengl/legacy/README4
-rw-r--r--examples/opengl/legacy/framebufferobject2/cubelogo.pngbin2884 -> 0 bytes
-rw-r--r--examples/opengl/legacy/framebufferobject2/framebufferobject2.pro11
-rw-r--r--examples/opengl/legacy/framebufferobject2/framebufferobject2.qrc5
-rw-r--r--examples/opengl/legacy/framebufferobject2/glwidget.cpp257
-rw-r--r--examples/opengl/legacy/framebufferobject2/glwidget.h75
-rw-r--r--examples/opengl/legacy/framebufferobject2/main.cpp71
-rw-r--r--examples/opengl/legacy/grabber/glwidget.cpp286
-rw-r--r--examples/opengl/legacy/grabber/glwidget.h107
-rw-r--r--examples/opengl/legacy/grabber/grabber.pro12
-rw-r--r--examples/opengl/legacy/grabber/main.cpp61
-rw-r--r--examples/opengl/legacy/grabber/mainwindow.cpp216
-rw-r--r--examples/opengl/legacy/grabber/mainwindow.h104
-rw-r--r--examples/opengl/legacy/hellogl/glwidget.cpp207
-rw-r--r--examples/opengl/legacy/hellogl/glwidget.h105
-rw-r--r--examples/opengl/legacy/hellogl/hellogl.pro17
-rw-r--r--examples/opengl/legacy/hellogl/main.cpp69
-rw-r--r--examples/opengl/legacy/hellogl/window.cpp107
-rw-r--r--examples/opengl/legacy/hellogl/window.h82
-rw-r--r--examples/opengl/legacy/legacy.pro16
-rw-r--r--examples/opengl/legacy/overpainting/bubble.cpp122
-rw-r--r--examples/opengl/legacy/overpainting/bubble.h77
-rw-r--r--examples/opengl/legacy/overpainting/glwidget.cpp293
-rw-r--r--examples/opengl/legacy/overpainting/glwidget.h114
-rw-r--r--examples/opengl/legacy/overpainting/main.cpp61
-rw-r--r--examples/opengl/legacy/overpainting/overpainting.pro19
-rw-r--r--examples/opengl/legacy/pbuffers/cube.cpp338
-rw-r--r--examples/opengl/legacy/pbuffers/cube.h159
-rw-r--r--examples/opengl/legacy/pbuffers/cubelogo.pngbin2884 -> 0 bytes
-rw-r--r--examples/opengl/legacy/pbuffers/glwidget.cpp256
-rw-r--r--examples/opengl/legacy/pbuffers/glwidget.h99
-rw-r--r--examples/opengl/legacy/pbuffers/main.cpp75
-rw-r--r--examples/opengl/legacy/pbuffers/pbuffers.pro13
-rw-r--r--examples/opengl/legacy/pbuffers/pbuffers.qrc5
-rw-r--r--examples/opengl/legacy/pbuffers2/bubbles.svg215
-rw-r--r--examples/opengl/legacy/pbuffers2/designer.pngbin2810 -> 0 bytes
-rw-r--r--examples/opengl/legacy/pbuffers2/glwidget.cpp328
-rw-r--r--examples/opengl/legacy/pbuffers2/glwidget.h94
-rw-r--r--examples/opengl/legacy/pbuffers2/main.cpp71
-rw-r--r--examples/opengl/legacy/pbuffers2/pbuffers2.pro11
-rw-r--r--examples/opengl/legacy/pbuffers2/pbuffers2.qrc6
-rw-r--r--examples/opengl/legacy/samplebuffers/glwidget.cpp174
-rw-r--r--examples/opengl/legacy/samplebuffers/glwidget.h71
-rw-r--r--examples/opengl/legacy/samplebuffers/main.cpp81
-rw-r--r--examples/opengl/legacy/samplebuffers/samplebuffers.pro10
-rw-r--r--examples/opengl/legacy/shared/qtlogo.cpp398
-rw-r--r--examples/opengl/legacy/shared/qtlogo.h78
-rw-r--r--examples/opengl/opengl.pro4
-rw-r--r--examples/opengl/openglwindow/.prev_CMakeLists.txt36
-rw-r--r--examples/opengl/openglwindow/CMakeLists.txt36
-rw-r--r--examples/opengl/openglwindow/main.cpp (renamed from examples/gui/openglwindow/main.cpp)0
-rw-r--r--examples/opengl/openglwindow/openglwindow.cpp (renamed from examples/gui/openglwindow/openglwindow.cpp)0
-rw-r--r--examples/opengl/openglwindow/openglwindow.h (renamed from examples/gui/openglwindow/openglwindow.h)0
-rw-r--r--examples/opengl/openglwindow/openglwindow.pri (renamed from examples/gui/openglwindow/openglwindow.pri)1
-rw-r--r--examples/opengl/openglwindow/openglwindow.pro (renamed from examples/gui/openglwindow/openglwindow.pro)2
-rw-r--r--examples/opengl/paintedwindow/CMakeLists.txt32
-rw-r--r--examples/opengl/paintedwindow/paintedwindow.h4
-rw-r--r--examples/opengl/paintedwindow/paintedwindow.pro2
-rw-r--r--examples/opengl/qopenglwidget/CMakeLists.txt51
-rw-r--r--examples/opengl/qopenglwidget/mainwindow.cpp2
-rw-r--r--examples/opengl/qopenglwidget/qopenglwidget.pro2
-rw-r--r--examples/opengl/qopenglwindow/CMakeLists.txt49
-rw-r--r--examples/opengl/qopenglwindow/qopenglwindow.pro1
-rw-r--r--examples/opengl/textures/CMakeLists.txt55
-rw-r--r--examples/opengl/textures/textures.pro2
-rw-r--r--examples/opengl/threadedqopenglwidget/CMakeLists.txt37
-rw-r--r--examples/opengl/threadedqopenglwidget/threadedqopenglwidget.pro2
-rw-r--r--examples/qpa/CMakeLists.txt4
-rw-r--r--examples/qpa/qrasterwindow/.prev_CMakeLists.txt29
-rw-r--r--examples/qpa/qrasterwindow/CMakeLists.txt29
-rw-r--r--examples/qpa/windows/CMakeLists.txt32
-rw-r--r--examples/qtconcurrent/CMakeLists.txt9
-rw-r--r--examples/qtconcurrent/imagescaling/CMakeLists.txt34
-rw-r--r--examples/qtconcurrent/map/.prev_CMakeLists.txt31
-rw-r--r--examples/qtconcurrent/map/CMakeLists.txt30
-rw-r--r--examples/qtconcurrent/progressdialog/CMakeLists.txt33
-rw-r--r--examples/qtconcurrent/runfunction/CMakeLists.txt33
-rw-r--r--examples/qtconcurrent/wordcount/CMakeLists.txt33
-rw-r--r--examples/qtestlib/CMakeLists.txt7
-rw-r--r--examples/qtestlib/tutorial1/CMakeLists.txt33
-rw-r--r--examples/qtestlib/tutorial2/CMakeLists.txt33
-rw-r--r--examples/qtestlib/tutorial3/CMakeLists.txt33
-rw-r--r--examples/qtestlib/tutorial4/CMakeLists.txt33
-rw-r--r--examples/qtestlib/tutorial5/CMakeLists.txt33
-rw-r--r--examples/sql/CMakeLists.txt17
-rw-r--r--examples/sql/books/CMakeLists.txt53
-rw-r--r--examples/sql/cachedtable/CMakeLists.txt35
-rw-r--r--examples/sql/drilldown/CMakeLists.txt53
-rw-r--r--examples/sql/drilldown/informationwindow.cpp2
-rw-r--r--examples/sql/masterdetail/CMakeLists.txt52
-rw-r--r--examples/sql/masterdetail/mainwindow.cpp2
-rw-r--r--examples/sql/querymodel/CMakeLists.txt36
-rw-r--r--examples/sql/relationaltablemodel/CMakeLists.txt34
-rw-r--r--examples/sql/sqlbrowser/CMakeLists.txt37
-rw-r--r--examples/sql/sqlbrowser/qsqlconnectiondialog.cpp7
-rw-r--r--examples/sql/sqlwidgetmapper/CMakeLists.txt34
-rw-r--r--examples/sql/tablemodel/CMakeLists.txt34
-rw-r--r--examples/vulkan/CMakeLists.txt11
-rw-r--r--examples/vulkan/hellovulkancubes/CMakeLists.txt63
-rw-r--r--examples/vulkan/hellovulkantexture/CMakeLists.txt45
-rw-r--r--examples/vulkan/hellovulkantriangle/CMakeLists.txt50
-rw-r--r--examples/vulkan/hellovulkanwidget/CMakeLists.txt53
-rw-r--r--examples/vulkan/hellovulkanwindow/CMakeLists.txt30
-rw-r--r--examples/widgets/CMakeLists.txt33
-rw-r--r--examples/widgets/animation/CMakeLists.txt8
-rw-r--r--examples/widgets/animation/animatedtiles/CMakeLists.txt50
-rw-r--r--examples/widgets/animation/easing/CMakeLists.txt47
-rw-r--r--examples/widgets/animation/easing/window.cpp8
-rw-r--r--examples/widgets/animation/moveblocks/CMakeLists.txt31
-rw-r--r--examples/widgets/animation/states/CMakeLists.txt49
-rw-r--r--examples/widgets/animation/stickman/CMakeLists.txt53
-rw-r--r--examples/widgets/animation/sub-attaq/.prev_CMakeLists.txt192
-rw-r--r--examples/widgets/animation/sub-attaq/CMakeLists.txt193
-rw-r--r--examples/widgets/animation/sub-attaq/mainwindow.cpp13
-rw-r--r--examples/widgets/animation/sub-attaq/sub-attaq.pro1
-rw-r--r--examples/widgets/desktop/CMakeLists.txt4
-rw-r--r--examples/widgets/desktop/screenshot/CMakeLists.txt32
-rw-r--r--examples/widgets/desktop/screenshot/screenshot.cpp2
-rw-r--r--examples/widgets/desktop/systray/CMakeLists.txt47
-rw-r--r--examples/widgets/desktop/systray/window.cpp2
-rw-r--r--examples/widgets/dialogs/CMakeLists.txt14
-rw-r--r--examples/widgets/dialogs/classwizard/CMakeLists.txt51
-rw-r--r--examples/widgets/dialogs/extension/CMakeLists.txt32
-rw-r--r--examples/widgets/dialogs/findfiles/CMakeLists.txt32
-rw-r--r--examples/widgets/dialogs/licensewizard/CMakeLists.txt48
-rw-r--r--examples/widgets/dialogs/standarddialogs/CMakeLists.txt32
-rw-r--r--examples/widgets/dialogs/tabdialog/CMakeLists.txt32
-rw-r--r--examples/widgets/dialogs/trivialwizard/CMakeLists.txt31
-rw-r--r--examples/widgets/doc/src/padnavigator.qdoc2
-rw-r--r--examples/widgets/draganddrop/CMakeLists.txt7
-rw-r--r--examples/widgets/draganddrop/draggableicons/CMakeLists.txt47
-rw-r--r--examples/widgets/draganddrop/draggabletext/CMakeLists.txt45
-rw-r--r--examples/widgets/draganddrop/dropsite/CMakeLists.txt33
-rw-r--r--examples/widgets/draganddrop/fridgemagnets/CMakeLists.txt46
-rw-r--r--examples/widgets/draganddrop/puzzle/.prev_CMakeLists.txt47
-rw-r--r--examples/widgets/draganddrop/puzzle/CMakeLists.txt47
-rw-r--r--examples/widgets/effects/CMakeLists.txt4
-rw-r--r--examples/widgets/effects/blurpicker/CMakeLists.txt54
-rw-r--r--examples/widgets/effects/fademessage/CMakeLists.txt45
-rw-r--r--examples/widgets/gestures/CMakeLists.txt3
-rw-r--r--examples/widgets/gestures/imagegestures/CMakeLists.txt33
-rw-r--r--examples/widgets/graphicsview/CMakeLists.txt16
-rw-r--r--examples/widgets/graphicsview/anchorlayout/CMakeLists.txt31
-rw-r--r--examples/widgets/graphicsview/basicgraphicslayouts/CMakeLists.txt46
-rw-r--r--examples/widgets/graphicsview/boxes/3rdparty/fbm.c207
-rw-r--r--examples/widgets/graphicsview/boxes/3rdparty/fbm.h40
-rw-r--r--examples/widgets/graphicsview/boxes/basic.fsh82
-rw-r--r--examples/widgets/graphicsview/boxes/basic.vsh70
-rw-r--r--examples/widgets/graphicsview/boxes/boxes.pro27
-rw-r--r--examples/widgets/graphicsview/boxes/boxes.qrc25
-rw-r--r--examples/widgets/graphicsview/boxes/cubemap_negx.jpgbin41060 -> 0 bytes
-rw-r--r--examples/widgets/graphicsview/boxes/cubemap_negy.jpgbin15520 -> 0 bytes
-rw-r--r--examples/widgets/graphicsview/boxes/cubemap_negz.jpgbin68911 -> 0 bytes
-rw-r--r--examples/widgets/graphicsview/boxes/cubemap_posx.jpgbin74915 -> 0 bytes
-rw-r--r--examples/widgets/graphicsview/boxes/cubemap_posy.jpgbin24193 -> 0 bytes
-rw-r--r--examples/widgets/graphicsview/boxes/cubemap_posz.jpgbin57881 -> 0 bytes
-rw-r--r--examples/widgets/graphicsview/boxes/dotted.fsh75
-rw-r--r--examples/widgets/graphicsview/boxes/fresnel.fsh88
-rw-r--r--examples/widgets/graphicsview/boxes/glass.fsh85
-rw-r--r--examples/widgets/graphicsview/boxes/glbuffers.cpp406
-rw-r--r--examples/widgets/graphicsview/boxes/glbuffers.h372
-rw-r--r--examples/widgets/graphicsview/boxes/glextensions.cpp107
-rw-r--r--examples/widgets/graphicsview/boxes/glextensions.h204
-rw-r--r--examples/widgets/graphicsview/boxes/gltrianglemesh.h99
-rw-r--r--examples/widgets/graphicsview/boxes/granite.fsh85
-rw-r--r--examples/widgets/graphicsview/boxes/main.cpp157
-rw-r--r--examples/widgets/graphicsview/boxes/marble.fsh80
-rw-r--r--examples/widgets/graphicsview/boxes/parameters.par5
-rw-r--r--examples/widgets/graphicsview/boxes/qt-logo.jpgbin20316 -> 0 bytes
-rw-r--r--examples/widgets/graphicsview/boxes/qt-logo.pngbin12167 -> 0 bytes
-rw-r--r--examples/widgets/graphicsview/boxes/qtbox.cpp470
-rw-r--r--examples/widgets/graphicsview/boxes/qtbox.h126
-rw-r--r--examples/widgets/graphicsview/boxes/reflection.fsh63
-rw-r--r--examples/widgets/graphicsview/boxes/refraction.fsh79
-rw-r--r--examples/widgets/graphicsview/boxes/roundedbox.cpp170
-rw-r--r--examples/widgets/graphicsview/boxes/roundedbox.h77
-rw-r--r--examples/widgets/graphicsview/boxes/scene.cpp1028
-rw-r--r--examples/widgets/graphicsview/boxes/scene.h246
-rw-r--r--examples/widgets/graphicsview/boxes/smiley.pngbin14508 -> 0 bytes
-rw-r--r--examples/widgets/graphicsview/boxes/square.jpgbin14542 -> 0 bytes
-rw-r--r--examples/widgets/graphicsview/boxes/trackball.cpp159
-rw-r--r--examples/widgets/graphicsview/boxes/trackball.h87
-rw-r--r--examples/widgets/graphicsview/boxes/wood.fsh79
-rw-r--r--examples/widgets/graphicsview/chip/.prev_CMakeLists.txt58
-rw-r--r--examples/widgets/graphicsview/chip/CMakeLists.txt60
-rw-r--r--examples/widgets/graphicsview/chip/chip.pro1
-rw-r--r--examples/widgets/graphicsview/chip/view.cpp21
-rw-r--r--examples/widgets/graphicsview/chip/view.h2
-rw-r--r--examples/widgets/graphicsview/collidingmice/CMakeLists.txt45
-rw-r--r--examples/widgets/graphicsview/diagramscene/CMakeLists.txt63
-rw-r--r--examples/widgets/graphicsview/dragdroprobot/CMakeLists.txt46
-rw-r--r--examples/widgets/graphicsview/elasticnodes/CMakeLists.txt34
-rw-r--r--examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt46
-rw-r--r--examples/widgets/graphicsview/embeddeddialogs/embeddeddialog.cpp2
-rw-r--r--examples/widgets/graphicsview/flowlayout/.prev_CMakeLists.txt33
-rw-r--r--examples/widgets/graphicsview/flowlayout/CMakeLists.txt33
-rw-r--r--examples/widgets/graphicsview/graphicsview.pro4
-rw-r--r--examples/widgets/graphicsview/padnavigator/.prev_CMakeLists.txt64
-rw-r--r--examples/widgets/graphicsview/padnavigator/CMakeLists.txt65
-rw-r--r--examples/widgets/graphicsview/padnavigator/padnavigator.pro2
-rw-r--r--examples/widgets/graphicsview/simpleanchorlayout/CMakeLists.txt31
-rw-r--r--examples/widgets/graphicsview/weatheranchorlayout/CMakeLists.txt49
-rw-r--r--examples/widgets/itemviews/CMakeLists.txt27
-rw-r--r--examples/widgets/itemviews/addressbook/CMakeLists.txt36
-rw-r--r--examples/widgets/itemviews/basicsortfiltermodel/CMakeLists.txt32
-rw-r--r--examples/widgets/itemviews/basicsortfiltermodel/window.cpp4
-rw-r--r--examples/widgets/itemviews/chart/CMakeLists.txt52
-rw-r--r--examples/widgets/itemviews/coloreditorfactory/CMakeLists.txt33
-rw-r--r--examples/widgets/itemviews/combowidgetmapper/CMakeLists.txt32
-rw-r--r--examples/widgets/itemviews/customsortfiltermodel/CMakeLists.txt47
-rw-r--r--examples/widgets/itemviews/dirview/CMakeLists.txt31
-rw-r--r--examples/widgets/itemviews/editabletreemodel/CMakeLists.txt47
-rw-r--r--examples/widgets/itemviews/fetchmore/CMakeLists.txt33
-rw-r--r--examples/widgets/itemviews/flattreeview/CMakeLists.txt31
-rw-r--r--examples/widgets/itemviews/frozencolumn/CMakeLists.txt45
-rw-r--r--examples/widgets/itemviews/interview/CMakeLists.txt47
-rw-r--r--examples/widgets/itemviews/pixelator/.prev_CMakeLists.txt53
-rw-r--r--examples/widgets/itemviews/pixelator/CMakeLists.txt54
-rw-r--r--examples/widgets/itemviews/pixelator/mainwindow.cpp4
-rw-r--r--examples/widgets/itemviews/puzzle/.prev_CMakeLists.txt47
-rw-r--r--examples/widgets/itemviews/puzzle/CMakeLists.txt47
-rw-r--r--examples/widgets/itemviews/simpledommodel/CMakeLists.txt36
-rw-r--r--examples/widgets/itemviews/simpletreemodel/CMakeLists.txt46
-rw-r--r--examples/widgets/itemviews/simplewidgetmapper/CMakeLists.txt32
-rw-r--r--examples/widgets/itemviews/spinboxdelegate/CMakeLists.txt32
-rw-r--r--examples/widgets/itemviews/spreadsheet/.prev_CMakeLists.txt54
-rw-r--r--examples/widgets/itemviews/spreadsheet/CMakeLists.txt60
-rw-r--r--examples/widgets/itemviews/stardelegate/CMakeLists.txt34
-rw-r--r--examples/widgets/itemviews/storageview/CMakeLists.txt32
-rw-r--r--examples/widgets/layouts/CMakeLists.txt6
-rw-r--r--examples/widgets/layouts/basiclayouts/CMakeLists.txt32
-rw-r--r--examples/widgets/layouts/borderlayout/CMakeLists.txt33
-rw-r--r--examples/widgets/layouts/dynamiclayouts/CMakeLists.txt32
-rw-r--r--examples/widgets/layouts/dynamiclayouts/dialog.cpp2
-rw-r--r--examples/widgets/layouts/flowlayout/CMakeLists.txt33
-rw-r--r--examples/widgets/mac/CMakeLists.txt7
-rw-r--r--examples/widgets/mac/qmaccocoaviewcontainer/CMakeLists.txt32
-rw-r--r--examples/widgets/mac/qmacnativewidget/CMakeLists.txt32
-rw-r--r--examples/widgets/mainwindows/CMakeLists.txt8
-rw-r--r--examples/widgets/mainwindows/application/CMakeLists.txt50
-rw-r--r--examples/widgets/mainwindows/dockwidgets/.prev_CMakeLists.txt54
-rw-r--r--examples/widgets/mainwindows/dockwidgets/CMakeLists.txt60
-rw-r--r--examples/widgets/mainwindows/mainwindow/CMakeLists.txt50
-rw-r--r--examples/widgets/mainwindows/mdi/CMakeLists.txt51
-rw-r--r--examples/widgets/mainwindows/menus/CMakeLists.txt32
-rw-r--r--examples/widgets/mainwindows/sdi/CMakeLists.txt50
-rw-r--r--examples/widgets/painting/CMakeLists.txt14
-rw-r--r--examples/widgets/painting/affine/.prev_CMakeLists.txt215
-rw-r--r--examples/widgets/painting/affine/CMakeLists.txt214
-rw-r--r--examples/widgets/painting/basicdrawing/CMakeLists.txt47
-rw-r--r--examples/widgets/painting/basicdrawing/window.cpp12
-rw-r--r--examples/widgets/painting/composition/.prev_CMakeLists.txt216
-rw-r--r--examples/widgets/painting/composition/CMakeLists.txt215
-rw-r--r--examples/widgets/painting/concentriccircles/CMakeLists.txt33
-rw-r--r--examples/widgets/painting/deform/.prev_CMakeLists.txt214
-rw-r--r--examples/widgets/painting/deform/CMakeLists.txt213
-rw-r--r--examples/widgets/painting/fontsampler/CMakeLists.txt39
-rw-r--r--examples/widgets/painting/gradients/.prev_CMakeLists.txt214
-rw-r--r--examples/widgets/painting/gradients/CMakeLists.txt213
-rw-r--r--examples/widgets/painting/imagecomposition/CMakeLists.txt46
-rw-r--r--examples/widgets/painting/imagecomposition/imagecomposer.cpp2
-rw-r--r--examples/widgets/painting/painterpaths/CMakeLists.txt39
-rw-r--r--examples/widgets/painting/painterpaths/window.cpp12
-rw-r--r--examples/widgets/painting/pathstroke/CMakeLists.txt214
-rw-r--r--examples/widgets/painting/shared/CMakeLists.txt24
-rw-r--r--examples/widgets/painting/shared/arthurwidgets.cpp6
-rw-r--r--examples/widgets/painting/shared/hoverpoints.cpp4
-rw-r--r--examples/widgets/painting/shared/shared.pri1
-rw-r--r--examples/widgets/painting/transformations/CMakeLists.txt33
-rw-r--r--examples/widgets/painting/transformations/window.cpp4
-rw-r--r--examples/widgets/richtext/CMakeLists.txt6
-rw-r--r--examples/widgets/richtext/calendar/CMakeLists.txt32
-rw-r--r--examples/widgets/richtext/calendar/mainwindow.cpp4
-rw-r--r--examples/widgets/richtext/orderform/CMakeLists.txt39
-rw-r--r--examples/widgets/richtext/syntaxhighlighter/CMakeLists.txt33
-rw-r--r--examples/widgets/richtext/textedit/.prev_CMakeLists.txt98
-rw-r--r--examples/widgets/richtext/textedit/CMakeLists.txt104
-rw-r--r--examples/widgets/richtext/textedit/textedit.cpp2
-rw-r--r--examples/widgets/scroller/CMakeLists.txt3
-rw-r--r--examples/widgets/scroller/graphicsview/CMakeLists.txt31
-rw-r--r--examples/widgets/statemachine/CMakeLists.txt11
-rw-r--r--examples/widgets/statemachine/eventtransitions/CMakeLists.txt31
-rw-r--r--examples/widgets/statemachine/factorial/CMakeLists.txt27
-rw-r--r--examples/widgets/statemachine/pingpong/CMakeLists.txt27
-rw-r--r--examples/widgets/statemachine/rogue/CMakeLists.txt33
-rw-r--r--examples/widgets/statemachine/trafficlight/CMakeLists.txt31
-rw-r--r--examples/widgets/statemachine/twowaybutton/CMakeLists.txt31
-rw-r--r--examples/widgets/tools/CMakeLists.txt22
-rw-r--r--examples/widgets/tools/codecs/CMakeLists.txt47
-rw-r--r--examples/widgets/tools/codecs/previewform.cpp2
-rw-r--r--examples/widgets/tools/completer/CMakeLists.txt47
-rw-r--r--examples/widgets/tools/completer/mainwindow.cpp8
-rw-r--r--examples/widgets/tools/customcompleter/CMakeLists.txt46
-rw-r--r--examples/widgets/tools/echoplugin/CMakeLists.txt4
-rw-r--r--examples/widgets/tools/echoplugin/echowindow/.prev_CMakeLists.txt33
-rw-r--r--examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt33
-rw-r--r--examples/widgets/tools/echoplugin/plugin/.prev_CMakeLists.txt35
-rw-r--r--examples/widgets/tools/echoplugin/plugin/CMakeLists.txt35
-rw-r--r--examples/widgets/tools/i18n/CMakeLists.txt59
-rw-r--r--examples/widgets/tools/plugandpaint/CMakeLists.txt4
-rw-r--r--examples/widgets/tools/plugandpaint/app/.prev_CMakeLists.txt66
-rw-r--r--examples/widgets/tools/plugandpaint/app/CMakeLists.txt68
-rw-r--r--examples/widgets/tools/plugandpaint/plugins/CMakeLists.txt4
-rw-r--r--examples/widgets/tools/plugandpaint/plugins/basictools/.prev_CMakeLists.txt35
-rw-r--r--examples/widgets/tools/plugandpaint/plugins/basictools/CMakeLists.txt35
-rw-r--r--examples/widgets/tools/plugandpaint/plugins/extrafilters/.prev_CMakeLists.txt35
-rw-r--r--examples/widgets/tools/plugandpaint/plugins/extrafilters/CMakeLists.txt35
-rw-r--r--examples/widgets/tools/regexp/CMakeLists.txt32
-rw-r--r--examples/widgets/tools/regexp/regexpdialog.cpp2
-rw-r--r--examples/widgets/tools/regularexpression/CMakeLists.txt45
-rw-r--r--examples/widgets/tools/regularexpression/regularexpressiondialog.cpp4
-rw-r--r--examples/widgets/tools/settingseditor/CMakeLists.txt35
-rw-r--r--examples/widgets/tools/settingseditor/locationdialog.cpp6
-rw-r--r--examples/widgets/tools/styleplugin/CMakeLists.txt19
-rw-r--r--examples/widgets/tools/styleplugin/plugin/.prev_CMakeLists.txt32
-rw-r--r--examples/widgets/tools/styleplugin/plugin/CMakeLists.txt32
-rw-r--r--examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt32
-rw-r--r--examples/widgets/tools/treemodelcompleter/CMakeLists.txt46
-rw-r--r--examples/widgets/tools/treemodelcompleter/mainwindow.cpp4
-rw-r--r--examples/widgets/tools/undo/CMakeLists.txt62
-rw-r--r--examples/widgets/tools/undo/mainwindow.cpp2
-rw-r--r--examples/widgets/tools/undoframework/CMakeLists.txt48
-rw-r--r--examples/widgets/touch/CMakeLists.txt6
-rw-r--r--examples/widgets/touch/dials/CMakeLists.txt32
-rw-r--r--examples/widgets/touch/fingerpaint/.prev_CMakeLists.txt39
-rw-r--r--examples/widgets/touch/fingerpaint/CMakeLists.txt45
-rw-r--r--examples/widgets/touch/knobs/CMakeLists.txt32
-rw-r--r--examples/widgets/touch/pinchzoom/CMakeLists.txt46
-rw-r--r--examples/widgets/tutorials/CMakeLists.txt7
-rw-r--r--examples/widgets/tutorials/addressbook/CMakeLists.txt9
-rw-r--r--examples/widgets/tutorials/addressbook/part1/CMakeLists.txt32
-rw-r--r--examples/widgets/tutorials/addressbook/part2/CMakeLists.txt32
-rw-r--r--examples/widgets/tutorials/addressbook/part3/CMakeLists.txt32
-rw-r--r--examples/widgets/tutorials/addressbook/part4/CMakeLists.txt32
-rw-r--r--examples/widgets/tutorials/addressbook/part5/CMakeLists.txt33
-rw-r--r--examples/widgets/tutorials/addressbook/part6/CMakeLists.txt33
-rw-r--r--examples/widgets/tutorials/addressbook/part7/CMakeLists.txt33
-rw-r--r--examples/widgets/tutorials/gettingStarted/CMakeLists.txt2
-rw-r--r--examples/widgets/tutorials/gettingStarted/gsQt/CMakeLists.txt7
-rw-r--r--examples/widgets/tutorials/gettingStarted/gsQt/part1/CMakeLists.txt31
-rw-r--r--examples/widgets/tutorials/gettingStarted/gsQt/part2/CMakeLists.txt31
-rw-r--r--examples/widgets/tutorials/gettingStarted/gsQt/part3/CMakeLists.txt31
-rw-r--r--examples/widgets/tutorials/gettingStarted/gsQt/part4/CMakeLists.txt31
-rw-r--r--examples/widgets/tutorials/gettingStarted/gsQt/part5/CMakeLists.txt31
-rw-r--r--examples/widgets/tutorials/modelview/1_readonly/CMakeLists.txt32
-rw-r--r--examples/widgets/tutorials/modelview/2_formatting/CMakeLists.txt32
-rw-r--r--examples/widgets/tutorials/modelview/3_changingmodel/CMakeLists.txt32
-rw-r--r--examples/widgets/tutorials/modelview/4_headers/CMakeLists.txt32
-rw-r--r--examples/widgets/tutorials/modelview/5_edit/CMakeLists.txt33
-rw-r--r--examples/widgets/tutorials/modelview/6_treeview/CMakeLists.txt32
-rw-r--r--examples/widgets/tutorials/modelview/7_selections/CMakeLists.txt32
-rw-r--r--examples/widgets/tutorials/modelview/CMakeLists.txt9
-rw-r--r--examples/widgets/tutorials/notepad/.prev_CMakeLists.txt66
-rw-r--r--examples/widgets/tutorials/notepad/CMakeLists.txt67
-rw-r--r--examples/widgets/tutorials/widgets/CMakeLists.txt6
-rw-r--r--examples/widgets/tutorials/widgets/childwidget/CMakeLists.txt31
-rw-r--r--examples/widgets/tutorials/widgets/nestedlayouts/CMakeLists.txt31
-rw-r--r--examples/widgets/tutorials/widgets/toplevel/CMakeLists.txt31
-rw-r--r--examples/widgets/tutorials/widgets/windowlayout/CMakeLists.txt31
-rw-r--r--examples/widgets/widgets/CMakeLists.txt27
-rw-r--r--examples/widgets/widgets/analogclock/CMakeLists.txt32
-rw-r--r--examples/widgets/widgets/calculator/CMakeLists.txt33
-rw-r--r--examples/widgets/widgets/calendarwidget/CMakeLists.txt32
-rw-r--r--examples/widgets/widgets/calendarwidget/window.cpp20
-rw-r--r--examples/widgets/widgets/charactermap/CMakeLists.txt33
-rw-r--r--examples/widgets/widgets/charactermap/mainwindow.cpp2
-rw-r--r--examples/widgets/widgets/codeeditor/CMakeLists.txt32
-rw-r--r--examples/widgets/widgets/digitalclock/CMakeLists.txt32
-rw-r--r--examples/widgets/widgets/elidedlabel/CMakeLists.txt33
-rw-r--r--examples/widgets/widgets/groupbox/CMakeLists.txt32
-rw-r--r--examples/widgets/widgets/icons/.prev_CMakeLists.txt39
-rw-r--r--examples/widgets/widgets/icons/CMakeLists.txt39
-rw-r--r--examples/widgets/widgets/icons/imagedelegate.cpp2
-rw-r--r--examples/widgets/widgets/icons/mainwindow.cpp13
-rw-r--r--examples/widgets/widgets/icons/mainwindow.h3
-rw-r--r--examples/widgets/widgets/imageviewer/.prev_CMakeLists.txt38
-rw-r--r--examples/widgets/widgets/imageviewer/CMakeLists.txt44
-rw-r--r--examples/widgets/widgets/lineedits/CMakeLists.txt32
-rw-r--r--examples/widgets/widgets/lineedits/window.cpp10
-rw-r--r--examples/widgets/widgets/mousebuttons/CMakeLists.txt32
-rw-r--r--examples/widgets/widgets/movie/CMakeLists.txt32
-rw-r--r--examples/widgets/widgets/movie/movieplayer.cpp2
-rw-r--r--examples/widgets/widgets/scribble/.prev_CMakeLists.txt39
-rw-r--r--examples/widgets/widgets/scribble/CMakeLists.txt45
-rw-r--r--examples/widgets/widgets/shapedclock/CMakeLists.txt32
-rw-r--r--examples/widgets/widgets/sliders/CMakeLists.txt33
-rw-r--r--examples/widgets/widgets/sliders/window.cpp12
-rw-r--r--examples/widgets/widgets/spinboxes/CMakeLists.txt32
-rw-r--r--examples/widgets/widgets/spinboxes/window.cpp2
-rw-r--r--examples/widgets/widgets/styles/CMakeLists.txt47
-rw-r--r--examples/widgets/widgets/stylesheet/CMakeLists.txt80
-rw-r--r--examples/widgets/widgets/tablet/CMakeLists.txt50
-rw-r--r--examples/widgets/widgets/tetrix/CMakeLists.txt34
-rw-r--r--examples/widgets/widgets/tooltips/CMakeLists.txt48
-rw-r--r--examples/widgets/widgets/validators/CMakeLists.txt49
-rw-r--r--examples/widgets/widgets/validators/validatorwidget.cpp4
-rw-r--r--examples/widgets/widgets/wiggly/CMakeLists.txt33
-rw-r--r--examples/widgets/widgets/windowflags/CMakeLists.txt33
-rw-r--r--examples/widgets/windowcontainer/CMakeLists.txt38
-rw-r--r--examples/widgets/windowcontainer/windowcontainer.cpp2
-rw-r--r--examples/widgets/windowcontainer/windowcontainer.pro2
-rw-r--r--examples/xml/CMakeLists.txt13
-rw-r--r--examples/xml/dombookmarks/CMakeLists.txt35
-rw-r--r--examples/xml/htmlinfo/.prev_CMakeLists.txt44
-rw-r--r--examples/xml/htmlinfo/CMakeLists.txt44
-rw-r--r--examples/xml/rsslisting/CMakeLists.txt36
-rw-r--r--examples/xml/streambookmarks/CMakeLists.txt36
-rw-r--r--examples/xml/xmlstreamlint/.prev_CMakeLists.txt27
-rw-r--r--examples/xml/xmlstreamlint/CMakeLists.txt28
500 files changed, 14125 insertions, 9954 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
new file mode 100644
index 0000000000..b473828415
--- /dev/null
+++ b/examples/CMakeLists.txt
@@ -0,0 +1,54 @@
+# special case begin
+qt_examples_build_begin()
+
+# special case end
+
+# Generated from examples.pro.
+
+add_subdirectory(corelib)
+add_subdirectory(embedded)
+add_subdirectory(qpa)
+
+if(TARGET Qt::DBus)
+ add_subdirectory(dbus)
+endif()
+
+if(TARGET Qt::Network)
+ add_subdirectory(network)
+endif()
+
+if(TARGET Qt::Test)
+ add_subdirectory(qtestlib)
+endif()
+
+if(TARGET Qt::Concurrent)
+ add_subdirectory(qtconcurrent)
+endif()
+
+if(TARGET Qt::Sql)
+ add_subdirectory(sql)
+endif()
+
+if(TARGET Qt::Widgets)
+ add_subdirectory(widgets)
+endif()
+
+if(TARGET Qt::Xml)
+ add_subdirectory(xml)
+endif()
+
+if(TARGET Qt::Gui)
+ add_subdirectory(gui)
+
+ if(QT_FEATURE_opengl)
+ add_subdirectory(opengl)
+ endif()
+
+ if(QT_FEATURE_vulkan)
+ add_subdirectory(vulkan)
+ endif()
+endif()
+
+# special case begin
+qt_examples_build_end()
+# special case end
diff --git a/examples/corelib/CMakeLists.txt b/examples/corelib/CMakeLists.txt
new file mode 100644
index 0000000000..5e24def251
--- /dev/null
+++ b/examples/corelib/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Generated from corelib.pro.
+
+add_subdirectory(ipc)
+add_subdirectory(mimetypes)
+add_subdirectory(serialization)
+add_subdirectory(tools)
+
+if(QT_FEATURE_thread)
+ add_subdirectory(threads)
+endif()
diff --git a/examples/corelib/ipc/CMakeLists.txt b/examples/corelib/ipc/CMakeLists.txt
new file mode 100644
index 0000000000..b134a3aa17
--- /dev/null
+++ b/examples/corelib/ipc/CMakeLists.txt
@@ -0,0 +1,14 @@
+# Generated from ipc.pro.
+
+
+if(QT_FEATURE_sharedmemory)
+ add_subdirectory(sharedmemory)
+endif()
+
+if(TARGET Qt::Network)
+
+ if(QT_FEATURE_localserver)
+ add_subdirectory(localfortuneserver)
+ add_subdirectory(localfortuneclient)
+ endif()
+endif()
diff --git a/examples/corelib/ipc/localfortuneclient/CMakeLists.txt b/examples/corelib/ipc/localfortuneclient/CMakeLists.txt
new file mode 100644
index 0000000000..4c011e751b
--- /dev/null
+++ b/examples/corelib/ipc/localfortuneclient/CMakeLists.txt
@@ -0,0 +1,34 @@
+# Generated from localfortuneclient.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(localfortuneclient LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/corelib/ipc/localfortuneclient")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Network)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(localfortuneclient
+ client.cpp client.h
+ main.cpp
+)
+target_link_libraries(localfortuneclient PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Network
+ Qt::Widgets
+)
+
+install(TARGETS localfortuneclient
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/corelib/ipc/localfortuneserver/CMakeLists.txt b/examples/corelib/ipc/localfortuneserver/CMakeLists.txt
new file mode 100644
index 0000000000..014df19185
--- /dev/null
+++ b/examples/corelib/ipc/localfortuneserver/CMakeLists.txt
@@ -0,0 +1,34 @@
+# Generated from localfortuneserver.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(localfortuneserver LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/corelib/ipc/localfortuneserver")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Network)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(localfortuneserver
+ main.cpp
+ server.cpp server.h
+)
+target_link_libraries(localfortuneserver PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Network
+ Qt::Widgets
+)
+
+install(TARGETS localfortuneserver
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/corelib/ipc/sharedmemory/CMakeLists.txt b/examples/corelib/ipc/sharedmemory/CMakeLists.txt
new file mode 100644
index 0000000000..6db5ea1a3b
--- /dev/null
+++ b/examples/corelib/ipc/sharedmemory/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from sharedmemory.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(sharedmemory LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/corelib/ipc/sharedmemory")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(sharedmemory
+ dialog.cpp dialog.h dialog.ui
+ main.cpp
+)
+target_link_libraries(sharedmemory PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS sharedmemory
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/corelib/mimetypes/CMakeLists.txt b/examples/corelib/mimetypes/CMakeLists.txt
new file mode 100644
index 0000000000..0b31e0db69
--- /dev/null
+++ b/examples/corelib/mimetypes/CMakeLists.txt
@@ -0,0 +1,6 @@
+# Generated from mimetypes.pro.
+
+
+if(TARGET Qt::Widgets)
+ add_subdirectory(mimetypebrowser)
+endif()
diff --git a/examples/corelib/mimetypes/mimetypebrowser/CMakeLists.txt b/examples/corelib/mimetypes/mimetypebrowser/CMakeLists.txt
new file mode 100644
index 0000000000..b62df6dd1e
--- /dev/null
+++ b/examples/corelib/mimetypes/mimetypebrowser/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from mimetypebrowser.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(mimetypebrowser LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/corelib/mimetypes/mimetypebrowser")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_executable(mimetypebrowser
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ mimetypemodel.cpp mimetypemodel.h
+)
+target_link_libraries(mimetypebrowser PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS mimetypebrowser
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/corelib/serialization/CMakeLists.txt b/examples/corelib/serialization/CMakeLists.txt
new file mode 100644
index 0000000000..a64b5130d2
--- /dev/null
+++ b/examples/corelib/serialization/CMakeLists.txt
@@ -0,0 +1,5 @@
+# Generated from serialization.pro.
+
+add_subdirectory(cbordump)
+add_subdirectory(convert)
+add_subdirectory(savegame)
diff --git a/examples/corelib/serialization/cbordump/CMakeLists.txt b/examples/corelib/serialization/cbordump/CMakeLists.txt
new file mode 100644
index 0000000000..98b5044b4a
--- /dev/null
+++ b/examples/corelib/serialization/cbordump/CMakeLists.txt
@@ -0,0 +1,27 @@
+# Generated from cbordump.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(cbordump LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/corelib/serialization/cbordump")
+
+find_package(Qt6 COMPONENTS Core)
+
+add_executable(cbordump
+ main.cpp
+)
+target_link_libraries(cbordump PUBLIC
+ Qt::Core
+)
+
+install(TARGETS cbordump
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/corelib/serialization/convert/CMakeLists.txt b/examples/corelib/serialization/convert/CMakeLists.txt
new file mode 100644
index 0000000000..98d4a943d6
--- /dev/null
+++ b/examples/corelib/serialization/convert/CMakeLists.txt
@@ -0,0 +1,34 @@
+# Generated from convert.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(convert LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/corelib/serialization/convert")
+
+find_package(Qt6 COMPONENTS Core)
+
+add_executable(convert
+ cborconverter.cpp cborconverter.h
+ converter.h
+ datastreamconverter.cpp datastreamconverter.h
+ jsonconverter.cpp jsonconverter.h
+ main.cpp
+ nullconverter.cpp nullconverter.h
+ textconverter.cpp textconverter.h
+ xmlconverter.cpp xmlconverter.h
+)
+target_link_libraries(convert PUBLIC
+ Qt::Core
+)
+
+install(TARGETS convert
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/corelib/serialization/savegame/CMakeLists.txt b/examples/corelib/serialization/savegame/CMakeLists.txt
new file mode 100644
index 0000000000..10851d55fd
--- /dev/null
+++ b/examples/corelib/serialization/savegame/CMakeLists.txt
@@ -0,0 +1,30 @@
+# Generated from savegame.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(savegame LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/corelib/serialization/savegame")
+
+find_package(Qt6 COMPONENTS Core)
+
+add_executable(savegame
+ character.cpp character.h
+ game.cpp game.h
+ level.cpp level.h
+ main.cpp
+)
+target_link_libraries(savegame PUBLIC
+ Qt::Core
+)
+
+install(TARGETS savegame
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/corelib/threads/CMakeLists.txt b/examples/corelib/threads/CMakeLists.txt
new file mode 100644
index 0000000000..b13dd16d93
--- /dev/null
+++ b/examples/corelib/threads/CMakeLists.txt
@@ -0,0 +1,9 @@
+# Generated from threads.pro.
+
+add_subdirectory(semaphores)
+add_subdirectory(waitconditions)
+
+if(TARGET Qt::Widgets)
+ add_subdirectory(mandelbrot)
+ add_subdirectory(queuedcustomtype)
+endif()
diff --git a/examples/corelib/threads/mandelbrot/CMakeLists.txt b/examples/corelib/threads/mandelbrot/CMakeLists.txt
new file mode 100644
index 0000000000..515eb3ed93
--- /dev/null
+++ b/examples/corelib/threads/mandelbrot/CMakeLists.txt
@@ -0,0 +1,39 @@
+# Generated from mandelbrot.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(mandelbrot LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/corelib/threads/mandelbrot")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(mandelbrot
+ main.cpp
+ mandelbrotwidget.cpp mandelbrotwidget.h
+ renderthread.cpp renderthread.h
+)
+target_link_libraries(mandelbrot PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+if(UNIX AND NOT APPLE AND NOT HAIKU AND NOT INTEGRITY AND NOT VXWORKS)
+ target_link_libraries(mandelbrot PUBLIC
+ m
+ )
+endif()
+
+install(TARGETS mandelbrot
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/corelib/threads/queuedcustomtype/CMakeLists.txt b/examples/corelib/threads/queuedcustomtype/CMakeLists.txt
new file mode 100644
index 0000000000..cc4ff1bd4a
--- /dev/null
+++ b/examples/corelib/threads/queuedcustomtype/CMakeLists.txt
@@ -0,0 +1,34 @@
+# Generated from queuedcustomtype.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(queuedcustomtype LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/corelib/threads/queuedcustomtype")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(queuedcustomtype
+ block.cpp block.h
+ main.cpp
+ renderthread.cpp renderthread.h
+ window.cpp window.h
+)
+target_link_libraries(queuedcustomtype PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS queuedcustomtype
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/corelib/threads/semaphores/CMakeLists.txt b/examples/corelib/threads/semaphores/CMakeLists.txt
new file mode 100644
index 0000000000..15b5dc56b9
--- /dev/null
+++ b/examples/corelib/threads/semaphores/CMakeLists.txt
@@ -0,0 +1,27 @@
+# Generated from semaphores.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(semaphores LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/corelib/threads/semaphores")
+
+find_package(Qt6 COMPONENTS Core)
+
+add_executable(semaphores
+ semaphores.cpp
+)
+target_link_libraries(semaphores PUBLIC
+ Qt::Core
+)
+
+install(TARGETS semaphores
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/corelib/threads/waitconditions/CMakeLists.txt b/examples/corelib/threads/waitconditions/CMakeLists.txt
new file mode 100644
index 0000000000..0b6d889d77
--- /dev/null
+++ b/examples/corelib/threads/waitconditions/CMakeLists.txt
@@ -0,0 +1,27 @@
+# Generated from waitconditions.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(waitconditions LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/corelib/threads/waitconditions")
+
+find_package(Qt6 COMPONENTS Core)
+
+add_executable(waitconditions
+ waitconditions.cpp
+)
+target_link_libraries(waitconditions PUBLIC
+ Qt::Core
+)
+
+install(TARGETS waitconditions
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/corelib/tools/CMakeLists.txt b/examples/corelib/tools/CMakeLists.txt
new file mode 100644
index 0000000000..d25014ee3c
--- /dev/null
+++ b/examples/corelib/tools/CMakeLists.txt
@@ -0,0 +1,5 @@
+# Generated from tools.pro.
+
+add_subdirectory(contiguouscache)
+add_subdirectory(customtype)
+add_subdirectory(customtypesending)
diff --git a/examples/corelib/tools/contiguouscache/CMakeLists.txt b/examples/corelib/tools/contiguouscache/CMakeLists.txt
new file mode 100644
index 0000000000..1e7a3350c2
--- /dev/null
+++ b/examples/corelib/tools/contiguouscache/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from contiguouscache.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(contiguouscache LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/corelib/tools/contiguouscache")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(contiguouscache
+ main.cpp
+ randomlistmodel.cpp randomlistmodel.h
+)
+target_link_libraries(contiguouscache PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS contiguouscache
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/corelib/tools/customtype/CMakeLists.txt b/examples/corelib/tools/customtype/CMakeLists.txt
new file mode 100644
index 0000000000..74969ed2ea
--- /dev/null
+++ b/examples/corelib/tools/customtype/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from customtype.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(customtype LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/corelib/tools/customtype")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(customtype
+ main.cpp
+ message.cpp message.h
+)
+target_link_libraries(customtype PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS customtype
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/corelib/tools/customtypesending/CMakeLists.txt b/examples/corelib/tools/customtypesending/CMakeLists.txt
new file mode 100644
index 0000000000..1456eaf5dc
--- /dev/null
+++ b/examples/corelib/tools/customtypesending/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from customtypesending.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(customtypesending LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/corelib/tools/customtypesending")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(customtypesending
+ main.cpp
+ message.cpp message.h
+ window.cpp window.h
+)
+target_link_libraries(customtypesending PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS customtypesending
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/dbus/CMakeLists.txt b/examples/dbus/CMakeLists.txt
new file mode 100644
index 0000000000..42a3df658a
--- /dev/null
+++ b/examples/dbus/CMakeLists.txt
@@ -0,0 +1,13 @@
+# Generated from dbus.pro.
+
+add_subdirectory(listnames)
+add_subdirectory(pingpong)
+
+if(QT_FEATURE_process)
+ add_subdirectory(complexpingpong)
+endif()
+
+if(TARGET Qt::Widgets)
+ add_subdirectory(chat)
+ add_subdirectory(remotecontrolledcar)
+endif()
diff --git a/examples/dbus/chat/.prev_CMakeLists.txt b/examples/dbus/chat/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..7889868753
--- /dev/null
+++ b/examples/dbus/chat/.prev_CMakeLists.txt
@@ -0,0 +1,35 @@
+# Generated from chat.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(chat LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/dbus/chat")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS DBus)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(chat
+ chat.cpp chat.h
+ chatmainwindow.ui
+ chatsetnickname.ui
+)
+target_link_libraries(chat PUBLIC
+ Qt::Core
+ Qt::DBus
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS chat
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/dbus/chat/CMakeLists.txt b/examples/dbus/chat/CMakeLists.txt
new file mode 100644
index 0000000000..f2fb0a55f8
--- /dev/null
+++ b/examples/dbus/chat/CMakeLists.txt
@@ -0,0 +1,49 @@
+# Generated from chat.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(chat LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/dbus/chat")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS DBus)
+find_package(Qt6 COMPONENTS Widgets)
+
+# special case begin
+set(chat_SRCS)
+qt6_add_dbus_interface(chat_SRCS
+ org.example.chat.xml
+ chat_interface
+)
+qt6_add_dbus_adaptor(chat_SRCS
+ org.example.chat.xml
+ qobject.h
+ QObject
+ chat_adaptor
+)
+# special case end
+add_qt_gui_executable(chat
+ chat.cpp chat.h
+ chatmainwindow.ui
+ chatsetnickname.ui
+ ${chat_SRCS} # special case
+)
+target_link_libraries(chat PUBLIC
+ Qt::Core
+ Qt::DBus
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS chat
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/dbus/complexpingpong/CMakeLists.txt b/examples/dbus/complexpingpong/CMakeLists.txt
new file mode 100644
index 0000000000..01a824e5e7
--- /dev/null
+++ b/examples/dbus/complexpingpong/CMakeLists.txt
@@ -0,0 +1,27 @@
+# Generated from complexpong.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(complexpong LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples")
+
+find_package(Qt6 COMPONENTS DBus)
+
+add_qt_gui_executable(complexpong
+ complexpong.cpp complexpong.h
+)
+target_link_libraries(complexpong PUBLIC
+ # Remove: gui
+ Qt::DBus
+)
+install(TARGETS complexpong
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/dbus/listnames/CMakeLists.txt b/examples/dbus/listnames/CMakeLists.txt
new file mode 100644
index 0000000000..acc1db632c
--- /dev/null
+++ b/examples/dbus/listnames/CMakeLists.txt
@@ -0,0 +1,29 @@
+# Generated from listnames.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(listnames LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/dbus/listnames")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS DBus)
+
+add_qt_gui_executable(listnames
+ listnames.cpp
+)
+target_link_libraries(listnames PUBLIC
+ Qt::Core
+ Qt::DBus
+)
+
+install(TARGETS listnames
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/dbus/pingpong/CMakeLists.txt b/examples/dbus/pingpong/CMakeLists.txt
new file mode 100644
index 0000000000..6a2a84e974
--- /dev/null
+++ b/examples/dbus/pingpong/CMakeLists.txt
@@ -0,0 +1,28 @@
+# Generated from pong.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(pong LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples")
+
+find_package(Qt6 COMPONENTS DBus)
+
+add_qt_gui_executable(pong
+ ping-common.h
+ pong.cpp pong.h
+)
+target_link_libraries(pong PUBLIC
+ # Remove: gui
+ Qt::DBus
+)
+install(TARGETS pong
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/dbus/remotecontrolledcar/CMakeLists.txt b/examples/dbus/remotecontrolledcar/CMakeLists.txt
new file mode 100644
index 0000000000..4d41919962
--- /dev/null
+++ b/examples/dbus/remotecontrolledcar/CMakeLists.txt
@@ -0,0 +1,4 @@
+# Generated from remotecontrolledcar.pro.
+
+add_subdirectory(car)
+add_subdirectory(controller)
diff --git a/examples/dbus/remotecontrolledcar/car/.prev_CMakeLists.txt b/examples/dbus/remotecontrolledcar/car/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..a028cbcb43
--- /dev/null
+++ b/examples/dbus/remotecontrolledcar/car/.prev_CMakeLists.txt
@@ -0,0 +1,34 @@
+# Generated from car.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(car LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/dbus/remotecontrolledcar/car")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS DBus)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(car
+ car.cpp car.h
+ main.cpp
+)
+target_link_libraries(car PUBLIC
+ Qt::Core
+ Qt::DBus
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS car
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/dbus/remotecontrolledcar/car/CMakeLists.txt b/examples/dbus/remotecontrolledcar/car/CMakeLists.txt
new file mode 100644
index 0000000000..8be7f9ebd1
--- /dev/null
+++ b/examples/dbus/remotecontrolledcar/car/CMakeLists.txt
@@ -0,0 +1,44 @@
+# Generated from car.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(car LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/dbus/remotecontrolledcar/car")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS DBus)
+find_package(Qt6 COMPONENTS Widgets)
+
+# special case begin
+set(car_SRCS)
+qt6_add_dbus_adaptor(car_SRCS
+ car.xml
+ car.h
+ Car
+ car_adaptor
+)
+# special case end
+add_qt_gui_executable(car
+ car.cpp car.h
+ main.cpp
+ ${car_SRCS} # special case
+)
+target_link_libraries(car PUBLIC
+ Qt::Core
+ Qt::DBus
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS car
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/dbus/remotecontrolledcar/controller/.prev_CMakeLists.txt b/examples/dbus/remotecontrolledcar/controller/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..65c32e7c07
--- /dev/null
+++ b/examples/dbus/remotecontrolledcar/controller/.prev_CMakeLists.txt
@@ -0,0 +1,34 @@
+# Generated from controller.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(controller LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/dbus/remotecontrolledcar/controller")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS DBus)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(controller
+ controller.cpp controller.h controller.ui
+ main.cpp
+)
+target_link_libraries(controller PUBLIC
+ Qt::Core
+ Qt::DBus
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS controller
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/dbus/remotecontrolledcar/controller/CMakeLists.txt b/examples/dbus/remotecontrolledcar/controller/CMakeLists.txt
new file mode 100644
index 0000000000..5ad9d2e51d
--- /dev/null
+++ b/examples/dbus/remotecontrolledcar/controller/CMakeLists.txt
@@ -0,0 +1,42 @@
+# Generated from controller.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(controller LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/dbus/remotecontrolledcar/controller")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS DBus)
+find_package(Qt6 COMPONENTS Widgets)
+
+# special case begin
+set(controller_SRCS)
+qt6_add_dbus_interface(controller_SRCS
+ car.xml
+ car_interface
+)
+# special case end
+add_qt_gui_executable(controller
+ controller.cpp controller.h controller.ui
+ main.cpp
+ ${controller_SRCS} # special case
+)
+target_link_libraries(controller PUBLIC
+ Qt::Core
+ Qt::DBus
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS controller
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/embedded/CMakeLists.txt b/examples/embedded/CMakeLists.txt
new file mode 100644
index 0000000000..bd7720809a
--- /dev/null
+++ b/examples/embedded/CMakeLists.txt
@@ -0,0 +1,8 @@
+# Generated from embedded.pro.
+
+add_subdirectory(styleexample)
+add_subdirectory(raycasting)
+add_subdirectory(flickable)
+add_subdirectory(digiflip)
+add_subdirectory(lightmaps)
+add_subdirectory(flightinfo)
diff --git a/examples/embedded/digiflip/CMakeLists.txt b/examples/embedded/digiflip/CMakeLists.txt
new file mode 100644
index 0000000000..cfad2a7c7b
--- /dev/null
+++ b/examples/embedded/digiflip/CMakeLists.txt
@@ -0,0 +1,31 @@
+# Generated from digiflip.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(digiflip LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/embedded/digiflip")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(digiflip
+ digiflip.cpp
+)
+target_link_libraries(digiflip PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS digiflip
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/embedded/flickable/CMakeLists.txt b/examples/embedded/flickable/CMakeLists.txt
new file mode 100644
index 0000000000..bae3146723
--- /dev/null
+++ b/examples/embedded/flickable/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from flickable.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(flickable LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/embedded/flickable")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(flickable
+ flickable.cpp flickable.h
+ main.cpp
+)
+target_link_libraries(flickable PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS flickable
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/embedded/flightinfo/.prev_CMakeLists.txt b/examples/embedded/flightinfo/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..f7898e8ed8
--- /dev/null
+++ b/examples/embedded/flightinfo/.prev_CMakeLists.txt
@@ -0,0 +1,47 @@
+# Generated from flightinfo.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(flightinfo LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/embedded/flightinfo")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Network)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(flightinfo
+ flightinfo.cpp
+ form.ui
+)
+target_link_libraries(flightinfo PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Network
+ Qt::Widgets
+)
+
+
+# Resources:
+set(flightinfo_resource_files
+ "aircraft.png"
+)
+
+qt6_add_resources(flightinfo "flightinfo"
+ PREFIX
+ "/"
+ FILES
+ ${flightinfo_resource_files}
+)
+
+install(TARGETS flightinfo
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/embedded/flightinfo/CMakeLists.txt b/examples/embedded/flightinfo/CMakeLists.txt
new file mode 100644
index 0000000000..f7898e8ed8
--- /dev/null
+++ b/examples/embedded/flightinfo/CMakeLists.txt
@@ -0,0 +1,47 @@
+# Generated from flightinfo.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(flightinfo LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/embedded/flightinfo")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Network)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(flightinfo
+ flightinfo.cpp
+ form.ui
+)
+target_link_libraries(flightinfo PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Network
+ Qt::Widgets
+)
+
+
+# Resources:
+set(flightinfo_resource_files
+ "aircraft.png"
+)
+
+qt6_add_resources(flightinfo "flightinfo"
+ PREFIX
+ "/"
+ FILES
+ ${flightinfo_resource_files}
+)
+
+install(TARGETS flightinfo
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/embedded/lightmaps/CMakeLists.txt b/examples/embedded/lightmaps/CMakeLists.txt
new file mode 100644
index 0000000000..641f75c3c8
--- /dev/null
+++ b/examples/embedded/lightmaps/CMakeLists.txt
@@ -0,0 +1,36 @@
+# Generated from lightmaps.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(lightmaps LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/embedded/lightmaps")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Network)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(lightmaps
+ lightmaps.cpp lightmaps.h
+ main.cpp
+ mapzoom.cpp mapzoom.h
+ slippymap.cpp slippymap.h
+)
+target_link_libraries(lightmaps PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Network
+ Qt::Widgets
+)
+
+install(TARGETS lightmaps
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/embedded/raycasting/CMakeLists.txt b/examples/embedded/raycasting/CMakeLists.txt
new file mode 100644
index 0000000000..86a3042f86
--- /dev/null
+++ b/examples/embedded/raycasting/CMakeLists.txt
@@ -0,0 +1,44 @@
+# Generated from raycasting.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(raycasting LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/embedded/raycasting")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(raycasting
+ raycasting.cpp
+)
+target_link_libraries(raycasting PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(raycasting_resource_files
+ "textures.png"
+)
+
+qt6_add_resources(raycasting "raycasting"
+ PREFIX
+ "/"
+ FILES
+ ${raycasting_resource_files}
+)
+
+install(TARGETS raycasting
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/embedded/styleexample/.prev_CMakeLists.txt b/examples/embedded/styleexample/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..ac03e58346
--- /dev/null
+++ b/examples/embedded/styleexample/.prev_CMakeLists.txt
@@ -0,0 +1,52 @@
+# Generated from styleexample.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(styleexample LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/embedded/styleexample")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(styleexample
+ main.cpp
+ stylewidget.cpp stylewidget.h stylewidget.ui
+)
+target_link_libraries(styleexample PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(styleexample_resource_files
+ "files/add.png"
+ "files/application.qss"
+ "files/blue.qss"
+ "files/khaki.qss"
+ "files/nature_1.jpg"
+ "files/nostyle.qss"
+ "files/remove.png"
+ "files/transparent.qss"
+)
+
+qt6_add_resources(styleexample "styleexample"
+ PREFIX
+ "/"
+ FILES
+ ${styleexample_resource_files}
+)
+
+install(TARGETS styleexample
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/embedded/styleexample/CMakeLists.txt b/examples/embedded/styleexample/CMakeLists.txt
new file mode 100644
index 0000000000..ac03e58346
--- /dev/null
+++ b/examples/embedded/styleexample/CMakeLists.txt
@@ -0,0 +1,52 @@
+# Generated from styleexample.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(styleexample LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/embedded/styleexample")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(styleexample
+ main.cpp
+ stylewidget.cpp stylewidget.h stylewidget.ui
+)
+target_link_libraries(styleexample PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(styleexample_resource_files
+ "files/add.png"
+ "files/application.qss"
+ "files/blue.qss"
+ "files/khaki.qss"
+ "files/nature_1.jpg"
+ "files/nostyle.qss"
+ "files/remove.png"
+ "files/transparent.qss"
+)
+
+qt6_add_resources(styleexample "styleexample"
+ PREFIX
+ "/"
+ FILES
+ ${styleexample_resource_files}
+)
+
+install(TARGETS styleexample
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/gui/CMakeLists.txt b/examples/gui/CMakeLists.txt
new file mode 100644
index 0000000000..7631777ef4
--- /dev/null
+++ b/examples/gui/CMakeLists.txt
@@ -0,0 +1,7 @@
+# Generated from gui.pro.
+
+if(NOT TARGET Qt::Gui)
+ return()
+endif()
+add_subdirectory(analogclock)
+add_subdirectory(rasterwindow)
diff --git a/examples/gui/analogclock/.prev_CMakeLists.txt b/examples/gui/analogclock/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..b71892d1b8
--- /dev/null
+++ b/examples/gui/analogclock/.prev_CMakeLists.txt
@@ -0,0 +1,34 @@
+# Generated from analogclock.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(analogclock LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/gui/analogclock")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+
+add_qt_gui_executable(analogclock
+ ../rasterwindow/rasterwindow.cpp ../rasterwindow/rasterwindow.h
+ main.cpp
+)
+target_include_directories(analogclock PUBLIC
+ ../rasterwindow
+)
+
+target_link_libraries(analogclock PUBLIC
+ Qt::Core
+ Qt::Gui
+)
+
+install(TARGETS analogclock
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/gui/analogclock/CMakeLists.txt b/examples/gui/analogclock/CMakeLists.txt
new file mode 100644
index 0000000000..d5605ab8ba
--- /dev/null
+++ b/examples/gui/analogclock/CMakeLists.txt
@@ -0,0 +1,41 @@
+# Generated from analogclock.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(analogclock LANGUAGES CXX)
+
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/gui/gui_analogclock") # special case
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets) # special case: add
+
+add_qt_gui_executable(gui_analogclock # special case: renamed target
+ ../rasterwindow/rasterwindow.cpp ../rasterwindow/rasterwindow.h
+ main.cpp
+)
+target_include_directories(gui_analogclock PUBLIC # special case
+ ../rasterwindow
+)
+# special case begin
+target_link_libraries(gui_analogclock PUBLIC # special case
+ Qt::Gui
+)
+# special case end
+
+target_link_libraries(gui_analogclock PUBLIC # special case
+ Qt::Core
+ Qt::Gui
+)
+
+install(TARGETS gui_analogclock # special case
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/gui/gui.pro b/examples/gui/gui.pro
index b8080c2075..275adc804d 100644
--- a/examples/gui/gui.pro
+++ b/examples/gui/gui.pro
@@ -6,5 +6,3 @@ CONFIG += no_docs_target
SUBDIRS += analogclock
SUBDIRS += rasterwindow
-qtHaveModule(gui):qtConfig(opengl): \
- SUBDIRS += openglwindow
diff --git a/examples/gui/rasterwindow/.prev_CMakeLists.txt b/examples/gui/rasterwindow/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..3f27ea597c
--- /dev/null
+++ b/examples/gui/rasterwindow/.prev_CMakeLists.txt
@@ -0,0 +1,34 @@
+# Generated from rasterwindow.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(rasterwindow LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/gui/rasterwindow")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+
+add_qt_gui_executable(rasterwindow
+ main.cpp
+ rasterwindow.cpp rasterwindow.h
+)
+target_include_directories(rasterwindow PUBLIC
+ ${CMAKE_CURRENT_SOURCE_DIR}
+)
+
+target_link_libraries(rasterwindow PUBLIC
+ Qt::Core
+ Qt::Gui
+)
+
+install(TARGETS rasterwindow
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/gui/rasterwindow/CMakeLists.txt b/examples/gui/rasterwindow/CMakeLists.txt
new file mode 100644
index 0000000000..555578725e
--- /dev/null
+++ b/examples/gui/rasterwindow/CMakeLists.txt
@@ -0,0 +1,35 @@
+# Generated from rasterwindow.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(rasterwindow LANGUAGES CXX)
+
+find_package(Qt6 COMPONENTS Widgets) # special case: add
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/gui/rasterwindow")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+
+add_qt_gui_executable(rasterwindow
+ main.cpp
+ rasterwindow.cpp rasterwindow.h
+)
+target_include_directories(rasterwindow PUBLIC
+ ${CMAKE_CURRENT_SOURCE_DIR}
+)
+target_link_libraries(rasterwindow PUBLIC
+ Qt::Core
+ Qt::Gui
+)
+
+install(TARGETS rasterwindow
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/network/CMakeLists.txt b/examples/network/CMakeLists.txt
new file mode 100644
index 0000000000..919310df9a
--- /dev/null
+++ b/examples/network/CMakeLists.txt
@@ -0,0 +1,44 @@
+# Generated from network.pro.
+
+add_subdirectory(download)
+add_subdirectory(downloadmanager)
+
+if(NOT INTEGRITY)
+ add_subdirectory(dnslookup)
+endif()
+
+if(TARGET Qt::Widgets)
+ add_subdirectory(blockingfortuneclient)
+ add_subdirectory(broadcastreceiver)
+ add_subdirectory(broadcastsender)
+ add_subdirectory(http)
+ add_subdirectory(loopback)
+ add_subdirectory(threadedfortuneserver)
+ add_subdirectory(googlesuggest)
+ # add_subdirectory(torrent) FIXME: This does not find its ui file:-/
+ add_subdirectory(multicastreceiver)
+ add_subdirectory(multicastsender)
+
+ if(QT_FEATURE_bearermanagement)
+ add_subdirectory(fortuneclient)
+ add_subdirectory(fortuneserver)
+
+ if(QT_FEATURE_processenvironment)
+ add_subdirectory(network-chat)
+ endif()
+ endif()
+
+ if(QT_FEATURE_openssl)
+ add_subdirectory(securesocketclient)
+ endif()
+
+ if(QT_FEATURE_dtls)
+ add_subdirectory(secureudpserver)
+ add_subdirectory(secureudpclient)
+ endif()
+
+ if(QT_FEATURE_sctp)
+ add_subdirectory(multistreamserver)
+ add_subdirectory(multistreamclient)
+ endif()
+endif()
diff --git a/examples/network/blockingfortuneclient/CMakeLists.txt b/examples/network/blockingfortuneclient/CMakeLists.txt
new file mode 100644
index 0000000000..d2c79bbcd2
--- /dev/null
+++ b/examples/network/blockingfortuneclient/CMakeLists.txt
@@ -0,0 +1,35 @@
+# Generated from blockingfortuneclient.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(blockingfortuneclient LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/network/blockingfortuneclient")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Network)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(blockingfortuneclient
+ blockingclient.cpp blockingclient.h
+ fortunethread.cpp fortunethread.h
+ main.cpp
+)
+target_link_libraries(blockingfortuneclient PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Network
+ Qt::Widgets
+)
+
+install(TARGETS blockingfortuneclient
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/network/broadcastreceiver/CMakeLists.txt b/examples/network/broadcastreceiver/CMakeLists.txt
new file mode 100644
index 0000000000..ea057a647b
--- /dev/null
+++ b/examples/network/broadcastreceiver/CMakeLists.txt
@@ -0,0 +1,34 @@
+# Generated from broadcastreceiver.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(broadcastreceiver LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/network/broadcastreceiver")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Network)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(broadcastreceiver
+ main.cpp
+ receiver.cpp receiver.h
+)
+target_link_libraries(broadcastreceiver PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Network
+ Qt::Widgets
+)
+
+install(TARGETS broadcastreceiver
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/network/broadcastsender/CMakeLists.txt b/examples/network/broadcastsender/CMakeLists.txt
new file mode 100644
index 0000000000..0a1885cfbb
--- /dev/null
+++ b/examples/network/broadcastsender/CMakeLists.txt
@@ -0,0 +1,34 @@
+# Generated from broadcastsender.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(broadcastsender LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/network/broadcastsender")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Network)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(broadcastsender
+ main.cpp
+ sender.cpp sender.h
+)
+target_link_libraries(broadcastsender PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Network
+ Qt::Widgets
+)
+
+install(TARGETS broadcastsender
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/network/dnslookup/CMakeLists.txt b/examples/network/dnslookup/CMakeLists.txt
new file mode 100644
index 0000000000..721d89179f
--- /dev/null
+++ b/examples/network/dnslookup/CMakeLists.txt
@@ -0,0 +1,29 @@
+# Generated from dnslookup.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(dnslookup LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/network/dnslookup")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Network)
+
+add_executable(dnslookup
+ dnslookup.cpp dnslookup.h
+)
+target_link_libraries(dnslookup PUBLIC
+ Qt::Core
+ Qt::Network
+)
+
+install(TARGETS dnslookup
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/network/download/CMakeLists.txt b/examples/network/download/CMakeLists.txt
new file mode 100644
index 0000000000..b4124fc8a3
--- /dev/null
+++ b/examples/network/download/CMakeLists.txt
@@ -0,0 +1,29 @@
+# Generated from download.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(download LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/network/download")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Network)
+
+add_executable(download
+ main.cpp
+)
+target_link_libraries(download PUBLIC
+ Qt::Core
+ Qt::Network
+)
+
+install(TARGETS download
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/network/downloadmanager/CMakeLists.txt b/examples/network/downloadmanager/CMakeLists.txt
new file mode 100644
index 0000000000..8fc16bedb5
--- /dev/null
+++ b/examples/network/downloadmanager/CMakeLists.txt
@@ -0,0 +1,31 @@
+# Generated from downloadmanager.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(downloadmanager LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/network/downloadmanager")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Network)
+
+add_executable(downloadmanager
+ downloadmanager.cpp downloadmanager.h
+ main.cpp
+ textprogressbar.cpp textprogressbar.h
+)
+target_link_libraries(downloadmanager PUBLIC
+ Qt::Core
+ Qt::Network
+)
+
+install(TARGETS downloadmanager
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/network/fortuneclient/CMakeLists.txt b/examples/network/fortuneclient/CMakeLists.txt
new file mode 100644
index 0000000000..d44e75b0ff
--- /dev/null
+++ b/examples/network/fortuneclient/CMakeLists.txt
@@ -0,0 +1,34 @@
+# Generated from fortuneclient.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(fortuneclient LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/network/fortuneclient")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Network)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(fortuneclient
+ client.cpp client.h
+ main.cpp
+)
+target_link_libraries(fortuneclient PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Network
+ Qt::Widgets
+)
+
+install(TARGETS fortuneclient
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/network/fortuneserver/CMakeLists.txt b/examples/network/fortuneserver/CMakeLists.txt
new file mode 100644
index 0000000000..2bcb9f076a
--- /dev/null
+++ b/examples/network/fortuneserver/CMakeLists.txt
@@ -0,0 +1,34 @@
+# Generated from fortuneserver.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(fortuneserver LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/network/fortuneserver")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Network)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(fortuneserver
+ main.cpp
+ server.cpp server.h
+)
+target_link_libraries(fortuneserver PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Network
+ Qt::Widgets
+)
+
+install(TARGETS fortuneserver
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/network/googlesuggest/CMakeLists.txt b/examples/network/googlesuggest/CMakeLists.txt
new file mode 100644
index 0000000000..247980601f
--- /dev/null
+++ b/examples/network/googlesuggest/CMakeLists.txt
@@ -0,0 +1,35 @@
+# Generated from googlesuggest.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(googlesuggest LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/network/googlesuggest")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Network)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(googlesuggest
+ googlesuggest.cpp googlesuggest.h
+ main.cpp
+ searchbox.cpp searchbox.h
+)
+target_link_libraries(googlesuggest PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Network
+ Qt::Widgets
+)
+
+install(TARGETS googlesuggest
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/network/http/CMakeLists.txt b/examples/network/http/CMakeLists.txt
new file mode 100644
index 0000000000..d9f50f5c9d
--- /dev/null
+++ b/examples/network/http/CMakeLists.txt
@@ -0,0 +1,45 @@
+# Generated from http.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(http LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/network/http")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Network)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(http
+ authenticationdialog.ui
+ httpwindow.cpp httpwindow.h
+ main.cpp
+)
+target_link_libraries(http PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Network
+ Qt::Widgets
+)
+
+if(ANDROID AND TARGET Qt::AndroidExtras)
+ target_compile_definitions(http PUBLIC
+ REQUEST_PERMISSIONS_ON_ANDROID
+ )
+
+ target_link_libraries(http PUBLIC
+ Qt::AndroidExtras
+ )
+endif()
+
+install(TARGETS http
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/network/loopback/CMakeLists.txt b/examples/network/loopback/CMakeLists.txt
new file mode 100644
index 0000000000..8d42284914
--- /dev/null
+++ b/examples/network/loopback/CMakeLists.txt
@@ -0,0 +1,34 @@
+# Generated from loopback.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(loopback LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/network/loopback")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Network)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(loopback
+ dialog.cpp dialog.h
+ main.cpp
+)
+target_link_libraries(loopback PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Network
+ Qt::Widgets
+)
+
+install(TARGETS loopback
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/network/multicastreceiver/CMakeLists.txt b/examples/network/multicastreceiver/CMakeLists.txt
new file mode 100644
index 0000000000..f45b1b0db2
--- /dev/null
+++ b/examples/network/multicastreceiver/CMakeLists.txt
@@ -0,0 +1,34 @@
+# Generated from multicastreceiver.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(multicastreceiver LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/network/multicastreceiver")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Network)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(multicastreceiver
+ main.cpp
+ receiver.cpp receiver.h
+)
+target_link_libraries(multicastreceiver PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Network
+ Qt::Widgets
+)
+
+install(TARGETS multicastreceiver
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/network/multicastsender/CMakeLists.txt b/examples/network/multicastsender/CMakeLists.txt
new file mode 100644
index 0000000000..5ebd7cb767
--- /dev/null
+++ b/examples/network/multicastsender/CMakeLists.txt
@@ -0,0 +1,34 @@
+# Generated from multicastsender.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(multicastsender LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/network/multicastsender")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Network)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(multicastsender
+ main.cpp
+ sender.cpp sender.h
+)
+target_link_libraries(multicastsender PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Network
+ Qt::Widgets
+)
+
+install(TARGETS multicastsender
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/network/multicastsender/sender.cpp b/examples/network/multicastsender/sender.cpp
index a542a2528f..a995bd7331 100644
--- a/examples/network/multicastsender/sender.cpp
+++ b/examples/network/multicastsender/sender.cpp
@@ -81,7 +81,7 @@ Sender::Sender(QWidget *parent)
buttonBox->addButton(startButton, QDialogButtonBox::ActionRole);
buttonBox->addButton(quitButton, QDialogButtonBox::RejectRole);
- connect(ttlSpinBox, QOverload<int>::of(&QSpinBox::valueChanged), this, &Sender::ttlChanged);
+ connect(ttlSpinBox, &QSpinBox::valueChanged, this, &Sender::ttlChanged);
connect(startButton, &QPushButton::clicked, this, &Sender::startSending);
connect(quitButton, &QPushButton::clicked, this, &Sender::close);
connect(&timer, &QTimer::timeout, this, &Sender::sendDatagram);
diff --git a/examples/network/multistreamclient/CMakeLists.txt b/examples/network/multistreamclient/CMakeLists.txt
new file mode 100644
index 0000000000..a4a4be05df
--- /dev/null
+++ b/examples/network/multistreamclient/CMakeLists.txt
@@ -0,0 +1,38 @@
+# Generated from multistreamclient.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(multistreamclient LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/network/multistreamclient")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Network)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(multistreamclient
+ chatconsumer.cpp chatconsumer.h
+ client.cpp client.h
+ consumer.h
+ main.cpp
+ movieconsumer.cpp movieconsumer.h
+ timeconsumer.cpp timeconsumer.h
+)
+target_link_libraries(multistreamclient PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Network
+ Qt::Widgets
+)
+
+install(TARGETS multistreamclient
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/network/multistreamserver/CMakeLists.txt b/examples/network/multistreamserver/CMakeLists.txt
new file mode 100644
index 0000000000..ee871d06fa
--- /dev/null
+++ b/examples/network/multistreamserver/CMakeLists.txt
@@ -0,0 +1,38 @@
+# Generated from multistreamserver.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(multistreamserver LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/network/multistreamserver")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Network)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(multistreamserver
+ chatprovider.cpp chatprovider.h
+ main.cpp
+ movieprovider.cpp movieprovider.h
+ provider.h
+ server.cpp server.h
+ timeprovider.cpp timeprovider.h
+)
+target_link_libraries(multistreamserver PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Network
+ Qt::Widgets
+)
+
+install(TARGETS multistreamserver
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/network/network-chat/CMakeLists.txt b/examples/network/network-chat/CMakeLists.txt
new file mode 100644
index 0000000000..4bd4879beb
--- /dev/null
+++ b/examples/network/network-chat/CMakeLists.txt
@@ -0,0 +1,38 @@
+# Generated from network-chat.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(network-chat LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/network/network-chat")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Network)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(network-chat
+ chatdialog.cpp chatdialog.h chatdialog.ui
+ client.cpp client.h
+ connection.cpp connection.h
+ main.cpp
+ peermanager.cpp peermanager.h
+ server.cpp server.h
+)
+target_link_libraries(network-chat PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Network
+ Qt::Widgets
+)
+
+install(TARGETS network-chat
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/network/securesocketclient/CMakeLists.txt b/examples/network/securesocketclient/CMakeLists.txt
new file mode 100644
index 0000000000..13cdeba66d
--- /dev/null
+++ b/examples/network/securesocketclient/CMakeLists.txt
@@ -0,0 +1,49 @@
+# Generated from securesocketclient.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(securesocketclient LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/network/securesocketclient")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Network)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(securesocketclient
+ certificateinfo.cpp certificateinfo.h certificateinfo.ui
+ main.cpp
+ sslclient.cpp sslclient.h sslclient.ui
+ sslerrors.ui
+)
+target_link_libraries(securesocketclient PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Network
+ Qt::Widgets
+)
+
+
+# Resources:
+set(securesocketclient_resource_files
+ "encrypted.png"
+)
+
+qt6_add_resources(securesocketclient "securesocketclient"
+ PREFIX
+ "/"
+ FILES
+ ${securesocketclient_resource_files}
+)
+
+install(TARGETS securesocketclient
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/network/securesocketclient/certificateinfo.cpp b/examples/network/securesocketclient/certificateinfo.cpp
index 81429fc655..9d0a674efe 100644
--- a/examples/network/securesocketclient/certificateinfo.cpp
+++ b/examples/network/securesocketclient/certificateinfo.cpp
@@ -57,7 +57,7 @@ CertificateInfo::CertificateInfo(QWidget *parent)
form = new Ui_CertificateInfo;
form->setupUi(this);
- connect(form->certificationPathView, QOverload<int>::of(&QComboBox::currentIndexChanged),
+ connect(form->certificationPathView, &QComboBox::currentIndexChanged,
this, &CertificateInfo::updateCertificateInfo);
}
diff --git a/examples/network/secureudpclient/CMakeLists.txt b/examples/network/secureudpclient/CMakeLists.txt
new file mode 100644
index 0000000000..936d93524b
--- /dev/null
+++ b/examples/network/secureudpclient/CMakeLists.txt
@@ -0,0 +1,36 @@
+# Generated from secureudpclient.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(secureudpclient LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/network/secureudpclient")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS Network)
+
+add_qt_gui_executable(secureudpclient
+ addressdialog.cpp addressdialog.h addressdialog.ui
+ association.cpp association.h
+ main.cpp
+ mainwindow.cpp mainwindow.h mainwindow.ui
+)
+target_link_libraries(secureudpclient PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Network
+ Qt::Widgets
+)
+
+install(TARGETS secureudpclient
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/network/secureudpserver/CMakeLists.txt b/examples/network/secureudpserver/CMakeLists.txt
new file mode 100644
index 0000000000..70816aea6b
--- /dev/null
+++ b/examples/network/secureudpserver/CMakeLists.txt
@@ -0,0 +1,36 @@
+# Generated from secureudpserver.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(secureudpserver LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/network/secureudpserver")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS Network)
+
+add_qt_gui_executable(secureudpserver
+ main.cpp
+ mainwindow.cpp mainwindow.h mainwindow.ui
+ nicselector.cpp nicselector.h nicselector.ui
+ server.cpp server.h
+)
+target_link_libraries(secureudpserver PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Network
+ Qt::Widgets
+)
+
+install(TARGETS secureudpserver
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/network/threadedfortuneserver/CMakeLists.txt b/examples/network/threadedfortuneserver/CMakeLists.txt
new file mode 100644
index 0000000000..20463b1417
--- /dev/null
+++ b/examples/network/threadedfortuneserver/CMakeLists.txt
@@ -0,0 +1,36 @@
+# Generated from threadedfortuneserver.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(threadedfortuneserver LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/network/threadedfortuneserver")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Network)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(threadedfortuneserver
+ dialog.cpp dialog.h
+ fortuneserver.cpp fortuneserver.h
+ fortunethread.cpp fortunethread.h
+ main.cpp
+)
+target_link_libraries(threadedfortuneserver PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Network
+ Qt::Widgets
+)
+
+install(TARGETS threadedfortuneserver
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/network/torrent/.prev_CMakeLists.txt b/examples/network/torrent/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..b3ff66a4b3
--- /dev/null
+++ b/examples/network/torrent/.prev_CMakeLists.txt
@@ -0,0 +1,65 @@
+# Generated from torrent.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(torrent LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/network/torrent")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Network)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(torrent
+ addtorrentdialog.cpp addtorrentdialog.h
+ bencodeparser.cpp bencodeparser.h
+ connectionmanager.cpp connectionmanager.h
+ filemanager.cpp filemanager.h
+ forms/addtorrentform.ui
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ metainfo.cpp metainfo.h
+ peerwireclient.cpp peerwireclient.h
+ ratecontroller.cpp ratecontroller.h
+ torrentclient.cpp torrentclient.h
+ torrentserver.cpp torrentserver.h
+ trackerclient.cpp trackerclient.h
+)
+target_link_libraries(torrent PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Network
+ Qt::Widgets
+)
+
+
+# Resources:
+set(icons_resource_files
+ "icons/1downarrow.png"
+ "icons/1uparrow.png"
+ "icons/bottom.png"
+ "icons/exit.png"
+ "icons/peertopeer.png"
+ "icons/player_pause.png"
+ "icons/player_play.png"
+ "icons/player_stop.png"
+)
+
+qt6_add_resources(torrent "icons"
+ PREFIX
+ "/"
+ FILES
+ ${icons_resource_files}
+)
+
+install(TARGETS torrent
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/network/torrent/CMakeLists.txt b/examples/network/torrent/CMakeLists.txt
new file mode 100644
index 0000000000..34df6e0c63
--- /dev/null
+++ b/examples/network/torrent/CMakeLists.txt
@@ -0,0 +1,66 @@
+# Generated from torrent.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(torrent LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/network/torrent")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Network)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(torrent
+ addtorrentdialog.cpp addtorrentdialog.h
+ bencodeparser.cpp bencodeparser.h
+ connectionmanager.cpp connectionmanager.h
+ filemanager.cpp filemanager.h
+ forms/addtorrentform.ui
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ metainfo.cpp metainfo.h
+ peerwireclient.cpp peerwireclient.h
+ ratecontroller.cpp ratecontroller.h
+ torrentclient.cpp torrentclient.h
+ torrentserver.cpp torrentserver.h
+ trackerclient.cpp trackerclient.h
+)
+target_include_directories(torrent PUBLIC forms) # special case
+target_link_libraries(torrent PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Network
+ Qt::Widgets
+)
+
+
+# Resources:
+set(icons_resource_files
+ "icons/1downarrow.png"
+ "icons/1uparrow.png"
+ "icons/bottom.png"
+ "icons/exit.png"
+ "icons/peertopeer.png"
+ "icons/player_pause.png"
+ "icons/player_play.png"
+ "icons/player_stop.png"
+)
+
+qt6_add_resources(torrent "icons"
+ PREFIX
+ "/"
+ FILES
+ ${icons_resource_files}
+)
+
+install(TARGETS torrent
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/opengl/2dpainting/2dpainting.pro b/examples/opengl/2dpainting/2dpainting.pro
index b9611f5b40..751c2022fd 100644
--- a/examples/opengl/2dpainting/2dpainting.pro
+++ b/examples/opengl/2dpainting/2dpainting.pro
@@ -1,4 +1,4 @@
-QT += widgets
+QT += widgets opengl openglwidgets
HEADERS = glwidget.h \
helper.h \
diff --git a/examples/opengl/2dpainting/CMakeLists.txt b/examples/opengl/2dpainting/CMakeLists.txt
new file mode 100644
index 0000000000..31f8005a19
--- /dev/null
+++ b/examples/opengl/2dpainting/CMakeLists.txt
@@ -0,0 +1,39 @@
+# Generated from 2dpainting.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(2dpainting LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/opengl/2dpainting")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS OpenGL)
+find_package(Qt6 COMPONENTS OpenGLWidgets)
+
+add_qt_gui_executable(2dpainting
+ glwidget.cpp glwidget.h
+ helper.cpp helper.h
+ main.cpp
+ widget.cpp widget.h
+ window.cpp window.h
+)
+target_link_libraries(2dpainting PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::OpenGL
+ Qt::OpenGLWidgets
+ Qt::Widgets
+)
+
+install(TARGETS 2dpainting
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/opengl/CMakeLists.txt b/examples/opengl/CMakeLists.txt
new file mode 100644
index 0000000000..3d5b055b1a
--- /dev/null
+++ b/examples/opengl/CMakeLists.txt
@@ -0,0 +1,17 @@
+# Generated from opengl.pro.
+
+add_subdirectory(hellowindow)
+add_subdirectory(paintedwindow)
+add_subdirectory(openglwindow)
+add_subdirectory(qopenglwindow)
+if(TARGET Qt::Widgets)
+ add_subdirectory(contextinfo)
+ add_subdirectory(threadedqopenglwidget)
+ add_subdirectory(2dpainting)
+ add_subdirectory(hellogl2)
+ add_subdirectory(qopenglwidget)
+ add_subdirectory(cube)
+ add_subdirectory(textures)
+ add_subdirectory(hellogles3)
+ add_subdirectory(computegles31)
+endif()
diff --git a/examples/opengl/computegles31/CMakeLists.txt b/examples/opengl/computegles31/CMakeLists.txt
new file mode 100644
index 0000000000..2012fca361
--- /dev/null
+++ b/examples/opengl/computegles31/CMakeLists.txt
@@ -0,0 +1,45 @@
+# Generated from computegles31.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(computegles31 LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/opengl/computegles31")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS OpenGL)
+
+add_qt_gui_executable(computegles31
+ glwindow.cpp glwindow.h
+ main.cpp
+)
+target_link_libraries(computegles31 PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::OpenGL
+)
+
+
+# Resources:
+set(computegles31_resource_files
+ "Qt-logo-medium.png"
+)
+
+qt6_add_resources(computegles31 "computegles31"
+ PREFIX
+ "/"
+ FILES
+ ${computegles31_resource_files}
+)
+
+install(TARGETS computegles31
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/opengl/computegles31/computegles31.pro b/examples/opengl/computegles31/computegles31.pro
index 5b9d7e4387..8d9b00ba83 100644
--- a/examples/opengl/computegles31/computegles31.pro
+++ b/examples/opengl/computegles31/computegles31.pro
@@ -1,3 +1,5 @@
+QT += opengl
+
HEADERS = $$PWD/glwindow.h
SOURCES = $$PWD/glwindow.cpp \
diff --git a/examples/opengl/contextinfo/CMakeLists.txt b/examples/opengl/contextinfo/CMakeLists.txt
new file mode 100644
index 0000000000..124dfd4b52
--- /dev/null
+++ b/examples/opengl/contextinfo/CMakeLists.txt
@@ -0,0 +1,35 @@
+# Generated from contextinfo.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(contextinfo LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/opengl/contextinfo")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS OpenGL)
+
+add_qt_gui_executable(contextinfo
+ main.cpp
+ renderwindow.cpp renderwindow.h
+ widget.cpp widget.h
+)
+target_link_libraries(contextinfo PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::OpenGL
+ Qt::Widgets
+)
+
+install(TARGETS contextinfo
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/opengl/contextinfo/contextinfo.pro b/examples/opengl/contextinfo/contextinfo.pro
index 3d948dd282..ae8f4067b6 100644
--- a/examples/opengl/contextinfo/contextinfo.pro
+++ b/examples/opengl/contextinfo/contextinfo.pro
@@ -1,5 +1,5 @@
TEMPLATE = app
-QT += widgets
+QT += widgets opengl
requires(qtConfig(filedialog))
SOURCES += main.cpp \
diff --git a/examples/opengl/contextinfo/renderwindow.cpp b/examples/opengl/contextinfo/renderwindow.cpp
index ea9a7a24cb..b778fd1d89 100644
--- a/examples/opengl/contextinfo/renderwindow.cpp
+++ b/examples/opengl/contextinfo/renderwindow.cpp
@@ -52,7 +52,7 @@
#include <QTimer>
#include <QMatrix4x4>
#include <QOpenGLContext>
-#include <QOpenGLShaderProgram>
+#include <QtOpenGL/QOpenGLShaderProgram>
#include <QOpenGLFunctions>
RenderWindow::RenderWindow(const QSurfaceFormat &format)
diff --git a/examples/opengl/cube/CMakeLists.txt b/examples/opengl/cube/CMakeLists.txt
new file mode 100644
index 0000000000..2d0d0f7887
--- /dev/null
+++ b/examples/opengl/cube/CMakeLists.txt
@@ -0,0 +1,61 @@
+# Generated from cube.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(cube LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/opengl/cube")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS OpenGL)
+find_package(Qt6 COMPONENTS OpenGLWidgets)
+
+add_qt_gui_executable(cube
+ geometryengine.cpp geometryengine.h
+ main.cpp
+ mainwidget.cpp mainwidget.h
+)
+target_link_libraries(cube PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::OpenGL
+ Qt::OpenGLWidgets
+ Qt::Widgets
+)
+
+
+# Resources:
+set(shaders_resource_files
+ "fshader.glsl"
+ "vshader.glsl"
+)
+
+qt6_add_resources(cube "shaders"
+ PREFIX
+ "/"
+ FILES
+ ${shaders_resource_files}
+)
+set(textures_resource_files
+ "cube.png"
+)
+
+qt6_add_resources(cube "textures"
+ PREFIX
+ "/"
+ FILES
+ ${textures_resource_files}
+)
+
+install(TARGETS cube
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/opengl/cube/cube.pro b/examples/opengl/cube/cube.pro
index b9416f1a9d..95a411322a 100644
--- a/examples/opengl/cube/cube.pro
+++ b/examples/opengl/cube/cube.pro
@@ -1,4 +1,4 @@
-QT += core gui widgets
+QT += core gui widgets opengl openglwidgets
TARGET = cube
TEMPLATE = app
diff --git a/examples/opengl/doc/src/2dpainting.qdoc b/examples/opengl/doc/src/2dpainting.qdoc
index e6b33e2a14..32b332fa8a 100644
--- a/examples/opengl/doc/src/2dpainting.qdoc
+++ b/examples/opengl/doc/src/2dpainting.qdoc
@@ -30,8 +30,8 @@
\title 2D Painting Example
\ingroup examples-widgets-opengl
- \brief The 2D Painting example shows how QPainter and QGLWidget can be used
- together to display accelerated 2D graphics on supported hardware.
+ \brief The 2D Painting example shows how QPainter and QOpenGLWidget can be
+ used together to display accelerated 2D graphics on supported hardware.
\image 2dpainting-example.png
@@ -39,23 +39,23 @@
paint devices provided by QPaintDevice subclasses, such as QWidget
and QImage.
- Since QGLWidget is a subclass of QWidget, it is possible
+ Since QOpenGLWidget is a subclass of QWidget, it is possible
to reimplement its \l{QWidget::paintEvent()}{paintEvent()} and use
QPainter to draw on the device, just as you would with a QWidget.
The only difference is that the painting operations will be accelerated
in hardware if it is supported by your system's OpenGL drivers.
In this example, we perform the same painting operations on a
- QWidget and a QGLWidget. The QWidget is shown with anti-aliasing
- enabled, and the QGLWidget will also use anti-aliasing if the
+ QWidget and a QOpenGLWidget. The QWidget is shown with anti-aliasing
+ enabled, and the QOpenGLWidget will also use anti-aliasing if the
required extensions are supported by your system's OpenGL driver.
\section1 Overview
- To be able to compare the results of painting onto a QGLWidget subclass
+ To be able to compare the results of painting onto a QOpenGLWidget subclass
with native drawing in a QWidget subclass, we want to show both kinds
of widget side by side. To do this, we derive subclasses of QWidget and
- QGLWidget, using a separate \c Helper class to perform the same painting
+ QOpenGLWidget, using a separate \c Helper class to perform the same painting
operations for each, and lay them out in a top-level widget, itself
provided a the \c Window class.
@@ -63,7 +63,7 @@
In this example, the painting operations are performed by a helper class.
We do this because we want the same painting operations to be performed
- for both our QWidget subclass and the QGLWidget subclass.
+ for both our QWidget subclass and the QOpenGLWidget subclass.
The \c Helper class is minimal:
@@ -81,7 +81,7 @@
The actual painting is performed in the \c paint() function. This takes
a QPainter that has already been set up to paint onto a paint device
- (either a QWidget or a QGLWidget), a QPaintEvent that provides information
+ (either a QWidget or a QOpenGLWidget), a QPaintEvent that provides information
about the region to be painted, and a measure of the elapsed time (in
milliseconds) since the paint device was last updated.
@@ -148,7 +148,7 @@
\section1 GLWidget Class Definition
The \c GLWidget class definition is basically the same as the \c Widget
- class except that it is derived from QGLWidget.
+ class except that it is derived from QOpenGLWidget.
\snippet 2dpainting/glwidget.h 0
@@ -161,11 +161,8 @@
\snippet 2dpainting/glwidget.cpp 0
- As well as initializing the \c elapsed member variable and storing the
- \c Helper object used to paint the widget, the base class's constructor
- is called with the format that specifies the \l QGL::SampleBuffers flag.
- This enables anti-aliasing if it is supported by your system's OpenGL
- driver.
+ The \c elapsed member variable is initialized and the \c Helper object used
+ to paint the widget is stored.
The \c animate() slot is exactly the same as that provided by the \c Widget
class:
diff --git a/examples/opengl/doc/src/cube.qdoc b/examples/opengl/doc/src/cube.qdoc
index 1fdfe0c6ec..4f5b6bda90 100644
--- a/examples/opengl/doc/src/cube.qdoc
+++ b/examples/opengl/doc/src/cube.qdoc
@@ -47,7 +47,7 @@
The example consist of two classes:
\list
- \li \c MainWidget extends QGLWidget and contains OpenGL ES 2.0
+ \li \c MainWidget extends QOpenGLWidget and contains OpenGL ES 2.0
initialization and drawing and mouse and timer event handling
\li \c GeometryEngine handles polygon geometries. Transfers polygon geometry
to vertex buffer objects and draws geometries from vertex buffer objects.
@@ -81,7 +81,7 @@
\snippet cube/fshader.glsl 0
- Using \c QGLShaderProgram we can compile, link and bind shader code to
+ Using QOpenGLShaderProgram we can compile, link and bind shader code to
graphics pipeline. This code uses Qt Resource files to access shader source code.
\snippet cube/mainwidget.cpp 3
@@ -92,9 +92,9 @@
\section1 Loading Textures from Qt Resource Files
- \c QGLWidget interface implements methods for loading textures from QImage to GL
- texture memory. We still need to use OpenGL provided functions for specifying
- the GL texture unit and configuring texture filtering options.
+ The \c QOpenGLWidget interface implements methods for loading textures from QImage
+ to OpenGL texture memory. We still need to use OpenGL provided functions for
+ specifying the OpenGL texture unit and configuring texture filtering options.
\snippet cube/mainwidget.cpp 4
diff --git a/examples/opengl/hellogl2/CMakeLists.txt b/examples/opengl/hellogl2/CMakeLists.txt
new file mode 100644
index 0000000000..798a83594e
--- /dev/null
+++ b/examples/opengl/hellogl2/CMakeLists.txt
@@ -0,0 +1,39 @@
+# Generated from hellogl2.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(hellogl2 LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/opengl/hellogl2")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS OpenGL)
+find_package(Qt6 COMPONENTS OpenGLWidgets)
+
+add_qt_gui_executable(hellogl2
+ glwidget.cpp glwidget.h
+ logo.cpp logo.h
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ window.cpp window.h
+)
+target_link_libraries(hellogl2 PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::OpenGL
+ Qt::OpenGLWidgets
+ Qt::Widgets
+)
+
+install(TARGETS hellogl2
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/opengl/hellogl2/hellogl2.pro b/examples/opengl/hellogl2/hellogl2.pro
index 3a52e04d74..d7cd38de53 100644
--- a/examples/opengl/hellogl2/hellogl2.pro
+++ b/examples/opengl/hellogl2/hellogl2.pro
@@ -8,7 +8,7 @@ SOURCES = glwidget.cpp \
mainwindow.cpp \
logo.cpp
-QT += widgets
+QT += widgets opengl openglwidgets
# install
target.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl2
diff --git a/examples/opengl/hellogles3/CMakeLists.txt b/examples/opengl/hellogles3/CMakeLists.txt
new file mode 100644
index 0000000000..7e8a5e57a7
--- /dev/null
+++ b/examples/opengl/hellogles3/CMakeLists.txt
@@ -0,0 +1,46 @@
+# Generated from hellogles3.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(hellogles3 LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/opengl/hellogles3")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS OpenGL)
+
+add_qt_gui_executable(hellogles3
+ ../hellogl2/logo.cpp ../hellogl2/logo.h
+ glwindow.cpp glwindow.h
+ main.cpp
+)
+target_link_libraries(hellogles3 PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::OpenGL
+)
+
+
+# Resources:
+set(hellogles3_resource_files
+ "qtlogo.png"
+)
+
+qt6_add_resources(hellogles3 "hellogles3"
+ PREFIX
+ "/"
+ FILES
+ ${hellogles3_resource_files}
+)
+
+install(TARGETS hellogles3
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/opengl/hellogles3/hellogles3.pro b/examples/opengl/hellogles3/hellogles3.pro
index e0d4c25ca6..8d9fbe25ca 100644
--- a/examples/opengl/hellogles3/hellogles3.pro
+++ b/examples/opengl/hellogles3/hellogles3.pro
@@ -1,3 +1,5 @@
+QT += opengl
+
HEADERS = $$PWD/glwindow.h \
$$PWD/../hellogl2/logo.h
diff --git a/examples/opengl/hellowindow/CMakeLists.txt b/examples/opengl/hellowindow/CMakeLists.txt
new file mode 100644
index 0000000000..876c282fbe
--- /dev/null
+++ b/examples/opengl/hellowindow/CMakeLists.txt
@@ -0,0 +1,34 @@
+# Generated from hellowindow.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(hellowindow LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/opengl/hellowindow")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS OpenGL)
+
+add_qt_gui_executable(hellowindow
+ hellowindow.cpp hellowindow.h
+ main.cpp
+)
+target_link_libraries(hellowindow PUBLIC
+ Qt::Core
+ Qt::CorePrivate
+ Qt::Gui
+ Qt::GuiPrivate
+ Qt::OpenGL
+)
+
+install(TARGETS hellowindow
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/opengl/hellowindow/hellowindow.h b/examples/opengl/hellowindow/hellowindow.h
index e6d7970cfc..938c6409a4 100644
--- a/examples/opengl/hellowindow/hellowindow.h
+++ b/examples/opengl/hellowindow/hellowindow.h
@@ -52,7 +52,7 @@
#include <QColor>
#include <QMutex>
-#include <QOpenGLShaderProgram>
+#include <QtOpenGL/QOpenGLShaderProgram>
#include <QOpenGLBuffer>
#include <QSharedPointer>
#include <QTimer>
diff --git a/examples/opengl/hellowindow/hellowindow.pro b/examples/opengl/hellowindow/hellowindow.pro
index cc220fd344..27c274a378 100644
--- a/examples/opengl/hellowindow/hellowindow.pro
+++ b/examples/opengl/hellowindow/hellowindow.pro
@@ -1,4 +1,4 @@
-QT += gui-private core-private
+QT += gui-private core-private opengl
HEADERS += hellowindow.h
SOURCES += hellowindow.cpp main.cpp
diff --git a/examples/opengl/legacy/README b/examples/opengl/legacy/README
deleted file mode 100644
index 8d6cbdef2a..0000000000
--- a/examples/opengl/legacy/README
+++ /dev/null
@@ -1,4 +0,0 @@
-This directory contains legacy examples that use the fixed pipeline
-and thus are not compatible with OpenGL ES 2.0+ and the core profile of
-OpenGL 3.0+. They also rely on the Qt OpenGL module (e.g. QGLWidget) which
-is not advisable in new application.
diff --git a/examples/opengl/legacy/framebufferobject2/cubelogo.png b/examples/opengl/legacy/framebufferobject2/cubelogo.png
deleted file mode 100644
index 2ccbede774..0000000000
--- a/examples/opengl/legacy/framebufferobject2/cubelogo.png
+++ /dev/null
Binary files differ
diff --git a/examples/opengl/legacy/framebufferobject2/framebufferobject2.pro b/examples/opengl/legacy/framebufferobject2/framebufferobject2.pro
deleted file mode 100644
index 3f2578bc1f..0000000000
--- a/examples/opengl/legacy/framebufferobject2/framebufferobject2.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-HEADERS += glwidget.h
-SOURCES += glwidget.cpp main.cpp
-RESOURCES += framebufferobject2.qrc
-
-QT += opengl widgets
-
-# install
-target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/framebufferobject2
-INSTALLS += target
-
-qtConfig(opengles.|angle|dynamicgl): error("This example requires Qt to be configured with -opengl desktop")
diff --git a/examples/opengl/legacy/framebufferobject2/framebufferobject2.qrc b/examples/opengl/legacy/framebufferobject2/framebufferobject2.qrc
deleted file mode 100644
index 9fc1a56a1a..0000000000
--- a/examples/opengl/legacy/framebufferobject2/framebufferobject2.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource prefix="/res">
- <file>cubelogo.png</file>
-</qresource>
-</RCC>
diff --git a/examples/opengl/legacy/framebufferobject2/glwidget.cpp b/examples/opengl/legacy/framebufferobject2/glwidget.cpp
deleted file mode 100644
index f14d31aff6..0000000000
--- a/examples/opengl/legacy/framebufferobject2/glwidget.cpp
+++ /dev/null
@@ -1,257 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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 "glwidget.h"
-#include <QtGui/QImage>
-#include <qmath.h>
-
-static GLint cubeArray[][3] = {
- {0, 0, 0}, {0, 1, 0}, {1, 1, 0}, {1, 0, 0},
- {0, 0, 1}, {1, 0, 1}, {1, 1, 1}, {0, 1, 1},
- {0, 0, 0}, {1, 0, 0}, {1, 0, 1}, {0, 0, 1},
- {0, 1, 0}, {0, 1, 1}, {1, 1, 1}, {1, 1, 0},
- {0, 1, 0}, {0, 0, 0}, {0, 0, 1}, {0, 1, 1},
- {1, 0, 0}, {1, 1, 0}, {1, 1, 1}, {1, 0, 1}
-};
-
-static GLint cubeTextureArray[][2] = {
- {0, 0}, {1, 0}, {1, 1}, {0, 1},
- {0, 0}, {0, 1}, {1, 1}, {1, 0},
- {0, 0}, {1, 0}, {1, 1}, {0, 1},
- {1, 0}, {0, 0}, {0, 1}, {1, 1},
- {0, 0}, {1, 0}, {1, 1}, {0, 1},
- {1, 0}, {0, 0}, {0, 1}, {1, 1}
-};
-
-static GLint faceArray[][2] = {
- {1, -1}, {1, 1}, {-1, 1}, {-1, -1}
-};
-
-static GLubyte colorArray[][4] = {
- {102, 176, 54, 255},
- {81, 141, 41, 255},
- {62, 108, 32, 255},
- {45, 79, 23, 255}
-};
-
-GLWidget::GLWidget(QWidget *parent)
- : QGLWidget(QGLFormat(QGL::SampleBuffers), parent)
-{
- // create the framebuffer object - make sure to have a current
- // context before creating it
- makeCurrent();
- fbo = new QGLFramebufferObject(512, 512);
- timerId = startTimer(20);
- setWindowTitle(tr("OpenGL framebuffer objects 2"));
-}
-
-GLWidget::~GLWidget()
-{
- glDeleteLists(pbufferList, 1);
- delete fbo;
-}
-
-void GLWidget::initializeGL()
-{
- glMatrixMode(GL_MODELVIEW);
-
- glEnable(GL_CULL_FACE);
-
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glVertexPointer(3, GL_INT, 0, cubeArray);
- glTexCoordPointer(2, GL_INT, 0, cubeTextureArray);
- glColorPointer(4, GL_UNSIGNED_BYTE, 0, colorArray);
-
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glEnable(GL_BLEND);
- glEnable(GL_TEXTURE_2D);
- glEnable(GL_DEPTH_TEST);
-
- glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
- pbufferList = glGenLists(1);
- glNewList(pbufferList, GL_COMPILE);
- {
- glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
-
- // draw cube background
- glPushMatrix();
- glLoadIdentity();
- glTranslatef(0.5f, 0.5f, -2.0f);
- glDisable(GL_TEXTURE_2D);
- glEnableClientState(GL_COLOR_ARRAY);
- glVertexPointer(2, GL_INT, 0, faceArray);
- glDrawArrays(GL_QUADS, 0, 4);
- glVertexPointer(3, GL_INT, 0, cubeArray);
- glDisableClientState(GL_COLOR_ARRAY);
- glEnable(GL_TEXTURE_2D);
- glPopMatrix();
-
- // draw cube
- glTranslatef(0.5f, 0.5f, 0.5f);
- glRotatef(3.0f, 1.0f, 1.0f, 1.0f);
- glTranslatef(-0.5f, -0.5f, -0.5f);
- glColor4f(0.9f, 0.9f, 0.9f, 1.0f);
- glDrawArrays(GL_QUADS, 0, 24);
-
- glPushMatrix(); // this state is popped back in the paintGL() function
- }
- glEndList();
-
- for (int i = 0; i < 3; ++i) {
- yOffs[i] = 0.0f;
- xInc[i] = 0.005f;
- rot[i] = 0.0f;
- }
- xOffs[0]= 0.0f;
- xOffs[1]= 0.5f;
- xOffs[2]= 1.0f;
-
- cubeTexture = bindTexture(QImage(":res/cubelogo.png"));
-
- glPushMatrix(); // push to avoid stack underflow in the first paintGL() call
-}
-
-void GLWidget::resizeGL(int w, int h)
-{
- glViewport(0, 0, w, h);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- float aspect = w/(float)(h ? h : 1);
- glFrustum(-aspect, aspect, -1, 1, 10, 100);
- glTranslatef(-0.5f, -0.5f, -0.5f);
- glTranslatef(0.0f, 0.0f, -15.0f);
-}
-
-void GLWidget::paintGL()
-{
- glPopMatrix(); // pop the matrix pushed in the pbuffer list
-
- // push the projection matrix and the entire GL state before
- // doing any rendering into our framebuffer object
- glPushAttrib(GL_ALL_ATTRIB_BITS);
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
-
- glViewport(0, 0, fbo->size().width(), fbo->size().height());
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1, 1, -1, 1, -99, 99);
- glTranslatef(-0.5f, -0.5f, 0.0f);
- glMatrixMode(GL_MODELVIEW);
-
- // render to the framebuffer object
- fbo->bind();
- glBindTexture(GL_TEXTURE_2D, cubeTexture);
- glCallList(pbufferList);
- fbo->release();
-
- // pop the projection matrix and GL state back for rendering
- // to the actual widget
- glPopAttrib();
- glMatrixMode(GL_PROJECTION);
- glPopMatrix();
-
- glBindTexture(GL_TEXTURE_2D, fbo->texture());
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- // draw the background
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
- glLoadIdentity();
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- glLoadIdentity();
-
- glVertexPointer(2, GL_INT, 0, faceArray);
- glTranslatef(-1.2f, -0.8f, 0.0f);
- glScalef(0.2f, 0.2f, 0.2f);
- for (int y = 0; y < 5; ++y) {
- for (int x = 0; x < 5; ++x) {
- glTranslatef(2.0f, 0, 0);
- glColor4f(0.8f, 0.8f, 0.8f, 1.0f);
- glDrawArrays(GL_QUADS, 0, 4);
- }
- glTranslatef(-10.0f, 2.0f, 0);
- }
- glVertexPointer(3, GL_INT, 0, cubeArray);
-
- glPopMatrix();
- glMatrixMode(GL_MODELVIEW);
-
- // draw the bouncing cubes
- drawCube(0, 0.0f, 1.5f, 2.5f, 1.5f);
- drawCube(1, 1.0f, 2.0f, 2.5f, 2.0f);
- drawCube(2, 2.0f, 3.5f, 2.5f, 2.5f);
- glPopMatrix();
-}
-
-void GLWidget::drawCube(int i, GLfloat z, GLfloat rotation, GLfloat jmp, GLfloat amp)
-{
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glTranslatef(xOffs[i], yOffs[i], z);
- glTranslatef(0.5f, 0.5f, 0.5f);
- GLfloat scale = 0.75 + i*(0.25f/2);
- glScalef(scale, scale, scale);
- glRotatef(rot[i], 1.0f, 1.0f, 1.0f);
- glTranslatef(-0.5f, -0.5f, -0.5f);
-
- glColor4f(1.0f, 1.0f, 1.0f, 0.8f);
- glDrawArrays(GL_QUADS, 0, 24);
-
- if (xOffs[i] > 1.0f || xOffs[i] < -1.0f) {
- xInc[i] = -xInc[i];
- xOffs[i] = xOffs[i] > 1.0f ? 1.0f : -1.0f;
- }
- xOffs[i] += xInc[i];
- yOffs[i] = qAbs(cos((-GLfloat(M_PI) * jmp) * xOffs[i]) * amp) - 1;
- rot[i] += rotation;
-}
diff --git a/examples/opengl/legacy/framebufferobject2/glwidget.h b/examples/opengl/legacy/framebufferobject2/glwidget.h
deleted file mode 100644
index d3e4aa5af5..0000000000
--- a/examples/opengl/legacy/framebufferobject2/glwidget.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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 <QtOpenGL>
-
-class GLWidget : public QGLWidget
-{
-public:
- GLWidget(QWidget *parent);
- ~GLWidget();
- void initializeGL() override;
- void resizeGL(int w, int h) override;
- void paintGL() override;
- void timerEvent(QTimerEvent *) override { update(); }
- void mousePressEvent(QMouseEvent *) override { killTimer(timerId); }
- void mouseReleaseEvent(QMouseEvent *) override { timerId = startTimer(20); }
-
- void drawCube(int i, GLfloat z, GLfloat ri, GLfloat jmp, GLfloat amp);
-
-private:
- GLfloat rot[3], xOffs[3], yOffs[3], xInc[3];
- GLuint pbufferList;
- GLuint cubeTexture;
- int timerId;
-
- QGLFramebufferObject *fbo;
-};
-
diff --git a/examples/opengl/legacy/framebufferobject2/main.cpp b/examples/opengl/legacy/framebufferobject2/main.cpp
deleted file mode 100644
index ae7447c2a5..0000000000
--- a/examples/opengl/legacy/framebufferobject2/main.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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/QApplication>
-#include <QtWidgets/QMessageBox>
-#include "glwidget.h"
-
-int main(int argc, char **argv)
-{
- Q_INIT_RESOURCE(framebufferobject2);
-
- QApplication a(argc, argv);
- if (!QGLFormat::hasOpenGL() || !QGLFramebufferObject::hasOpenGLFramebufferObjects()) {
- QMessageBox::information(0, "OpenGL framebuffer objects 2",
- "This system does not support OpenGL/framebuffer objects.");
- return -1;
- }
-
- GLWidget widget(0);
- widget.resize(640, 480);
- widget.show();
- return a.exec();
-}
-
diff --git a/examples/opengl/legacy/grabber/glwidget.cpp b/examples/opengl/legacy/grabber/glwidget.cpp
deleted file mode 100644
index 6be4d30597..0000000000
--- a/examples/opengl/legacy/grabber/glwidget.cpp
+++ /dev/null
@@ -1,286 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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 "glwidget.h"
-
-#include <QMouseEvent>
-#include <QTimer>
-#include <qmath.h>
-
-GLWidget::GLWidget(QWidget *parent)
- : QGLWidget(parent)
-{
- gear1 = 0;
- gear2 = 0;
- gear3 = 0;
- xRot = 0;
- yRot = 0;
- zRot = 0;
- gear1Rot = 0;
-
- QTimer *timer = new QTimer(this);
- connect(timer, SIGNAL(timeout()), this, SLOT(advanceGears()));
- timer->start(20);
-}
-
-GLWidget::~GLWidget()
-{
- makeCurrent();
- glDeleteLists(gear1, 1);
- glDeleteLists(gear2, 1);
- glDeleteLists(gear3, 1);
-}
-
-void GLWidget::setXRotation(int angle)
-{
- normalizeAngle(&angle);
- if (angle != xRot) {
- xRot = angle;
- emit xRotationChanged(angle);
- updateGL();
- }
-}
-
-void GLWidget::setYRotation(int angle)
-{
- normalizeAngle(&angle);
- if (angle != yRot) {
- yRot = angle;
- emit yRotationChanged(angle);
- updateGL();
- }
-}
-
-void GLWidget::setZRotation(int angle)
-{
- normalizeAngle(&angle);
- if (angle != zRot) {
- zRot = angle;
- emit zRotationChanged(angle);
- updateGL();
- }
-}
-
-void GLWidget::initializeGL()
-{
- static const GLfloat lightPos[4] = { 5.0f, 5.0f, 10.0f, 1.0f };
- static const GLfloat reflectance1[4] = { 0.8f, 0.1f, 0.0f, 1.0f };
- static const GLfloat reflectance2[4] = { 0.0f, 0.8f, 0.2f, 1.0f };
- static const GLfloat reflectance3[4] = { 0.2f, 0.2f, 1.0f, 1.0f };
-
- glLightfv(GL_LIGHT0, GL_POSITION, lightPos);
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
- glEnable(GL_DEPTH_TEST);
-
- gear1 = makeGear(reflectance1, 1.0, 4.0, 1.0, 0.7, 20);
- gear2 = makeGear(reflectance2, 0.5, 2.0, 2.0, 0.7, 10);
- gear3 = makeGear(reflectance3, 1.3, 2.0, 0.5, 0.7, 10);
-
- glEnable(GL_NORMALIZE);
- glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
-}
-
-void GLWidget::paintGL()
-{
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- glPushMatrix();
- glRotated(xRot / 16.0, 1.0, 0.0, 0.0);
- glRotated(yRot / 16.0, 0.0, 1.0, 0.0);
- glRotated(zRot / 16.0, 0.0, 0.0, 1.0);
-
- drawGear(gear1, -3.0, -2.0, 0.0, gear1Rot / 16.0);
- drawGear(gear2, +3.1, -2.0, 0.0, -2.0 * (gear1Rot / 16.0) - 9.0);
-
- glRotated(+90.0, 1.0, 0.0, 0.0);
- drawGear(gear3, -3.1, -1.8, -2.2, +2.0 * (gear1Rot / 16.0) - 2.0);
-
- glPopMatrix();
-}
-
-void GLWidget::resizeGL(int width, int height)
-{
- int side = qMin(width, height);
- glViewport((width - side) / 2, (height - side) / 2, side, side);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glFrustum(-1.0, +1.0, -1.0, 1.0, 5.0, 60.0);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glTranslated(0.0, 0.0, -40.0);
-}
-
-void GLWidget::mousePressEvent(QMouseEvent *event)
-{
- lastPos = event->pos();
-}
-
-void GLWidget::mouseMoveEvent(QMouseEvent *event)
-{
- int dx = event->x() - lastPos.x();
- int dy = event->y() - lastPos.y();
-
- if (event->buttons() & Qt::LeftButton) {
- setXRotation(xRot + 8 * dy);
- setYRotation(yRot + 8 * dx);
- } else if (event->buttons() & Qt::RightButton) {
- setXRotation(xRot + 8 * dy);
- setZRotation(zRot + 8 * dx);
- }
- lastPos = event->pos();
-}
-
-void GLWidget::advanceGears()
-{
- gear1Rot += 2 * 16;
- updateGL();
-}
-
-GLuint GLWidget::makeGear(const GLfloat *reflectance, GLdouble innerRadius,
- GLdouble outerRadius, GLdouble thickness,
- GLdouble toothSize, GLint toothCount)
-{
- GLuint list = glGenLists(1);
- glNewList(list, GL_COMPILE);
- glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, reflectance);
-
- GLdouble r0 = innerRadius;
- GLdouble r1 = outerRadius - toothSize / 2.0;
- GLdouble r2 = outerRadius + toothSize / 2.0;
- GLdouble toothAngle = 2 * M_PI / toothCount;
- GLdouble delta = toothAngle / 4.0;
- GLdouble z = thickness / 2.0;
-
- glShadeModel(GL_FLAT);
-
- for (int i = 0; i < 2; ++i) {
- GLdouble sign = (i == 0) ? +1.0 : -1.0;
-
- glNormal3d(0.0, 0.0, sign);
-
- glBegin(GL_QUAD_STRIP);
- for (int j = 0; j <= toothCount; ++j) {
- GLdouble angle = j * toothAngle;
- glVertex3d(r0 * cos(angle), r0 * sin(angle), sign * z);
- glVertex3d(r1 * cos(angle), r1 * sin(angle), sign * z);
- glVertex3d(r0 * cos(angle), r0 * sin(angle), sign * z);
- glVertex3d(r1 * cos(angle + 3 * delta), r1 * sin(angle + 3 * delta), sign * z);
- }
- glEnd();
-
- glBegin(GL_QUADS);
- for (int j = 0; j < toothCount; ++j) {
- GLdouble angle = j * toothAngle;
- glVertex3d(r1 * cos(angle), r1 * sin(angle), sign * z);
- glVertex3d(r2 * cos(angle + delta), r2 * sin(angle + delta), sign * z);
- glVertex3d(r2 * cos(angle + 2 * delta), r2 * sin(angle + 2 * delta), sign * z);
- glVertex3d(r1 * cos(angle + 3 * delta), r1 * sin(angle + 3 * delta), sign * z);
- }
- glEnd();
- }
-
- glBegin(GL_QUAD_STRIP);
- for (int i = 0; i < toothCount; ++i) {
- for (int j = 0; j < 2; ++j) {
- GLdouble angle = (i + j / 2.0) * toothAngle;
- GLdouble s1 = r1;
- GLdouble s2 = r2;
- if (j == 1)
- qSwap(s1, s2);
-
- glNormal3d(cos(angle), sin(angle), 0.0);
- glVertex3d(s1 * cos(angle), s1 * sin(angle), +z);
- glVertex3d(s1 * cos(angle), s1 * sin(angle), -z);
-
- glNormal3d(s2 * sin(angle + delta) - s1 * sin(angle),
- s1 * cos(angle) - s2 * cos(angle + delta), 0.0);
- glVertex3d(s2 * cos(angle + delta), s2 * sin(angle + delta), +z);
- glVertex3d(s2 * cos(angle + delta), s2 * sin(angle + delta), -z);
- }
- }
- glVertex3d(r1, 0.0, +z);
- glVertex3d(r1, 0.0, -z);
- glEnd();
-
- glShadeModel(GL_SMOOTH);
-
- glBegin(GL_QUAD_STRIP);
- for (int i = 0; i <= toothCount; ++i) {
- GLdouble angle = i * toothAngle;
- glNormal3d(-cos(angle), -sin(angle), 0.0);
- glVertex3d(r0 * cos(angle), r0 * sin(angle), +z);
- glVertex3d(r0 * cos(angle), r0 * sin(angle), -z);
- }
- glEnd();
-
- glEndList();
-
- return list;
-}
-
-void GLWidget::drawGear(GLuint gear, GLdouble dx, GLdouble dy, GLdouble dz,
- GLdouble angle)
-{
- glPushMatrix();
- glTranslated(dx, dy, dz);
- glRotated(angle, 0.0, 0.0, 1.0);
- glCallList(gear);
- glPopMatrix();
-}
-
-void GLWidget::normalizeAngle(int *angle)
-{
- while (*angle < 0)
- *angle += 360 * 16;
- while (*angle > 360 * 16)
- *angle -= 360 * 16;
-}
diff --git a/examples/opengl/legacy/grabber/glwidget.h b/examples/opengl/legacy/grabber/glwidget.h
deleted file mode 100644
index 67020b0ada..0000000000
--- a/examples/opengl/legacy/grabber/glwidget.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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$
-**
-****************************************************************************/
-
-#ifndef GLWIDGET_H
-#define GLWIDGET_H
-
-#include <QGLWidget>
-
-class GLWidget : public QGLWidget
-{
- Q_OBJECT
-
-public:
- GLWidget(QWidget *parent = 0);
- ~GLWidget();
-
- int xRotation() const { return xRot; }
- int yRotation() const { return yRot; }
- int zRotation() const { return zRot; }
-
-public slots:
- void setXRotation(int angle);
- void setYRotation(int angle);
- void setZRotation(int angle);
-
-signals:
- void xRotationChanged(int angle);
- void yRotationChanged(int angle);
- void zRotationChanged(int angle);
-
-protected:
- void initializeGL() override;
- void paintGL() override;
- void resizeGL(int width, int height) override;
- void mousePressEvent(QMouseEvent *event) override;
- void mouseMoveEvent(QMouseEvent *event) override;
-
-private slots:
- void advanceGears();
-
-private:
- GLuint makeGear(const GLfloat *reflectance, GLdouble innerRadius,
- GLdouble outerRadius, GLdouble thickness,
- GLdouble toothSize, GLint toothCount);
- void drawGear(GLuint gear, GLdouble dx, GLdouble dy, GLdouble dz,
- GLdouble angle);
- void normalizeAngle(int *angle);
-
- GLuint gear1;
- GLuint gear2;
- GLuint gear3;
- int xRot;
- int yRot;
- int zRot;
- int gear1Rot;
-
- QPoint lastPos;
-};
-
-#endif // GLWIDGET_H
diff --git a/examples/opengl/legacy/grabber/grabber.pro b/examples/opengl/legacy/grabber/grabber.pro
deleted file mode 100644
index 88c03f1c5e..0000000000
--- a/examples/opengl/legacy/grabber/grabber.pro
+++ /dev/null
@@ -1,12 +0,0 @@
-HEADERS = glwidget.h \
- mainwindow.h
-SOURCES = glwidget.cpp \
- main.cpp \
- mainwindow.cpp
-QT += opengl widgets
-
-# install
-target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/grabber
-INSTALLS += target
-
-qtConfig(opengles.|angle|dynamicgl): error("This example requires Qt to be configured with -opengl desktop")
diff --git a/examples/opengl/legacy/grabber/main.cpp b/examples/opengl/legacy/grabber/main.cpp
deleted file mode 100644
index e02118b078..0000000000
--- a/examples/opengl/legacy/grabber/main.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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 "mainwindow.h"
-
-#include <QApplication>
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- MainWindow window;
- window.show();
- return app.exec();
-}
diff --git a/examples/opengl/legacy/grabber/mainwindow.cpp b/examples/opengl/legacy/grabber/mainwindow.cpp
deleted file mode 100644
index 6ea6a28051..0000000000
--- a/examples/opengl/legacy/grabber/mainwindow.cpp
+++ /dev/null
@@ -1,216 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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 "glwidget.h"
-#include "mainwindow.h"
-
-#include <QtWidgets>
-
-MainWindow::MainWindow()
-{
- centralWidget = new QWidget;
- setCentralWidget(centralWidget);
-
- glWidget = new GLWidget;
- pixmapLabel = new QLabel;
-
- glWidgetArea = new QScrollArea;
- glWidgetArea->setWidget(glWidget);
- glWidgetArea->setWidgetResizable(true);
- glWidgetArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
- glWidgetArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
- glWidgetArea->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
- glWidgetArea->setMinimumSize(50, 50);
-
- pixmapLabelArea = new QScrollArea;
- pixmapLabelArea->setWidget(pixmapLabel);
- pixmapLabelArea->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
- pixmapLabelArea->setMinimumSize(50, 50);
-
- xSlider = createSlider(SIGNAL(xRotationChanged(int)),
- SLOT(setXRotation(int)));
- ySlider = createSlider(SIGNAL(yRotationChanged(int)),
- SLOT(setYRotation(int)));
- zSlider = createSlider(SIGNAL(zRotationChanged(int)),
- SLOT(setZRotation(int)));
-
- createActions();
- createMenus();
-
- QGridLayout *centralLayout = new QGridLayout;
- centralLayout->addWidget(glWidgetArea, 0, 0);
- centralLayout->addWidget(pixmapLabelArea, 0, 1);
- centralLayout->addWidget(xSlider, 1, 0, 1, 2);
- centralLayout->addWidget(ySlider, 2, 0, 1, 2);
- centralLayout->addWidget(zSlider, 3, 0, 1, 2);
- centralWidget->setLayout(centralLayout);
-
- xSlider->setValue(15 * 16);
- ySlider->setValue(345 * 16);
- zSlider->setValue(0 * 16);
-
- setWindowTitle(tr("Grabber"));
- resize(400, 300);
-}
-
-void MainWindow::renderIntoPixmap()
-{
- QSize size = getSize();
- if (size.isValid()) {
- QPixmap pixmap = glWidget->renderPixmap(size.width(), size.height());
- setPixmap(pixmap);
- }
-}
-
-void MainWindow::grabFrameBuffer()
-{
- QImage image = glWidget->grabFrameBuffer();
- setPixmap(QPixmap::fromImage(image));
-}
-
-void MainWindow::clearPixmap()
-{
- setPixmap(QPixmap());
-}
-
-void MainWindow::about()
-{
- QMessageBox::about(this, tr("About Grabber"),
- tr("The <b>Grabber</b> example demonstrates two approaches for "
- "rendering OpenGL into a Qt pixmap."));
-}
-
-void MainWindow::createActions()
-{
- renderIntoPixmapAct = new QAction(tr("&Render into Pixmap..."), this);
- renderIntoPixmapAct->setShortcut(tr("Ctrl+R"));
- connect(renderIntoPixmapAct, SIGNAL(triggered()),
- this, SLOT(renderIntoPixmap()));
-
- grabFrameBufferAct = new QAction(tr("&Grab Frame Buffer"), this);
- grabFrameBufferAct->setShortcut(tr("Ctrl+G"));
- connect(grabFrameBufferAct, SIGNAL(triggered()),
- this, SLOT(grabFrameBuffer()));
-
- clearPixmapAct = new QAction(tr("&Clear Pixmap"), this);
- clearPixmapAct->setShortcut(tr("Ctrl+L"));
- connect(clearPixmapAct, SIGNAL(triggered()), this, SLOT(clearPixmap()));
-
- exitAct = new QAction(tr("E&xit"), this);
- exitAct->setShortcuts(QKeySequence::Quit);
- connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
-
- 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()));
-}
-
-void MainWindow::createMenus()
-{
- fileMenu = menuBar()->addMenu(tr("&File"));
- fileMenu->addAction(renderIntoPixmapAct);
- fileMenu->addAction(grabFrameBufferAct);
- fileMenu->addAction(clearPixmapAct);
- fileMenu->addSeparator();
- fileMenu->addAction(exitAct);
-
- helpMenu = menuBar()->addMenu(tr("&Help"));
- helpMenu->addAction(aboutAct);
- helpMenu->addAction(aboutQtAct);
-}
-
-QSlider *MainWindow::createSlider(const char *changedSignal,
- const char *setterSlot)
-{
- QSlider *slider = new QSlider(Qt::Horizontal);
- slider->setRange(0, 360 * 16);
- slider->setSingleStep(16);
- slider->setPageStep(15 * 16);
- slider->setTickInterval(15 * 16);
- slider->setTickPosition(QSlider::TicksRight);
- connect(slider, SIGNAL(valueChanged(int)), glWidget, setterSlot);
- connect(glWidget, changedSignal, slider, SLOT(setValue(int)));
- return slider;
-}
-
-void MainWindow::setPixmap(const QPixmap &pixmap)
-{
- pixmapLabel->setPixmap(pixmap);
- QSize size = pixmap.size() / pixmap.devicePixelRatio();
- if (size - QSize(1, 0) == pixmapLabelArea->maximumViewportSize())
- size -= QSize(1, 0);
- pixmapLabel->resize(size);
-}
-
-QSize MainWindow::getSize()
-{
- bool ok;
- QString text = QInputDialog::getText(this, tr("Grabber"),
- tr("Enter pixmap size:"),
- QLineEdit::Normal,
- tr("%1 x %2").arg(glWidget->width())
- .arg(glWidget->height()),
- &ok);
- if (!ok)
- return QSize();
-
- QRegularExpression regExp(tr("^([0-9]+) *x *([0-9]+)$"));
- QRegularExpressionMatch match = regExp.match(text);
- if (match.hasMatch()) {
- int width = match.captured(1).toInt();
- int height = match.captured(2).toInt();
- if (width > 0 && width < 2048 && height > 0 && height < 2048)
- return QSize(width, height);
- }
-
- return glWidget->size();
-}
diff --git a/examples/opengl/legacy/grabber/mainwindow.h b/examples/opengl/legacy/grabber/mainwindow.h
deleted file mode 100644
index 2d699784dd..0000000000
--- a/examples/opengl/legacy/grabber/mainwindow.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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$
-**
-****************************************************************************/
-
-#ifndef MAINWINDOW_H
-#define MAINWINDOW_H
-
-#include <QMainWindow>
-
-QT_BEGIN_NAMESPACE
-class QLabel;
-class QMenu;
-class QScrollArea;
-class QSlider;
-QT_END_NAMESPACE
-
-class GLWidget;
-
-class MainWindow : public QMainWindow
-{
- Q_OBJECT
-
-public:
- MainWindow();
-
-private slots:
- void renderIntoPixmap();
- void grabFrameBuffer();
- void clearPixmap();
- void about();
-
-private:
- void createActions();
- void createMenus();
- QSlider *createSlider(const char *changedSignal, const char *setterSlot);
- void setPixmap(const QPixmap &pixmap);
- QSize getSize();
-
- QWidget *centralWidget;
- QScrollArea *glWidgetArea;
- QScrollArea *pixmapLabelArea;
- GLWidget *glWidget;
- QLabel *pixmapLabel;
- QSlider *xSlider;
- QSlider *ySlider;
- QSlider *zSlider;
-
- QMenu *fileMenu;
- QMenu *helpMenu;
- QAction *grabFrameBufferAct;
- QAction *renderIntoPixmapAct;
- QAction *clearPixmapAct;
- QAction *exitAct;
- QAction *aboutAct;
- QAction *aboutQtAct;
-};
-
-#endif // MAINWINDOW_H
diff --git a/examples/opengl/legacy/hellogl/glwidget.cpp b/examples/opengl/legacy/hellogl/glwidget.cpp
deleted file mode 100644
index 059a9bb96d..0000000000
--- a/examples/opengl/legacy/hellogl/glwidget.cpp
+++ /dev/null
@@ -1,207 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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 <QtOpenGL>
-
-#include <math.h>
-
-#include "glwidget.h"
-#include "qtlogo.h"
-
-#ifndef GL_MULTISAMPLE
-#define GL_MULTISAMPLE 0x809D
-#endif
-
-//! [0]
-GLWidget::GLWidget(QWidget *parent)
- : QGLWidget(QGLFormat(QGL::SampleBuffers), parent)
-{
- logo = 0;
- xRot = 0;
- yRot = 0;
- zRot = 0;
-
- qtGreen = QColor::fromCmykF(0.40, 0.0, 1.0, 0.0);
- qtPurple = QColor::fromCmykF(0.39, 0.39, 0.0, 0.0);
-}
-//! [0]
-
-//! [1]
-GLWidget::~GLWidget()
-{
-}
-//! [1]
-
-//! [2]
-QSize GLWidget::minimumSizeHint() const
-{
- return QSize(50, 50);
-}
-//! [2]
-
-//! [3]
-QSize GLWidget::sizeHint() const
-//! [3] //! [4]
-{
- return QSize(400, 400);
-}
-//! [4]
-
-static void qNormalizeAngle(int &angle)
-{
- while (angle < 0)
- angle += 360 * 16;
- while (angle > 360 * 16)
- angle -= 360 * 16;
-}
-
-//! [5]
-void GLWidget::setXRotation(int angle)
-{
- qNormalizeAngle(angle);
- if (angle != xRot) {
- xRot = angle;
- emit xRotationChanged(angle);
- update();
- }
-}
-//! [5]
-
-void GLWidget::setYRotation(int angle)
-{
- qNormalizeAngle(angle);
- if (angle != yRot) {
- yRot = angle;
- emit yRotationChanged(angle);
- update();
- }
-}
-
-void GLWidget::setZRotation(int angle)
-{
- qNormalizeAngle(angle);
- if (angle != zRot) {
- zRot = angle;
- emit zRotationChanged(angle);
- update();
- }
-}
-
-//! [6]
-void GLWidget::initializeGL()
-{
- initializeOpenGLFunctions();
-
- qglClearColor(qtPurple.darker());
-
- logo = new QtLogo(this, 64);
- logo->setColor(qtGreen.darker());
-
- glEnable(GL_DEPTH_TEST);
- glEnable(GL_CULL_FACE);
- glShadeModel(GL_SMOOTH);
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
- glEnable(GL_MULTISAMPLE);
- static GLfloat lightPosition[4] = { 0.5, 5.0, 7.0, 1.0 };
- glLightfv(GL_LIGHT0, GL_POSITION, lightPosition);
-}
-//! [6]
-
-//! [7]
-void GLWidget::paintGL()
-{
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- glLoadIdentity();
- glTranslatef(0.0, 0.0, -10.0);
- glRotatef(xRot / 16.0, 1.0, 0.0, 0.0);
- glRotatef(yRot / 16.0, 0.0, 1.0, 0.0);
- glRotatef(zRot / 16.0, 0.0, 0.0, 1.0);
- logo->draw(static_cast<QOpenGLFunctions_1_1 *>(this));
-}
-//! [7]
-
-//! [8]
-void GLWidget::resizeGL(int width, int height)
-{
- int side = qMin(width, height);
- glViewport((width - side) / 2, (height - side) / 2, side, side);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-0.5, +0.5, -0.5, +0.5, 4.0, 15.0);
- glMatrixMode(GL_MODELVIEW);
-}
-//! [8]
-
-//! [9]
-void GLWidget::mousePressEvent(QMouseEvent *event)
-{
- lastPos = event->pos();
-}
-//! [9]
-
-//! [10]
-void GLWidget::mouseMoveEvent(QMouseEvent *event)
-{
- int dx = event->x() - lastPos.x();
- int dy = event->y() - lastPos.y();
-
- if (event->buttons() & Qt::LeftButton) {
- setXRotation(xRot + 8 * dy);
- setYRotation(yRot + 8 * dx);
- } else if (event->buttons() & Qt::RightButton) {
- setXRotation(xRot + 8 * dy);
- setZRotation(zRot + 8 * dx);
- }
- lastPos = event->pos();
-}
-//! [10]
diff --git a/examples/opengl/legacy/hellogl/glwidget.h b/examples/opengl/legacy/hellogl/glwidget.h
deleted file mode 100644
index 8154d7405c..0000000000
--- a/examples/opengl/legacy/hellogl/glwidget.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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$
-**
-****************************************************************************/
-
-#ifndef GLWIDGET_H
-#define GLWIDGET_H
-
-#include <QGLWidget>
-#include <QOpenGLFunctions_1_1>
-
-class QtLogo;
-
-//! [0]
-class GLWidget : public QGLWidget, public QOpenGLFunctions_1_1
-{
- Q_OBJECT
-
-public:
- GLWidget(QWidget *parent = 0);
- ~GLWidget();
-
- QSize minimumSizeHint() const override;
- QSize sizeHint() const override;
-//! [0]
-
-//! [1]
-public slots:
- void setXRotation(int angle);
- void setYRotation(int angle);
- void setZRotation(int angle);
-
-signals:
- void xRotationChanged(int angle);
- void yRotationChanged(int angle);
- void zRotationChanged(int angle);
-//! [1]
-
-//! [2]
-protected:
- void initializeGL() override;
- void paintGL() override;
- void resizeGL(int width, int height) override;
- void mousePressEvent(QMouseEvent *event) override;
- void mouseMoveEvent(QMouseEvent *event) override;
-//! [2]
-
-//! [3]
-private:
- QtLogo *logo;
- int xRot;
- int yRot;
- int zRot;
- QPoint lastPos;
- QColor qtGreen;
- QColor qtPurple;
-};
-//! [3]
-
-#endif
diff --git a/examples/opengl/legacy/hellogl/hellogl.pro b/examples/opengl/legacy/hellogl/hellogl.pro
deleted file mode 100644
index c6e926c245..0000000000
--- a/examples/opengl/legacy/hellogl/hellogl.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-VPATH += ../shared
-INCLUDEPATH += ../shared
-
-HEADERS = glwidget.h \
- window.h \
- qtlogo.h
-SOURCES = glwidget.cpp \
- main.cpp \
- window.cpp \
- qtlogo.cpp
-QT += opengl widgets
-
-# install
-target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/hellogl
-INSTALLS += target
-
-qtConfig(opengles.|angle): error("This example requires Qt to be configured with -opengl desktop")
diff --git a/examples/opengl/legacy/hellogl/main.cpp b/examples/opengl/legacy/hellogl/main.cpp
deleted file mode 100644
index 13581c8fb2..0000000000
--- a/examples/opengl/legacy/hellogl/main.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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 <QApplication>
-#include <QDesktopWidget>
-
-#include "window.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- Window window;
- window.resize(window.sizeHint());
- int desktopArea = QApplication::desktop()->width() *
- QApplication::desktop()->height();
- int widgetArea = window.width() * window.height();
- if (((float)widgetArea / (float)desktopArea) < 0.75f)
- window.show();
- else
- window.showMaximized();
- return app.exec();
-}
diff --git a/examples/opengl/legacy/hellogl/window.cpp b/examples/opengl/legacy/hellogl/window.cpp
deleted file mode 100644
index 58863909e0..0000000000
--- a/examples/opengl/legacy/hellogl/window.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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 "glwidget.h"
-#include "window.h"
-
-//! [0]
-Window::Window()
-{
- glWidget = new GLWidget;
-
- xSlider = createSlider();
- 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)));
-//! [0]
-
-//! [1]
- QHBoxLayout *mainLayout = new QHBoxLayout;
- mainLayout->addWidget(glWidget);
- mainLayout->addWidget(xSlider);
- mainLayout->addWidget(ySlider);
- mainLayout->addWidget(zSlider);
- setLayout(mainLayout);
-
- xSlider->setValue(15 * 16);
- ySlider->setValue(345 * 16);
- zSlider->setValue(0 * 16);
- setWindowTitle(tr("Hello GL"));
-}
-//! [1]
-
-//! [2]
-QSlider *Window::createSlider()
-{
- QSlider *slider = new QSlider(Qt::Vertical);
- slider->setRange(0, 360 * 16);
- slider->setSingleStep(16);
- slider->setPageStep(15 * 16);
- slider->setTickInterval(15 * 16);
- slider->setTickPosition(QSlider::TicksRight);
- return slider;
-}
-//! [2]
-
-void Window::keyPressEvent(QKeyEvent *e)
-{
- if (e->key() == Qt::Key_Escape)
- close();
- else
- QWidget::keyPressEvent(e);
-}
diff --git a/examples/opengl/legacy/hellogl/window.h b/examples/opengl/legacy/hellogl/window.h
deleted file mode 100644
index 04e83694a4..0000000000
--- a/examples/opengl/legacy/hellogl/window.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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$
-**
-****************************************************************************/
-
-#ifndef WINDOW_H
-#define WINDOW_H
-
-#include <QWidget>
-
-QT_BEGIN_NAMESPACE
-class QSlider;
-QT_END_NAMESPACE
-//! [0]
-class GLWidget;
-
-class Window : public QWidget
-{
- Q_OBJECT
-
-public:
- Window();
-
-protected:
- void keyPressEvent(QKeyEvent *event) override;
-
-private:
- QSlider *createSlider();
-
- GLWidget *glWidget;
- QSlider *xSlider;
- QSlider *ySlider;
- QSlider *zSlider;
-};
-//! [0]
-
-#endif
diff --git a/examples/opengl/legacy/legacy.pro b/examples/opengl/legacy/legacy.pro
deleted file mode 100644
index 1398332c11..0000000000
--- a/examples/opengl/legacy/legacy.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-requires(qtHaveModule(opengl))
-
-TEMPLATE = subdirs
-
-!qtConfig(dynamicgl):!qtConfig(opengles2) {
- # legacy desktop-only examples, no dynamic GL support
- SUBDIRS = \
- grabber \
- hellogl \
- overpainting \
- pbuffers \
- framebufferobject2 \
- samplebuffers
-}
-
-EXAMPLE_FILES = shared
diff --git a/examples/opengl/legacy/overpainting/bubble.cpp b/examples/opengl/legacy/overpainting/bubble.cpp
deleted file mode 100644
index 352e359cf9..0000000000
--- a/examples/opengl/legacy/overpainting/bubble.cpp
+++ /dev/null
@@ -1,122 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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 "bubble.h"
-
-#include <QRandomGenerator>
-
-Bubble::Bubble(const QPointF &position, qreal radius, const QPointF &velocity)
- : position(position), vel(velocity), radius(radius)
-{
- innerColor = randomColor();
- outerColor = randomColor();
- updateBrush();
-}
-
-void Bubble::updateBrush()
-{
- QRadialGradient gradient(QPointF(radius, radius), radius,
- QPointF(radius*0.5, radius*0.5));
-
- gradient.setColorAt(0, QColor(255, 255, 255, 255));
- gradient.setColorAt(0.25, innerColor);
- gradient.setColorAt(1, outerColor);
- brush = QBrush(gradient);
-}
-
-void Bubble::drawBubble(QPainter *painter)
-{
- painter->save();
- painter->translate(position.x() - radius, position.y() - radius);
- painter->setBrush(brush);
- painter->drawEllipse(0, 0, int(2*radius), int(2*radius));
- painter->restore();
-}
-
-QColor Bubble::randomColor()
-{
- int red = int(205 + QRandomGenerator::global()->bounded(50));
- int green = int(205 + QRandomGenerator::global()->bounded(50));
- int blue = int(205 + QRandomGenerator::global()->bounded(50));
- int alpha = int(91 + QRandomGenerator::global()->bounded(100));
-
- return QColor(red, green, blue, alpha);
-}
-
-void Bubble::move(const QRect &bbox)
-{
- position += vel;
- qreal leftOverflow = position.x() - radius - bbox.left();
- qreal rightOverflow = position.x() + radius - bbox.right();
- qreal topOverflow = position.y() - radius - bbox.top();
- qreal bottomOverflow = position.y() + radius - bbox.bottom();
-
- if (leftOverflow < 0.0) {
- position.setX(position.x() - 2 * leftOverflow);
- vel.setX(-vel.x());
- } else if (rightOverflow > 0.0) {
- position.setX(position.x() - 2 * rightOverflow);
- vel.setX(-vel.x());
- }
-
- if (topOverflow < 0.0) {
- position.setY(position.y() - 2 * topOverflow);
- vel.setY(-vel.y());
- } else if (bottomOverflow > 0.0) {
- position.setY(position.y() - 2 * bottomOverflow);
- vel.setY(-vel.y());
- }
-}
-
-QRectF Bubble::rect()
-{
- return QRectF(position.x() - radius, position.y() - radius,
- 2 * radius, 2 * radius);
-}
diff --git a/examples/opengl/legacy/overpainting/bubble.h b/examples/opengl/legacy/overpainting/bubble.h
deleted file mode 100644
index bd63e0437f..0000000000
--- a/examples/opengl/legacy/overpainting/bubble.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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$
-**
-****************************************************************************/
-
-#ifndef BUBBLE_H
-#define BUBBLE_H
-
-#include <QPainter>
-
-class Bubble
-{
-public:
- Bubble(const QPointF &position, qreal radius, const QPointF &velocity);
-
- void drawBubble(QPainter *painter);
- void updateBrush();
- void move(const QRect &bbox);
- QRectF rect();
-
-private:
- QColor randomColor();
-
- QBrush brush;
- QPointF position;
- QPointF vel;
- qreal radius;
- QColor innerColor;
- QColor outerColor;
-};
-
-#endif // BUBBLE_H
diff --git a/examples/opengl/legacy/overpainting/glwidget.cpp b/examples/opengl/legacy/overpainting/glwidget.cpp
deleted file mode 100644
index c4558ce785..0000000000
--- a/examples/opengl/legacy/overpainting/glwidget.cpp
+++ /dev/null
@@ -1,293 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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 "bubble.h"
-#include "qtlogo.h"
-#include "glwidget.h"
-
-#include <QMouseEvent>
-#include <QRandomGenerator>
-#include <QTime>
-
-#include <math.h>
-#include <stdlib.h>
-
-#ifndef GL_MULTISAMPLE
-#define GL_MULTISAMPLE 0x809D
-#endif
-
-//! [0]
-GLWidget::GLWidget(QWidget *parent)
- : QGLWidget(QGLFormat(QGL::SampleBuffers), parent)
-{
- QTime midnight(0, 0, 0);
-
- logo = 0;
- xRot = 0;
- yRot = 0;
- zRot = 0;
-
- qtGreen = QColor::fromCmykF(0.40, 0.0, 1.0, 0.0);
- qtPurple = QColor::fromCmykF(0.39, 0.39, 0.0, 0.0);
-
- animationTimer.setSingleShot(false);
- connect(&animationTimer, SIGNAL(timeout()), this, SLOT(animate()));
- animationTimer.start(25);
-
- setAutoFillBackground(false);
- setMinimumSize(200, 200);
- setWindowTitle(tr("Overpainting a Scene"));
-}
-//! [0]
-
-//! [1]
-GLWidget::~GLWidget()
-{
-}
-//! [1]
-
-static void qNormalizeAngle(int &angle)
-{
- while (angle < 0)
- angle += 360 * 16;
- while (angle > 360 * 16)
- angle -= 360 * 16;
-}
-
-void GLWidget::setXRotation(int angle)
-{
- qNormalizeAngle(angle);
- if (angle != xRot)
- xRot = angle;
-}
-
-void GLWidget::setYRotation(int angle)
-{
- qNormalizeAngle(angle);
- if (angle != yRot)
- yRot = angle;
-}
-
-void GLWidget::setZRotation(int angle)
-{
- qNormalizeAngle(angle);
- if (angle != zRot)
- zRot = angle;
-}
-
-//! [2]
-void GLWidget::initializeGL()
-{
- initializeOpenGLFunctions();
-
- glEnable(GL_MULTISAMPLE);
-
- logo = new QtLogo(this);
- logo->setColor(qtGreen.darker());
-}
-//! [2]
-
-void GLWidget::mousePressEvent(QMouseEvent *event)
-{
- lastPos = event->pos();
-}
-
-void GLWidget::mouseMoveEvent(QMouseEvent *event)
-{
- int dx = event->x() - lastPos.x();
- int dy = event->y() - lastPos.y();
-
- if (event->buttons() & Qt::LeftButton) {
- setXRotation(xRot + 8 * dy);
- setYRotation(yRot + 8 * dx);
- } else if (event->buttons() & Qt::RightButton) {
- setXRotation(xRot + 8 * dy);
- setZRotation(zRot + 8 * dx);
- }
- lastPos = event->pos();
-}
-
-void GLWidget::paintEvent(QPaintEvent *event)
-{
- makeCurrent();
-//! [4]
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
-//! [4]
-
-//! [6]
- qglClearColor(qtPurple.darker());
- glShadeModel(GL_SMOOTH);
- glEnable(GL_DEPTH_TEST);
- glEnable(GL_CULL_FACE);
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
- glEnable(GL_MULTISAMPLE);
- static GLfloat lightPosition[4] = { 0.5, 5.0, 7.0, 1.0 };
- glLightfv(GL_LIGHT0, GL_POSITION, lightPosition);
-
- qreal pixelRatio = devicePixelRatio();
- setupViewport(width() * pixelRatio, height() * pixelRatio);
-//! [6]
-
-//! [7]
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- glLoadIdentity();
- glTranslatef(0.0, 0.0, -10.0);
- glRotatef(xRot / 16.0, 1.0, 0.0, 0.0);
- glRotatef(yRot / 16.0, 0.0, 1.0, 0.0);
- glRotatef(zRot / 16.0, 0.0, 0.0, 1.0);
-
- logo->draw(static_cast<QOpenGLFunctions_1_1 *>(this));
-//! [7]
-
-//! [8]
- glShadeModel(GL_FLAT);
- glDisable(GL_CULL_FACE);
- glDisable(GL_DEPTH_TEST);
- glDisable(GL_LIGHTING);
-
- glMatrixMode(GL_MODELVIEW);
- glPopMatrix();
-//! [8]
-
-//! [10]
- QPainter painter(this);
- painter.setRenderHint(QPainter::Antialiasing);
- for (Bubble *bubble : qAsConst(bubbles)) {
- if (bubble->rect().intersects(event->rect()))
- bubble->drawBubble(&painter);
- }
- drawInstructions(&painter);
- painter.end();
-}
-//! [10]
-
-//! [11]
-void GLWidget::resizeGL(int width, int height)
-{
- qreal pixelRatio = devicePixelRatio();
- setupViewport(width*pixelRatio, height*pixelRatio);
-}
-//! [11]
-
-//! [12]
-void GLWidget::showEvent(QShowEvent *event)
-{
- Q_UNUSED(event);
- createBubbles(20 - bubbles.count());
-}
-//! [12]
-
-QSize GLWidget::sizeHint() const
-{
- return QSize(400, 400);
-}
-
-void GLWidget::createBubbles(int number)
-{
- for (int i = 0; i < number; ++i) {
- QPointF position(width()*(0.1 + QRandomGenerator::global()->bounded(0.8)),
- height()*(0.1 + QRandomGenerator::global()->bounded(0.8)));
- qreal radius = qMin(width(), height())*(0.0125 + QRandomGenerator::global()->bounded(0.0875));
- QPointF velocity(width()*0.0125*(-0.5 + QRandomGenerator::global()->bounded(1.0)),
- height()*0.0125*(-0.5 + QRandomGenerator::global()->bounded(1.0)));
-
- bubbles.append(new Bubble(position, radius, velocity));
- }
-}
-
-//! [13]
-void GLWidget::animate()
-{
- for (Bubble *bubble : qAsConst(bubbles))
- bubble->move(rect());
- update();
-}
-//! [13]
-
-//! [14]
-void GLWidget::setupViewport(int width, int height)
-{
- int side = qMin(width, height);
- glViewport((width - side) / 2, (height - side) / 2, side, side);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
-#ifdef QT_OPENGL_ES
- glOrthof(-0.5, +0.5, -0.5, 0.5, 4.0, 15.0);
-#else
- glOrtho(-0.5, +0.5, -0.5, 0.5, 4.0, 15.0);
-#endif
- glMatrixMode(GL_MODELVIEW);
-}
-//! [14]
-
-//! [15]
-void GLWidget::drawInstructions(QPainter *painter)
-{
- QString text = tr("Click and drag with the left mouse button "
- "to rotate the Qt logo.");
- QFontMetrics metrics = QFontMetrics(font());
- int border = qMax(4, metrics.leading());
-
- QRect rect = metrics.boundingRect(0, 0, width() - 2*border, int(height()*0.125),
- Qt::AlignCenter | Qt::TextWordWrap, text);
- painter->setRenderHint(QPainter::TextAntialiasing);
- painter->fillRect(QRect(0, 0, width(), rect.height() + 2*border),
- QColor(0, 0, 0, 127));
- painter->setPen(Qt::white);
- painter->fillRect(QRect(0, 0, width(), rect.height() + 2*border),
- QColor(0, 0, 0, 127));
- painter->drawText((width() - rect.width())/2, border,
- rect.width(), rect.height(),
- Qt::AlignCenter | Qt::TextWordWrap, text);
-}
-//! [15]
diff --git a/examples/opengl/legacy/overpainting/glwidget.h b/examples/opengl/legacy/overpainting/glwidget.h
deleted file mode 100644
index e5ea539f6d..0000000000
--- a/examples/opengl/legacy/overpainting/glwidget.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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$
-**
-****************************************************************************/
-
-#ifndef GLWIDGET_H
-#define GLWIDGET_H
-
-#include <QGLWidget>
-#include <QOpenGLFunctions_1_1>
-#include <QTimer>
-
-class Bubble;
-class QtLogo;
-
-//! [0]
-class GLWidget : public QGLWidget, public QOpenGLFunctions_1_1
-{
- Q_OBJECT
-
-public:
- GLWidget(QWidget *parent = 0);
- ~GLWidget();
-//! [0]
-
- QSize sizeHint() const override;
- int xRotation() const { return xRot; }
- int yRotation() const { return yRot; }
- int zRotation() const { return zRot; }
-
-public slots:
- void setXRotation(int angle);
- void setYRotation(int angle);
- void setZRotation(int angle);
-
-//! [1]
-protected:
- void initializeGL() override;
- void paintEvent(QPaintEvent *event) override;
- void resizeGL(int width, int height) override;
- void mousePressEvent(QMouseEvent *event) override;
- void mouseMoveEvent(QMouseEvent *event) override;
- void showEvent(QShowEvent *event) override;
-
-private slots:
- void animate();
-
-private:
- void createBubbles(int number);
- void drawInstructions(QPainter *painter);
-//! [1]
- void setupViewport(int width, int height);
-
- QColor qtGreen;
- QColor qtPurple;
-
- GLuint object;
- int xRot;
- int yRot;
- int zRot;
- QPoint lastPos;
-//! [4]
- QtLogo *logo;
- QList<Bubble*> bubbles;
- QTimer animationTimer;
-//! [4]
-};
-
-#endif // GLWIDGET_H
diff --git a/examples/opengl/legacy/overpainting/main.cpp b/examples/opengl/legacy/overpainting/main.cpp
deleted file mode 100644
index c5f0f2e3f7..0000000000
--- a/examples/opengl/legacy/overpainting/main.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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 "glwidget.h"
-
-#include <QApplication>
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- GLWidget window;
- window.show();
- return app.exec();
-}
diff --git a/examples/opengl/legacy/overpainting/overpainting.pro b/examples/opengl/legacy/overpainting/overpainting.pro
deleted file mode 100644
index 17213a6079..0000000000
--- a/examples/opengl/legacy/overpainting/overpainting.pro
+++ /dev/null
@@ -1,19 +0,0 @@
-QT += opengl widgets
-
-VPATH += ../shared
-INCLUDEPATH += ../shared
-
-HEADERS = bubble.h \
- glwidget.h \
- qtlogo.h
-
-SOURCES = bubble.cpp \
- glwidget.cpp \
- main.cpp \
- qtlogo.cpp
-
-# install
-target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/overpainting
-INSTALLS += target
-
-qtConfig(opengles.|angle): error("This example requires Qt to be configured with -opengl desktop")
diff --git a/examples/opengl/legacy/pbuffers/cube.cpp b/examples/opengl/legacy/pbuffers/cube.cpp
deleted file mode 100644
index f598741ec3..0000000000
--- a/examples/opengl/legacy/pbuffers/cube.cpp
+++ /dev/null
@@ -1,338 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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 "cube.h"
-#include "glwidget.h"
-
-#include <QtGui/QImage>
-#include <QtCore/QPropertyAnimation>
-
-static const qreal speeds[] = { 3.8f, 4.4f, 5.6f };
-static const qreal amplitudes[] = { 2.0f, 2.5f, 3.0f };
-
-static inline void qSetColor(float colorVec[], QColor c)
-{
- colorVec[0] = c.redF();
- colorVec[1] = c.greenF();
- colorVec[2] = c.blueF();
- colorVec[3] = c.alphaF();
-}
-
-int Geometry::append(const QVector3D &a, const QVector3D &n, const QVector2D &t)
-{
- int v = vertices.count();
- vertices.append(a);
- normals.append(n);
- texCoords.append(t);
- faces.append(v);
- colors.append(QVector4D(0.6f, 0.6f, 0.6f, 1.0f));
- return v;
-}
-
-void Geometry::addQuad(const QVector3D &a, const QVector3D &b,
- const QVector3D &c, const QVector3D &d,
- const QVector<QVector2D> &tex)
-{
- QVector3D norm = QVector3D::normal(a, b, c);
- // append first triangle
- int aref = append(a, norm, tex[0]);
- append(b, norm, tex[1]);
- int cref = append(c, norm, tex[2]);
- // append second triangle
- faces.append(aref);
- faces.append(cref);
- append(d, norm, tex[3]);
-}
-
-void Geometry::loadArrays() const
-{
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_NORMAL_ARRAY);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glEnableClientState(GL_COLOR_ARRAY);
- glVertexPointer(3, GL_FLOAT, 0, vertices.constData());
- glNormalPointer(GL_FLOAT, 0, normals.constData());
- glTexCoordPointer(2, GL_FLOAT, 0, texCoords.constData());
- glColorPointer(4, GL_FLOAT, 0, colors.constData());
-}
-
-void Geometry::setColors(int start, GLfloat colorArray[4][4])
-{
- int off = faces[start];
- for (int i = 0; i < 4; ++i)
- colors[i + off] = QVector4D(colorArray[i][0],
- colorArray[i][1],
- colorArray[i][2],
- colorArray[i][3]);
-}
-
-Tile::Tile(const QVector3D &loc)
- : location(loc)
- , start(0)
- , count(0)
- , useFlatColor(false)
- , geom(0)
-{
- qSetColor(faceColor, QColor(Qt::darkGray));
-}
-
-void Tile::setColors(GLfloat colorArray[4][4])
-{
- useFlatColor = true;
- geom->setColors(start, colorArray);
-}
-
-void Tile::draw() const
-{
- QMatrix4x4 mat;
- mat.translate(location);
- mat.rotate(orientation);
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
- glMultMatrixf(mat.constData());
- glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, faceColor);
- glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, geom->indices() + start);
- glPopMatrix();
-}
-
-TileBuilder::TileBuilder(Geometry *g, qreal depth, qreal size)
- : verts(4)
- , tex(4)
- , start(g->count())
- , count(0)
- , geom(g)
-{
- // front face - make a square with bottom-left at origin
- verts[br].setX(size);
- verts[tr].setX(size);
- verts[tr].setY(size);
- verts[tl].setY(size);
-
- // these vert numbers are good for the tex-coords
- for (int i = 0; i < 4; ++i)
- tex[i] = verts[i].toVector2D();
-
- // now move verts half cube width across so cube is centered on origin
- for (int i = 0; i < 4; ++i)
- verts[i] -= QVector3D(size / 2.0f, size / 2.0f, -depth);
-
- // add the front face
- g->addQuad(verts[bl], verts[br], verts[tr], verts[tl], tex);
-
- count = g->count() - start;
-}
-
-void TileBuilder::initialize(Tile *tile) const
-{
- tile->start = start;
- tile->count = count;
- tile->geom = geom;
- qSetColor(tile->faceColor, color);
-}
-
-Tile *TileBuilder::newTile(const QVector3D &loc) const
-{
- Tile *tile = new Tile(loc);
- initialize(tile);
- return tile;
-}
-
-Cube::Cube(const QVector3D &loc)
- : Tile(loc)
- , rot(0.0f)
- , r(0)
- , animGroup(0)
-{
-}
-
-Cube::~Cube()
-{
-}
-
-void Cube::setAltitude(qreal a)
-{
- if (location.y() != a)
- {
- location.setY(a);
- emit changed();
- }
-}
-
-void Cube::setRange(qreal r)
-{
- if (location.x() != r)
- {
- location.setX(r);
- emit changed();
- }
-}
-
-void Cube::setRotation(qreal r)
-{
- if (r != rot)
- {
- orientation = QQuaternion::fromAxisAndAngle(QVector3D(1.0f, 1.0f, 1.0f), r);
- emit changed();
- }
-}
-
-void Cube::removeBounce()
-{
- delete animGroup;
- animGroup = 0;
- delete r;
- r = 0;
-}
-
-void Cube::startAnimation()
-{
- if (r)
- {
- r->start();
- r->setCurrentTime(startx);
- }
- if (animGroup)
- animGroup->start();
- if (rtn)
- rtn->start();
-}
-
-void Cube::setAnimationPaused(bool paused)
-{
- if (paused)
- {
- if (r)
- r->pause();
- if (animGroup)
- animGroup->pause();
- if (rtn)
- rtn->pause();
- }
- else
- {
- if (r)
- r->resume();
- if (animGroup)
- animGroup->resume();
- if (rtn)
- rtn->resume();
- }
-}
-
-CubeBuilder::CubeBuilder(Geometry *g, qreal depth, qreal size)
- : TileBuilder(g, depth)
- , ix(0)
-{
- for (int i = 0; i < 4; ++i)
- verts[i].setZ(size / 2.0f);
- // back face - "extrude" verts down
- QVector<QVector3D> back(verts);
- for (int i = 0; i < 4; ++i)
- back[i].setZ(-size / 2.0f);
-
- // add the back face
- g->addQuad(back[br], back[bl], back[tl], back[tr], tex);
-
- // add the sides
- g->addQuad(back[bl], back[br], verts[br], verts[bl], tex);
- g->addQuad(back[br], back[tr], verts[tr], verts[br], tex);
- g->addQuad(back[tr], back[tl], verts[tl], verts[tr], tex);
- g->addQuad(back[tl], back[bl], verts[bl], verts[tl], tex);
-
- count = g->count() - start;
-}
-
-Cube *CubeBuilder::newCube(const QVector3D &loc) const
-{
- Cube *c = new Cube(loc);
- initialize(c);
- qreal d = 4000.0f;
- qreal d3 = d / 3.0f;
- // Animate movement from left to right
- c->r = new QPropertyAnimation(c, "range");
- c->r->setStartValue(-1.3f);
- c->r->setEndValue(1.3f);
- c->startx = ix * d3 * 3.0f;
- c->r->setDuration(d * 4.0f);
- c->r->setLoopCount(-1);
- c->r->setEasingCurve(QEasingCurve(QEasingCurve::CosineCurve));
-
- c->animGroup = new QSequentialAnimationGroup(c);
-
- // Animate movement from bottom to top
- QPropertyAnimation *a_up = new QPropertyAnimation(c, "altitude", c->animGroup);
- a_up->setEndValue(loc.y());
- a_up->setStartValue(loc.y() + amplitudes[ix]);
- a_up->setDuration(d / speeds[ix]);
- a_up->setLoopCount(1);
- a_up->setEasingCurve(QEasingCurve(QEasingCurve::InQuad));
-
- // Animate movement from top to bottom
- QPropertyAnimation *a_down = new QPropertyAnimation(c, "altitude", c->animGroup);
- a_down->setEndValue(loc.y() + amplitudes[ix]);
- a_down->setStartValue(loc.y());
- a_down->setDuration(d / speeds[ix]);
- a_down->setLoopCount(1);
- a_down->setEasingCurve(QEasingCurve(QEasingCurve::OutQuad));
-
- c->animGroup->addAnimation(a_up);
- c->animGroup->addAnimation(a_down);
- c->animGroup->setLoopCount(-1);
-
- // Animate rotation
- c->rtn = new QPropertyAnimation(c, "rotation");
- c->rtn->setStartValue(c->rot);
- c->rtn->setEndValue(359.0f);
- c->rtn->setDuration(d * 2.0f);
- c->rtn->setLoopCount(-1);
- c->rtn->setDuration(d / 2);
- ix = (ix + 1) % 3;
- return c;
-}
diff --git a/examples/opengl/legacy/pbuffers/cube.h b/examples/opengl/legacy/pbuffers/cube.h
deleted file mode 100644
index 17cac2decd..0000000000
--- a/examples/opengl/legacy/pbuffers/cube.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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$
-**
-****************************************************************************/
-
-#ifndef CUBE_H
-#define CUBE_H
-
-#include <QtOpenGL/qgl.h>
-#include <QtCore/qvector.h>
-#include <QtCore/qsequentialanimationgroup.h>
-#include <QtGui/qmatrix4x4.h>
-#include <QtGui/qvector3d.h>
-#include <QtGui/qvector2d.h>
-
-QT_BEGIN_NAMESPACE
-class QPropertyAnimation;
-QT_END_NAMESPACE
-
-class Geometry
-{
-public:
- void loadArrays() const;
- void addQuad(const QVector3D &a, const QVector3D &b,
- const QVector3D &c, const QVector3D &d,
- const QVector<QVector2D> &tex);
- void setColors(int start, GLfloat colors[4][4]);
- const GLushort *indices() const { return faces.constData(); }
- int count() const { return faces.count(); }
-private:
- QVector<GLushort> faces;
- QVector<QVector3D> vertices;
- QVector<QVector3D> normals;
- QVector<QVector2D> texCoords;
- QVector<QVector4D> colors;
- int append(const QVector3D &a, const QVector3D &n, const QVector2D &t);
- void addTri(const QVector3D &a, const QVector3D &b, const QVector3D &c, const QVector3D &n);
- friend class Tile;
-};
-
-class Tile
-{
-public:
- void draw() const;
- void setColors(GLfloat[4][4]);
-protected:
- Tile(const QVector3D &loc = QVector3D());
- QVector3D location;
- QQuaternion orientation;
-private:
- int start;
- int count;
- bool useFlatColor;
- GLfloat faceColor[4];
- Geometry *geom;
- friend class TileBuilder;
-};
-
-class TileBuilder
-{
-public:
- enum { bl, br, tr, tl };
- explicit TileBuilder(Geometry *, qreal depth = 0.0f, qreal size = 1.0f);
- Tile *newTile(const QVector3D &loc = QVector3D()) const;
- void setColor(QColor c) { color = c; }
-protected:
- void initialize(Tile *) const;
- QVector<QVector3D> verts;
- QVector<QVector2D> tex;
- int start;
- int count;
- Geometry *geom;
- QColor color;
-};
-
-class Cube : public QObject, public Tile
-{
- Q_OBJECT
- Q_PROPERTY(qreal range READ range WRITE setRange)
- Q_PROPERTY(qreal altitude READ altitude WRITE setAltitude)
- Q_PROPERTY(qreal rotation READ rotation WRITE setRotation)
-public:
- Cube(const QVector3D &loc = QVector3D());
- ~Cube();
- qreal range() { return location.x(); }
- void setRange(qreal r);
- qreal altitude() { return location.y(); }
- void setAltitude(qreal a);
- qreal rotation() { return rot; }
- void setRotation(qreal r);
- void removeBounce();
- void startAnimation();
- void setAnimationPaused(bool paused);
-signals:
- void changed();
-private:
- qreal rot;
- QPropertyAnimation *r;
- QPropertyAnimation *rtn;
- QSequentialAnimationGroup *animGroup;
- qreal startx;
- friend class CubeBuilder;
-};
-
-class CubeBuilder : public TileBuilder
-{
-public:
- explicit CubeBuilder(Geometry *, qreal depth = 0.0f, qreal size = 1.0f);
- Cube *newCube(const QVector3D &loc = QVector3D()) const;
-private:
- mutable int ix;
-};
-
-#endif // CUBE_H
diff --git a/examples/opengl/legacy/pbuffers/cubelogo.png b/examples/opengl/legacy/pbuffers/cubelogo.png
deleted file mode 100644
index 2ccbede774..0000000000
--- a/examples/opengl/legacy/pbuffers/cubelogo.png
+++ /dev/null
Binary files differ
diff --git a/examples/opengl/legacy/pbuffers/glwidget.cpp b/examples/opengl/legacy/pbuffers/glwidget.cpp
deleted file mode 100644
index 5763436d5e..0000000000
--- a/examples/opengl/legacy/pbuffers/glwidget.cpp
+++ /dev/null
@@ -1,256 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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 "glwidget.h"
-#include <math.h>
-
-#include "cube.h"
-
-#include <QGLPixelBuffer>
-
-#ifndef GL_MULTISAMPLE
-#define GL_MULTISAMPLE 0x809D
-#endif
-
-static GLfloat colorArray[][4] = {
- {0.243f, 0.423f, 0.125f, 1.0f},
- {0.176f, 0.31f, 0.09f, 1.0f},
- {0.4f, 0.69f, 0.212f, 1.0f},
- {0.317f, 0.553f, 0.161f, 1.0f}
-};
-
-GLWidget::GLWidget(QWidget *parent)
- : QGLWidget(QGLFormat(QGL::SampleBuffers), parent)
- , geom(0)
- , cube(0)
-{
- // create the pbuffer
- QGLFormat pbufferFormat = format();
- pbufferFormat.setSampleBuffers(false);
- pbuffer = new QGLPixelBuffer(QSize(512, 512), pbufferFormat, this);
- setWindowTitle(tr("OpenGL pbuffers"));
- initializeGeometry();
-}
-
-GLWidget::~GLWidget()
-{
- pbuffer->releaseFromDynamicTexture();
- glDeleteTextures(1, &dynamicTexture);
- delete pbuffer;
-
- qDeleteAll(cubes);
- qDeleteAll(tiles);
- delete cube;
-}
-
-void GLWidget::initializeGL()
-{
- initCommon();
- glShadeModel(GL_SMOOTH);
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
- static GLfloat lightPosition[4] = { 0.5, 5.0, 7.0, 1.0 };
- glLightfv(GL_LIGHT0, GL_POSITION, lightPosition);
- initPbuffer();
- cube->startAnimation();
- connect(cube, SIGNAL(changed()), this, SLOT(update()));
- for (int i = 0; i < 3; ++i)
- {
- cubes[i]->startAnimation();
- connect(cubes[i], SIGNAL(changed()), this, SLOT(update()));
- }
-}
-
-void GLWidget::paintGL()
-{
- pbuffer->makeCurrent();
- drawPbuffer();
- // On direct render platforms, drawing onto the pbuffer context above
- // automatically updates the dynamic texture. For cases where rendering
- // directly to a texture is not supported, explicitly copy.
- if (!hasDynamicTextureUpdate)
- pbuffer->updateDynamicTexture(dynamicTexture);
- makeCurrent();
-
- // Use the pbuffer as a texture to render the scene
- glBindTexture(GL_TEXTURE_2D, dynamicTexture);
-
- // set up to render the scene
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- glLoadIdentity();
- glTranslatef(0.0f, 0.0f, -10.0f);
-
- // draw the background
- glPushMatrix();
- glScalef(aspect, 1.0f, 1.0f);
- for (int i = 0; i < tiles.count(); ++i)
- tiles[i]->draw();
- glPopMatrix();
-
- // draw the bouncing cubes
- for (int i = 0; i < cubes.count(); ++i)
- cubes[i]->draw();
-}
-
-void GLWidget::initializeGeometry()
-{
- geom = new Geometry();
- CubeBuilder cBuilder(geom, 0.5);
- cBuilder.setColor(QColor(255, 255, 255, 212));
- // build the 3 bouncing, spinning cubes
- for (int i = 3; i > 0; --i)
- cubes.append(cBuilder.newCube(QVector3D((float)(i-1), -1.5f, 5 - i)));
-
- // build the spinning cube which goes in the dynamic texture
- cube = cBuilder.newCube();
- cube->removeBounce();
-
- // build the background tiles
- TileBuilder tBuilder(geom);
- tBuilder.setColor(QColor(Qt::white));
- for (int c = -2; c <= +2; ++c)
- for (int r = -2; r <= +2; ++r)
- tiles.append(tBuilder.newTile(QVector3D(c, r, 0)));
-
- // graded backdrop for the pbuffer scene
- TileBuilder bBuilder(geom, 0.0f, 2.0f);
- bBuilder.setColor(QColor(102, 176, 54, 210));
- backdrop = bBuilder.newTile(QVector3D(0.0f, 0.0f, -1.5f));
- backdrop->setColors(colorArray);
-}
-
-void GLWidget::initCommon()
-{
- qglClearColor(QColor(Qt::darkGray));
-
- glEnable(GL_DEPTH_TEST);
- glEnable(GL_CULL_FACE);
- glEnable(GL_MULTISAMPLE);
-
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glEnable(GL_BLEND);
-
- glEnable(GL_TEXTURE_2D);
-
- geom->loadArrays();
-}
-
-void GLWidget::perspectiveProjection()
-{
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
-#ifdef QT_OPENGL_ES
- glFrustumf(-aspect, +aspect, -1.0, +1.0, 4.0, 15.0);
-#else
- glFrustum(-aspect, +aspect, -1.0, +1.0, 4.0, 15.0);
-#endif
- glMatrixMode(GL_MODELVIEW);
-}
-
-void GLWidget::orthographicProjection()
-{
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
-#ifdef QT_OPENGL_ES
- glOrthof(-1.0, +1.0, -1.0, +1.0, -90.0, +90.0);
-#else
- glOrtho(-1.0, +1.0, -1.0, +1.0, -90.0, +90.0);
-#endif
- glMatrixMode(GL_MODELVIEW);
-}
-
-void GLWidget::resizeGL(int width, int height)
-{
- glViewport(0, 0, width * devicePixelRatio(), height * devicePixelRatio());
- aspect = (qreal)width / (qreal)(height ? height : 1);
- perspectiveProjection();
-}
-
-void GLWidget::drawPbuffer()
-{
- orthographicProjection();
-
- glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- glDisable(GL_TEXTURE_2D);
- backdrop->draw();
- glEnable(GL_TEXTURE_2D);
-
- glBindTexture(GL_TEXTURE_2D, cubeTexture);
- glDisable(GL_CULL_FACE);
- cube->draw();
- glEnable(GL_CULL_FACE);
-
- glFlush();
-}
-
-void GLWidget::initPbuffer()
-{
- pbuffer->makeCurrent();
-
- cubeTexture = bindTexture(QImage(":res/cubelogo.png"));
-
- initCommon();
-
- // generate a texture that has the same size/format as the pbuffer
- dynamicTexture = pbuffer->generateDynamicTexture();
-
- // bind the dynamic texture to the pbuffer - this is a no-op under X11
- hasDynamicTextureUpdate = pbuffer->bindToDynamicTexture(dynamicTexture);
- makeCurrent();
-}
-
-void GLWidget::setAnimationPaused(bool enable)
-{
- cube->setAnimationPaused(enable);
- for (int i = 0; i < 3; ++i)
- cubes[i]->setAnimationPaused(enable);
-}
diff --git a/examples/opengl/legacy/pbuffers/glwidget.h b/examples/opengl/legacy/pbuffers/glwidget.h
deleted file mode 100644
index 397329c428..0000000000
--- a/examples/opengl/legacy/pbuffers/glwidget.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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$
-**
-****************************************************************************/
-
-#ifndef GLWIDGET_H
-#define GLWIDGET_H
-
-#include <QGLWidget>
-
-class Geometry;
-class Cube;
-class Tile;
-QT_BEGIN_NAMESPACE
-class QGLPixelBuffer;
-QT_END_NAMESPACE
-
-class GLWidget : public QGLWidget
-{
-public:
- GLWidget(QWidget *parent = 0);
- ~GLWidget();
-
-protected:
- void initializeGL() override;
- void paintGL() override;
- void resizeGL(int width, int height) override;
- void mousePressEvent(QMouseEvent *) override { setAnimationPaused(true); }
- void mouseReleaseEvent(QMouseEvent *) override { setAnimationPaused(false); }
-
-private:
- void initializeGeometry();
- void initPbuffer();
- void initCommon();
- void perspectiveProjection();
- void orthographicProjection();
- void drawPbuffer();
- void setAnimationPaused(bool enable);
-
- qreal aspect;
- GLuint dynamicTexture;
- GLuint cubeTexture;
- bool hasDynamicTextureUpdate;
- QGLPixelBuffer *pbuffer;
- Geometry *geom;
- Cube *cube;
- Tile *backdrop;
- QList<Cube *> cubes;
- QList<Tile *> tiles;
-
-};
-//! [3]
-
-#endif
diff --git a/examples/opengl/legacy/pbuffers/main.cpp b/examples/opengl/legacy/pbuffers/main.cpp
deleted file mode 100644
index 157f450b75..0000000000
--- a/examples/opengl/legacy/pbuffers/main.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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/QApplication>
-#include <QtWidgets/QMessageBox>
-#include <QtOpenGL/QGLPixelBuffer>
-
-#include "glwidget.h"
-
-int main(int argc, char **argv)
-{
- Q_INIT_RESOURCE(pbuffers);
-
- QApplication a(argc, argv);
- GLWidget widget(0);
- widget.resize(640, 480);
- widget.makeCurrent();
-
- if (!QGLFormat::hasOpenGL() || !QGLPixelBuffer::hasOpenGLPbuffers()) {
- QMessageBox::information(0, "OpenGL pbuffers",
- "This system does not support OpenGL/pbuffers.");
- return -1;
- }
-
- widget.show();
- return a.exec();
-}
-
diff --git a/examples/opengl/legacy/pbuffers/pbuffers.pro b/examples/opengl/legacy/pbuffers/pbuffers.pro
deleted file mode 100644
index 7572ba3583..0000000000
--- a/examples/opengl/legacy/pbuffers/pbuffers.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-HEADERS += glwidget.h \
- cube.h
-SOURCES += glwidget.cpp \
- main.cpp \
- cube.cpp
-RESOURCES += pbuffers.qrc
-QT += opengl widgets
-
-# install
-target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/pbuffers
-INSTALLS += target
-
-qtConfig(opengles.|angle|dynamicgl): error("This example requires Qt to be configured with -opengl desktop")
diff --git a/examples/opengl/legacy/pbuffers/pbuffers.qrc b/examples/opengl/legacy/pbuffers/pbuffers.qrc
deleted file mode 100644
index 9fc1a56a1a..0000000000
--- a/examples/opengl/legacy/pbuffers/pbuffers.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource prefix="/res">
- <file>cubelogo.png</file>
-</qresource>
-</RCC>
diff --git a/examples/opengl/legacy/pbuffers2/bubbles.svg b/examples/opengl/legacy/pbuffers2/bubbles.svg
deleted file mode 100644
index 51730124a2..0000000000
--- a/examples/opengl/legacy/pbuffers2/bubbles.svg
+++ /dev/null
@@ -1,215 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
-<svg width="20cm" height="15cm" viewBox="0 0 800 600"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink/"
- baseProfile="tiny" version="1.2">
- <title>Spheres</title>
- <desc>Semi-transparent bubbles on a colored background.</desc>
- <defs>
- <!-- Create radial gradients for each bubble. -->
- <radialGradient id="blueBubble" gradientUnits="userSpaceOnUse"
- cx="0" cy="0" r="100" fx="-50" fy="-50">
- <stop offset="0%" stop-color="white" stop-opacity="1" />
- <stop offset="25%" stop-color="#cdcdff" stop-opacity=".65" />
- <stop offset="100%" stop-color="#cdaacd" stop-opacity=".75" />
- </radialGradient>
- <radialGradient id="redBubble" gradientUnits="userSpaceOnUse"
- cx="0" cy="0" r="100" fx="-50" fy="-50">
- <stop offset="0%" stop-color="white" stop-opacity="1" />
- <stop offset="25%" stop-color="#ffcdcd" stop-opacity=".65" />
- <stop offset="100%" stop-color="#bbbb99" stop-opacity=".75" />
- </radialGradient>
- <radialGradient id="greenBubble" gradientUnits="userSpaceOnUse"
- cx="0" cy="0" r="100" fx="-50" fy="-50">
- <stop offset="0%" stop-color="white" stop-opacity="1" />
- <stop offset="25%" stop-color="#cdffcd" stop-opacity=".65" />
- <stop offset="100%" stop-color="#99aaaa" stop-opacity=".75" />
- </radialGradient>
- <radialGradient id="yellowBubble" gradientUnits="userSpaceOnUse"
- cx="0" cy="0" r="100" fx="-50" fy="-50">
- <stop offset="0%" stop-color="white" stop-opacity="1" />
- <stop offset="25%" stop-color="#ffffcd" stop-opacity=".65" />
- <stop offset="100%" stop-color="#bbbbaa" stop-opacity=".75" />
- </radialGradient>
- <radialGradient id="background" gradientUnits="userSpaceOnUse"
- cx="0" cy="0" r="400" fx="250" fy="250">
- <stop offset="0%" stop-color="#ffffee" />
- <stop offset="100%" stop-color="#ccccaa" />
- </radialGradient>
- <linearGradient id="surface" gradientUnits="userSpaceOnUse"
- x1="-100" y1="200" x2="400" y2="200">
- <stop offset="0%" stop-color="#ffffcc" />
- <stop offset="100%" stop-color="#bbbb88" />
- </linearGradient>
-
- <!-- Create radial gradients for each circle to make them look like
- spheres. -->
- <radialGradient id="blueSphere" gradientUnits="userSpaceOnUse"
- cx="0" cy="0" r="100" fx="-50" fy="-50">
- <stop offset="0%" stop-color="white" />
- <stop offset="75%" stop-color="blue" />
- <stop offset="100%" stop-color="#222244" />
- </radialGradient>
- <radialGradient id="redSphere" gradientUnits="userSpaceOnUse"
- cx="0" cy="0" r="100" fx="-50" fy="-50">
- <stop offset="0%" stop-color="white" />
- <stop offset="75%" stop-color="red" />
- <stop offset="100%" stop-color="#442222" />
- </radialGradient>
- <radialGradient id="greenSphere" gradientUnits="userSpaceOnUse"
- cx="0" cy="0" r="100" fx="-50" fy="-50">
- <stop offset="0%" stop-color="white" />
- <stop offset="75%" stop-color="green" />
- <stop offset="100%" stop-color="#113311" />
- </radialGradient>
- <radialGradient id="yellowSphere" gradientUnits="userSpaceOnUse"
- cx="0" cy="0" r="100" fx="-50" fy="-50">
- <stop offset="0%" stop-color="white" />
- <stop offset="75%" stop-color="yellow" />
- <stop offset="100%" stop-color="#444422" />
- </radialGradient>
- <radialGradient id="shadowGrad" gradientUnits="userSpaceOnUse"
- cx="0" cy="0" r="100" fx="-50" fy="50">
- <stop offset="0%" stop-color="black" stop-opacity="1.0" />
- <stop offset="100%" stop-color="black" stop-opacity="0.0" />
- </radialGradient>
-
- <!-- Define a shadow for each sphere. -->
- <circle id="shadow" fill="url(#shadowGrad)" cx="0" cy="0" r="100" />
- <g id="bubble">
- <circle fill="black" cx="0" cy="0" r="50" />
- <circle fill="#a6ce39" cx="0" cy="0" r="33" />
- <path fill="black" d="M 37,50 L 50,37 L 12,-1 L 22,-11 L 10,-24 L -24,10
- L -11,22 L -1,12 Z" />
- <circle cx="0" cy="0" r="100" />
- </g>
- </defs>
- <g>
- <rect fill="url(#background)" x="0" y="0" width="800" height="600" />
- </g>
-
- <g transform="translate(200,700)">
- <use xlink:href="#bubble" fill="url(#blueBubble)" />
- <animateTransform attributeName="transform" type="translate" additive="sum"
- values="0,0; 0,-800" begin="1s" dur="10s" fill="freeze" repeatCount="indefinite" />
- </g>
- <g transform="translate(315,700)">
- <g transform="scale(0.5,0.5)">
- <use xlink:href="#bubble" fill="url(#redBubble)" />
- </g>
- <animateTransform attributeName="transform" type="translate" additive="sum"
- values="0,0; 0,-800" begin="3s" dur="7s" fill="freeze" repeatCount="indefinite" />
- </g>
- <g transform="translate(80,700)">
- <g transform="scale(0.65,0.65)">
- <use xlink:href="#bubble" fill="url(#greenBubble)" />
- </g>
- <animateTransform attributeName="transform" type="translate" additive="sum"
- values="0,0; 0,-800" begin="5s" dur="9s" fill="freeze" repeatCount="indefinite" />
- </g>
- <g transform="translate(255,700)">
- <g transform="scale(0.3,0.3)">
- <use xlink:href="#bubble" fill="url(#yellowBubble)" />
- </g>
- <animateTransform attributeName="transform" type="translate" additive="sum"
- values="0,0; 0,-800" begin="2s" dur="6s" fill="freeze" repeatCount="indefinite" />
- </g>
- <g transform="translate(565,700)">
- <g transform="scale(0.4,0.4)">
- <use xlink:href="#bubble" fill="url(#blueBubble)" />
- </g>
- <animateTransform attributeName="transform" type="translate" additive="sum"
- values="0,0; 0,-800" begin="4s" dur="8s" fill="freeze" repeatCount="indefinite" />
- </g>
- <g transform="translate(715,700)">
- <g transform="scale(0.6,0.6)">
- <use xlink:href="#bubble" fill="url(#redBubble)" />
- </g>
- <animateTransform attributeName="transform" type="translate" additive="sum"
- values="0,0; 0,-800" begin="1s" dur="4s" fill="freeze" repeatCount="indefinite" />
- </g>
- <g transform="translate(645,700)">
- <g transform="scale(0.375,0.375)">
- <use xlink:href="#bubble" fill="url(#greenBubble)" />
- </g>
- <animateTransform attributeName="transform" type="translate" additive="sum"
- values="0,0; 0,-800" begin="0s" dur="11s" fill="freeze" repeatCount="indefinite" />
- </g>
- <g transform="translate(555,700)">
- <g transform="scale(0.9,0.9)">
- <use xlink:href="#bubble" fill="url(#yellowBubble)" />
- </g>
- <animateTransform attributeName="transform" type="translate" additive="sum"
- values="0,0; 0,-800" begin="3s" dur="7.5s" fill="freeze" repeatCount="indefinite" />
- </g>
-
- <g transform="translate(360,700)">
- <g transform="scale(0.5,0.5)">
- <use xlink:href="#bubble" fill="url(#blueBubble)" />
- </g>
- <animateTransform attributeName="transform" type="translate" additive="sum"
- values="0,0; 0,-800" begin="3s" dur="6s" fill="freeze" repeatCount="indefinite" />
- </g>
- <g transform="translate(215,700)">
- <g transform="scale(0.45,0.45)">
- <use xlink:href="#bubble" fill="url(#redBubble)" />
- </g>
- <animateTransform attributeName="transform" type="translate" additive="sum"
- values="0,0; 0,-800" begin="5.5s" dur="7s" fill="freeze" repeatCount="indefinite" />
- </g>
- <g transform="translate(420,700)">
- <g transform="scale(0.75,0.75)">
- <use xlink:href="#bubble" fill="url(#greenBubble)" />
- </g>
- <animateTransform attributeName="transform" type="translate" additive="sum"
- values="0,0; 0,-800" begin="1s" dur="9s" fill="freeze" repeatCount="indefinite" />
- </g>
- <g transform="translate(815,700)">
- <g transform="scale(0.6,0.6)">
- <use xlink:href="#bubble" fill="url(#yellowBubble)" />
- </g>
- <animateTransform attributeName="transform" type="translate" additive="sum"
- values="0,0; 0,-800" begin="2s" dur="9.5s" fill="freeze" repeatCount="indefinite" />
- </g>
-
- <g transform="translate(225,375)" >
- <g transform="scale(1.0,0.5)" >
- <path d="M 0 0 L 350 0 L 450 450 L -100 450 z"
- fill="url(#surface)" stroke="none" />
- </g>
- </g>
- <g transform="translate(200,0)" >
- <g transform="translate(200,490) scale(2.0,1.0) rotate(45)" >
- <rect fill="#a6ce39" x="-69" y="-69" width="138" height="138" />
- <circle fill="black" cx="0" cy="0" r="50" />
- <circle fill="#a6ce39" cx="0" cy="0" r="33" />
- <path fill="black" d="M 37,50 L 50,37 L 12,-1 L 22,-11 L 10,-24 L -24,10
- L -11,22 L -1,12 Z" />
- <animateTransform attributeName="transform" type="rotate" additive="sum" values="0; 360"
- begin="0s" dur="10s" fill="freeze" repeatCount="indefinite" />
- </g>
- <g transform="translate(200,375)">
- <use xlink:href="#shadow" transform="translate(25,55) scale(1.0,0.5)" />
- <circle fill="url(#blueSphere)" cx="0" cy="0" r="100" />
- </g>
- <g transform="translate(315,440)">
- <g transform="scale(0.5,0.5)">
- <use xlink:href="#shadow" transform="translate(25,55) scale(1.0,0.5)" />
- <circle fill="url(#redSphere)" cx="0" cy="0" r="100" />
- </g>
- </g>
- <g transform="translate(80,475)">
- <g transform="scale(0.65,0.65)">
- <use xlink:href="#shadow" transform="translate(25,55) scale(1.0,0.5)" />
- <circle fill="url(#greenSphere)" cx="0" cy="0" r="100" />
- </g>
- </g>
- <g transform="translate(255,525)">
- <g transform="scale(0.3,0.3)">
- <use xlink:href="#shadow" transform="translate(25,55) scale(1.0,0.5)" />
- <circle fill="url(#yellowSphere)" cx="0" cy="0" r="100" />
- </g>
- </g>
- </g>
-</svg>
diff --git a/examples/opengl/legacy/pbuffers2/designer.png b/examples/opengl/legacy/pbuffers2/designer.png
deleted file mode 100644
index 4f32d57496..0000000000
--- a/examples/opengl/legacy/pbuffers2/designer.png
+++ /dev/null
Binary files differ
diff --git a/examples/opengl/legacy/pbuffers2/glwidget.cpp b/examples/opengl/legacy/pbuffers2/glwidget.cpp
deleted file mode 100644
index c710d03cab..0000000000
--- a/examples/opengl/legacy/pbuffers2/glwidget.cpp
+++ /dev/null
@@ -1,328 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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 <QtGui/QImage>
-#include <qmath.h>
-#include "glwidget.h"
-
-#ifndef GL_MULTISAMPLE
-#define GL_MULTISAMPLE 0x809D
-#endif
-
-GLWidget::GLWidget(QWidget *parent)
- : QGLWidget(QGLFormat(QGL::SampleBuffers), parent)
-{
- setWindowTitle(tr("OpenGL pbuffers 2"));
-
- pbuffer = new QGLPixelBuffer(1024, 1024, format(), this);
-
- rot_x = rot_y = rot_z = 0.0f;
- scale = 0.1f;
- anim = new QTimeLine(750, this);
- anim->setUpdateInterval(20);
- connect(anim, SIGNAL(valueChanged(qreal)), SLOT(animate(qreal)));
- connect(anim, SIGNAL(finished()), SLOT(animFinished()));
-
- svg_renderer = new QSvgRenderer(QLatin1String(":/res/bubbles.svg"), this);
- connect(svg_renderer, SIGNAL(repaintNeeded()), this, SLOT(draw()));
-
- logo = QImage(":/res/designer.png");
- logo = logo.convertToFormat(QImage::Format_ARGB32);
-
- makeCurrent(); // need a current context to create the display list
- tile_list = glGenLists(1);
- glNewList(tile_list, GL_COMPILE);
- glBegin(GL_QUADS);
- {
- glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 1.0f);
- glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f, -1.0f, 1.0f);
- glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f, 1.0f, 1.0f);
- glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f, 1.0f);
-
- glTexCoord2f(1.0f, 0.0f); glVertex3f(-1.0f, -1.0f, -1.0f);
- glTexCoord2f(1.0f, 1.0f); glVertex3f(-1.0f, 1.0f, -1.0f);
- glTexCoord2f(0.0f, 1.0f); glVertex3f( 1.0f, 1.0f, -1.0f);
- glTexCoord2f(0.0f, 0.0f); glVertex3f( 1.0f, -1.0f, -1.0f);
-
- glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f, -1.0f);
- glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, 1.0f, 1.0f);
- glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f, 1.0f, 1.0f);
- glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f, 1.0f, -1.0f);
-
- glTexCoord2f(1.0f, 1.0f); glVertex3f(-1.0f, -1.0f, -1.0f);
- glTexCoord2f(0.0f, 1.0f); glVertex3f( 1.0f, -1.0f, -1.0f);
- glTexCoord2f(0.0f, 0.0f); glVertex3f( 1.0f, -1.0f, 1.0f);
- glTexCoord2f(1.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 1.0f);
-
- glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f, -1.0f, -1.0f);
- glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f, 1.0f, -1.0f);
- glTexCoord2f(0.0f, 1.0f); glVertex3f( 1.0f, 1.0f, 1.0f);
- glTexCoord2f(0.0f, 0.0f); glVertex3f( 1.0f, -1.0f, 1.0f);
-
- glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, -1.0f, -1.0f);
- glTexCoord2f(1.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 1.0f);
- glTexCoord2f(1.0f, 1.0f); glVertex3f(-1.0f, 1.0f, 1.0f);
- glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f, -1.0f);
-}
- glEnd();
- glEndList();
-
- wave = new GLfloat[logo.width()*logo.height()];
- memset(wave, 0, logo.width()*logo.height());
- startTimer(30); // wave timer
-
- pbuffer->makeCurrent();
- dynamicTexture = pbuffer->generateDynamicTexture();
-
- // bind the dynamic texture to the pbuffer - this is a no-op under X11
- hasDynamicTextureUpdate = pbuffer->bindToDynamicTexture(dynamicTexture);
-}
-
-GLWidget::~GLWidget()
-{
- delete[] wave;
- glDeleteLists(tile_list, 1);
- pbuffer->releaseFromDynamicTexture();
- glDeleteTextures(1, &dynamicTexture);
- delete pbuffer;
-}
-
-void GLWidget::paintEvent(QPaintEvent *)
-{
- draw();
-}
-
-void GLWidget::draw()
-{
- QPainter p(this); // used for text overlay
-
- // save the GL state set for QPainter
- p.beginNativePainting();
- saveGLState();
-
- // render the 'bubbles.svg' file into our pbuffer
- QPainter pbuffer_painter(pbuffer);
- svg_renderer->render(&pbuffer_painter);
- pbuffer_painter.end();
- glFlush();
-
- if (!hasDynamicTextureUpdate)
- pbuffer->updateDynamicTexture(dynamicTexture);
-
- makeCurrent();
- // draw into the GL widget
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glFrustum(-1, 1, -1, 1, 10, 100);
- glTranslatef(0.0f, 0.0f, -15.0f);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glViewport(0, 0, width() * devicePixelRatio(), height() * devicePixelRatio());
-
- glBindTexture(GL_TEXTURE_2D, dynamicTexture);
- glEnable(GL_TEXTURE_2D);
- glEnable(GL_MULTISAMPLE);
- glEnable(GL_CULL_FACE);
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
- // draw background
- glPushMatrix();
- glScalef(1.7f, 1.7f, 1.7f);
- glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
- glCallList(tile_list);
- glPopMatrix();
-
- const int w = logo.width();
- const int h = logo.height();
-
- glRotatef(rot_x, 1.0f, 0.0f, 0.0f);
- glRotatef(rot_y, 0.0f, 1.0f, 0.0f);
- glRotatef(rot_z, 0.0f, 0.0f, 1.0f);
- glScalef(scale/w, scale/w, scale/w);
-
- glDepthFunc(GL_LESS);
- glEnable(GL_DEPTH_TEST);
-
- // draw the Qt icon
- glTranslatef(-w+1, -h+1, 0.0f);
- for (int y=h-1; y>=0; --y) {
- uint *p = (uint*) logo.scanLine(y);
- uint *end = p + w;
- int x = 0;
- while (p < end) {
- glColor4ub(qRed(*p), qGreen(*p), qBlue(*p), uchar(qAlpha(*p)*.9));
- glTranslatef(0.0f, 0.0f, wave[y*w+x]);
- if (qAlpha(*p) > 128)
- glCallList(tile_list);
- glTranslatef(0.0f, 0.0f, -wave[y*w+x]);
- glTranslatef(2.0f, 0.0f, 0.0f);
- ++x;
- ++p;
- }
- glTranslatef(-w*2.0f, 2.0f, 0.0f);
- }
-
- // restore the GL state that QPainter expects
- restoreGLState();
- p.endNativePainting();
-
- // draw the overlayed text using QPainter
- p.setPen(QColor(197, 197, 197, 157));
- p.setBrush(QColor(197, 197, 197, 127));
- p.drawRect(QRect(0, 0, width(), 50));
- p.setPen(Qt::black);
- p.setBrush(Qt::NoBrush);
- const QString str1(tr("A simple OpenGL pbuffer example."));
- const QString str2(tr("Use the mouse wheel to zoom, press buttons and move mouse to rotate, double-click to flip."));
- QFontMetrics fm(p.font());
- p.drawText(width()/2 - fm.width(str1)/2, 20, str1);
- p.drawText(width()/2 - fm.width(str2)/2, 20 + fm.lineSpacing(), str2);
-}
-
-void GLWidget::mousePressEvent(QMouseEvent *e)
-{
- anchor = e->pos();
-}
-
-void GLWidget::mouseMoveEvent(QMouseEvent *e)
-{
- QPoint diff = e->pos() - anchor;
- if (e->buttons() & Qt::LeftButton) {
- rot_x += diff.y()/5.0f;
- rot_y += diff.x()/5.0f;
- } else if (e->buttons() & Qt::RightButton) {
- rot_z += diff.x()/5.0f;
- }
-
- anchor = e->pos();
- draw();
-}
-
-void GLWidget::wheelEvent(QWheelEvent *e)
-{
- e->delta() > 0 ? scale += scale*0.1f : scale -= scale*0.1f;
- draw();
-}
-
-void GLWidget::mouseDoubleClickEvent(QMouseEvent *)
-{
- anim->start();
-}
-
-void GLWidget::animate(qreal val)
-{
- rot_y = val * 180;
- draw();
-}
-
-void GLWidget::animFinished()
-{
- if (anim->direction() == QTimeLine::Forward)
- anim->setDirection(QTimeLine::Backward);
- else
- anim->setDirection(QTimeLine::Forward);
-}
-
-void GLWidget::saveGLState()
-{
- glPushAttrib(GL_ALL_ATTRIB_BITS);
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
-}
-
-void GLWidget::restoreGLState()
-{
- glMatrixMode(GL_PROJECTION);
- glPopMatrix();
- glMatrixMode(GL_MODELVIEW);
- glPopMatrix();
- glPopAttrib();
-}
-
-void GLWidget::timerEvent(QTimerEvent *)
-{
- if (QApplication::mouseButtons() != 0)
- return;
-
- static bool scale_in = true;
-
- if (scale_in && scale > 35.0f)
- scale_in = false;
- else if (!scale_in && scale < .5f)
- scale_in = true;
-
- scale *= scale_in ? 1.01f : 0.99f;
- rot_z += 0.3f;
- rot_x += 0.1f;
-
- static float wt = 0.0;
- wt += 0.1f;
-
- const int width = logo.width();
- const int dx = width >> 1, dy = dx; // disturbance point
- const float v = -4; // wave speed
- const float W = .3f;
- const int AMP = 5;
-
- for (int i = 0; i < width; ++i) {
- for (int j = 0; j < width; ++j) {
- const float s = hypot(j - dx, i - dy);
- const double raw = AMP * sin(2 * M_PI * W * (wt + s / v));
- if (s != 0)
- wave[i * width + j] = raw / (0.2 * (s + 2));
- else
- wave[i * width + j] = raw;
- }
- }
-}
diff --git a/examples/opengl/legacy/pbuffers2/glwidget.h b/examples/opengl/legacy/pbuffers2/glwidget.h
deleted file mode 100644
index 2889754ce4..0000000000
--- a/examples/opengl/legacy/pbuffers2/glwidget.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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 <QtOpenGL>
-#include <QImage>
-#include <QTimeLine>
-#include <QSvgRenderer>
-
-class GLWidget : public QGLWidget
-{
- Q_OBJECT
-
-public:
- GLWidget(QWidget *parent);
- ~GLWidget();
-
- void saveGLState();
- void restoreGLState();
-
- void paintEvent(QPaintEvent *);
- void mousePressEvent(QMouseEvent *);
- void mouseDoubleClickEvent(QMouseEvent *);
- void mouseMoveEvent(QMouseEvent *);
- void timerEvent(QTimerEvent *);
- void wheelEvent(QWheelEvent *);
-
-public slots:
- void animate(qreal);
- void animFinished();
- void draw();
-
-private:
- QPoint anchor;
- float scale;
- float rot_x, rot_y, rot_z;
- GLuint tile_list;
- GLfloat *wave;
- bool hasDynamicTextureUpdate;
-
- QImage logo;
- QTimeLine *anim;
- QSvgRenderer *svg_renderer;
-
- GLuint dynamicTexture;
- QGLPixelBuffer *pbuffer;
-};
-
diff --git a/examples/opengl/legacy/pbuffers2/main.cpp b/examples/opengl/legacy/pbuffers2/main.cpp
deleted file mode 100644
index 03da7ab545..0000000000
--- a/examples/opengl/legacy/pbuffers2/main.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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/QApplication>
-#include <QtWidgets/QMessageBox>
-#include "glwidget.h"
-
-int main(int argc, char **argv)
-{
- Q_INIT_RESOURCE(pbuffers2);
-
- QApplication a(argc, argv);
- GLWidget widget(0);
- widget.resize(640, 480);
- widget.makeCurrent();
- if (!QGLFormat::hasOpenGL() || !QGLPixelBuffer::hasOpenGLPbuffers()) {
- QMessageBox::information(0, "OpenGL pbuffers 2",
- "This system does not support OpenGL/pbuffers.");
- return -1;
- }
- widget.show();
- return a.exec();
-}
-
diff --git a/examples/opengl/legacy/pbuffers2/pbuffers2.pro b/examples/opengl/legacy/pbuffers2/pbuffers2.pro
deleted file mode 100644
index f1baae3931..0000000000
--- a/examples/opengl/legacy/pbuffers2/pbuffers2.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-QT += opengl svg widgets
-
-HEADERS += glwidget.h
-SOURCES += glwidget.cpp main.cpp
-RESOURCES += pbuffers2.qrc
-
-# install
-target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/pbuffers2
-INSTALLS += target
-
-qtConfig(opengles.|angle|dynamicgl): error("This example requires Qt to be configured with -opengl desktop")
diff --git a/examples/opengl/legacy/pbuffers2/pbuffers2.qrc b/examples/opengl/legacy/pbuffers2/pbuffers2.qrc
deleted file mode 100644
index 986f1ca385..0000000000
--- a/examples/opengl/legacy/pbuffers2/pbuffers2.qrc
+++ /dev/null
@@ -1,6 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource prefix="/res">
- <file>bubbles.svg</file>
- <file>designer.png</file>
-</qresource>
-</RCC>
diff --git a/examples/opengl/legacy/samplebuffers/glwidget.cpp b/examples/opengl/legacy/samplebuffers/glwidget.cpp
deleted file mode 100644
index da30de4d55..0000000000
--- a/examples/opengl/legacy/samplebuffers/glwidget.cpp
+++ /dev/null
@@ -1,174 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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 "glwidget.h"
-#include <qmath.h>
-
-#ifndef GL_MULTISAMPLE
-#define GL_MULTISAMPLE 0x809D
-#endif
-
-GLWidget::GLWidget(QWidget *parent)
- : QGLWidget(QGLFormat(QGL::SampleBuffers), parent)
-{
- startTimer(40);
- setWindowTitle(tr("Sample Buffers"));
-}
-
-void GLWidget::initializeGL()
-{
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-.5, .5, .5, -.5, -1000, 1000);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
-
- makeObject();
-}
-
-void GLWidget::resizeGL(int w, int h)
-{
- glViewport(0, 0, w, h);
-}
-
-void GLWidget::paintGL()
-{
- static float rot = 0.0;
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
- glEnable(GL_MULTISAMPLE);
- glTranslatef(-0.25f, -0.10f, 0.0f);
- glScalef(0.75f, 1.15f, 0.0f);
- glRotatef(rot, 0.0f, 0.f, 1.0f);
- glCallList(list);
- glPopMatrix();
-
- glPushMatrix();
- glDisable(GL_MULTISAMPLE);
- glTranslatef(0.25f, -0.10f, 0.0f);
- glScalef(0.75f, 1.15f, 0.0f);
- glRotatef(rot, 0.0f, 0.0f, 1.0f);
- glCallList(list);
- glPopMatrix();
-
- rot += 0.2f;
-
- qglColor(Qt::black);
- renderText(-0.35, 0.4, 0.0, "Multisampling enabled");
- renderText(0.15, 0.4, 0.0, "Multisampling disabled");
-}
-
-void GLWidget::timerEvent(QTimerEvent *)
-{
- update();
-}
-
-void GLWidget::makeObject()
-{
- QColor qtGreen(QColor::fromCmykF(0.40, 0.0, 1.0, 0.0));
- const int NumSectors = 15;
- GLdouble x1 = +0.06;
- GLdouble y1 = -0.14;
- GLdouble x2 = +0.14;
- GLdouble y2 = -0.06;
- GLdouble x3 = +0.08;
- GLdouble y3 = +0.00;
- GLdouble x4 = +0.30;
- GLdouble y4 = +0.22;
-
- list = glGenLists(1);
- glNewList(list, GL_COMPILE);
- {
- const double sectorAngle = 2 * M_PI / NumSectors;
- for (int i = 0; i < NumSectors; ++i) {
- double angle = i * sectorAngle;
- GLdouble x5 = 0.30 * sin(angle);
- GLdouble y5 = 0.30 * cos(angle);
- GLdouble x6 = 0.20 * sin(angle);
- GLdouble y6 = 0.20 * cos(angle);
-
- angle += sectorAngle;
- GLdouble x7 = 0.20 * sin(angle);
- GLdouble y7 = 0.20 * cos(angle);
- GLdouble x8 = 0.30 * sin(angle);
- GLdouble y8 = 0.30 * cos(angle);
-
- qglColor(qtGreen);
- quad(GL_QUADS, x5, y5, x6, y6, x7, y7, x8, y8);
- qglColor(Qt::black);
- quad(GL_LINE_LOOP, x5, y5, x6, y6, x7, y7, x8, y8);
- }
-
- qglColor(qtGreen);
- quad(GL_QUADS, x1, y1, x2, y2, y2, x2, y1, x1);
- quad(GL_QUADS, x3, y3, x4, y4, y4, x4, y3, x3);
-
- qglColor(Qt::black);
- quad(GL_LINE_LOOP, x1, y1, x2, y2, y2, x2, y1, x1);
- quad(GL_LINE_LOOP, x3, y3, x4, y4, y4, x4, y3, x3);
- }
- glEndList();
-}
-
-void GLWidget::quad(GLenum primitive, GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2,
- GLdouble x3, GLdouble y3, GLdouble x4, GLdouble y4)
-{
- glBegin(primitive);
- {
- glVertex2d(x1, y1);
- glVertex2d(x2, y2);
- glVertex2d(x3, y3);
- glVertex2d(x4, y4);
- }
- glEnd();
-}
diff --git a/examples/opengl/legacy/samplebuffers/glwidget.h b/examples/opengl/legacy/samplebuffers/glwidget.h
deleted file mode 100644
index f02f0835ef..0000000000
--- a/examples/opengl/legacy/samplebuffers/glwidget.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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 <QtOpenGL>
-
-class GLWidget : public QGLWidget
-{
-public:
- GLWidget(QWidget *parent);
-
-protected:
- void initializeGL() override;
- void resizeGL(int w, int h) override;
- void paintGL() override;
- void timerEvent(QTimerEvent *) override;
-
- void makeObject();
- void quad(GLenum primitive, GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2,
- GLdouble x3, GLdouble y3, GLdouble x4, GLdouble y4);
-
-private:
- GLuint list;
-};
-
diff --git a/examples/opengl/legacy/samplebuffers/main.cpp b/examples/opengl/legacy/samplebuffers/main.cpp
deleted file mode 100644
index 216dff1fda..0000000000
--- a/examples/opengl/legacy/samplebuffers/main.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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/QApplication>
-#include <QtWidgets/QMessageBox>
-#include "glwidget.h"
-
-int main(int argc, char **argv)
-{
- QApplication a(argc, argv);
-
- QGLFormat f = QGLFormat::defaultFormat();
- f.setSampleBuffers(true);
- QGLFormat::setDefaultFormat(f);
- if (!QGLFormat::hasOpenGL()) {
- QMessageBox::information(0, "OpenGL samplebuffers",
- "This system does not support OpenGL.");
- return 0;
- }
-
- GLWidget widget(0);
-
- if (!widget.format().sampleBuffers()) {
- QMessageBox::information(0, "OpenGL samplebuffers",
- "This system does not have sample buffer support.");
- return 0;
- }
-
- widget.resize(640, 480);
- widget.show();
-
- return a.exec();
-}
-
diff --git a/examples/opengl/legacy/samplebuffers/samplebuffers.pro b/examples/opengl/legacy/samplebuffers/samplebuffers.pro
deleted file mode 100644
index aca56f8df8..0000000000
--- a/examples/opengl/legacy/samplebuffers/samplebuffers.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-HEADERS += glwidget.h
-SOURCES += glwidget.cpp main.cpp
-
-QT += opengl widgets
-
-# install
-target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/samplebuffers
-INSTALLS += target
-
-qtConfig(opengles.|angle|dynamicgl): error("This example requires Qt to be configured with -opengl desktop")
diff --git a/examples/opengl/legacy/shared/qtlogo.cpp b/examples/opengl/legacy/shared/qtlogo.cpp
deleted file mode 100644
index 9ad274ce09..0000000000
--- a/examples/opengl/legacy/shared/qtlogo.cpp
+++ /dev/null
@@ -1,398 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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 "qtlogo.h"
-
-#include <QGLWidget>
-#include <QMatrix4x4>
-#include <QVector3D>
-#include <QOpenGLFunctions_1_1>
-
-#include <qmath.h>
-
-static const qreal tee_height = 0.311126;
-static const qreal cross_width = 0.25;
-static const qreal bar_thickness = 0.113137;
-static const qreal logo_depth = 0.10;
-
-//! [0]
-struct Geometry
-{
- QVector<GLushort> faces;
- QVector<QVector3D> vertices;
- QVector<QVector3D> normals;
- void appendSmooth(const QVector3D &a, const QVector3D &n, int from);
- void appendFaceted(const QVector3D &a, const QVector3D &n);
- void finalize();
- void loadArrays(QOpenGLFunctions_1_1 *functions) const;
-};
-//! [0]
-
-//! [1]
-class Patch
-{
-public:
- enum Smoothing { Faceted, Smooth };
- Patch(Geometry *);
- void setSmoothing(Smoothing s) { sm = s; }
- void translate(const QVector3D &t);
- void rotate(qreal deg, QVector3D axis);
- void draw(QOpenGLFunctions_1_1 *functions) const;
- void addTri(const QVector3D &a, const QVector3D &b, const QVector3D &c, const QVector3D &n);
- void addQuad(const QVector3D &a, const QVector3D &b, const QVector3D &c, const QVector3D &d);
-
- GLushort start;
- GLushort count;
- GLushort initv;
-
- GLfloat faceColor[4];
- QMatrix4x4 mat;
- Smoothing sm;
- Geometry *geom;
-};
-//! [1]
-
-static inline void qSetColor(float colorVec[], QColor c)
-{
- colorVec[0] = c.redF();
- colorVec[1] = c.greenF();
- colorVec[2] = c.blueF();
- colorVec[3] = c.alphaF();
-}
-
-void Geometry::loadArrays(QOpenGLFunctions_1_1 *functions) const
-{
- functions->glVertexPointer(3, GL_FLOAT, 0, vertices.constData());
- functions->glNormalPointer(GL_FLOAT, 0, normals.constData());
-}
-
-void Geometry::finalize()
-{
- // TODO: add vertex buffer uploading here
-
- // Finish smoothing normals by ensuring accumulated normals are returned
- // to length 1.0.
- for (int i = 0; i < normals.count(); ++i)
- normals[i].normalize();
-}
-
-void Geometry::appendSmooth(const QVector3D &a, const QVector3D &n, int from)
-{
- // Smooth normals are achieved by averaging the normals for faces meeting
- // at a point. First find the point in geometry already generated
- // (working backwards, since most often the points shared are between faces
- // recently added).
- int v = vertices.count() - 1;
- for ( ; v >= from; --v)
- if (qFuzzyCompare(vertices[v], a))
- break;
-
- if (v < from) {
- // The vertex was not found so add it as a new one, and initialize
- // its corresponding normal
- v = vertices.count();
- vertices.append(a);
- normals.append(n);
- } else {
- // Vert found, accumulate normals into corresponding normal slot.
- // Must call finalize once finished accumulating normals
- normals[v] += n;
- }
-
- // In both cases (found or not) reference the vertex via its index
- faces.append(v);
-}
-
-void Geometry::appendFaceted(const QVector3D &a, const QVector3D &n)
-{
- // Faceted normals are achieved by duplicating the vertex for every
- // normal, so that faces meeting at a vertex get a sharp edge.
- int v = vertices.count();
- vertices.append(a);
- normals.append(n);
- faces.append(v);
-}
-
-Patch::Patch(Geometry *g)
- : start(g->faces.count())
- , count(0)
- , initv(g->vertices.count())
- , sm(Patch::Smooth)
- , geom(g)
-{
- qSetColor(faceColor, QColor(Qt::darkGray));
-}
-
-void Patch::rotate(qreal deg, QVector3D axis)
-{
- mat.rotate(deg, axis);
-}
-
-void Patch::translate(const QVector3D &t)
-{
- mat.translate(t);
-}
-
-//! [2]
-void Patch::draw(QOpenGLFunctions_1_1 *functions) const
-{
- functions->glPushMatrix();
- functions->glMultMatrixf(mat.constData());
- functions->glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, faceColor);
-
- const GLushort *indices = geom->faces.constData();
- functions->glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, indices + start);
- functions->glPopMatrix();
-}
-//! [2]
-
-void Patch::addTri(const QVector3D &a, const QVector3D &b, const QVector3D &c, const QVector3D &n)
-{
- QVector3D norm = n.isNull() ? QVector3D::normal(a, b, c) : n;
-
- if (sm == Smooth) {
- geom->appendSmooth(a, norm, initv);
- geom->appendSmooth(b, norm, initv);
- geom->appendSmooth(c, norm, initv);
- } else {
- geom->appendFaceted(a, norm);
- geom->appendFaceted(b, norm);
- geom->appendFaceted(c, norm);
- }
-
- count += 3;
-}
-
-void Patch::addQuad(const QVector3D &a, const QVector3D &b, const QVector3D &c, const QVector3D &d)
-{
- QVector3D norm = QVector3D::normal(a, b, c);
-
- if (sm == Smooth) {
- addTri(a, b, c, norm);
- addTri(a, c, d, norm);
- } else {
- // If faceted share the two common vertices
- addTri(a, b, c, norm);
- int k = geom->vertices.count();
- geom->appendSmooth(a, norm, k);
- geom->appendSmooth(c, norm, k);
- geom->appendFaceted(d, norm);
- count += 3;
- }
-}
-
-static inline QVector<QVector3D> extrude(const QVector<QVector3D> &vertices, qreal depth)
-{
- QVector<QVector3D> extr = vertices;
- for (int v = 0; v < extr.count(); ++v)
- extr[v].setZ(extr[v].z() - depth);
- return extr;
-}
-
-class Rectoid
-{
-public:
- void translate(const QVector3D &t)
- {
- for (int i = 0; i < parts.count(); ++i)
- parts[i]->translate(t);
- }
-
- void rotate(qreal deg, QVector3D axis)
- {
- for (int i = 0; i < parts.count(); ++i)
- parts[i]->rotate(deg, axis);
- }
-
- // No special Rectoid destructor - the parts are fetched out of this member
- // variable, and destroyed by the new owner
- QList<Patch *> parts;
-};
-
-class RectPrism : public Rectoid
-{
-public:
- RectPrism(Geometry *g, qreal width, qreal height, qreal depth);
-};
-
-RectPrism::RectPrism(Geometry *g, qreal width, qreal height, qreal depth)
-{
- enum { bl, br, tr, tl };
- Patch *fb = new Patch(g);
- fb->setSmoothing(Patch::Faceted);
-
- // front face
- QVector<QVector3D> r(4);
- r[br].setX(width);
- r[tr].setX(width);
- r[tr].setY(height);
- r[tl].setY(height);
- QVector3D adjToCenter(-width / 2.0, -height / 2.0, depth / 2.0);
- for (int i = 0; i < 4; ++i)
- r[i] += adjToCenter;
- fb->addQuad(r[bl], r[br], r[tr], r[tl]);
-
- // back face
- QVector<QVector3D> s = extrude(r, depth);
- fb->addQuad(s[tl], s[tr], s[br], s[bl]);
-
- // side faces
- Patch *sides = new Patch(g);
- sides->setSmoothing(Patch::Faceted);
- sides->addQuad(s[bl], s[br], r[br], r[bl]);
- sides->addQuad(s[br], s[tr], r[tr], r[br]);
- sides->addQuad(s[tr], s[tl], r[tl], r[tr]);
- sides->addQuad(s[tl], s[bl], r[bl], r[tl]);
-
- parts << fb << sides;
-}
-
-class RectTorus : public Rectoid
-{
-public:
- RectTorus(Geometry *g, qreal iRad, qreal oRad, qreal depth, int numSectors);
-};
-
-RectTorus::RectTorus(Geometry *g, qreal iRad, qreal oRad, qreal depth, int k)
-{
- QVector<QVector3D> inside;
- QVector<QVector3D> outside;
- for (int i = 0; i < k; ++i) {
- qreal angle = (i * 2 * M_PI) / k;
- inside << QVector3D(iRad * qSin(angle), iRad * qCos(angle), depth / 2.0);
- outside << QVector3D(oRad * qSin(angle), oRad * qCos(angle), depth / 2.0);
- }
- inside << QVector3D(0.0, iRad, 0.0);
- outside << QVector3D(0.0, oRad, 0.0);
- QVector<QVector3D> in_back = extrude(inside, depth);
- QVector<QVector3D> out_back = extrude(outside, depth);
-
- // Create front, back and sides as separate patches so that smooth normals
- // are generated for the curving sides, but a faceted edge is created between
- // sides and front/back
- Patch *front = new Patch(g);
- for (int i = 0; i < k; ++i)
- front->addQuad(outside[i], inside[i],
- inside[(i + 1) % k], outside[(i + 1) % k]);
- Patch *back = new Patch(g);
- for (int i = 0; i < k; ++i)
- back->addQuad(in_back[i], out_back[i],
- out_back[(i + 1) % k], in_back[(i + 1) % k]);
- Patch *is = new Patch(g);
- for (int i = 0; i < k; ++i)
- is->addQuad(in_back[i], in_back[(i + 1) % k],
- inside[(i + 1) % k], inside[i]);
- Patch *os = new Patch(g);
- for (int i = 0; i < k; ++i)
- os->addQuad(out_back[(i + 1) % k], out_back[i],
- outside[i], outside[(i + 1) % k]);
- parts << front << back << is << os;
-}
-
-QtLogo::QtLogo(QObject *parent, int divisions, qreal scale)
- : QObject(parent)
- , geom(new Geometry())
-{
- buildGeometry(divisions, scale);
-}
-
-QtLogo::~QtLogo()
-{
- qDeleteAll(parts);
- delete geom;
-}
-
-void QtLogo::setColor(QColor c)
-{
- for (int i = 0; i < parts.count(); ++i)
- qSetColor(parts[i]->faceColor, c);
-}
-
-//! [3]
-void QtLogo::buildGeometry(int divisions, qreal scale)
-{
- qreal cw = cross_width * scale;
- qreal bt = bar_thickness * scale;
- qreal ld = logo_depth * scale;
- qreal th = tee_height *scale;
-
- RectPrism cross(geom, cw, bt, ld);
- RectPrism stem(geom, bt, th, ld);
-
- QVector3D z(0.0, 0.0, 1.0);
- cross.rotate(45.0, z);
- stem.rotate(45.0, z);
-
- qreal stem_downshift = (th + bt) / 2.0;
- stem.translate(QVector3D(0.0, -stem_downshift, 0.0));
-
- RectTorus body(geom, 0.20, 0.30, 0.1, divisions);
-
- parts << stem.parts << cross.parts << body.parts;
-
- geom->finalize();
-}
-//! [3]
-
-//! [4]
-void QtLogo::draw(QOpenGLFunctions_1_1 *functions) const
-{
- geom->loadArrays(functions);
-
- functions->glEnableClientState(GL_VERTEX_ARRAY);
- functions->glEnableClientState(GL_NORMAL_ARRAY);
-
- for (int i = 0; i < parts.count(); ++i)
- parts[i]->draw(functions);
-
- functions->glDisableClientState(GL_VERTEX_ARRAY);
- functions->glDisableClientState(GL_NORMAL_ARRAY);
-}
-//! [4]
diff --git a/examples/opengl/legacy/shared/qtlogo.h b/examples/opengl/legacy/shared/qtlogo.h
deleted file mode 100644
index ed2d7d750d..0000000000
--- a/examples/opengl/legacy/shared/qtlogo.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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$
-**
-****************************************************************************/
-
-#ifndef QTLOGO_H
-#define QTLOGO_H
-
-#include <QObject>
-#include <QColor>
-
-QT_FORWARD_DECLARE_CLASS(QOpenGLFunctions_1_1)
-
-class Patch;
-struct Geometry;
-
-//! [0]
-class QtLogo : public QObject
-{
-public:
- explicit QtLogo(QObject *parent, int d = 64, qreal s = 1.0);
- ~QtLogo();
- void setColor(QColor c);
- void draw(QOpenGLFunctions_1_1 *functions) const;
-private:
- void buildGeometry(int d, qreal s);
-
- QList<Patch *> parts;
- Geometry *geom;
-};
-//! [0]
-
-#endif // QTLOGO_H
diff --git a/examples/opengl/opengl.pro b/examples/opengl/opengl.pro
index 89b3e1d86e..907930d7ac 100644
--- a/examples/opengl/opengl.pro
+++ b/examples/opengl/opengl.pro
@@ -2,6 +2,7 @@ TEMPLATE = subdirs
SUBDIRS = hellowindow \
paintedwindow \
+ openglwindow \
qopenglwindow
qtHaveModule(widgets) {
@@ -15,6 +16,3 @@ qtHaveModule(widgets) {
hellogles3 \
computegles31
}
-
-EXAMPLE_FILES += \
- legacy
diff --git a/examples/opengl/openglwindow/.prev_CMakeLists.txt b/examples/opengl/openglwindow/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..9780e18c7f
--- /dev/null
+++ b/examples/opengl/openglwindow/.prev_CMakeLists.txt
@@ -0,0 +1,36 @@
+# Generated from openglwindow.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(openglwindow LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/opengl/openglwindow")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS OpenGL)
+
+add_qt_gui_executable(openglwindow
+ main.cpp
+ openglwindow.cpp openglwindow.h
+)
+target_include_directories(openglwindow PUBLIC
+ ${CMAKE_CURRENT_SOURCE_DIR}
+)
+
+target_link_libraries(openglwindow PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::OpenGL
+)
+
+install(TARGETS openglwindow
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/opengl/openglwindow/CMakeLists.txt b/examples/opengl/openglwindow/CMakeLists.txt
new file mode 100644
index 0000000000..9780e18c7f
--- /dev/null
+++ b/examples/opengl/openglwindow/CMakeLists.txt
@@ -0,0 +1,36 @@
+# Generated from openglwindow.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(openglwindow LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/opengl/openglwindow")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS OpenGL)
+
+add_qt_gui_executable(openglwindow
+ main.cpp
+ openglwindow.cpp openglwindow.h
+)
+target_include_directories(openglwindow PUBLIC
+ ${CMAKE_CURRENT_SOURCE_DIR}
+)
+
+target_link_libraries(openglwindow PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::OpenGL
+)
+
+install(TARGETS openglwindow
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/gui/openglwindow/main.cpp b/examples/opengl/openglwindow/main.cpp
index 03a6ece06f..03a6ece06f 100644
--- a/examples/gui/openglwindow/main.cpp
+++ b/examples/opengl/openglwindow/main.cpp
diff --git a/examples/gui/openglwindow/openglwindow.cpp b/examples/opengl/openglwindow/openglwindow.cpp
index bac887dca0..bac887dca0 100644
--- a/examples/gui/openglwindow/openglwindow.cpp
+++ b/examples/opengl/openglwindow/openglwindow.cpp
diff --git a/examples/gui/openglwindow/openglwindow.h b/examples/opengl/openglwindow/openglwindow.h
index 8db943ddde..8db943ddde 100644
--- a/examples/gui/openglwindow/openglwindow.h
+++ b/examples/opengl/openglwindow/openglwindow.h
diff --git a/examples/gui/openglwindow/openglwindow.pri b/examples/opengl/openglwindow/openglwindow.pri
index 45b0b0cd29..30320df3b7 100644
--- a/examples/gui/openglwindow/openglwindow.pri
+++ b/examples/opengl/openglwindow/openglwindow.pri
@@ -1,3 +1,4 @@
+QT += opengl
INCLUDEPATH += $$PWD
SOURCES += $$PWD/openglwindow.cpp
HEADERS += $$PWD/openglwindow.h
diff --git a/examples/gui/openglwindow/openglwindow.pro b/examples/opengl/openglwindow/openglwindow.pro
index 93f18f3d3f..8b1ae71c14 100644
--- a/examples/gui/openglwindow/openglwindow.pro
+++ b/examples/opengl/openglwindow/openglwindow.pro
@@ -3,5 +3,5 @@ include(openglwindow.pri)
SOURCES += \
main.cpp
-target.path = $$[QT_INSTALL_EXAMPLES]/gui/openglwindow
+target.path = $$[QT_INSTALL_EXAMPLES]/opengl/openglwindow
INSTALLS += target
diff --git a/examples/opengl/paintedwindow/CMakeLists.txt b/examples/opengl/paintedwindow/CMakeLists.txt
new file mode 100644
index 0000000000..2711bdc45b
--- /dev/null
+++ b/examples/opengl/paintedwindow/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from paintedwindow.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(paintedwindow LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/opengl/paintedwindow")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS OpenGL)
+
+add_qt_gui_executable(paintedwindow
+ main.cpp
+ paintedwindow.cpp paintedwindow.h
+)
+target_link_libraries(paintedwindow PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::OpenGL
+)
+
+install(TARGETS paintedwindow
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/opengl/paintedwindow/paintedwindow.h b/examples/opengl/paintedwindow/paintedwindow.h
index 7281451924..972d8d10bd 100644
--- a/examples/opengl/paintedwindow/paintedwindow.h
+++ b/examples/opengl/paintedwindow/paintedwindow.h
@@ -51,8 +51,8 @@
#include <QWindow>
#include <QtGui/qopengl.h>
-#include <QtGui/qopenglshaderprogram.h>
-#include <QtGui/qopenglframebufferobject.h>
+#include <QtOpenGL/qopenglshaderprogram.h>
+#include <QtOpenGL/qopenglframebufferobject.h>
#include <QPropertyAnimation>
diff --git a/examples/opengl/paintedwindow/paintedwindow.pro b/examples/opengl/paintedwindow/paintedwindow.pro
index 1846aa4049..569eebe674 100644
--- a/examples/opengl/paintedwindow/paintedwindow.pro
+++ b/examples/opengl/paintedwindow/paintedwindow.pro
@@ -1,3 +1,5 @@
+QT += opengl
+
HEADERS += paintedwindow.h
SOURCES += paintedwindow.cpp main.cpp
diff --git a/examples/opengl/qopenglwidget/CMakeLists.txt b/examples/opengl/qopenglwidget/CMakeLists.txt
new file mode 100644
index 0000000000..10b30f9461
--- /dev/null
+++ b/examples/opengl/qopenglwidget/CMakeLists.txt
@@ -0,0 +1,51 @@
+# Generated from qopenglwidget.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(qopenglwidget LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/opengl/qopenglwidget")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS OpenGL)
+find_package(Qt6 COMPONENTS OpenGLWidgets)
+
+add_qt_gui_executable(qopenglwidget
+ bubble.cpp bubble.h
+ glwidget.cpp glwidget.h
+ main.cpp
+ mainwindow.cpp mainwindow.h
+)
+target_link_libraries(qopenglwidget PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::OpenGL
+ Qt::OpenGLWidgets
+ Qt::Widgets
+)
+
+
+# Resources:
+set(texture_resource_files
+ "qt.png"
+)
+
+qt6_add_resources(qopenglwidget "texture"
+ PREFIX
+ "/"
+ FILES
+ ${texture_resource_files}
+)
+
+install(TARGETS qopenglwidget
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/opengl/qopenglwidget/mainwindow.cpp b/examples/opengl/qopenglwidget/mainwindow.cpp
index 6fab3df79e..eb34f87cb7 100644
--- a/examples/opengl/qopenglwidget/mainwindow.cpp
+++ b/examples/opengl/qopenglwidget/mainwindow.cpp
@@ -134,7 +134,7 @@ MainWindow::MainWindow()
connect(slider, &QAbstractSlider::valueChanged, glwidget, &GLWidget::setScaling);
connect(transparent, &QCheckBox::toggled, glwidget, &GLWidget::setTransparent);
- connect(updateInterval, QOverload<int>::of(&QSpinBox::valueChanged),
+ connect(updateInterval, &QSpinBox::valueChanged,
this, &MainWindow::updateIntervalChanged);
connect(timerBased, &QCheckBox::toggled, this, &MainWindow::timerUsageChanged);
connect(timerBased, &QCheckBox::toggled, updateInterval, &QWidget::setEnabled);
diff --git a/examples/opengl/qopenglwidget/qopenglwidget.pro b/examples/opengl/qopenglwidget/qopenglwidget.pro
index 0165285c02..7ac546d7ce 100644
--- a/examples/opengl/qopenglwidget/qopenglwidget.pro
+++ b/examples/opengl/qopenglwidget/qopenglwidget.pro
@@ -1,4 +1,4 @@
-QT += widgets
+QT += widgets opengl openglwidgets
SOURCES += main.cpp \
glwidget.cpp \
diff --git a/examples/opengl/qopenglwindow/CMakeLists.txt b/examples/opengl/qopenglwindow/CMakeLists.txt
new file mode 100644
index 0000000000..9d354d376b
--- /dev/null
+++ b/examples/opengl/qopenglwindow/CMakeLists.txt
@@ -0,0 +1,49 @@
+# Generated from qopenglwindow.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(qopenglwindow LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/opengl/qopenglwindow")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS OpenGL)
+
+add_qt_gui_executable(qopenglwindow
+ background_renderer.cpp background_renderer.h
+ main.cpp
+)
+target_include_directories(qopenglwindow PUBLIC
+ .
+)
+
+target_link_libraries(qopenglwindow PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::OpenGL
+)
+
+
+# Resources:
+set(shaders_resource_files
+ "background.frag"
+)
+
+qt6_add_resources(qopenglwindow "shaders"
+ PREFIX
+ "/"
+ FILES
+ ${shaders_resource_files}
+)
+
+install(TARGETS qopenglwindow
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/opengl/qopenglwindow/qopenglwindow.pro b/examples/opengl/qopenglwindow/qopenglwindow.pro
index dad4b58158..e7073a324b 100644
--- a/examples/opengl/qopenglwindow/qopenglwindow.pro
+++ b/examples/opengl/qopenglwindow/qopenglwindow.pro
@@ -1,6 +1,7 @@
TEMPLATE = app
TARGET = qopenglwindow
INCLUDEPATH += .
+QT += opengl
RESOURCES += shaders.qrc
diff --git a/examples/opengl/textures/CMakeLists.txt b/examples/opengl/textures/CMakeLists.txt
new file mode 100644
index 0000000000..1bb4ae6240
--- /dev/null
+++ b/examples/opengl/textures/CMakeLists.txt
@@ -0,0 +1,55 @@
+# Generated from textures.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(textures LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/opengl/textures")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS OpenGL)
+find_package(Qt6 COMPONENTS OpenGLWidgets)
+
+add_qt_gui_executable(textures
+ glwidget.cpp glwidget.h
+ main.cpp
+ window.cpp window.h
+)
+target_link_libraries(textures PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::OpenGL
+ Qt::OpenGLWidgets
+ Qt::Widgets
+)
+
+
+# Resources:
+set(textures_resource_files
+ "images/side1.png"
+ "images/side2.png"
+ "images/side3.png"
+ "images/side4.png"
+ "images/side5.png"
+ "images/side6.png"
+)
+
+qt6_add_resources(textures "textures"
+ PREFIX
+ "/"
+ FILES
+ ${textures_resource_files}
+)
+
+install(TARGETS textures
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/opengl/textures/textures.pro b/examples/opengl/textures/textures.pro
index 7a7d19bee6..d2a6506cb8 100644
--- a/examples/opengl/textures/textures.pro
+++ b/examples/opengl/textures/textures.pro
@@ -6,7 +6,7 @@ SOURCES = glwidget.cpp \
RESOURCES = textures.qrc
-QT += widgets
+QT += widgets opengl openglwidgets
# install
target.path = $$[QT_INSTALL_EXAMPLES]/opengl/textures
diff --git a/examples/opengl/threadedqopenglwidget/CMakeLists.txt b/examples/opengl/threadedqopenglwidget/CMakeLists.txt
new file mode 100644
index 0000000000..f5368f89ef
--- /dev/null
+++ b/examples/opengl/threadedqopenglwidget/CMakeLists.txt
@@ -0,0 +1,37 @@
+# Generated from threadedqopenglwidget.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(threadedqopenglwidget LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/opengl/threadedqopenglwidget")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS OpenGL)
+find_package(Qt6 COMPONENTS OpenGLWidgets)
+
+add_qt_gui_executable(threadedqopenglwidget
+ glwidget.cpp glwidget.h
+ main.cpp
+ mainwindow.cpp mainwindow.h
+)
+target_link_libraries(threadedqopenglwidget PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::OpenGL
+ Qt::OpenGLWidgets
+ Qt::Widgets
+)
+
+install(TARGETS threadedqopenglwidget
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/opengl/threadedqopenglwidget/threadedqopenglwidget.pro b/examples/opengl/threadedqopenglwidget/threadedqopenglwidget.pro
index 4e941b28c4..a62fbeb9c2 100644
--- a/examples/opengl/threadedqopenglwidget/threadedqopenglwidget.pro
+++ b/examples/opengl/threadedqopenglwidget/threadedqopenglwidget.pro
@@ -1,4 +1,4 @@
-QT += widgets
+QT += widgets opengl openglwidgets
SOURCES += main.cpp \
glwidget.cpp \
diff --git a/examples/qpa/CMakeLists.txt b/examples/qpa/CMakeLists.txt
new file mode 100644
index 0000000000..0ae7f61e57
--- /dev/null
+++ b/examples/qpa/CMakeLists.txt
@@ -0,0 +1,4 @@
+# Generated from qpa.pro.
+
+add_subdirectory(windows)
+add_subdirectory(qrasterwindow)
diff --git a/examples/qpa/qrasterwindow/.prev_CMakeLists.txt b/examples/qpa/qrasterwindow/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..8fd75f1079
--- /dev/null
+++ b/examples/qpa/qrasterwindow/.prev_CMakeLists.txt
@@ -0,0 +1,29 @@
+# Generated from qrasterwindow.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(qrasterwindow LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/qpa/qrasterwindow")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+
+add_qt_gui_executable(qrasterwindow
+ main.cpp
+)
+target_link_libraries(qrasterwindow PUBLIC
+ Qt::Core
+ Qt::Gui
+)
+
+install(TARGETS qrasterwindow
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/qpa/qrasterwindow/CMakeLists.txt b/examples/qpa/qrasterwindow/CMakeLists.txt
new file mode 100644
index 0000000000..8fd75f1079
--- /dev/null
+++ b/examples/qpa/qrasterwindow/CMakeLists.txt
@@ -0,0 +1,29 @@
+# Generated from qrasterwindow.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(qrasterwindow LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/qpa/qrasterwindow")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+
+add_qt_gui_executable(qrasterwindow
+ main.cpp
+)
+target_link_libraries(qrasterwindow PUBLIC
+ Qt::Core
+ Qt::Gui
+)
+
+install(TARGETS qrasterwindow
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/qpa/windows/CMakeLists.txt b/examples/qpa/windows/CMakeLists.txt
new file mode 100644
index 0000000000..4eeab0e3bc
--- /dev/null
+++ b/examples/qpa/windows/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from windows.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(windows LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/qpa/windows")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+
+add_executable(windows
+ main.cpp
+ window.cpp window.h
+)
+target_link_libraries(windows PUBLIC
+ Qt::Core
+ Qt::CorePrivate
+ Qt::Gui
+ Qt::GuiPrivate
+)
+
+install(TARGETS windows
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/qtconcurrent/CMakeLists.txt b/examples/qtconcurrent/CMakeLists.txt
new file mode 100644
index 0000000000..13cfed8773
--- /dev/null
+++ b/examples/qtconcurrent/CMakeLists.txt
@@ -0,0 +1,9 @@
+if(TARGET Qt::Gui)
+ add_subdirectory(map)
+endif()
+if(TARGET Qt::Widgets)
+ add_subdirectory(imagescaling)
+ add_subdirectory(progressdialog)
+ add_subdirectory(runfunction)
+ add_subdirectory(wordcount)
+endif()
diff --git a/examples/qtconcurrent/imagescaling/CMakeLists.txt b/examples/qtconcurrent/imagescaling/CMakeLists.txt
new file mode 100644
index 0000000000..8585ed89a0
--- /dev/null
+++ b/examples/qtconcurrent/imagescaling/CMakeLists.txt
@@ -0,0 +1,34 @@
+# Generated from imagescaling.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(imagescaling LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/qtconcurrent/imagescaling")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Concurrent)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(imagescaling
+ imagescaling.cpp imagescaling.h
+ main.cpp
+)
+target_link_libraries(imagescaling PUBLIC
+ Qt::Concurrent
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS imagescaling
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/qtconcurrent/map/.prev_CMakeLists.txt b/examples/qtconcurrent/map/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..8e158b2397
--- /dev/null
+++ b/examples/qtconcurrent/map/.prev_CMakeLists.txt
@@ -0,0 +1,31 @@
+# Generated from map.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(mapdemo LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/qtconcurrent/map")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Concurrent)
+
+add_executable(mapdemo
+ main.cpp
+)
+target_link_libraries(mapdemo PUBLIC
+ Qt::Concurrent
+ Qt::Core
+ Qt::Gui
+)
+
+install(TARGETS mapdemo
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/qtconcurrent/map/CMakeLists.txt b/examples/qtconcurrent/map/CMakeLists.txt
new file mode 100644
index 0000000000..e5a3ba1c66
--- /dev/null
+++ b/examples/qtconcurrent/map/CMakeLists.txt
@@ -0,0 +1,30 @@
+# Generated from map.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(mapdemo LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/qtconcurrent/map")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Concurrent)
+
+add_executable(mapdemo
+ main.cpp
+)
+target_link_libraries(mapdemo PUBLIC
+ Qt::Concurrent
+ Qt::Core
+ Qt::Gui
+)
+install(TARGETS mapdemo
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/qtconcurrent/progressdialog/CMakeLists.txt b/examples/qtconcurrent/progressdialog/CMakeLists.txt
new file mode 100644
index 0000000000..912490bd65
--- /dev/null
+++ b/examples/qtconcurrent/progressdialog/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from progressdialog.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(progressdialog LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/qtconcurrent/progressdialog")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Concurrent)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_executable(progressdialog
+ main.cpp
+)
+target_link_libraries(progressdialog PUBLIC
+ Qt::Concurrent
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS progressdialog
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/qtconcurrent/runfunction/CMakeLists.txt b/examples/qtconcurrent/runfunction/CMakeLists.txt
new file mode 100644
index 0000000000..a8cb3de4d4
--- /dev/null
+++ b/examples/qtconcurrent/runfunction/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from runfunction.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(runfunction LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/qtconcurrent/runfunction")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Concurrent)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_executable(runfunction
+ main.cpp
+)
+target_link_libraries(runfunction PUBLIC
+ Qt::Concurrent
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS runfunction
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/qtconcurrent/wordcount/CMakeLists.txt b/examples/qtconcurrent/wordcount/CMakeLists.txt
new file mode 100644
index 0000000000..22d78c3877
--- /dev/null
+++ b/examples/qtconcurrent/wordcount/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from wordcount.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(wordcount LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/qtconcurrent/wordcount")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Concurrent)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_executable(wordcount
+ main.cpp
+)
+target_link_libraries(wordcount PUBLIC
+ Qt::Concurrent
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS wordcount
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/qtestlib/CMakeLists.txt b/examples/qtestlib/CMakeLists.txt
new file mode 100644
index 0000000000..83e7df5768
--- /dev/null
+++ b/examples/qtestlib/CMakeLists.txt
@@ -0,0 +1,7 @@
+# Generated from qtestlib.pro.
+
+add_subdirectory(tutorial1)
+add_subdirectory(tutorial2)
+add_subdirectory(tutorial3)
+add_subdirectory(tutorial4)
+add_subdirectory(tutorial5)
diff --git a/examples/qtestlib/tutorial1/CMakeLists.txt b/examples/qtestlib/tutorial1/CMakeLists.txt
new file mode 100644
index 0000000000..27b5d886b5
--- /dev/null
+++ b/examples/qtestlib/tutorial1/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from tutorial1.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(tutorial1 LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/qtestlib/tutorial1")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS Test)
+
+add_executable(tutorial1
+ testqstring.cpp
+)
+target_link_libraries(tutorial1 PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Test
+ Qt::Widgets
+)
+
+install(TARGETS tutorial1
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/qtestlib/tutorial2/CMakeLists.txt b/examples/qtestlib/tutorial2/CMakeLists.txt
new file mode 100644
index 0000000000..2a3a53ad34
--- /dev/null
+++ b/examples/qtestlib/tutorial2/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from tutorial2.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(tutorial2 LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/qtestlib/tutorial2")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS Test)
+
+add_executable(tutorial2
+ testqstring.cpp
+)
+target_link_libraries(tutorial2 PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Test
+ Qt::Widgets
+)
+
+install(TARGETS tutorial2
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/qtestlib/tutorial3/CMakeLists.txt b/examples/qtestlib/tutorial3/CMakeLists.txt
new file mode 100644
index 0000000000..f7a76b3b4f
--- /dev/null
+++ b/examples/qtestlib/tutorial3/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from tutorial3.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(tutorial3 LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/qtestlib/tutorial3")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS Test)
+
+add_executable(tutorial3
+ testgui.cpp
+)
+target_link_libraries(tutorial3 PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Test
+ Qt::Widgets
+)
+
+install(TARGETS tutorial3
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/qtestlib/tutorial4/CMakeLists.txt b/examples/qtestlib/tutorial4/CMakeLists.txt
new file mode 100644
index 0000000000..40a6f4b9e2
--- /dev/null
+++ b/examples/qtestlib/tutorial4/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from tutorial4.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(tutorial4 LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/qtestlib/tutorial4")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS Test)
+
+add_executable(tutorial4
+ testgui.cpp
+)
+target_link_libraries(tutorial4 PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Test
+ Qt::Widgets
+)
+
+install(TARGETS tutorial4
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/qtestlib/tutorial5/CMakeLists.txt b/examples/qtestlib/tutorial5/CMakeLists.txt
new file mode 100644
index 0000000000..88f5efb995
--- /dev/null
+++ b/examples/qtestlib/tutorial5/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from tutorial5.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(tutorial5 LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/qtestlib/tutorial5")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS Test)
+
+add_executable(tutorial5
+ benchmarking.cpp
+)
+target_link_libraries(tutorial5 PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Test
+ Qt::Widgets
+)
+
+install(TARGETS tutorial5
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/sql/CMakeLists.txt b/examples/sql/CMakeLists.txt
new file mode 100644
index 0000000000..ca15f22baf
--- /dev/null
+++ b/examples/sql/CMakeLists.txt
@@ -0,0 +1,17 @@
+# Generated from sql.pro.
+
+add_subdirectory(books)
+add_subdirectory(drilldown)
+add_subdirectory(cachedtable)
+add_subdirectory(querymodel)
+add_subdirectory(relationaltablemodel)
+add_subdirectory(sqlwidgetmapper)
+add_subdirectory(tablemodel)
+
+if(TARGET Qt::Xml)
+ add_subdirectory(masterdetail)
+endif()
+
+if(NOT CMAKE_CROSSCOMPILING) # special case
+ add_subdirectory(sqlbrowser)
+endif()
diff --git a/examples/sql/books/CMakeLists.txt b/examples/sql/books/CMakeLists.txt
new file mode 100644
index 0000000000..870d90bf14
--- /dev/null
+++ b/examples/sql/books/CMakeLists.txt
@@ -0,0 +1,53 @@
+# Generated from books.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(books LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/sql/books")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Sql)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(books
+ bookdelegate.cpp bookdelegate.h
+ bookwindow.cpp bookwindow.h bookwindow.ui
+ initdb.h
+ main.cpp
+)
+target_include_directories(books PUBLIC
+ .
+)
+
+target_link_libraries(books PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Sql
+ Qt::Widgets
+)
+
+
+# Resources:
+set(books_resource_files
+ "images/star.png"
+)
+
+qt6_add_resources(books "books"
+ PREFIX
+ "/"
+ FILES
+ ${books_resource_files}
+)
+
+install(TARGETS books
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/sql/cachedtable/CMakeLists.txt b/examples/sql/cachedtable/CMakeLists.txt
new file mode 100644
index 0000000000..872c462fdd
--- /dev/null
+++ b/examples/sql/cachedtable/CMakeLists.txt
@@ -0,0 +1,35 @@
+# Generated from cachedtable.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(cachedtable LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/sql/cachedtable")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Sql)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(cachedtable
+ ../connection.h
+ main.cpp
+ tableeditor.cpp tableeditor.h
+)
+target_link_libraries(cachedtable PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Sql
+ Qt::Widgets
+)
+
+install(TARGETS cachedtable
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/sql/drilldown/CMakeLists.txt b/examples/sql/drilldown/CMakeLists.txt
new file mode 100644
index 0000000000..5b6bea0423
--- /dev/null
+++ b/examples/sql/drilldown/CMakeLists.txt
@@ -0,0 +1,53 @@
+# Generated from drilldown.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(drilldown LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/sql/drilldown")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Sql)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(drilldown
+ ../connection.h
+ imageitem.cpp imageitem.h
+ informationwindow.cpp informationwindow.h
+ main.cpp
+ view.cpp view.h
+)
+target_link_libraries(drilldown PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Sql
+ Qt::Widgets
+)
+
+
+# Resources:
+set(drilldown_resource_files
+ "images/qt-creator.png"
+ "images/qt-logo.png"
+ "images/qt-project.png"
+ "images/qt-quick.png"
+)
+
+qt6_add_resources(drilldown "drilldown"
+ PREFIX
+ "/"
+ FILES
+ ${drilldown_resource_files}
+)
+
+install(TARGETS drilldown
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/sql/drilldown/informationwindow.cpp b/examples/sql/drilldown/informationwindow.cpp
index 0007432672..349416b553 100644
--- a/examples/sql/drilldown/informationwindow.cpp
+++ b/examples/sql/drilldown/informationwindow.cpp
@@ -87,7 +87,7 @@ InformationWindow::InformationWindow(int id, QSqlRelationalTableModel *items,
connect(descriptionEditor, &QTextEdit::textChanged, [=]() {
enableButtons();
});
- connect(imageFileEditor, QOverload<int>::of(&QComboBox::currentIndexChanged), [=]() {
+ connect(imageFileEditor, &QComboBox::currentIndexChanged, [=]() {
enableButtons();
});
diff --git a/examples/sql/masterdetail/CMakeLists.txt b/examples/sql/masterdetail/CMakeLists.txt
new file mode 100644
index 0000000000..7052461601
--- /dev/null
+++ b/examples/sql/masterdetail/CMakeLists.txt
@@ -0,0 +1,52 @@
+# Generated from masterdetail.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(masterdetail LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/sql/masterdetail")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Sql)
+find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS Xml)
+
+add_qt_gui_executable(masterdetail
+ database.h
+ dialog.cpp dialog.h
+ main.cpp
+ mainwindow.cpp mainwindow.h
+)
+target_link_libraries(masterdetail PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Sql
+ Qt::Widgets
+ Qt::Xml
+)
+
+
+# Resources:
+set(masterdetail_resource_files
+ "images/icon.png"
+ "images/image.png"
+)
+
+qt6_add_resources(masterdetail "masterdetail"
+ PREFIX
+ "/"
+ FILES
+ ${masterdetail_resource_files}
+)
+
+install(TARGETS masterdetail
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/sql/masterdetail/mainwindow.cpp b/examples/sql/masterdetail/mainwindow.cpp
index 2ff9a10d91..11f123372c 100644
--- a/examples/sql/masterdetail/mainwindow.cpp
+++ b/examples/sql/masterdetail/mainwindow.cpp
@@ -283,7 +283,7 @@ QGroupBox* MainWindow::createArtistGroupBox()
artistView->setModel(model->relationModel(2));
artistView->setModelColumn(1);
- connect(artistView, QOverload<int>::of(&QComboBox::currentIndexChanged),
+ connect(artistView, &QComboBox::currentIndexChanged,
this, &MainWindow::changeArtist);
QGroupBox *box = new QGroupBox(tr("Artist"));
diff --git a/examples/sql/querymodel/CMakeLists.txt b/examples/sql/querymodel/CMakeLists.txt
new file mode 100644
index 0000000000..e4127baeef
--- /dev/null
+++ b/examples/sql/querymodel/CMakeLists.txt
@@ -0,0 +1,36 @@
+# Generated from querymodel.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(querymodel LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/sql/querymodel")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Sql)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(querymodel
+ ../connection.h
+ customsqlmodel.cpp customsqlmodel.h
+ editablesqlmodel.cpp editablesqlmodel.h
+ main.cpp
+)
+target_link_libraries(querymodel PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Sql
+ Qt::Widgets
+)
+
+install(TARGETS querymodel
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/sql/relationaltablemodel/CMakeLists.txt b/examples/sql/relationaltablemodel/CMakeLists.txt
new file mode 100644
index 0000000000..c758f3c32d
--- /dev/null
+++ b/examples/sql/relationaltablemodel/CMakeLists.txt
@@ -0,0 +1,34 @@
+# Generated from relationaltablemodel.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(relationaltablemodel LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/sql/relationaltablemodel")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Sql)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(relationaltablemodel
+ ../connection.h
+ relationaltablemodel.cpp
+)
+target_link_libraries(relationaltablemodel PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Sql
+ Qt::Widgets
+)
+
+install(TARGETS relationaltablemodel
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/sql/sqlbrowser/CMakeLists.txt b/examples/sql/sqlbrowser/CMakeLists.txt
new file mode 100644
index 0000000000..833b57f1a1
--- /dev/null
+++ b/examples/sql/sqlbrowser/CMakeLists.txt
@@ -0,0 +1,37 @@
+# Generated from sqlbrowser.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(sqlbrowser LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/sql/sqlbrowser")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Sql)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(sqlbrowser
+ browser.cpp browser.h
+ browserwidget.ui
+ connectionwidget.cpp connectionwidget.h
+ main.cpp
+ qsqlconnectiondialog.cpp qsqlconnectiondialog.h qsqlconnectiondialog.ui
+)
+target_link_libraries(sqlbrowser PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Sql
+ Qt::Widgets
+)
+
+install(TARGETS sqlbrowser
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/sql/sqlbrowser/qsqlconnectiondialog.cpp b/examples/sql/sqlbrowser/qsqlconnectiondialog.cpp
index 0d4a1bde77..482048ab98 100644
--- a/examples/sql/sqlbrowser/qsqlconnectiondialog.cpp
+++ b/examples/sql/sqlbrowser/qsqlconnectiondialog.cpp
@@ -60,13 +60,6 @@ QSqlConnectionDialog::QSqlConnectionDialog(QWidget *parent)
QStringList drivers = QSqlDatabase::drivers();
- // remove compat names
- drivers.removeAll("QMYSQL3");
- drivers.removeAll("QOCI8");
- drivers.removeAll("QODBC3");
- drivers.removeAll("QPSQL7");
- drivers.removeAll("QTDS7");
-
if (!drivers.contains("QSQLITE"))
ui.dbCheckBox->setEnabled(false);
diff --git a/examples/sql/sqlwidgetmapper/CMakeLists.txt b/examples/sql/sqlwidgetmapper/CMakeLists.txt
new file mode 100644
index 0000000000..8d8a1a82ed
--- /dev/null
+++ b/examples/sql/sqlwidgetmapper/CMakeLists.txt
@@ -0,0 +1,34 @@
+# Generated from sqlwidgetmapper.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(sqlwidgetmapper LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/sql/sqlwidgetmapper")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Sql)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(sqlwidgetmapper
+ main.cpp
+ window.cpp window.h
+)
+target_link_libraries(sqlwidgetmapper PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Sql
+ Qt::Widgets
+)
+
+install(TARGETS sqlwidgetmapper
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/sql/tablemodel/CMakeLists.txt b/examples/sql/tablemodel/CMakeLists.txt
new file mode 100644
index 0000000000..85e1bd9167
--- /dev/null
+++ b/examples/sql/tablemodel/CMakeLists.txt
@@ -0,0 +1,34 @@
+# Generated from tablemodel.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(tablemodel LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/sql/tablemodel")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Sql)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(tablemodel
+ ../connection.h
+ tablemodel.cpp
+)
+target_link_libraries(tablemodel PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Sql
+ Qt::Widgets
+)
+
+install(TARGETS tablemodel
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/vulkan/CMakeLists.txt b/examples/vulkan/CMakeLists.txt
new file mode 100644
index 0000000000..b00a40447a
--- /dev/null
+++ b/examples/vulkan/CMakeLists.txt
@@ -0,0 +1,11 @@
+# Generated from vulkan.pro.
+
+add_subdirectory(hellovulkanwindow)
+add_subdirectory(hellovulkantriangle)
+add_subdirectory(hellovulkantexture)
+if(TARGET Qt::Widgets)
+ add_subdirectory(hellovulkanwidget)
+endif()
+if(TARGET Qt::Concurrent AND TARGET Qt::Widgets)
+ add_subdirectory(hellovulkancubes)
+endif()
diff --git a/examples/vulkan/hellovulkancubes/CMakeLists.txt b/examples/vulkan/hellovulkancubes/CMakeLists.txt
new file mode 100644
index 0000000000..94feac6401
--- /dev/null
+++ b/examples/vulkan/hellovulkancubes/CMakeLists.txt
@@ -0,0 +1,63 @@
+# Generated from hellovulkancubes.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(hellovulkancubes LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/vulkan/hellovulkancubes")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS Concurrent)
+
+add_qt_gui_executable(hellovulkancubes
+ camera.cpp camera.h
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ mesh.cpp mesh.h
+ renderer.cpp renderer.h
+ shader.cpp shader.h
+ vulkanwindow.cpp vulkanwindow.h
+)
+target_link_libraries(hellovulkancubes PUBLIC
+ Qt::Concurrent
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set_source_files_properties("../shared/block.buf"
+ PROPERTIES QT_RESOURCE_ALIAS "block.buf"
+)
+set_source_files_properties("../shared/qt_logo.buf"
+ PROPERTIES QT_RESOURCE_ALIAS "qt_logo.buf"
+)
+set(hellovulkancubes_resource_files
+ "../shared/block.buf"
+ "../shared/qt_logo.buf"
+ "color_frag.spv"
+ "color_phong_frag.spv"
+ "color_phong_vert.spv"
+ "color_vert.spv"
+)
+
+qt6_add_resources(hellovulkancubes "hellovulkancubes"
+ PREFIX
+ "/"
+ FILES
+ ${hellovulkancubes_resource_files}
+)
+
+install(TARGETS hellovulkancubes
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/vulkan/hellovulkantexture/CMakeLists.txt b/examples/vulkan/hellovulkantexture/CMakeLists.txt
new file mode 100644
index 0000000000..59e019998c
--- /dev/null
+++ b/examples/vulkan/hellovulkantexture/CMakeLists.txt
@@ -0,0 +1,45 @@
+# Generated from hellovulkantexture.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(hellovulkantexture LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/vulkan/hellovulkantexture")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+
+add_qt_gui_executable(hellovulkantexture
+ hellovulkantexture.cpp hellovulkantexture.h
+ main.cpp
+)
+target_link_libraries(hellovulkantexture PUBLIC
+ Qt::Core
+ Qt::Gui
+)
+
+
+# Resources:
+set(hellovulkantexture_resource_files
+ "qt256.png"
+ "texture_frag.spv"
+ "texture_vert.spv"
+)
+
+qt6_add_resources(hellovulkantexture "hellovulkantexture"
+ PREFIX
+ "/"
+ FILES
+ ${hellovulkantexture_resource_files}
+)
+
+install(TARGETS hellovulkantexture
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/vulkan/hellovulkantriangle/CMakeLists.txt b/examples/vulkan/hellovulkantriangle/CMakeLists.txt
new file mode 100644
index 0000000000..dae891ea07
--- /dev/null
+++ b/examples/vulkan/hellovulkantriangle/CMakeLists.txt
@@ -0,0 +1,50 @@
+# Generated from hellovulkantriangle.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(hellovulkantriangle LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/vulkan/hellovulkantriangle")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+
+add_qt_gui_executable(hellovulkantriangle
+ ../shared/trianglerenderer.cpp ../shared/trianglerenderer.h
+ main.cpp
+)
+target_link_libraries(hellovulkantriangle PUBLIC
+ Qt::Core
+ Qt::Gui
+)
+
+
+# Resources:
+set_source_files_properties("../shared/color_frag.spv"
+ PROPERTIES QT_RESOURCE_ALIAS "color_frag.spv"
+)
+set_source_files_properties("../shared/color_vert.spv"
+ PROPERTIES QT_RESOURCE_ALIAS "color_vert.spv"
+)
+set(hellovulkantriangle_resource_files
+ "../shared/color_frag.spv"
+ "../shared/color_vert.spv"
+)
+
+qt6_add_resources(hellovulkantriangle "hellovulkantriangle"
+ PREFIX
+ "/"
+ FILES
+ ${hellovulkantriangle_resource_files}
+)
+
+install(TARGETS hellovulkantriangle
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/vulkan/hellovulkanwidget/CMakeLists.txt b/examples/vulkan/hellovulkanwidget/CMakeLists.txt
new file mode 100644
index 0000000000..6dde273e94
--- /dev/null
+++ b/examples/vulkan/hellovulkanwidget/CMakeLists.txt
@@ -0,0 +1,53 @@
+# Generated from hellovulkanwidget.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(hellovulkanwidget LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/vulkan/hellovulkanwidget")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(hellovulkanwidget
+ ../shared/trianglerenderer.cpp ../shared/trianglerenderer.h
+ hellovulkanwidget.cpp hellovulkanwidget.h
+ main.cpp
+)
+target_link_libraries(hellovulkanwidget PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set_source_files_properties("../shared/color_frag.spv"
+ PROPERTIES QT_RESOURCE_ALIAS "color_frag.spv"
+)
+set_source_files_properties("../shared/color_vert.spv"
+ PROPERTIES QT_RESOURCE_ALIAS "color_vert.spv"
+)
+set(hellovulkanwidget_resource_files
+ "../shared/color_frag.spv"
+ "../shared/color_vert.spv"
+)
+
+qt6_add_resources(hellovulkanwidget "hellovulkanwidget"
+ PREFIX
+ "/"
+ FILES
+ ${hellovulkanwidget_resource_files}
+)
+
+install(TARGETS hellovulkanwidget
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/vulkan/hellovulkanwindow/CMakeLists.txt b/examples/vulkan/hellovulkanwindow/CMakeLists.txt
new file mode 100644
index 0000000000..3a20345899
--- /dev/null
+++ b/examples/vulkan/hellovulkanwindow/CMakeLists.txt
@@ -0,0 +1,30 @@
+# Generated from hellovulkanwindow.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(hellovulkanwindow LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/vulkan/hellovulkanwindow")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+
+add_qt_gui_executable(hellovulkanwindow
+ hellovulkanwindow.cpp hellovulkanwindow.h
+ main.cpp
+)
+target_link_libraries(hellovulkanwindow PUBLIC
+ Qt::Core
+ Qt::Gui
+)
+
+install(TARGETS hellovulkanwindow
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/CMakeLists.txt b/examples/widgets/CMakeLists.txt
new file mode 100644
index 0000000000..1b18fc8622
--- /dev/null
+++ b/examples/widgets/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from widgets.pro.
+
+add_subdirectory(animation)
+add_subdirectory(desktop)
+add_subdirectory(dialogs)
+if(QT_FEATURE_draganddrop) # special case
+ add_subdirectory(draganddrop)
+endif()
+add_subdirectory(effects)
+add_subdirectory(gestures)
+add_subdirectory(graphicsview)
+add_subdirectory(itemviews)
+add_subdirectory(layouts)
+add_subdirectory(painting)
+add_subdirectory(richtext)
+add_subdirectory(scroller)
+add_subdirectory(statemachine)
+add_subdirectory(tools)
+add_subdirectory(touch)
+add_subdirectory(tutorials)
+add_subdirectory(widgets)
+
+if(TARGET Qt::Gui AND QT_FEATURE_opengl)
+ add_subdirectory(windowcontainer)
+endif()
+
+if(QT_FEATURE_cursor) # special case
+ add_subdirectory(mainwindows)
+endif()
+
+if(APPLE_OSX)
+ add_subdirectory(mac)
+endif()
diff --git a/examples/widgets/animation/CMakeLists.txt b/examples/widgets/animation/CMakeLists.txt
new file mode 100644
index 0000000000..15f62728da
--- /dev/null
+++ b/examples/widgets/animation/CMakeLists.txt
@@ -0,0 +1,8 @@
+# Generated from animation.pro.
+
+add_subdirectory(animatedtiles)
+add_subdirectory(easing)
+add_subdirectory(moveblocks)
+add_subdirectory(states)
+add_subdirectory(stickman)
+add_subdirectory(sub-attaq)
diff --git a/examples/widgets/animation/animatedtiles/CMakeLists.txt b/examples/widgets/animation/animatedtiles/CMakeLists.txt
new file mode 100644
index 0000000000..b8755a3321
--- /dev/null
+++ b/examples/widgets/animation/animatedtiles/CMakeLists.txt
@@ -0,0 +1,50 @@
+# Generated from animatedtiles.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(animatedtiles LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/animation/animatedtiles")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(animatedtiles
+ main.cpp
+)
+target_link_libraries(animatedtiles PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(animatedtiles_resource_files
+ "images/Time-For-Lunch-2.jpg"
+ "images/centered.png"
+ "images/ellipse.png"
+ "images/figure8.png"
+ "images/kinetic.png"
+ "images/random.png"
+ "images/tile.png"
+)
+
+qt6_add_resources(animatedtiles "animatedtiles"
+ PREFIX
+ "/"
+ FILES
+ ${animatedtiles_resource_files}
+)
+
+install(TARGETS animatedtiles
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/animation/easing/CMakeLists.txt b/examples/widgets/animation/easing/CMakeLists.txt
new file mode 100644
index 0000000000..6b09e45cff
--- /dev/null
+++ b/examples/widgets/animation/easing/CMakeLists.txt
@@ -0,0 +1,47 @@
+# Generated from easing.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(easing LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/animation/easing")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(easing
+ animation.h
+ form.ui
+ main.cpp
+ window.cpp window.h
+)
+target_link_libraries(easing PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(easing_resource_files
+ "images/qt-logo.png"
+)
+
+qt6_add_resources(easing "easing"
+ PREFIX
+ "/"
+ FILES
+ ${easing_resource_files}
+)
+
+install(TARGETS easing
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/animation/easing/window.cpp b/examples/widgets/animation/easing/window.cpp
index 378af07535..7b4fe1d912 100644
--- a/examples/widgets/animation/easing/window.cpp
+++ b/examples/widgets/animation/easing/window.cpp
@@ -67,13 +67,13 @@ Window::Window(QWidget *parent)
connect(m_ui.easingCurvePicker, &QListWidget::currentRowChanged,
this, &Window::curveChanged);
- connect(m_ui.buttonGroup, QOverload<QAbstractButton *>::of(&QButtonGroup::buttonClicked),
+ connect(m_ui.buttonGroup, &QButtonGroup::buttonClicked,
this, &Window::pathChanged);
- connect(m_ui.periodSpinBox, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
+ connect(m_ui.periodSpinBox, &QDoubleSpinBox::valueChanged,
this, &Window::periodChanged);
- connect(m_ui.amplitudeSpinBox, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
+ connect(m_ui.amplitudeSpinBox, &QDoubleSpinBox::valueChanged,
this, &Window::amplitudeChanged);
- connect(m_ui.overshootSpinBox, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
+ connect(m_ui.overshootSpinBox, &QDoubleSpinBox::valueChanged,
this, &Window::overshootChanged);
createCurveIcons();
diff --git a/examples/widgets/animation/moveblocks/CMakeLists.txt b/examples/widgets/animation/moveblocks/CMakeLists.txt
new file mode 100644
index 0000000000..c5219c9e6a
--- /dev/null
+++ b/examples/widgets/animation/moveblocks/CMakeLists.txt
@@ -0,0 +1,31 @@
+# Generated from moveblocks.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(moveblocks LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/animation/moveblocks")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(moveblocks
+ main.cpp
+)
+target_link_libraries(moveblocks PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS moveblocks
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/animation/states/CMakeLists.txt b/examples/widgets/animation/states/CMakeLists.txt
new file mode 100644
index 0000000000..cddcc6a7a3
--- /dev/null
+++ b/examples/widgets/animation/states/CMakeLists.txt
@@ -0,0 +1,49 @@
+# Generated from states.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(states LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/animation/states")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(states
+ main.cpp
+)
+target_link_libraries(states PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(states_resource_files
+ "accessories-dictionary.png"
+ "akregator.png"
+ "digikam.png"
+ "help-browser.png"
+ "k3b.png"
+ "kchart.png"
+)
+
+qt6_add_resources(states "states"
+ PREFIX
+ "/"
+ FILES
+ ${states_resource_files}
+)
+
+install(TARGETS states
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/animation/stickman/CMakeLists.txt b/examples/widgets/animation/stickman/CMakeLists.txt
new file mode 100644
index 0000000000..791e685fc2
--- /dev/null
+++ b/examples/widgets/animation/stickman/CMakeLists.txt
@@ -0,0 +1,53 @@
+# Generated from stickman.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(stickman LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/animation/stickman")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(stickman
+ animation.cpp animation.h
+ graphicsview.cpp graphicsview.h
+ lifecycle.cpp lifecycle.h
+ main.cpp
+ node.cpp node.h
+ rectbutton.cpp rectbutton.h
+ stickman.cpp stickman.h
+)
+target_link_libraries(stickman PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(stickman_resource_files
+ "animations/chilling.bin"
+ "animations/dancing.bin"
+ "animations/dead.bin"
+ "animations/jumping.bin"
+)
+
+qt6_add_resources(stickman "stickman"
+ PREFIX
+ "/"
+ FILES
+ ${stickman_resource_files}
+)
+
+install(TARGETS stickman
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/animation/sub-attaq/.prev_CMakeLists.txt b/examples/widgets/animation/sub-attaq/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..74f095f4f6
--- /dev/null
+++ b/examples/widgets/animation/sub-attaq/.prev_CMakeLists.txt
@@ -0,0 +1,192 @@
+# Generated from sub-attaq.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(sub-attaq LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/animation/sub-attaq")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(sub-attaq
+ animationmanager.cpp animationmanager.h
+ boat.cpp boat.h boat_p.h
+ bomb.cpp bomb.h
+ graphicsscene.cpp graphicsscene.h
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ pixmapitem.cpp pixmapitem.h
+ progressitem.cpp progressitem.h
+ qanimationstate.cpp qanimationstate.h
+ states.cpp states.h
+ submarine.cpp submarine.h submarine_p.h
+ textinformationitem.cpp textinformationitem.h
+ torpedo.cpp torpedo.h
+)
+target_link_libraries(sub-attaq PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set_source_files_properties("pics/big/background.png"
+ PROPERTIES QT_RESOURCE_ALIAS "big/background"
+)
+set_source_files_properties("pics/big/boat.png"
+ PROPERTIES QT_RESOURCE_ALIAS "big/boat"
+)
+set_source_files_properties("pics/big/bomb.png"
+ PROPERTIES QT_RESOURCE_ALIAS "big/bomb"
+)
+set_source_files_properties("pics/big/explosion/boat/step1.png"
+ PROPERTIES QT_RESOURCE_ALIAS "big/explosion/boat/step1"
+)
+set_source_files_properties("pics/big/explosion/boat/step2.png"
+ PROPERTIES QT_RESOURCE_ALIAS "big/explosion/boat/step2"
+)
+set_source_files_properties("pics/big/explosion/boat/step3.png"
+ PROPERTIES QT_RESOURCE_ALIAS "big/explosion/boat/step3"
+)
+set_source_files_properties("pics/big/explosion/boat/step4.png"
+ PROPERTIES QT_RESOURCE_ALIAS "big/explosion/boat/step4"
+)
+set_source_files_properties("pics/big/explosion/submarine/step1.png"
+ PROPERTIES QT_RESOURCE_ALIAS "big/explosion/submarine/step1"
+)
+set_source_files_properties("pics/big/explosion/submarine/step2.png"
+ PROPERTIES QT_RESOURCE_ALIAS "big/explosion/submarine/step2"
+)
+set_source_files_properties("pics/big/explosion/submarine/step3.png"
+ PROPERTIES QT_RESOURCE_ALIAS "big/explosion/submarine/step3"
+)
+set_source_files_properties("pics/big/explosion/submarine/step4.png"
+ PROPERTIES QT_RESOURCE_ALIAS "big/explosion/submarine/step4"
+)
+set_source_files_properties("pics/big/submarine.png"
+ PROPERTIES QT_RESOURCE_ALIAS "big/submarine"
+)
+set_source_files_properties("pics/big/surface.png"
+ PROPERTIES QT_RESOURCE_ALIAS "big/surface"
+)
+set_source_files_properties("pics/big/torpedo.png"
+ PROPERTIES QT_RESOURCE_ALIAS "big/torpedo"
+)
+set_source_files_properties("pics/scalable/boat.svg"
+ PROPERTIES QT_RESOURCE_ALIAS "boat"
+)
+set_source_files_properties("pics/scalable/sub-attaq.svg"
+ PROPERTIES QT_RESOURCE_ALIAS "all"
+)
+set_source_files_properties("pics/scalable/submarine.svg"
+ PROPERTIES QT_RESOURCE_ALIAS "submarine"
+)
+set_source_files_properties("pics/scalable/torpedo.svg"
+ PROPERTIES QT_RESOURCE_ALIAS "torpedo"
+)
+set_source_files_properties("pics/small/background.png"
+ PROPERTIES QT_RESOURCE_ALIAS "small/background"
+)
+set_source_files_properties("pics/small/boat.png"
+ PROPERTIES QT_RESOURCE_ALIAS "small/boat"
+)
+set_source_files_properties("pics/small/bomb.png"
+ PROPERTIES QT_RESOURCE_ALIAS "small/bomb"
+)
+set_source_files_properties("pics/small/submarine.png"
+ PROPERTIES QT_RESOURCE_ALIAS "small/submarine"
+)
+set_source_files_properties("pics/small/surface.png"
+ PROPERTIES QT_RESOURCE_ALIAS "small/surface"
+)
+set_source_files_properties("pics/small/torpedo.png"
+ PROPERTIES QT_RESOURCE_ALIAS "small/torpedo"
+)
+set_source_files_properties("pics/welcome/logo-a.png"
+ PROPERTIES QT_RESOURCE_ALIAS "logo-a"
+)
+set_source_files_properties("pics/welcome/logo-a2.png"
+ PROPERTIES QT_RESOURCE_ALIAS "logo-a2"
+)
+set_source_files_properties("pics/welcome/logo-b.png"
+ PROPERTIES QT_RESOURCE_ALIAS "logo-b"
+)
+set_source_files_properties("pics/welcome/logo-dash.png"
+ PROPERTIES QT_RESOURCE_ALIAS "logo-dash"
+)
+set_source_files_properties("pics/welcome/logo-excl.png"
+ PROPERTIES QT_RESOURCE_ALIAS "logo-excl"
+)
+set_source_files_properties("pics/welcome/logo-q.png"
+ PROPERTIES QT_RESOURCE_ALIAS "logo-q"
+)
+set_source_files_properties("pics/welcome/logo-s.png"
+ PROPERTIES QT_RESOURCE_ALIAS "logo-s"
+)
+set_source_files_properties("pics/welcome/logo-t.png"
+ PROPERTIES QT_RESOURCE_ALIAS "logo-t"
+)
+set_source_files_properties("pics/welcome/logo-t2.png"
+ PROPERTIES QT_RESOURCE_ALIAS "logo-t2"
+)
+set_source_files_properties("pics/welcome/logo-u.png"
+ PROPERTIES QT_RESOURCE_ALIAS "logo-u"
+)
+set(subattaq_resource_files
+ "data.xml"
+ "pics/big/background.png"
+ "pics/big/boat.png"
+ "pics/big/bomb.png"
+ "pics/big/explosion/boat/step1.png"
+ "pics/big/explosion/boat/step2.png"
+ "pics/big/explosion/boat/step3.png"
+ "pics/big/explosion/boat/step4.png"
+ "pics/big/explosion/submarine/step1.png"
+ "pics/big/explosion/submarine/step2.png"
+ "pics/big/explosion/submarine/step3.png"
+ "pics/big/explosion/submarine/step4.png"
+ "pics/big/submarine.png"
+ "pics/big/surface.png"
+ "pics/big/torpedo.png"
+ "pics/scalable/boat.svg"
+ "pics/scalable/sub-attaq.svg"
+ "pics/scalable/submarine.svg"
+ "pics/scalable/torpedo.svg"
+ "pics/small/background.png"
+ "pics/small/boat.png"
+ "pics/small/bomb.png"
+ "pics/small/submarine.png"
+ "pics/small/surface.png"
+ "pics/small/torpedo.png"
+ "pics/welcome/logo-a.png"
+ "pics/welcome/logo-a2.png"
+ "pics/welcome/logo-b.png"
+ "pics/welcome/logo-dash.png"
+ "pics/welcome/logo-excl.png"
+ "pics/welcome/logo-q.png"
+ "pics/welcome/logo-s.png"
+ "pics/welcome/logo-t.png"
+ "pics/welcome/logo-t2.png"
+ "pics/welcome/logo-u.png"
+)
+
+qt6_add_resources(sub-attaq "subattaq"
+ PREFIX
+ "/"
+ FILES
+ ${subattaq_resource_files}
+)
+
+install(TARGETS sub-attaq
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/animation/sub-attaq/CMakeLists.txt b/examples/widgets/animation/sub-attaq/CMakeLists.txt
new file mode 100644
index 0000000000..2e4e455b34
--- /dev/null
+++ b/examples/widgets/animation/sub-attaq/CMakeLists.txt
@@ -0,0 +1,193 @@
+# Generated from sub-attaq.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(sub-attaq LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/animation/sub-attaq")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS OpenGL) # special case
+
+add_qt_gui_executable(sub-attaq
+ animationmanager.cpp animationmanager.h
+ boat.cpp boat.h boat_p.h
+ bomb.cpp bomb.h
+ graphicsscene.cpp graphicsscene.h
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ pixmapitem.cpp pixmapitem.h
+ progressitem.cpp progressitem.h
+ qanimationstate.cpp qanimationstate.h
+ states.cpp states.h
+ submarine.cpp submarine.h submarine_p.h
+ textinformationitem.cpp textinformationitem.h
+ torpedo.cpp torpedo.h
+)
+target_link_libraries(sub-attaq PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set_source_files_properties("pics/big/background.png"
+ PROPERTIES QT_RESOURCE_ALIAS "big/background"
+)
+set_source_files_properties("pics/big/boat.png"
+ PROPERTIES QT_RESOURCE_ALIAS "big/boat"
+)
+set_source_files_properties("pics/big/bomb.png"
+ PROPERTIES QT_RESOURCE_ALIAS "big/bomb"
+)
+set_source_files_properties("pics/big/explosion/boat/step1.png"
+ PROPERTIES QT_RESOURCE_ALIAS "big/explosion/boat/step1"
+)
+set_source_files_properties("pics/big/explosion/boat/step2.png"
+ PROPERTIES QT_RESOURCE_ALIAS "big/explosion/boat/step2"
+)
+set_source_files_properties("pics/big/explosion/boat/step3.png"
+ PROPERTIES QT_RESOURCE_ALIAS "big/explosion/boat/step3"
+)
+set_source_files_properties("pics/big/explosion/boat/step4.png"
+ PROPERTIES QT_RESOURCE_ALIAS "big/explosion/boat/step4"
+)
+set_source_files_properties("pics/big/explosion/submarine/step1.png"
+ PROPERTIES QT_RESOURCE_ALIAS "big/explosion/submarine/step1"
+)
+set_source_files_properties("pics/big/explosion/submarine/step2.png"
+ PROPERTIES QT_RESOURCE_ALIAS "big/explosion/submarine/step2"
+)
+set_source_files_properties("pics/big/explosion/submarine/step3.png"
+ PROPERTIES QT_RESOURCE_ALIAS "big/explosion/submarine/step3"
+)
+set_source_files_properties("pics/big/explosion/submarine/step4.png"
+ PROPERTIES QT_RESOURCE_ALIAS "big/explosion/submarine/step4"
+)
+set_source_files_properties("pics/big/submarine.png"
+ PROPERTIES QT_RESOURCE_ALIAS "big/submarine"
+)
+set_source_files_properties("pics/big/surface.png"
+ PROPERTIES QT_RESOURCE_ALIAS "big/surface"
+)
+set_source_files_properties("pics/big/torpedo.png"
+ PROPERTIES QT_RESOURCE_ALIAS "big/torpedo"
+)
+set_source_files_properties("pics/scalable/boat.svg"
+ PROPERTIES QT_RESOURCE_ALIAS "boat"
+)
+set_source_files_properties("pics/scalable/sub-attaq.svg"
+ PROPERTIES QT_RESOURCE_ALIAS "all"
+)
+set_source_files_properties("pics/scalable/submarine.svg"
+ PROPERTIES QT_RESOURCE_ALIAS "submarine"
+)
+set_source_files_properties("pics/scalable/torpedo.svg"
+ PROPERTIES QT_RESOURCE_ALIAS "torpedo"
+)
+set_source_files_properties("pics/small/background.png"
+ PROPERTIES QT_RESOURCE_ALIAS "small/background"
+)
+set_source_files_properties("pics/small/boat.png"
+ PROPERTIES QT_RESOURCE_ALIAS "small/boat"
+)
+set_source_files_properties("pics/small/bomb.png"
+ PROPERTIES QT_RESOURCE_ALIAS "small/bomb"
+)
+set_source_files_properties("pics/small/submarine.png"
+ PROPERTIES QT_RESOURCE_ALIAS "small/submarine"
+)
+set_source_files_properties("pics/small/surface.png"
+ PROPERTIES QT_RESOURCE_ALIAS "small/surface"
+)
+set_source_files_properties("pics/small/torpedo.png"
+ PROPERTIES QT_RESOURCE_ALIAS "small/torpedo"
+)
+set_source_files_properties("pics/welcome/logo-a.png"
+ PROPERTIES QT_RESOURCE_ALIAS "logo-a"
+)
+set_source_files_properties("pics/welcome/logo-a2.png"
+ PROPERTIES QT_RESOURCE_ALIAS "logo-a2"
+)
+set_source_files_properties("pics/welcome/logo-b.png"
+ PROPERTIES QT_RESOURCE_ALIAS "logo-b"
+)
+set_source_files_properties("pics/welcome/logo-dash.png"
+ PROPERTIES QT_RESOURCE_ALIAS "logo-dash"
+)
+set_source_files_properties("pics/welcome/logo-excl.png"
+ PROPERTIES QT_RESOURCE_ALIAS "logo-excl"
+)
+set_source_files_properties("pics/welcome/logo-q.png"
+ PROPERTIES QT_RESOURCE_ALIAS "logo-q"
+)
+set_source_files_properties("pics/welcome/logo-s.png"
+ PROPERTIES QT_RESOURCE_ALIAS "logo-s"
+)
+set_source_files_properties("pics/welcome/logo-t.png"
+ PROPERTIES QT_RESOURCE_ALIAS "logo-t"
+)
+set_source_files_properties("pics/welcome/logo-t2.png"
+ PROPERTIES QT_RESOURCE_ALIAS "logo-t2"
+)
+set_source_files_properties("pics/welcome/logo-u.png"
+ PROPERTIES QT_RESOURCE_ALIAS "logo-u"
+)
+set(subattaq_resource_files
+ "data.xml"
+ "pics/big/background.png"
+ "pics/big/boat.png"
+ "pics/big/bomb.png"
+ "pics/big/explosion/boat/step1.png"
+ "pics/big/explosion/boat/step2.png"
+ "pics/big/explosion/boat/step3.png"
+ "pics/big/explosion/boat/step4.png"
+ "pics/big/explosion/submarine/step1.png"
+ "pics/big/explosion/submarine/step2.png"
+ "pics/big/explosion/submarine/step3.png"
+ "pics/big/explosion/submarine/step4.png"
+ "pics/big/submarine.png"
+ "pics/big/surface.png"
+ "pics/big/torpedo.png"
+ "pics/scalable/boat.svg"
+ "pics/scalable/sub-attaq.svg"
+ "pics/scalable/submarine.svg"
+ "pics/scalable/torpedo.svg"
+ "pics/small/background.png"
+ "pics/small/boat.png"
+ "pics/small/bomb.png"
+ "pics/small/submarine.png"
+ "pics/small/surface.png"
+ "pics/small/torpedo.png"
+ "pics/welcome/logo-a.png"
+ "pics/welcome/logo-a2.png"
+ "pics/welcome/logo-b.png"
+ "pics/welcome/logo-dash.png"
+ "pics/welcome/logo-excl.png"
+ "pics/welcome/logo-q.png"
+ "pics/welcome/logo-s.png"
+ "pics/welcome/logo-t.png"
+ "pics/welcome/logo-t2.png"
+ "pics/welcome/logo-u.png"
+)
+
+qt6_add_resources(sub-attaq "subattaq"
+ PREFIX
+ "/"
+ FILES
+ ${subattaq_resource_files}
+)
+
+install(TARGETS sub-attaq
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/animation/sub-attaq/mainwindow.cpp b/examples/widgets/animation/sub-attaq/mainwindow.cpp
index f9617a22eb..0c152c9180 100644
--- a/examples/widgets/animation/sub-attaq/mainwindow.cpp
+++ b/examples/widgets/animation/sub-attaq/mainwindow.cpp
@@ -59,10 +59,6 @@
#include <QMenuBar>
#include <QLayout>
-#ifndef QT_NO_OPENGL
-# include <QtOpenGL>
-#endif
-
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
@@ -84,14 +80,5 @@ MainWindow::MainWindow(QWidget *parent)
view = new QGraphicsView(scene, this);
view->setAlignment(Qt::AlignLeft | Qt::AlignTop);
scene->setupScene(newAction, quitAction);
-#ifndef QT_NO_OPENGL
- QGLWidget *glWidget = new QGLWidget(QGLFormat(QGL::SampleBuffers));
- if (glWidget->context()->isValid()) {
- view->setViewport(glWidget);
- } else {
- qWarning("Unable to create an Open GL context with sample buffers, not using Open GL.");
- delete glWidget;
- }
-#endif
setCentralWidget(view);
}
diff --git a/examples/widgets/animation/sub-attaq/sub-attaq.pro b/examples/widgets/animation/sub-attaq/sub-attaq.pro
index ac79fd4249..ea44253fa1 100644
--- a/examples/widgets/animation/sub-attaq/sub-attaq.pro
+++ b/examples/widgets/animation/sub-attaq/sub-attaq.pro
@@ -1,5 +1,4 @@
QT += widgets
-qtHaveModule(opengl): QT += opengl
HEADERS += boat.h \
bomb.h \
mainwindow.h \
diff --git a/examples/widgets/desktop/CMakeLists.txt b/examples/widgets/desktop/CMakeLists.txt
new file mode 100644
index 0000000000..a50d3c2f0a
--- /dev/null
+++ b/examples/widgets/desktop/CMakeLists.txt
@@ -0,0 +1,4 @@
+# Generated from desktop.pro.
+
+add_subdirectory(screenshot)
+add_subdirectory(systray)
diff --git a/examples/widgets/desktop/screenshot/CMakeLists.txt b/examples/widgets/desktop/screenshot/CMakeLists.txt
new file mode 100644
index 0000000000..3145dd41e5
--- /dev/null
+++ b/examples/widgets/desktop/screenshot/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from screenshot.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(screenshot LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/desktop/screenshot")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(screenshot
+ main.cpp
+ screenshot.cpp screenshot.h
+)
+target_link_libraries(screenshot PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS screenshot
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/desktop/screenshot/screenshot.cpp b/examples/widgets/desktop/screenshot/screenshot.cpp
index d0a849e0b8..af344db1d2 100644
--- a/examples/widgets/desktop/screenshot/screenshot.cpp
+++ b/examples/widgets/desktop/screenshot/screenshot.cpp
@@ -70,7 +70,7 @@ Screenshot::Screenshot()
delaySpinBox->setSuffix(tr(" s"));
delaySpinBox->setMaximum(60);
- connect(delaySpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
+ connect(delaySpinBox, &QSpinBox::valueChanged,
this, &Screenshot::updateCheckBox);
hideThisWindowCheckBox = new QCheckBox(tr("Hide This Window"), optionsGroupBox);
diff --git a/examples/widgets/desktop/systray/CMakeLists.txt b/examples/widgets/desktop/systray/CMakeLists.txt
new file mode 100644
index 0000000000..16af7808d7
--- /dev/null
+++ b/examples/widgets/desktop/systray/CMakeLists.txt
@@ -0,0 +1,47 @@
+# Generated from systray.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(systray LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/desktop/systray")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(systray
+ main.cpp
+ window.cpp window.h
+)
+target_link_libraries(systray PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(systray_resource_files
+ "images/bad.png"
+ "images/heart.png"
+ "images/trash.png"
+)
+
+qt6_add_resources(systray "systray"
+ PREFIX
+ "/"
+ FILES
+ ${systray_resource_files}
+)
+
+install(TARGETS systray
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/desktop/systray/window.cpp b/examples/widgets/desktop/systray/window.cpp
index e30166beac..3238e3bf31 100644
--- a/examples/widgets/desktop/systray/window.cpp
+++ b/examples/widgets/desktop/systray/window.cpp
@@ -80,7 +80,7 @@ Window::Window()
connect(showMessageButton, &QAbstractButton::clicked, this, &Window::showMessage);
connect(showIconCheckBox, &QAbstractButton::toggled, trayIcon, &QSystemTrayIcon::setVisible);
- connect(iconComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
+ connect(iconComboBox, &QComboBox::currentIndexChanged,
this, &Window::setIcon);
connect(trayIcon, &QSystemTrayIcon::messageClicked, this, &Window::messageClicked);
connect(trayIcon, &QSystemTrayIcon::activated, this, &Window::iconActivated);
diff --git a/examples/widgets/dialogs/CMakeLists.txt b/examples/widgets/dialogs/CMakeLists.txt
new file mode 100644
index 0000000000..c9d6823adc
--- /dev/null
+++ b/examples/widgets/dialogs/CMakeLists.txt
@@ -0,0 +1,14 @@
+# Generated from dialogs.pro.
+
+add_subdirectory(extension)
+add_subdirectory(findfiles)
+if(TARGET Qt::PrintSupport AND QT_FEATURE_wizard) # special case
+ add_subdirectory(licensewizard)
+endif()
+add_subdirectory(standarddialogs)
+add_subdirectory(tabdialog)
+
+if(QT_FEATURE_wizard) # special case
+ add_subdirectory(classwizard)
+ add_subdirectory(trivialwizard)
+endif()
diff --git a/examples/widgets/dialogs/classwizard/CMakeLists.txt b/examples/widgets/dialogs/classwizard/CMakeLists.txt
new file mode 100644
index 0000000000..0a85f02b21
--- /dev/null
+++ b/examples/widgets/dialogs/classwizard/CMakeLists.txt
@@ -0,0 +1,51 @@
+# Generated from classwizard.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(classwizard LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/dialogs/classwizard")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(classwizard
+ classwizard.cpp classwizard.h
+ main.cpp
+)
+target_link_libraries(classwizard PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(classwizard_resource_files
+ "images/background.png"
+ "images/banner.png"
+ "images/logo1.png"
+ "images/logo2.png"
+ "images/logo3.png"
+ "images/watermark1.png"
+ "images/watermark2.png"
+)
+
+qt6_add_resources(classwizard "classwizard"
+ PREFIX
+ "/"
+ FILES
+ ${classwizard_resource_files}
+)
+
+install(TARGETS classwizard
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/dialogs/extension/CMakeLists.txt b/examples/widgets/dialogs/extension/CMakeLists.txt
new file mode 100644
index 0000000000..dfac53a3f6
--- /dev/null
+++ b/examples/widgets/dialogs/extension/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from extension.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(extension LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/dialogs/extension")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(extension
+ finddialog.cpp finddialog.h
+ main.cpp
+)
+target_link_libraries(extension PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS extension
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/dialogs/findfiles/CMakeLists.txt b/examples/widgets/dialogs/findfiles/CMakeLists.txt
new file mode 100644
index 0000000000..42681ca424
--- /dev/null
+++ b/examples/widgets/dialogs/findfiles/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from findfiles.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(findfiles LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/dialogs/findfiles")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(findfiles
+ main.cpp
+ window.cpp window.h
+)
+target_link_libraries(findfiles PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS findfiles
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/dialogs/licensewizard/CMakeLists.txt b/examples/widgets/dialogs/licensewizard/CMakeLists.txt
new file mode 100644
index 0000000000..20b4b7d799
--- /dev/null
+++ b/examples/widgets/dialogs/licensewizard/CMakeLists.txt
@@ -0,0 +1,48 @@
+# Generated from licensewizard.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(licensewizard LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/dialogs/licensewizard")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS PrintSupport)
+
+add_qt_gui_executable(licensewizard
+ licensewizard.cpp licensewizard.h
+ main.cpp
+)
+target_link_libraries(licensewizard PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::PrintSupport
+ Qt::Widgets
+)
+
+
+# Resources:
+set(licensewizard_resource_files
+ "images/logo.png"
+ "images/watermark.png"
+)
+
+qt6_add_resources(licensewizard "licensewizard"
+ PREFIX
+ "/"
+ FILES
+ ${licensewizard_resource_files}
+)
+
+install(TARGETS licensewizard
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/dialogs/standarddialogs/CMakeLists.txt b/examples/widgets/dialogs/standarddialogs/CMakeLists.txt
new file mode 100644
index 0000000000..ed4c11b041
--- /dev/null
+++ b/examples/widgets/dialogs/standarddialogs/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from standarddialogs.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(standarddialogs LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/dialogs/standarddialogs")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(standarddialogs
+ dialog.cpp dialog.h
+ main.cpp
+)
+target_link_libraries(standarddialogs PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS standarddialogs
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/dialogs/tabdialog/CMakeLists.txt b/examples/widgets/dialogs/tabdialog/CMakeLists.txt
new file mode 100644
index 0000000000..0df1238e56
--- /dev/null
+++ b/examples/widgets/dialogs/tabdialog/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from tabdialog.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(tabdialog LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/dialogs/tabdialog")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(tabdialog
+ main.cpp
+ tabdialog.cpp tabdialog.h
+)
+target_link_libraries(tabdialog PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS tabdialog
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/dialogs/trivialwizard/CMakeLists.txt b/examples/widgets/dialogs/trivialwizard/CMakeLists.txt
new file mode 100644
index 0000000000..759483ab8f
--- /dev/null
+++ b/examples/widgets/dialogs/trivialwizard/CMakeLists.txt
@@ -0,0 +1,31 @@
+# Generated from trivialwizard.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(trivialwizard LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/dialogs/trivialwizard")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(trivialwizard
+ trivialwizard.cpp
+)
+target_link_libraries(trivialwizard PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS trivialwizard
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/doc/src/padnavigator.qdoc b/examples/widgets/doc/src/padnavigator.qdoc
index d8e83978cf..31440b650f 100644
--- a/examples/widgets/doc/src/padnavigator.qdoc
+++ b/examples/widgets/doc/src/padnavigator.qdoc
@@ -545,7 +545,7 @@
with OpenGL, but without OpenGL it avoids unnecessary re-scaling of the
background pixmap.
\li It sets render hints that increase rendering quality.
- \li If OpenGL is supported, a QGLWidget viewport is assigned to the view.
+ \li If OpenGL is supported, a QOpenGLWidget viewport is assigned to the view.
\endlist
Finally, we start the state engine.
diff --git a/examples/widgets/draganddrop/CMakeLists.txt b/examples/widgets/draganddrop/CMakeLists.txt
new file mode 100644
index 0000000000..fbad523a73
--- /dev/null
+++ b/examples/widgets/draganddrop/CMakeLists.txt
@@ -0,0 +1,7 @@
+# Generated from draganddrop.pro.
+
+add_subdirectory(draggableicons)
+add_subdirectory(draggabletext)
+add_subdirectory(dropsite)
+add_subdirectory(fridgemagnets)
+add_subdirectory(puzzle)
diff --git a/examples/widgets/draganddrop/draggableicons/CMakeLists.txt b/examples/widgets/draganddrop/draggableicons/CMakeLists.txt
new file mode 100644
index 0000000000..5695657792
--- /dev/null
+++ b/examples/widgets/draganddrop/draggableicons/CMakeLists.txt
@@ -0,0 +1,47 @@
+# Generated from draggableicons.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(draggableicons LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/draganddrop/draggableicons")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(draggableicons
+ dragwidget.cpp dragwidget.h
+ main.cpp
+)
+target_link_libraries(draggableicons PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(draggableicons_resource_files
+ "images/boat.png"
+ "images/car.png"
+ "images/house.png"
+)
+
+qt6_add_resources(draggableicons "draggableicons"
+ PREFIX
+ "/"
+ FILES
+ ${draggableicons_resource_files}
+)
+
+install(TARGETS draggableicons
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/draganddrop/draggabletext/CMakeLists.txt b/examples/widgets/draganddrop/draggabletext/CMakeLists.txt
new file mode 100644
index 0000000000..d3dfc125b2
--- /dev/null
+++ b/examples/widgets/draganddrop/draggabletext/CMakeLists.txt
@@ -0,0 +1,45 @@
+# Generated from draggabletext.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(draggabletext LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/draganddrop/draggabletext")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(draggabletext
+ dragwidget.cpp dragwidget.h
+ main.cpp
+)
+target_link_libraries(draggabletext PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(draggabletext_resource_files
+ "words.txt"
+)
+
+qt6_add_resources(draggabletext "draggabletext"
+ PREFIX
+ "/dictionary"
+ FILES
+ ${draggabletext_resource_files}
+)
+
+install(TARGETS draggabletext
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/draganddrop/dropsite/CMakeLists.txt b/examples/widgets/draganddrop/dropsite/CMakeLists.txt
new file mode 100644
index 0000000000..7d6ce02b4b
--- /dev/null
+++ b/examples/widgets/draganddrop/dropsite/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from dropsite.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(dropsite LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/draganddrop/dropsite")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(dropsite
+ droparea.cpp droparea.h
+ dropsitewindow.cpp dropsitewindow.h
+ main.cpp
+)
+target_link_libraries(dropsite PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS dropsite
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/draganddrop/fridgemagnets/CMakeLists.txt b/examples/widgets/draganddrop/fridgemagnets/CMakeLists.txt
new file mode 100644
index 0000000000..31441ab7cb
--- /dev/null
+++ b/examples/widgets/draganddrop/fridgemagnets/CMakeLists.txt
@@ -0,0 +1,46 @@
+# Generated from fridgemagnets.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(fridgemagnets LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/draganddrop/fridgemagnets")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(fridgemagnets
+ draglabel.cpp draglabel.h
+ dragwidget.cpp dragwidget.h
+ main.cpp
+)
+target_link_libraries(fridgemagnets PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(fridgemagnets_resource_files
+ "words.txt"
+)
+
+qt6_add_resources(fridgemagnets "fridgemagnets"
+ PREFIX
+ "/dictionary"
+ FILES
+ ${fridgemagnets_resource_files}
+)
+
+install(TARGETS fridgemagnets
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/draganddrop/puzzle/.prev_CMakeLists.txt b/examples/widgets/draganddrop/puzzle/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..148f386115
--- /dev/null
+++ b/examples/widgets/draganddrop/puzzle/.prev_CMakeLists.txt
@@ -0,0 +1,47 @@
+# Generated from puzzle.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(puzzle LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/draganddrop/puzzle")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(puzzle
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ pieceslist.cpp pieceslist.h
+ puzzlewidget.cpp puzzlewidget.h
+)
+target_link_libraries(puzzle PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(puzzle_resource_files
+ "example.jpg"
+)
+
+qt6_add_resources(puzzle "puzzle"
+ PREFIX
+ "/images"
+ FILES
+ ${puzzle_resource_files}
+)
+
+install(TARGETS puzzle
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/draganddrop/puzzle/CMakeLists.txt b/examples/widgets/draganddrop/puzzle/CMakeLists.txt
new file mode 100644
index 0000000000..b181efd090
--- /dev/null
+++ b/examples/widgets/draganddrop/puzzle/CMakeLists.txt
@@ -0,0 +1,47 @@
+# Generated from puzzle.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(puzzle LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/draganddrop/draganddrop_puzzle") # special case
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(draganddrop_puzzle # special case: renamed puzzle
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ pieceslist.cpp pieceslist.h
+ puzzlewidget.cpp puzzlewidget.h
+)
+target_link_libraries(draganddrop_puzzle PUBLIC # special case
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(puzzle_resource_files
+ "example.jpg"
+)
+
+qt6_add_resources(draganddrop_puzzle "puzzle" # special case
+ PREFIX
+ "/images"
+ FILES
+ ${puzzle_resource_files}
+)
+
+install(TARGETS draganddrop_puzzle # special case: renamed puzzle
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/effects/CMakeLists.txt b/examples/widgets/effects/CMakeLists.txt
new file mode 100644
index 0000000000..6e8a892de1
--- /dev/null
+++ b/examples/widgets/effects/CMakeLists.txt
@@ -0,0 +1,4 @@
+# Generated from effects.pro.
+
+add_subdirectory(blurpicker)
+add_subdirectory(fademessage)
diff --git a/examples/widgets/effects/blurpicker/CMakeLists.txt b/examples/widgets/effects/blurpicker/CMakeLists.txt
new file mode 100644
index 0000000000..3f9fa69797
--- /dev/null
+++ b/examples/widgets/effects/blurpicker/CMakeLists.txt
@@ -0,0 +1,54 @@
+# Generated from blurpicker.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(blurpicker LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/effects/blurpicker")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(blurpicker
+ blureffect.cpp blureffect.h
+ blurpicker.cpp blurpicker.h
+ main.cpp
+)
+target_link_libraries(blurpicker PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(blurpicker_resource_files
+ "images/accessories-calculator.png"
+ "images/accessories-text-editor.png"
+ "images/background.jpg"
+ "images/help-browser.png"
+ "images/internet-group-chat.png"
+ "images/internet-mail.png"
+ "images/internet-web-browser.png"
+ "images/office-calendar.png"
+ "images/system-users.png"
+)
+
+qt6_add_resources(blurpicker "blurpicker"
+ PREFIX
+ "/"
+ FILES
+ ${blurpicker_resource_files}
+)
+
+install(TARGETS blurpicker
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/effects/fademessage/CMakeLists.txt b/examples/widgets/effects/fademessage/CMakeLists.txt
new file mode 100644
index 0000000000..b84985a886
--- /dev/null
+++ b/examples/widgets/effects/fademessage/CMakeLists.txt
@@ -0,0 +1,45 @@
+# Generated from fademessage.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(fademessage LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/effects/fademessage")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(fademessage
+ fademessage.cpp fademessage.h
+ main.cpp
+)
+target_link_libraries(fademessage PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(fademessage_resource_files
+ "background.jpg"
+)
+
+qt6_add_resources(fademessage "fademessage"
+ PREFIX
+ "/"
+ FILES
+ ${fademessage_resource_files}
+)
+
+install(TARGETS fademessage
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/gestures/CMakeLists.txt b/examples/widgets/gestures/CMakeLists.txt
new file mode 100644
index 0000000000..0f9f95b72f
--- /dev/null
+++ b/examples/widgets/gestures/CMakeLists.txt
@@ -0,0 +1,3 @@
+# Generated from gestures.pro.
+
+add_subdirectory(imagegestures)
diff --git a/examples/widgets/gestures/imagegestures/CMakeLists.txt b/examples/widgets/gestures/imagegestures/CMakeLists.txt
new file mode 100644
index 0000000000..9676089ff9
--- /dev/null
+++ b/examples/widgets/gestures/imagegestures/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from imagegestures.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(imagegestures LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/gestures/imagegestures")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(imagegestures
+ imagewidget.cpp imagewidget.h
+ main.cpp
+ mainwidget.cpp mainwidget.h
+)
+target_link_libraries(imagegestures PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS imagegestures
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/graphicsview/CMakeLists.txt b/examples/widgets/graphicsview/CMakeLists.txt
new file mode 100644
index 0000000000..d7ef0fd0dc
--- /dev/null
+++ b/examples/widgets/graphicsview/CMakeLists.txt
@@ -0,0 +1,16 @@
+# Generated from graphicsview.pro.
+
+add_subdirectory(chip)
+add_subdirectory(elasticnodes)
+add_subdirectory(embeddeddialogs)
+add_subdirectory(collidingmice)
+add_subdirectory(padnavigator)
+add_subdirectory(basicgraphicslayouts)
+add_subdirectory(diagramscene)
+if(QT_FEATURE_cursor AND QT_FEATURE_draganddrop)
+ add_subdirectory(dragdroprobot)
+endif()
+add_subdirectory(flowlayout)
+add_subdirectory(anchorlayout)
+add_subdirectory(simpleanchorlayout)
+add_subdirectory(weatheranchorlayout)
diff --git a/examples/widgets/graphicsview/anchorlayout/CMakeLists.txt b/examples/widgets/graphicsview/anchorlayout/CMakeLists.txt
new file mode 100644
index 0000000000..c04890d613
--- /dev/null
+++ b/examples/widgets/graphicsview/anchorlayout/CMakeLists.txt
@@ -0,0 +1,31 @@
+# Generated from anchorlayout.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(anchorlayout LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/graphicsview/anchorlayout")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(anchorlayout
+ main.cpp
+)
+target_link_libraries(anchorlayout PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS anchorlayout
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/graphicsview/basicgraphicslayouts/CMakeLists.txt b/examples/widgets/graphicsview/basicgraphicslayouts/CMakeLists.txt
new file mode 100644
index 0000000000..18c35e6a3e
--- /dev/null
+++ b/examples/widgets/graphicsview/basicgraphicslayouts/CMakeLists.txt
@@ -0,0 +1,46 @@
+# Generated from basicgraphicslayouts.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(basicgraphicslayouts LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/graphicsview/basicgraphicslayouts")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(basicgraphicslayouts
+ layoutitem.cpp layoutitem.h
+ main.cpp
+ window.cpp window.h
+)
+target_link_libraries(basicgraphicslayouts PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(basicgraphicslayouts_resource_files
+ "images/block.png"
+)
+
+qt6_add_resources(basicgraphicslayouts "basicgraphicslayouts"
+ PREFIX
+ "/"
+ FILES
+ ${basicgraphicslayouts_resource_files}
+)
+
+install(TARGETS basicgraphicslayouts
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/graphicsview/boxes/3rdparty/fbm.c b/examples/widgets/graphicsview/boxes/3rdparty/fbm.c
deleted file mode 100644
index 3eebaabfba..0000000000
--- a/examples/widgets/graphicsview/boxes/3rdparty/fbm.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/*****************************************************************
-
- Implementation of the fractional Brownian motion algorithm. These
- functions were originally the work of F. Kenton Musgrave.
- For documentation of the different functions please refer to the
- book:
- "Texturing and modeling: a procedural approach"
- by David S. Ebert et. al.
-
-******************************************************************/
-
-#if defined (_MSC_VER)
-#include <qglobal.h>
-#endif
-
-#include <time.h>
-#include <stdlib.h>
-#include "fbm.h"
-
-#if defined(Q_CC_MSVC)
-#pragma warning(disable:4244)
-#endif
-
-/* Definitions used by the noise2() functions */
-
-//#define B 0x100
-//#define BM 0xff
-#define B 0x20
-#define BM 0x1f
-
-#define N 0x1000
-#define NP 12 /* 2^N */
-#define NM 0xfff
-
-static int p[B + B + 2];
-static float g3[B + B + 2][3];
-static float g2[B + B + 2][2];
-static float g1[B + B + 2];
-static int start = 1;
-
-static void init(void);
-
-#define s_curve(t) ( t * t * (3. - 2. * t) )
-
-#define lerp(t, a, b) ( a + t * (b - a) )
-
-#define setup(i,b0,b1,r0,r1)\
- t = vec[i] + N;\
- b0 = ((int)t) & BM;\
- b1 = (b0+1) & BM;\
- r0 = t - (int)t;\
- r1 = r0 - 1.;
-#define at3(rx,ry,rz) ( rx * q[0] + ry * q[1] + rz * q[2] )
-
-/* Fractional Brownian Motion function */
-
-double fBm( Vector point, double H, double lacunarity, double octaves,
- int init )
-{
-
- double value, frequency, remainder;
- int i;
- static double exponent_array[10];
- float vec[3];
-
- /* precompute and store spectral weights */
- if ( init ) {
- start = 1;
- srand( time(0) );
- /* seize required memory for exponent_array */
- frequency = 1.0;
- for (i=0; i<=octaves; i++) {
- /* compute weight for each frequency */
- exponent_array[i] = pow( frequency, -H );
- frequency *= lacunarity;
- }
- }
-
- value = 0.0; /* initialize vars to proper values */
- frequency = 1.0;
- vec[0]=point.x;
- vec[1]=point.y;
- vec[2]=point.z;
-
-
- /* inner loop of spectral construction */
- for (i=0; i<octaves; i++) {
- /* value += noise3( vec ) * exponent_array[i];*/
- value += noise3( vec ) * exponent_array[i];
- vec[0] *= lacunarity;
- vec[1] *= lacunarity;
- vec[2] *= lacunarity;
- } /* for */
-
- remainder = octaves - (int)octaves;
- if ( remainder ) /* add in ``octaves'' remainder */
- /* ``i'' and spatial freq. are preset in loop above */
- value += remainder * noise3( vec ) * exponent_array[i];
-
- return( value );
-
-} /* fBm() */
-
-
-float noise3(float vec[3])
-{
- int bx0, bx1, by0, by1, bz0, bz1, b00, b10, b01, b11;
- float rx0, rx1, ry0, ry1, rz0, rz1, *q, sy, sz, a, b, c, d, t, u, v;
- int i, j;
-
- if (start) {
- start = 0;
- init();
- }
-
- setup(0, bx0,bx1, rx0,rx1);
- setup(1, by0,by1, ry0,ry1);
- setup(2, bz0,bz1, rz0,rz1);
-
- i = p[ bx0 ];
- j = p[ bx1 ];
-
- b00 = p[ i + by0 ];
- b10 = p[ j + by0 ];
- b01 = p[ i + by1 ];
- b11 = p[ j + by1 ];
-
- t = s_curve(rx0);
- sy = s_curve(ry0);
- sz = s_curve(rz0);
-
-
- q = g3[ b00 + bz0 ] ; u = at3(rx0,ry0,rz0);
- q = g3[ b10 + bz0 ] ; v = at3(rx1,ry0,rz0);
- a = lerp(t, u, v);
-
- q = g3[ b01 + bz0 ] ; u = at3(rx0,ry1,rz0);
- q = g3[ b11 + bz0 ] ; v = at3(rx1,ry1,rz0);
- b = lerp(t, u, v);
-
- c = lerp(sy, a, b);
-
- q = g3[ b00 + bz1 ] ; u = at3(rx0,ry0,rz1);
- q = g3[ b10 + bz1 ] ; v = at3(rx1,ry0,rz1);
- a = lerp(t, u, v);
-
- q = g3[ b01 + bz1 ] ; u = at3(rx0,ry1,rz1);
- q = g3[ b11 + bz1 ] ; v = at3(rx1,ry1,rz1);
- b = lerp(t, u, v);
-
- d = lerp(sy, a, b);
-
- return lerp(sz, c, d);
-}
-
-static void normalize2(float v[2])
-{
- float s;
-
- s = sqrt(v[0] * v[0] + v[1] * v[1]);
- v[0] = v[0] / s;
- v[1] = v[1] / s;
-}
-
-static void normalize3(float v[3])
-{
- float s;
-
- s = sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
- v[0] = v[0] / s;
- v[1] = v[1] / s;
- v[2] = v[2] / s;
-}
-
-static void init(void)
-{
- int i, j, k;
-
- for (i = 0 ; i < B ; i++) {
- p[i] = i;
-
- g1[i] = (float)((rand() % (B + B)) - B) / B;
-
- for (j = 0 ; j < 2 ; j++)
- g2[i][j] = (float)((rand() % (B + B)) - B) / B;
- normalize2(g2[i]);
-
- for (j = 0 ; j < 3 ; j++)
- g3[i][j] = (float)((rand() % (B + B)) - B) / B;
- normalize3(g3[i]);
- }
-
- while (--i) {
- k = p[i];
- p[i] = p[j = rand() % B];
- p[j] = k;
- }
-
- for (i = 0 ; i < B + 2 ; i++) {
- p[B + i] = p[i];
- g1[B + i] = g1[i];
- for (j = 0 ; j < 2 ; j++)
- g2[B + i][j] = g2[i][j];
- for (j = 0 ; j < 3 ; j++)
- g3[B + i][j] = g3[i][j];
- }
-}
diff --git a/examples/widgets/graphicsview/boxes/3rdparty/fbm.h b/examples/widgets/graphicsview/boxes/3rdparty/fbm.h
deleted file mode 100644
index b8a4a99ae4..0000000000
--- a/examples/widgets/graphicsview/boxes/3rdparty/fbm.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*****************************************************************
-
- Prototypes for the fractional Brownian motion algorithm. These
- functions were originally the work of F. Kenton Musgrave. For
- documentation of the different functions please refer to the book:
- "Texturing and modeling: a procedural approach"
- by David S. Ebert et. al.
-
-******************************************************************/
-
-#ifndef _fbm_h
-#define _fbm_h
-
-#include <math.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-//#define TRUE 1
-//#define FALSE 0
-
-typedef struct {
- double x;
- double y;
- double z;
-} Vector;
-
-float noise3(float vec[]);
-double fBm( Vector point, double H, double lacunarity, double octaves,
- int init );
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-
-
-
diff --git a/examples/widgets/graphicsview/boxes/basic.fsh b/examples/widgets/graphicsview/boxes/basic.fsh
deleted file mode 100644
index 327daeef54..0000000000
--- a/examples/widgets/graphicsview/boxes/basic.fsh
+++ /dev/null
@@ -1,82 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the demonstration applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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$
-**
-****************************************************************************/
-
-varying vec3 position, normal;
-varying vec4 specular, ambient, diffuse, lightDirection;
-
-uniform sampler2D tex;
-uniform vec4 basicColor;
-
-void main()
-{
- vec3 N = normalize(normal);
- // assume directional light
-
- gl_MaterialParameters M = gl_FrontMaterial;
-
- float NdotL = dot(N, lightDirection.xyz);
- float RdotL = dot(reflect(normalize(position), N), lightDirection.xyz);
-
- vec3 absN = abs(gl_TexCoord[1].xyz);
- vec3 texCoord;
- if (absN.x > absN.y && absN.x > absN.z)
- texCoord = gl_TexCoord[1].yzx;
- else if (absN.y > absN.z)
- texCoord = gl_TexCoord[1].zxy;
- else
- texCoord = gl_TexCoord[1].xyz;
- texCoord.y *= -sign(texCoord.z);
- texCoord += 0.5;
-
- vec4 texColor = texture2D(tex, texCoord.xy);
- vec4 unlitColor = gl_Color * mix(basicColor, vec4(texColor.xyz, 1.0), texColor.w);
- gl_FragColor = (ambient + diffuse * max(NdotL, 0.0)) * unlitColor +
- M.specular * specular * pow(max(RdotL, 0.0), M.shininess);
-}
diff --git a/examples/widgets/graphicsview/boxes/basic.vsh b/examples/widgets/graphicsview/boxes/basic.vsh
deleted file mode 100644
index 454e0bd903..0000000000
--- a/examples/widgets/graphicsview/boxes/basic.vsh
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the demonstration applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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$
-**
-****************************************************************************/
-
-varying vec3 position, normal;
-varying vec4 specular, ambient, diffuse, lightDirection;
-
-uniform mat4 view;
-
-void main()
-{
- gl_TexCoord[0] = gl_MultiTexCoord0;
- gl_TexCoord[1] = gl_Vertex;
- specular = gl_LightSource[0].specular;
- ambient = gl_LightSource[0].ambient;
- diffuse = gl_LightSource[0].diffuse;
- lightDirection = view * gl_LightSource[0].position;
-
- normal = gl_NormalMatrix * gl_Normal;
- position = (gl_ModelViewMatrix * gl_Vertex).xyz;
-
- gl_FrontColor = gl_Color;
- gl_Position = ftransform();
-}
diff --git a/examples/widgets/graphicsview/boxes/boxes.pro b/examples/widgets/graphicsview/boxes/boxes.pro
deleted file mode 100644
index 601edd6883..0000000000
--- a/examples/widgets/graphicsview/boxes/boxes.pro
+++ /dev/null
@@ -1,27 +0,0 @@
-QT += opengl widgets
-requires(qtConfig(combobox))
-
-qtConfig(opengles.|angle|dynamicgl): error("This example requires Qt to be configured with -opengl desktop")
-
-HEADERS += 3rdparty/fbm.h \
- glbuffers.h \
- glextensions.h \
- gltrianglemesh.h \
- qtbox.h \
- roundedbox.h \
- scene.h \
- trackball.h
-SOURCES += 3rdparty/fbm.c \
- glbuffers.cpp \
- glextensions.cpp \
- main.cpp \
- qtbox.cpp \
- roundedbox.cpp \
- scene.cpp \
- trackball.cpp
-
-RESOURCES += boxes.qrc
-
-# install
-target.path = $$[QT_INSTALL_EXAMPLES]/widgets/graphicsview/boxes
-INSTALLS += target
diff --git a/examples/widgets/graphicsview/boxes/boxes.qrc b/examples/widgets/graphicsview/boxes/boxes.qrc
deleted file mode 100644
index d27506dc5a..0000000000
--- a/examples/widgets/graphicsview/boxes/boxes.qrc
+++ /dev/null
@@ -1,25 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource prefix="/res/boxes">
- <file>cubemap_negx.jpg</file>
- <file>cubemap_negy.jpg</file>
- <file>cubemap_negz.jpg</file>
- <file>cubemap_posx.jpg</file>
- <file>cubemap_posy.jpg</file>
- <file>cubemap_posz.jpg</file>
- <file>square.jpg</file>
- <file>basic.vsh</file>
- <file>basic.fsh</file>
- <file>dotted.fsh</file>
- <file>fresnel.fsh</file>
- <file>glass.fsh</file>
- <file>granite.fsh</file>
- <file>marble.fsh</file>
- <file>reflection.fsh</file>
- <file>refraction.fsh</file>
- <file>wood.fsh</file>
- <file>parameters.par</file>
- <file>qt-logo.png</file>
- <file>smiley.png</file>
- <file>qt-logo.jpg</file>
-</qresource>
-</RCC>
diff --git a/examples/widgets/graphicsview/boxes/cubemap_negx.jpg b/examples/widgets/graphicsview/boxes/cubemap_negx.jpg
deleted file mode 100644
index 07c282eab9..0000000000
--- a/examples/widgets/graphicsview/boxes/cubemap_negx.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/widgets/graphicsview/boxes/cubemap_negy.jpg b/examples/widgets/graphicsview/boxes/cubemap_negy.jpg
deleted file mode 100644
index 46cd2f9cf3..0000000000
--- a/examples/widgets/graphicsview/boxes/cubemap_negy.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/widgets/graphicsview/boxes/cubemap_negz.jpg b/examples/widgets/graphicsview/boxes/cubemap_negz.jpg
deleted file mode 100644
index 40c01ddff3..0000000000
--- a/examples/widgets/graphicsview/boxes/cubemap_negz.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/widgets/graphicsview/boxes/cubemap_posx.jpg b/examples/widgets/graphicsview/boxes/cubemap_posx.jpg
deleted file mode 100644
index 0b42e8a1b1..0000000000
--- a/examples/widgets/graphicsview/boxes/cubemap_posx.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/widgets/graphicsview/boxes/cubemap_posy.jpg b/examples/widgets/graphicsview/boxes/cubemap_posy.jpg
deleted file mode 100644
index 2aca9b1e98..0000000000
--- a/examples/widgets/graphicsview/boxes/cubemap_posy.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/widgets/graphicsview/boxes/cubemap_posz.jpg b/examples/widgets/graphicsview/boxes/cubemap_posz.jpg
deleted file mode 100644
index 2e49173848..0000000000
--- a/examples/widgets/graphicsview/boxes/cubemap_posz.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/widgets/graphicsview/boxes/dotted.fsh b/examples/widgets/graphicsview/boxes/dotted.fsh
deleted file mode 100644
index 5cbf590e21..0000000000
--- a/examples/widgets/graphicsview/boxes/dotted.fsh
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the demonstration applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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$
-**
-****************************************************************************/
-
-varying vec3 position, normal;
-varying vec4 specular, ambient, diffuse, lightDirection;
-
-uniform sampler2D tex;
-
-void main()
-{
- vec3 N = normalize(normal);
-
- gl_MaterialParameters M = gl_FrontMaterial;
-
- // assume directional light
- float NdotL = dot(N, lightDirection.xyz);
- float RdotL = dot(reflect(normalize(position), N), lightDirection.xyz);
-
- float r1 = length(fract(7.0 * gl_TexCoord[1].xyz) - 0.5);
- float r2 = length(fract(5.0 * gl_TexCoord[1].xyz + 0.2) - 0.5);
- float r3 = length(fract(11.0 * gl_TexCoord[1].xyz + 0.7) - 0.5);
- vec4 rs = vec4(r1, r2, r3, 0.0);
-
- vec4 unlitColor = gl_Color * (0.8 - clamp(10.0 * (0.4 - rs), 0.0, 0.2));
- unlitColor.w = 1.0;
- gl_FragColor = (ambient + diffuse * max(NdotL, 0.0)) * unlitColor +
- M.specular * specular * pow(max(RdotL, 0.0), M.shininess);
-}
diff --git a/examples/widgets/graphicsview/boxes/fresnel.fsh b/examples/widgets/graphicsview/boxes/fresnel.fsh
deleted file mode 100644
index 6758ad5770..0000000000
--- a/examples/widgets/graphicsview/boxes/fresnel.fsh
+++ /dev/null
@@ -1,88 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the demonstration applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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$
-**
-****************************************************************************/
-
-varying vec3 position, normal;
-varying vec4 specular, ambient, diffuse, lightDirection;
-
-uniform sampler2D tex;
-uniform samplerCube env;
-uniform mat4 view;
-uniform vec4 basicColor;
-
-void main()
-{
- vec3 N = normalize(normal);
- // assume directional light
-
- gl_MaterialParameters M = gl_FrontMaterial;
-
- float NdotL = dot(N, lightDirection.xyz);
- float RdotL = dot(reflect(normalize(position), N), lightDirection.xyz);
-
- vec3 absN = abs(gl_TexCoord[1].xyz);
- vec3 texCoord;
- if (absN.x > absN.y && absN.x > absN.z)
- texCoord = gl_TexCoord[1].yzx;
- else if (absN.y > absN.z)
- texCoord = gl_TexCoord[1].zxy;
- else
- texCoord = gl_TexCoord[1].xyz;
- texCoord.y *= -sign(texCoord.z);
- texCoord += 0.5;
-
- vec4 texColor = texture2D(tex, texCoord.xy);
- vec4 unlitColor = gl_Color * mix(basicColor, vec4(texColor.xyz, 1.0), texColor.w);
- vec4 litColor = (ambient + diffuse * max(NdotL, 0.0)) * unlitColor +
- M.specular * specular * pow(max(RdotL, 0.0), M.shininess);
-
- vec3 R = 2.0 * dot(-position, N) * N + position;
- vec4 reflectedColor = textureCube(env, R * mat3(view[0].xyz, view[1].xyz, view[2].xyz));
- gl_FragColor = mix(litColor, reflectedColor, 0.2 + 0.8 * pow(1.0 + dot(N, normalize(position)), 2.0));
-}
diff --git a/examples/widgets/graphicsview/boxes/glass.fsh b/examples/widgets/graphicsview/boxes/glass.fsh
deleted file mode 100644
index 528d04e4d3..0000000000
--- a/examples/widgets/graphicsview/boxes/glass.fsh
+++ /dev/null
@@ -1,85 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the demonstration applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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$
-**
-****************************************************************************/
-
-varying vec3 position, normal;
-varying vec4 specular, ambient, diffuse, lightDirection;
-
-uniform sampler2D tex;
-uniform samplerCube env;
-uniform mat4 view;
-
-// Some arbitrary values
-// Arrays don't work here on glsl < 120, apparently.
-//const float coeffs[6] = float[6](1.0/4.0, 1.0/4.1, 1.0/4.2, 1.0/4.3, 1.0/4.4, 1.0/4.5);
-float coeffs(int i)
-{
- return 1.0 / (3.0 + 0.1 * float(i));
-}
-
-void main()
-{
- vec3 N = normalize(normal);
- vec3 I = -normalize(position);
- mat3 V = mat3(view[0].xyz, view[1].xyz, view[2].xyz);
- float IdotN = dot(I, N);
- float scales[6];
- vec3 C[6];
- for (int i = 0; i < 6; ++i) {
- scales[i] = (IdotN - sqrt(1.0 - coeffs(i) + coeffs(i) * (IdotN * IdotN)));
- C[i] = textureCube(env, (-I + coeffs(i) * N) * V).xyz;
- }
- vec4 refractedColor = 0.25 * vec4(C[5].x + 2.0*C[0].x + C[1].x, C[1].y + 2.0*C[2].y + C[3].y,
- C[3].z + 2.0*C[4].z + C[5].z, 4.0);
-
- vec3 R = 2.0 * dot(-position, N) * N + position;
- vec4 reflectedColor = textureCube(env, R * V);
-
- gl_FragColor = mix(refractedColor, reflectedColor, 0.4 + 0.6 * pow(1.0 - IdotN, 2.0));
-}
diff --git a/examples/widgets/graphicsview/boxes/glbuffers.cpp b/examples/widgets/graphicsview/boxes/glbuffers.cpp
deleted file mode 100644
index 91de336af3..0000000000
--- a/examples/widgets/graphicsview/boxes/glbuffers.cpp
+++ /dev/null
@@ -1,406 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the demonstration applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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 "glbuffers.h"
-
-void qgluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar)
-{
- const GLdouble ymax = zNear * tan(qDegreesToRadians(fovy) / 2.0);
- const GLdouble ymin = -ymax;
- const GLdouble xmin = ymin * aspect;
- const GLdouble xmax = ymax * aspect;
- glFrustum(xmin, xmax, ymin, ymax, zNear, zFar);
-}
-
-//============================================================================//
-// GLTexture //
-//============================================================================//
-
-GLTexture::GLTexture()
-{
- glGenTextures(1, &m_texture);
-}
-
-GLTexture::~GLTexture()
-{
- glDeleteTextures(1, &m_texture);
-}
-
-//============================================================================//
-// GLTexture2D //
-//============================================================================//
-
-GLTexture2D::GLTexture2D(int width, int height)
-{
- glBindTexture(GL_TEXTURE_2D, m_texture);
- glTexImage2D(GL_TEXTURE_2D, 0, 4, width, height, 0,
- GL_BGRA, GL_UNSIGNED_BYTE, nullptr);
-
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
- //glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
- glBindTexture(GL_TEXTURE_2D, 0);
-}
-
-
-GLTexture2D::GLTexture2D(const QString &fileName, int width, int height)
-{
- // TODO: Add error handling.
- QImage image(fileName);
-
- if (image.isNull()) {
- m_failed = true;
- return;
- }
-
- image = image.convertToFormat(QImage::Format_ARGB32);
-
- //qDebug() << "Image size:" << image.width() << "x" << image.height();
- if (width <= 0)
- width = image.width();
- if (height <= 0)
- height = image.height();
- if (width != image.width() || height != image.height())
- image = image.scaled(width, height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
-
- glBindTexture(GL_TEXTURE_2D, m_texture);
-
- // Works on x86, so probably works on all little-endian systems.
- // Does it work on big-endian systems?
- glTexImage2D(GL_TEXTURE_2D, 0, 4, image.width(), image.height(), 0,
- GL_BGRA, GL_UNSIGNED_BYTE, image.bits());
-
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
- //glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
- glBindTexture(GL_TEXTURE_2D, 0);
-}
-
-void GLTexture2D::load(int width, int height, QRgb *data)
-{
- glBindTexture(GL_TEXTURE_2D, m_texture);
- glTexImage2D(GL_TEXTURE_2D, 0, 4, width, height, 0,
- GL_BGRA, GL_UNSIGNED_BYTE, data);
- glBindTexture(GL_TEXTURE_2D, 0);
-}
-
-void GLTexture2D::bind()
-{
- glBindTexture(GL_TEXTURE_2D, m_texture);
- glEnable(GL_TEXTURE_2D);
-}
-
-void GLTexture2D::unbind()
-{
- glBindTexture(GL_TEXTURE_2D, 0);
- glDisable(GL_TEXTURE_2D);
-}
-
-
-//============================================================================//
-// GLTexture3D //
-//============================================================================//
-
-GLTexture3D::GLTexture3D(int width, int height, int depth)
-{
- GLBUFFERS_ASSERT_OPENGL("GLTexture3D::GLTexture3D", glTexImage3D, return)
-
- glBindTexture(GL_TEXTURE_3D, m_texture);
- glTexImage3D(GL_TEXTURE_3D, 0, 4, width, height, depth, 0,
- GL_BGRA, GL_UNSIGNED_BYTE, nullptr);
-
- glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_REPEAT);
- glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_REPEAT);
- glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_REPEAT);
- glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- //glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
- //glTexParameteri(GL_TEXTURE_3D, GL_GENERATE_MIPMAP, GL_TRUE);
- glBindTexture(GL_TEXTURE_3D, 0);
-}
-
-void GLTexture3D::load(int width, int height, int depth, QRgb *data)
-{
- GLBUFFERS_ASSERT_OPENGL("GLTexture3D::load", glTexImage3D, return)
-
- glBindTexture(GL_TEXTURE_3D, m_texture);
- glTexImage3D(GL_TEXTURE_3D, 0, 4, width, height, depth, 0,
- GL_BGRA, GL_UNSIGNED_BYTE, data);
- glBindTexture(GL_TEXTURE_3D, 0);
-}
-
-void GLTexture3D::bind()
-{
- glBindTexture(GL_TEXTURE_3D, m_texture);
- glEnable(GL_TEXTURE_3D);
-}
-
-void GLTexture3D::unbind()
-{
- glBindTexture(GL_TEXTURE_3D, 0);
- glDisable(GL_TEXTURE_3D);
-}
-
-//============================================================================//
-// GLTextureCube //
-//============================================================================//
-
-GLTextureCube::GLTextureCube(int size)
-{
- glBindTexture(GL_TEXTURE_CUBE_MAP, m_texture);
-
- for (int i = 0; i < 6; ++i)
- glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, 4, size, size, 0,
- GL_BGRA, GL_UNSIGNED_BYTE, nullptr);
-
- glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
- glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- //glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
- //glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_GENERATE_MIPMAP, GL_TRUE);
- glBindTexture(GL_TEXTURE_CUBE_MAP, 0);
-}
-
-GLTextureCube::GLTextureCube(const QStringList &fileNames, int size)
-{
- // TODO: Add error handling.
-
- glBindTexture(GL_TEXTURE_CUBE_MAP, m_texture);
-
- int index = 0;
- for (const QString &file : fileNames) {
- QImage image(file);
- if (image.isNull()) {
- m_failed = true;
- break;
- }
-
- image = image.convertToFormat(QImage::Format_ARGB32);
-
- //qDebug() << "Image size:" << image.width() << "x" << image.height();
- if (size <= 0)
- size = image.width();
- if (size != image.width() || size != image.height())
- image = image.scaled(size, size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
-
- // Works on x86, so probably works on all little-endian systems.
- // Does it work on big-endian systems?
- glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + index, 0, 4, image.width(), image.height(), 0,
- GL_BGRA, GL_UNSIGNED_BYTE, image.bits());
-
- if (++index == 6)
- break;
- }
-
- // Clear remaining faces.
- while (index < 6) {
- glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + index, 0, 4, size, size, 0,
- GL_BGRA, GL_UNSIGNED_BYTE, nullptr);
- ++index;
- }
-
- glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
- glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- //glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
- //glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_GENERATE_MIPMAP, GL_TRUE);
- glBindTexture(GL_TEXTURE_CUBE_MAP, 0);
-}
-
-void GLTextureCube::load(int size, int face, QRgb *data)
-{
- glBindTexture(GL_TEXTURE_CUBE_MAP, m_texture);
- glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, 0, 4, size, size, 0,
- GL_BGRA, GL_UNSIGNED_BYTE, data);
- glBindTexture(GL_TEXTURE_CUBE_MAP, 0);
-}
-
-void GLTextureCube::bind()
-{
- glBindTexture(GL_TEXTURE_CUBE_MAP, m_texture);
- glEnable(GL_TEXTURE_CUBE_MAP);
-}
-
-void GLTextureCube::unbind()
-{
- glBindTexture(GL_TEXTURE_CUBE_MAP, 0);
- glDisable(GL_TEXTURE_CUBE_MAP);
-}
-
-//============================================================================//
-// GLFrameBufferObject //
-//============================================================================//
-
-GLFrameBufferObject::GLFrameBufferObject(int width, int height)
- : m_width(width)
- , m_height(height)
-{
- GLBUFFERS_ASSERT_OPENGL("GLFrameBufferObject::GLFrameBufferObject",
- glGenFramebuffersEXT && glGenRenderbuffersEXT && glBindRenderbufferEXT && glRenderbufferStorageEXT, return)
-
- // TODO: share depth buffers of same size
- glGenFramebuffersEXT(1, &m_fbo);
- //glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
- glGenRenderbuffersEXT(1, &m_depthBuffer);
- glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, m_depthBuffer);
- glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, m_width, m_height);
- //glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_depthBuffer);
- //glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
-}
-
-GLFrameBufferObject::~GLFrameBufferObject()
-{
- GLBUFFERS_ASSERT_OPENGL("GLFrameBufferObject::~GLFrameBufferObject",
- glDeleteFramebuffersEXT && glDeleteRenderbuffersEXT, return)
-
- glDeleteFramebuffersEXT(1, &m_fbo);
- glDeleteRenderbuffersEXT(1, &m_depthBuffer);
-}
-
-void GLFrameBufferObject::setAsRenderTarget(bool state)
-{
- GLBUFFERS_ASSERT_OPENGL("GLFrameBufferObject::setAsRenderTarget", glBindFramebufferEXT, return)
-
- if (state) {
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
- glPushAttrib(GL_VIEWPORT_BIT);
- glViewport(0, 0, m_width, m_height);
- } else {
- glPopAttrib();
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
- }
-}
-
-bool GLFrameBufferObject::isComplete()
-{
- GLBUFFERS_ASSERT_OPENGL("GLFrameBufferObject::isComplete", glCheckFramebufferStatusEXT, return false)
-
- return GL_FRAMEBUFFER_COMPLETE_EXT == glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
-}
-
-//============================================================================//
-// GLRenderTargetCube //
-//============================================================================//
-
-GLRenderTargetCube::GLRenderTargetCube(int size)
- : GLTextureCube(size)
- , m_fbo(size, size)
-{
-}
-
-void GLRenderTargetCube::begin(int face)
-{
- GLBUFFERS_ASSERT_OPENGL("GLRenderTargetCube::begin",
- glFramebufferTexture2DEXT && glFramebufferRenderbufferEXT, return)
-
- m_fbo.setAsRenderTarget(true);
- glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
- GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, m_texture, 0);
- glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_fbo.m_depthBuffer);
-}
-
-void GLRenderTargetCube::end()
-{
- m_fbo.setAsRenderTarget(false);
-}
-
-void GLRenderTargetCube::getViewMatrix(QMatrix4x4& mat, int face)
-{
- if (face < 0 || face >= 6) {
- qWarning("GLRenderTargetCube::getViewMatrix: 'face' must be in the range [0, 6). (face == %d)", face);
- return;
- }
-
- static constexpr int perm[6][3] = {
- {2, 1, 0},
- {2, 1, 0},
- {0, 2, 1},
- {0, 2, 1},
- {0, 1, 2},
- {0, 1, 2},
- };
-
- static constexpr float signs[6][3] = {
- {-1.0f, -1.0f, -1.0f},
- {+1.0f, -1.0f, +1.0f},
- {+1.0f, +1.0f, -1.0f},
- {+1.0f, -1.0f, +1.0f},
- {+1.0f, -1.0f, -1.0f},
- {-1.0f, -1.0f, +1.0f},
- };
-
- mat.fill(0.0f);
- for (int i = 0; i < 3; ++i)
- mat(i, perm[face][i]) = signs[face][i];
- mat(3, 3) = 1.0f;
-}
-
-void GLRenderTargetCube::getProjectionMatrix(QMatrix4x4& mat, float nearZ, float farZ)
-{
- static const QMatrix4x4 reference(
- 1.0f, 0.0f, 0.0f, 0.0f,
- 0.0f, 1.0f, 0.0f, 0.0f,
- 0.0f, 0.0f, 0.0f, 0.0f,
- 0.0f, 0.0f, -1.0f, 0.0f);
-
- mat = reference;
- mat(2, 2) = (nearZ+farZ)/(nearZ-farZ);
- mat(2, 3) = 2.0f*nearZ*farZ/(nearZ-farZ);
-}
diff --git a/examples/widgets/graphicsview/boxes/glbuffers.h b/examples/widgets/graphicsview/boxes/glbuffers.h
deleted file mode 100644
index 4318e8ac24..0000000000
--- a/examples/widgets/graphicsview/boxes/glbuffers.h
+++ /dev/null
@@ -1,372 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the demonstration applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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$
-**
-****************************************************************************/
-
-#ifndef GLBUFFERS_H
-#define GLBUFFERS_H
-
-//#include <GL/glew.h>
-#include "glextensions.h"
-
-#include <QtWidgets>
-#include <QtOpenGL>
-
-#define BUFFER_OFFSET(i) ((char*)0 + (i))
-#define SIZE_OF_MEMBER(cls, member) sizeof(static_cast<cls *>(nullptr)->member)
-
-#define GLBUFFERS_ASSERT_OPENGL(prefix, assertion, returnStatement) \
-if (m_failed || !(assertion)) { \
- if (!m_failed) qCritical(prefix ": The necessary OpenGL functions are not available."); \
- m_failed = true; \
- returnStatement; \
-}
-
-void qgluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
-
-QT_BEGIN_NAMESPACE
-class QMatrix4x4;
-QT_END_NAMESPACE
-
-class GLTexture
-{
-public:
- GLTexture();
- virtual ~GLTexture();
- virtual void bind() = 0;
- virtual void unbind() = 0;
- virtual bool failed() const {return m_failed;}
-protected:
- GLuint m_texture = 0;
- bool m_failed = false;
-};
-
-class GLFrameBufferObject
-{
-public:
- friend class GLRenderTargetCube;
- // friend class GLRenderTarget2D;
-
- GLFrameBufferObject(int width, int height);
- virtual ~GLFrameBufferObject();
- bool isComplete();
- virtual bool failed() const {return m_failed;}
-protected:
- void setAsRenderTarget(bool state = true);
- GLuint m_fbo = 0;
- GLuint m_depthBuffer = 0;
- int m_width, m_height;
- bool m_failed = false;
-};
-
-class GLTexture2D : public GLTexture
-{
-public:
- GLTexture2D(int width, int height);
- explicit GLTexture2D(const QString &fileName, int width = 0, int height = 0);
- void load(int width, int height, QRgb *data);
- void bind() override;
- void unbind() override;
-};
-
-class GLTexture3D : public GLTexture
-{
-public:
- GLTexture3D(int width, int height, int depth);
- // TODO: Implement function below
- //GLTexture3D(const QString& fileName, int width = 0, int height = 0);
- void load(int width, int height, int depth, QRgb *data);
- void bind() override;
- void unbind() override;
-};
-
-class GLTextureCube : public GLTexture
-{
-public:
- GLTextureCube(int size);
- explicit GLTextureCube(const QStringList &fileNames, int size = 0);
- void load(int size, int face, QRgb *data);
- void bind() override;
- void unbind() override;
-};
-
-// TODO: Define and implement class below
-//class GLRenderTarget2D : public GLTexture2D
-
-class GLRenderTargetCube : public GLTextureCube
-{
-public:
- GLRenderTargetCube(int size);
- // begin rendering to one of the cube's faces. 0 <= face < 6
- void begin(int face);
- // end rendering
- void end();
- bool failed() const override { return m_failed || m_fbo.failed(); }
-
- static void getViewMatrix(QMatrix4x4& mat, int face);
- static void getProjectionMatrix(QMatrix4x4& mat, float nearZ, float farZ);
-private:
- GLFrameBufferObject m_fbo;
-};
-
-struct VertexDescription
-{
- enum
- {
- Null = 0, // Terminates a VertexDescription array
- Position,
- TexCoord,
- Normal,
- Color,
- };
- int field; // Position, TexCoord, Normal, Color
- int type; // GL_FLOAT, GL_UNSIGNED_BYTE
- int count; // number of elements
- int offset; // field's offset into vertex struct
- int index; // 0 (unused at the moment)
-};
-
-// Implementation of interleaved buffers.
-// 'T' is a struct which must include a null-terminated static array
-// 'VertexDescription* description'.
-// Example:
-/*
-struct Vertex
-{
- GLfloat position[3];
- GLfloat texCoord[2];
- GLfloat normal[3];
- GLbyte color[4];
- static VertexDescription description[];
-};
-
-VertexDescription Vertex::description[] = {
- {VertexDescription::Position, GL_FLOAT, SIZE_OF_MEMBER(Vertex, position) / sizeof(GLfloat), offsetof(Vertex, position), 0},
- {VertexDescription::TexCoord, GL_FLOAT, SIZE_OF_MEMBER(Vertex, texCoord) / sizeof(GLfloat), offsetof(Vertex, texCoord), 0},
- {VertexDescription::Normal, GL_FLOAT, SIZE_OF_MEMBER(Vertex, normal) / sizeof(GLfloat), offsetof(Vertex, normal), 0},
- {VertexDescription::Color, GL_BYTE, SIZE_OF_MEMBER(Vertex, color) / sizeof(GLbyte), offsetof(Vertex, color), 0},
- {VertexDescription::Null, 0, 0, 0, 0},
-};
-*/
-template<class T>
-class GLVertexBuffer
-{
-public:
- GLVertexBuffer(int length, const T *data = nullptr, int mode = GL_STATIC_DRAW)
- {
- GLBUFFERS_ASSERT_OPENGL("GLVertexBuffer::GLVertexBuffer", glGenBuffers && glBindBuffer && glBufferData, return)
-
- glGenBuffers(1, &m_buffer);
- glBindBuffer(GL_ARRAY_BUFFER, m_buffer);
- glBufferData(GL_ARRAY_BUFFER, (m_length = length) * sizeof(T), data, mode);
- }
-
- ~GLVertexBuffer()
- {
- GLBUFFERS_ASSERT_OPENGL("GLVertexBuffer::~GLVertexBuffer", glDeleteBuffers, return)
-
- glDeleteBuffers(1, &m_buffer);
- }
-
- void bind()
- {
- GLBUFFERS_ASSERT_OPENGL("GLVertexBuffer::bind", glBindBuffer, return)
-
- glBindBuffer(GL_ARRAY_BUFFER, m_buffer);
- for (VertexDescription *desc = T::description; desc->field != VertexDescription::Null; ++desc) {
- switch (desc->field) {
- case VertexDescription::Position:
- glVertexPointer(desc->count, desc->type, sizeof(T), BUFFER_OFFSET(desc->offset));
- glEnableClientState(GL_VERTEX_ARRAY);
- break;
- case VertexDescription::TexCoord:
- glTexCoordPointer(desc->count, desc->type, sizeof(T), BUFFER_OFFSET(desc->offset));
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- break;
- case VertexDescription::Normal:
- glNormalPointer(desc->type, sizeof(T), BUFFER_OFFSET(desc->offset));
- glEnableClientState(GL_NORMAL_ARRAY);
- break;
- case VertexDescription::Color:
- glColorPointer(desc->count, desc->type, sizeof(T), BUFFER_OFFSET(desc->offset));
- glEnableClientState(GL_COLOR_ARRAY);
- break;
- default:
- break;
- }
- }
- }
-
- void unbind()
- {
- GLBUFFERS_ASSERT_OPENGL("GLVertexBuffer::unbind", glBindBuffer, return)
-
- glBindBuffer(GL_ARRAY_BUFFER, 0);
- for (VertexDescription *desc = T::description; desc->field != VertexDescription::Null; ++desc) {
- switch (desc->field) {
- case VertexDescription::Position:
- glDisableClientState(GL_VERTEX_ARRAY);
- break;
- case VertexDescription::TexCoord:
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- break;
- case VertexDescription::Normal:
- glDisableClientState(GL_NORMAL_ARRAY);
- break;
- case VertexDescription::Color:
- glDisableClientState(GL_COLOR_ARRAY);
- break;
- default:
- break;
- }
- }
- }
-
- int length() const {return m_length;}
-
- T *lock()
- {
- GLBUFFERS_ASSERT_OPENGL("GLVertexBuffer::lock", glBindBuffer && glMapBuffer, return nullptr)
-
- glBindBuffer(GL_ARRAY_BUFFER, m_buffer);
- //glBufferData(GL_ARRAY_BUFFER, m_length, NULL, m_mode);
- GLvoid* buffer = glMapBuffer(GL_ARRAY_BUFFER, GL_READ_WRITE);
- m_failed = (buffer == nullptr);
- return reinterpret_cast<T *>(buffer);
- }
-
- void unlock()
- {
- GLBUFFERS_ASSERT_OPENGL("GLVertexBuffer::unlock", glBindBuffer && glUnmapBuffer, return)
-
- glBindBuffer(GL_ARRAY_BUFFER, m_buffer);
- glUnmapBuffer(GL_ARRAY_BUFFER);
- }
-
- bool failed()
- {
- return m_failed;
- }
-
-private:
- int m_length = 0;
- int m_mode = 0;
- GLuint m_buffer = 0;
- bool m_failed = false;
-};
-
-template<class T>
-class GLIndexBuffer
-{
-public:
- GLIndexBuffer(int length, const T *data = nullptr, int mode = GL_STATIC_DRAW)
- : m_length(0)
- , m_mode(mode)
- , m_buffer(0)
- , m_failed(false)
- {
- GLBUFFERS_ASSERT_OPENGL("GLIndexBuffer::GLIndexBuffer", glGenBuffers && glBindBuffer && glBufferData, return)
-
- glGenBuffers(1, &m_buffer);
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_buffer);
- glBufferData(GL_ELEMENT_ARRAY_BUFFER, (m_length = length) * sizeof(T), data, mode);
- }
-
- ~GLIndexBuffer()
- {
- GLBUFFERS_ASSERT_OPENGL("GLIndexBuffer::~GLIndexBuffer", glDeleteBuffers, return)
-
- glDeleteBuffers(1, &m_buffer);
- }
-
- void bind()
- {
- GLBUFFERS_ASSERT_OPENGL("GLIndexBuffer::bind", glBindBuffer, return)
-
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_buffer);
- }
-
- void unbind()
- {
- GLBUFFERS_ASSERT_OPENGL("GLIndexBuffer::unbind", glBindBuffer, return)
-
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
- }
-
- int length() const {return m_length;}
-
- T *lock()
- {
- GLBUFFERS_ASSERT_OPENGL("GLIndexBuffer::lock", glBindBuffer && glMapBuffer, return nullptr)
-
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_buffer);
- GLvoid* buffer = glMapBuffer(GL_ELEMENT_ARRAY_BUFFER, GL_READ_WRITE);
- m_failed = (buffer == nullptr);
- return reinterpret_cast<T *>(buffer);
- }
-
- void unlock()
- {
- GLBUFFERS_ASSERT_OPENGL("GLIndexBuffer::unlock", glBindBuffer && glUnmapBuffer, return)
-
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_buffer);
- glUnmapBuffer(GL_ELEMENT_ARRAY_BUFFER);
- }
-
- bool failed()
- {
- return m_failed;
- }
-
-private:
- int m_length, m_mode;
- GLuint m_buffer;
- bool m_failed;
-};
-
-#endif
diff --git a/examples/widgets/graphicsview/boxes/glextensions.cpp b/examples/widgets/graphicsview/boxes/glextensions.cpp
deleted file mode 100644
index ac89911046..0000000000
--- a/examples/widgets/graphicsview/boxes/glextensions.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the demonstration applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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 "glextensions.h"
-
-#define RESOLVE_GL_FUNC(f) ok &= bool((f = (_gl##f) context->getProcAddress(QLatin1String("gl" #f))));
-
-bool GLExtensionFunctions::resolve(const QGLContext *context)
-{
- bool ok = true;
-
- RESOLVE_GL_FUNC(GenFramebuffersEXT)
- RESOLVE_GL_FUNC(GenRenderbuffersEXT)
- RESOLVE_GL_FUNC(BindRenderbufferEXT)
- RESOLVE_GL_FUNC(RenderbufferStorageEXT)
- RESOLVE_GL_FUNC(DeleteFramebuffersEXT)
- RESOLVE_GL_FUNC(DeleteRenderbuffersEXT)
- RESOLVE_GL_FUNC(BindFramebufferEXT)
- RESOLVE_GL_FUNC(FramebufferTexture2DEXT)
- RESOLVE_GL_FUNC(FramebufferRenderbufferEXT)
- RESOLVE_GL_FUNC(CheckFramebufferStatusEXT)
-
- RESOLVE_GL_FUNC(ActiveTexture)
- RESOLVE_GL_FUNC(TexImage3D)
-
- RESOLVE_GL_FUNC(GenBuffers)
- RESOLVE_GL_FUNC(BindBuffer)
- RESOLVE_GL_FUNC(BufferData)
- RESOLVE_GL_FUNC(DeleteBuffers)
- RESOLVE_GL_FUNC(MapBuffer)
- RESOLVE_GL_FUNC(UnmapBuffer)
-
- return ok;
-}
-
-bool GLExtensionFunctions::fboSupported() {
- return GenFramebuffersEXT
- && GenRenderbuffersEXT
- && BindRenderbufferEXT
- && RenderbufferStorageEXT
- && DeleteFramebuffersEXT
- && DeleteRenderbuffersEXT
- && BindFramebufferEXT
- && FramebufferTexture2DEXT
- && FramebufferRenderbufferEXT
- && CheckFramebufferStatusEXT;
-}
-
-bool GLExtensionFunctions::openGL15Supported() {
- return ActiveTexture
- && TexImage3D
- && GenBuffers
- && BindBuffer
- && BufferData
- && DeleteBuffers
- && MapBuffer
- && UnmapBuffer;
-}
-
-#undef RESOLVE_GL_FUNC
diff --git a/examples/widgets/graphicsview/boxes/glextensions.h b/examples/widgets/graphicsview/boxes/glextensions.h
deleted file mode 100644
index 685700d866..0000000000
--- a/examples/widgets/graphicsview/boxes/glextensions.h
+++ /dev/null
@@ -1,204 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the demonstration applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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$
-**
-****************************************************************************/
-
-#ifndef GLEXTENSIONS_H
-#define GLEXTENSIONS_H
-
-#include <QtOpenGL>
-
-/*
-Functions resolved:
-
-glGenFramebuffersEXT
-glGenRenderbuffersEXT
-glBindRenderbufferEXT
-glRenderbufferStorageEXT
-glDeleteFramebuffersEXT
-glDeleteRenderbuffersEXT
-glBindFramebufferEXT
-glFramebufferTexture2DEXT
-glFramebufferRenderbufferEXT
-glCheckFramebufferStatusEXT
-
-glActiveTexture
-glTexImage3D
-
-glGenBuffers
-glBindBuffer
-glBufferData
-glDeleteBuffers
-glMapBuffer
-glUnmapBuffer
-*/
-
-#ifndef APIENTRY
-# define APIENTRY
-#endif
-#ifndef APIENTRYP
-# define APIENTRYP APIENTRY *
-#endif
-
-#ifndef GL_VERSION_1_2
-#define GL_TEXTURE_3D 0x806F
-#define GL_TEXTURE_WRAP_R 0x8072
-#define GL_CLAMP_TO_EDGE 0x812F
-#define GL_BGRA 0x80E1
-#endif
-
-#ifndef GL_VERSION_1_3
-#define GL_TEXTURE0 0x84C0
-#define GL_TEXTURE1 0x84C1
-#define GL_TEXTURE2 0x84C2
-#define GL_TEXTURE_CUBE_MAP 0x8513
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
-//#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
-//#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
-//#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
-//#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
-//#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
-#endif
-
-#ifndef GL_ARB_vertex_buffer_object
-typedef ptrdiff_t GLsizeiptrARB;
-#endif
-
-#ifndef GL_VERSION_1_5
-#define GL_ARRAY_BUFFER 0x8892
-#define GL_ELEMENT_ARRAY_BUFFER 0x8893
-#define GL_READ_WRITE 0x88BA
-#define GL_STATIC_DRAW 0x88E4
-#endif
-
-#ifndef GL_EXT_framebuffer_object
-#define GL_RENDERBUFFER_EXT 0x8D41
-#define GL_FRAMEBUFFER_EXT 0x8D40
-#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5
-#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0
-#define GL_DEPTH_ATTACHMENT_EXT 0x8D00
-#endif
-
-typedef void (APIENTRY *_glGenFramebuffersEXT) (GLsizei, GLuint *);
-typedef void (APIENTRY *_glGenRenderbuffersEXT) (GLsizei, GLuint *);
-typedef void (APIENTRY *_glBindRenderbufferEXT) (GLenum, GLuint);
-typedef void (APIENTRY *_glRenderbufferStorageEXT) (GLenum, GLenum, GLsizei, GLsizei);
-typedef void (APIENTRY *_glDeleteFramebuffersEXT) (GLsizei, const GLuint*);
-typedef void (APIENTRY *_glDeleteRenderbuffersEXT) (GLsizei, const GLuint*);
-typedef void (APIENTRY *_glBindFramebufferEXT) (GLenum, GLuint);
-typedef void (APIENTRY *_glFramebufferTexture2DEXT) (GLenum, GLenum, GLenum, GLuint, GLint);
-typedef void (APIENTRY *_glFramebufferRenderbufferEXT) (GLenum, GLenum, GLenum, GLuint);
-typedef GLenum (APIENTRY *_glCheckFramebufferStatusEXT) (GLenum);
-
-typedef void (APIENTRY *_glActiveTexture) (GLenum);
-typedef void (APIENTRY *_glTexImage3D) (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
-
-typedef void (APIENTRY *_glGenBuffers) (GLsizei, GLuint *);
-typedef void (APIENTRY *_glBindBuffer) (GLenum, GLuint);
-typedef void (APIENTRY *_glBufferData) (GLenum, GLsizeiptrARB, const GLvoid *, GLenum);
-typedef void (APIENTRY *_glDeleteBuffers) (GLsizei, const GLuint *);
-typedef void *(APIENTRY *_glMapBuffer) (GLenum, GLenum);
-typedef GLboolean (APIENTRY *_glUnmapBuffer) (GLenum);
-
-struct GLExtensionFunctions
-{
- bool resolve(const QGLContext *context);
-
- bool fboSupported();
- bool openGL15Supported(); // the rest: multi-texture, 3D-texture, vertex buffer objects
-
- _glGenFramebuffersEXT GenFramebuffersEXT;
- _glGenRenderbuffersEXT GenRenderbuffersEXT;
- _glBindRenderbufferEXT BindRenderbufferEXT;
- _glRenderbufferStorageEXT RenderbufferStorageEXT;
- _glDeleteFramebuffersEXT DeleteFramebuffersEXT;
- _glDeleteRenderbuffersEXT DeleteRenderbuffersEXT;
- _glBindFramebufferEXT BindFramebufferEXT;
- _glFramebufferTexture2DEXT FramebufferTexture2DEXT;
- _glFramebufferRenderbufferEXT FramebufferRenderbufferEXT;
- _glCheckFramebufferStatusEXT CheckFramebufferStatusEXT;
-
- _glActiveTexture ActiveTexture;
- _glTexImage3D TexImage3D;
-
- _glGenBuffers GenBuffers;
- _glBindBuffer BindBuffer;
- _glBufferData BufferData;
- _glDeleteBuffers DeleteBuffers;
- _glMapBuffer MapBuffer;
- _glUnmapBuffer UnmapBuffer;
-};
-
-inline GLExtensionFunctions &getGLExtensionFunctions()
-{
- static GLExtensionFunctions funcs;
- return funcs;
-}
-
-#define glGenFramebuffersEXT getGLExtensionFunctions().GenFramebuffersEXT
-#define glGenRenderbuffersEXT getGLExtensionFunctions().GenRenderbuffersEXT
-#define glBindRenderbufferEXT getGLExtensionFunctions().BindRenderbufferEXT
-#define glRenderbufferStorageEXT getGLExtensionFunctions().RenderbufferStorageEXT
-#define glDeleteFramebuffersEXT getGLExtensionFunctions().DeleteFramebuffersEXT
-#define glDeleteRenderbuffersEXT getGLExtensionFunctions().DeleteRenderbuffersEXT
-#define glBindFramebufferEXT getGLExtensionFunctions().BindFramebufferEXT
-#define glFramebufferTexture2DEXT getGLExtensionFunctions().FramebufferTexture2DEXT
-#define glFramebufferRenderbufferEXT getGLExtensionFunctions().FramebufferRenderbufferEXT
-#define glCheckFramebufferStatusEXT getGLExtensionFunctions().CheckFramebufferStatusEXT
-
-#define glActiveTexture getGLExtensionFunctions().ActiveTexture
-#define glTexImage3D getGLExtensionFunctions().TexImage3D
-
-#define glGenBuffers getGLExtensionFunctions().GenBuffers
-#define glBindBuffer getGLExtensionFunctions().BindBuffer
-#define glBufferData getGLExtensionFunctions().BufferData
-#define glDeleteBuffers getGLExtensionFunctions().DeleteBuffers
-#define glMapBuffer getGLExtensionFunctions().MapBuffer
-#define glUnmapBuffer getGLExtensionFunctions().UnmapBuffer
-
-#endif
diff --git a/examples/widgets/graphicsview/boxes/gltrianglemesh.h b/examples/widgets/graphicsview/boxes/gltrianglemesh.h
deleted file mode 100644
index e5c4f51514..0000000000
--- a/examples/widgets/graphicsview/boxes/gltrianglemesh.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the demonstration applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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$
-**
-****************************************************************************/
-
-#ifndef GLTRIANGLEMESH_H
-#define GLTRIANGLEMESH_H
-
-#include "glbuffers.h"
-#include "glextensions.h"
-
-#include <QtWidgets>
-#include <QtOpenGL>
-
-
-template<class TVertex, class TIndex>
-class GLTriangleMesh
-{
-public:
- GLTriangleMesh(int vertexCount, int indexCount) : m_vb(vertexCount), m_ib(indexCount)
- {
- }
-
- virtual ~GLTriangleMesh()
- {
- }
-
- virtual void draw()
- {
- if (failed())
- return;
-
- int type = GL_UNSIGNED_INT;
- if (sizeof(TIndex) == sizeof(char)) type = GL_UNSIGNED_BYTE;
- if (sizeof(TIndex) == sizeof(short)) type = GL_UNSIGNED_SHORT;
-
- m_vb.bind();
- m_ib.bind();
- glDrawElements(GL_TRIANGLES, m_ib.length(), type, BUFFER_OFFSET(0));
- m_vb.unbind();
- m_ib.unbind();
- }
-
- bool failed()
- {
- return m_vb.failed() || m_ib.failed();
- }
-protected:
- GLVertexBuffer<TVertex> m_vb;
- GLIndexBuffer<TIndex> m_ib;
-};
-
-
-#endif
diff --git a/examples/widgets/graphicsview/boxes/granite.fsh b/examples/widgets/graphicsview/boxes/granite.fsh
deleted file mode 100644
index 5dcde5d2b1..0000000000
--- a/examples/widgets/graphicsview/boxes/granite.fsh
+++ /dev/null
@@ -1,85 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the demonstration applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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$
-**
-****************************************************************************/
-
-varying vec3 position, normal;
-varying vec4 specular, ambient, diffuse, lightDirection;
-
-uniform sampler2D tex;
-uniform sampler3D noise;
-
-//const vec4 graniteColors[3] = {vec4(0.0, 0.0, 0.0, 1), vec4(0.30, 0.15, 0.10, 1), vec4(0.80, 0.70, 0.75, 1)};
-uniform vec4 graniteColors[3];
-
-float steep(float x)
-{
- return clamp(5.0 * x - 2.0, 0.0, 1.0);
-}
-
-void main()
-{
- vec2 turbulence = vec2(0, 0);
- float scale = 1.0;
- for (int i = 0; i < 4; ++i) {
- turbulence += scale * (texture3D(noise, gl_TexCoord[1].xyz / scale).xy - 0.5);
- scale *= 0.5;
- }
-
- vec3 N = normalize(normal);
- // assume directional light
-
- gl_MaterialParameters M = gl_FrontMaterial;
-
- float NdotL = dot(N, lightDirection.xyz);
- float RdotL = dot(reflect(normalize(position), N), lightDirection.xyz);
-
- vec4 unlitColor = mix(graniteColors[1], mix(graniteColors[0], graniteColors[2], steep(0.5 + turbulence.y)), 4.0 * abs(turbulence.x));
- gl_FragColor = (ambient + diffuse * max(NdotL, 0.0)) * unlitColor +
- M.specular * specular * pow(max(RdotL, 0.0), M.shininess);
-}
diff --git a/examples/widgets/graphicsview/boxes/main.cpp b/examples/widgets/graphicsview/boxes/main.cpp
deleted file mode 100644
index 2b3e6d3389..0000000000
--- a/examples/widgets/graphicsview/boxes/main.cpp
+++ /dev/null
@@ -1,157 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the demonstration applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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 "glextensions.h"
-#include "scene.h"
-
-#include <QGLWidget>
-#include <QtWidgets>
-
-class GraphicsView : public QGraphicsView
-{
-public:
- GraphicsView()
- {
- setWindowTitle(tr("Boxes"));
- setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
- //setRenderHints(QPainter::SmoothPixmapTransform);
- }
-
-protected:
- void resizeEvent(QResizeEvent *event) override {
- if (scene())
- scene()->setSceneRect(QRect(QPoint(0, 0), event->size()));
- QGraphicsView::resizeEvent(event);
- }
-};
-
-inline bool matchString(const char *extensionString, const char *subString)
-{
- int subStringLength = strlen(subString);
- return (strncmp(extensionString, subString, subStringLength) == 0)
- && ((extensionString[subStringLength] == ' ') || (extensionString[subStringLength] == '\0'));
-}
-
-bool necessaryExtensionsSupported()
-{
- const char *extensionString = reinterpret_cast<const char *>(glGetString(GL_EXTENSIONS));
- const char *p = extensionString;
-
- const int GL_EXT_FBO = 1;
- const int GL_ARB_VS = 2;
- const int GL_ARB_FS = 4;
- const int GL_ARB_SO = 8;
- int extensions = 0;
-
- while (*p) {
- if (matchString(p, "GL_EXT_framebuffer_object"))
- extensions |= GL_EXT_FBO;
- else if (matchString(p, "GL_ARB_vertex_shader"))
- extensions |= GL_ARB_VS;
- else if (matchString(p, "GL_ARB_fragment_shader"))
- extensions |= GL_ARB_FS;
- else if (matchString(p, "GL_ARB_shader_objects"))
- extensions |= GL_ARB_SO;
- while ((*p != ' ') && (*p != '\0'))
- ++p;
- if (*p == ' ')
- ++p;
- }
- return (extensions == 15);
-}
-
-int main(int argc, char **argv)
-{
- QApplication app(argc, argv);
-
- if ((QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_1_5) == 0) {
- QMessageBox::critical(nullptr, "OpenGL features missing",
- "OpenGL version 1.5 or higher is required to run this demo.\n"
- "The program will now exit.");
- return -1;
- }
-
- int maxTextureSize = 1024;
- QGLWidget *widget = new QGLWidget(QGLFormat(QGL::SampleBuffers));
- widget->makeCurrent();
-
- if (!necessaryExtensionsSupported()) {
- QMessageBox::critical(nullptr, "OpenGL features missing",
- "The OpenGL extensions required to run this demo are missing.\n"
- "The program will now exit.");
- delete widget;
- return -2;
- }
-
- // Check if all the necessary functions are resolved.
- if (!getGLExtensionFunctions().resolve(widget->context())) {
- QMessageBox::critical(nullptr, "OpenGL features missing",
- "Failed to resolve OpenGL functions required to run this demo.\n"
- "The program will now exit.");
- delete widget;
- return -3;
- }
-
- // TODO: Make conditional for final release
- QMessageBox::information(nullptr, "For your information",
- "This demo can be GPU and CPU intensive and may\n"
- "work poorly or not at all on your system.");
-
- widget->makeCurrent(); // The current context must be set before calling Scene's constructor
- Scene scene(1024, 768, maxTextureSize);
- GraphicsView view;
- view.setViewport(widget);
- view.setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
- view.setScene(&scene);
- view.show();
-
- return app.exec();
-}
-
diff --git a/examples/widgets/graphicsview/boxes/marble.fsh b/examples/widgets/graphicsview/boxes/marble.fsh
deleted file mode 100644
index c0b1980a67..0000000000
--- a/examples/widgets/graphicsview/boxes/marble.fsh
+++ /dev/null
@@ -1,80 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the demonstration applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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$
-**
-****************************************************************************/
-
-varying vec3 position, normal;
-varying vec4 specular, ambient, diffuse, lightDirection;
-
-uniform sampler2D tex;
-uniform sampler3D noise;
-
-//const vec4 marbleColors[2] = {vec4(0.9, 0.9, 0.9, 1), vec4(0.6, 0.5, 0.5, 1)};
-uniform vec4 marbleColors[2];
-
-void main()
-{
- float turbulence = 0.0;
- float scale = 1.0;
- for (int i = 0; i < 4; ++i) {
- turbulence += scale * (texture3D(noise, 0.125 * gl_TexCoord[1].xyz / scale).x - 0.5);
- scale *= 0.5;
- }
-
- vec3 N = normalize(normal);
- // assume directional light
-
- gl_MaterialParameters M = gl_FrontMaterial;
-
- float NdotL = dot(N, lightDirection.xyz);
- float RdotL = dot(reflect(normalize(position), N), lightDirection.xyz);
-
- vec4 unlitColor = mix(marbleColors[0], marbleColors[1], exp(-4.0 * abs(turbulence)));
- gl_FragColor = (ambient + diffuse * max(NdotL, 0.0)) * unlitColor +
- M.specular * specular * pow(max(RdotL, 0.0), M.shininess);
-}
diff --git a/examples/widgets/graphicsview/boxes/parameters.par b/examples/widgets/graphicsview/boxes/parameters.par
deleted file mode 100644
index 50e20739b9..0000000000
--- a/examples/widgets/graphicsview/boxes/parameters.par
+++ /dev/null
@@ -1,5 +0,0 @@
-color basicColor ff0e3d0e
-color woodColors ff5e3d33 ffcc9966
-float woodTubulence 0.1
-color graniteColors ff000000 ff4d261a ffccb3bf
-color marbleColors ffe6e6e6 ff998080
diff --git a/examples/widgets/graphicsview/boxes/qt-logo.jpg b/examples/widgets/graphicsview/boxes/qt-logo.jpg
deleted file mode 100644
index 8d7fab052a..0000000000
--- a/examples/widgets/graphicsview/boxes/qt-logo.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/widgets/graphicsview/boxes/qt-logo.png b/examples/widgets/graphicsview/boxes/qt-logo.png
deleted file mode 100644
index 0b0b15480c..0000000000
--- a/examples/widgets/graphicsview/boxes/qt-logo.png
+++ /dev/null
Binary files differ
diff --git a/examples/widgets/graphicsview/boxes/qtbox.cpp b/examples/widgets/graphicsview/boxes/qtbox.cpp
deleted file mode 100644
index 8713aac05d..0000000000
--- a/examples/widgets/graphicsview/boxes/qtbox.cpp
+++ /dev/null
@@ -1,470 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the demonstration applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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 "qtbox.h"
-
-constexpr qreal ROTATE_SPEED_X = 30.0 / 1000.0;
-constexpr qreal ROTATE_SPEED_Y = 20.0 / 1000.0;
-constexpr qreal ROTATE_SPEED_Z = 40.0 / 1000.0;
-constexpr int MAX_ITEM_SIZE = 512;
-constexpr int MIN_ITEM_SIZE = 16;
-
-//============================================================================//
-// ItemBase //
-//============================================================================//
-
-ItemBase::ItemBase(int size, int x, int y) : m_size(size), m_startTime(QTime::currentTime())
-{
- setFlag(QGraphicsItem::ItemIsMovable, true);
- setFlag(QGraphicsItem::ItemIsSelectable, true);
- setFlag(QGraphicsItem::ItemIsFocusable, true);
- setAcceptHoverEvents(true);
- setPos(x, y);
-}
-
-QRectF ItemBase::boundingRect() const
-{
- return QRectF(-m_size / 2, -m_size / 2, m_size, m_size);
-}
-
-void ItemBase::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *)
-{
- if (option->state & QStyle::State_Selected) {
- painter->setRenderHint(QPainter::Antialiasing, true);
- if (option->state & QStyle::State_HasFocus)
- painter->setPen(Qt::yellow);
- else
- painter->setPen(Qt::white);
- painter->drawRect(boundingRect());
-
- painter->drawLine(m_size / 2 - 9, m_size / 2, m_size / 2, m_size / 2 - 9);
- painter->drawLine(m_size / 2 - 6, m_size / 2, m_size / 2, m_size / 2 - 6);
- painter->drawLine(m_size / 2 - 3, m_size / 2, m_size / 2, m_size / 2 - 3);
-
- painter->setRenderHint(QPainter::Antialiasing, false);
- }
-}
-
-void ItemBase::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
-{
- if (!isSelected() && scene()) {
- scene()->clearSelection();
- setSelected(true);
- }
-
- QMenu menu;
- QAction *delAction = menu.addAction("Delete");
- QAction *newAction = menu.addAction("New");
- QAction *growAction = menu.addAction("Grow");
- QAction *shrinkAction = menu.addAction("Shrink");
-
- QAction *selectedAction = menu.exec(event->screenPos());
-
- if (selectedAction == delAction)
- deleteSelectedItems(scene());
- else if (selectedAction == newAction)
- duplicateSelectedItems(scene());
- else if (selectedAction == growAction)
- growSelectedItems(scene());
- else if (selectedAction == shrinkAction)
- shrinkSelectedItems(scene());
-}
-
-void ItemBase::duplicateSelectedItems(QGraphicsScene *scene)
-{
- if (!scene)
- return;
-
- const QList<QGraphicsItem *> selected = scene->selectedItems();
- for (QGraphicsItem *item : selected) {
- ItemBase *itemBase = qgraphicsitem_cast<ItemBase *>(item);
- if (itemBase)
- scene->addItem(itemBase->createNew(itemBase->m_size, itemBase->pos().x() + itemBase->m_size, itemBase->pos().y()));
- }
-}
-
-void ItemBase::deleteSelectedItems(QGraphicsScene *scene)
-{
- if (!scene)
- return;
-
- const QList<QGraphicsItem *> selected = scene->selectedItems();
- for (QGraphicsItem *item : selected) {
- ItemBase *itemBase = qgraphicsitem_cast<ItemBase *>(item);
- if (itemBase)
- delete itemBase;
- }
-}
-
-void ItemBase::growSelectedItems(QGraphicsScene *scene)
-{
- if (!scene)
- return;
-
- const QList<QGraphicsItem *> selected = scene->selectedItems();
- for (QGraphicsItem *item : selected) {
- ItemBase *itemBase = qgraphicsitem_cast<ItemBase *>(item);
- if (itemBase) {
- itemBase->prepareGeometryChange();
- itemBase->m_size *= 2;
- if (itemBase->m_size > MAX_ITEM_SIZE)
- itemBase->m_size = MAX_ITEM_SIZE;
- }
- }
-}
-
-void ItemBase::shrinkSelectedItems(QGraphicsScene *scene)
-{
- if (!scene)
- return;
-
- const QList<QGraphicsItem *> selected = scene->selectedItems();
- for (QGraphicsItem *item : selected) {
- ItemBase *itemBase = qgraphicsitem_cast<ItemBase *>(item);
- if (itemBase) {
- itemBase->prepareGeometryChange();
- itemBase->m_size /= 2;
- if (itemBase->m_size < MIN_ITEM_SIZE)
- itemBase->m_size = MIN_ITEM_SIZE;
- }
- }
-}
-
-void ItemBase::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
-{
- if (m_isResizing) {
- int dx = int(2.0 * event->pos().x());
- int dy = int(2.0 * event->pos().y());
- prepareGeometryChange();
- m_size = (dx > dy ? dx : dy);
- if (m_size < MIN_ITEM_SIZE)
- m_size = MIN_ITEM_SIZE;
- else if (m_size > MAX_ITEM_SIZE)
- m_size = MAX_ITEM_SIZE;
- } else {
- QGraphicsItem::mouseMoveEvent(event);
- }
-}
-
-void ItemBase::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
-{
- if (m_isResizing || (isInResizeArea(event->pos()) && isSelected()))
- setCursor(Qt::SizeFDiagCursor);
- else
- setCursor(Qt::ArrowCursor);
- QGraphicsItem::hoverMoveEvent(event);
-}
-
-void ItemBase::mousePressEvent(QGraphicsSceneMouseEvent *event)
-{
- static qreal z = 0.0;
- setZValue(z += 1.0);
- if (event->button() == Qt::LeftButton && isInResizeArea(event->pos())) {
- m_isResizing = true;
- } else {
- QGraphicsItem::mousePressEvent(event);
- }
-}
-
-void ItemBase::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
-{
- if (event->button() == Qt::LeftButton && m_isResizing) {
- m_isResizing = false;
- } else {
- QGraphicsItem::mouseReleaseEvent(event);
- }
-}
-
-void ItemBase::keyPressEvent(QKeyEvent *event)
-{
- switch (event->key()) {
- case Qt::Key_Delete:
- deleteSelectedItems(scene());
- break;
- case Qt::Key_Insert:
- duplicateSelectedItems(scene());
- break;
- case Qt::Key_Plus:
- growSelectedItems(scene());
- break;
- case Qt::Key_Minus:
- shrinkSelectedItems(scene());
- break;
- default:
- QGraphicsItem::keyPressEvent(event);
- break;
- }
-}
-
-void ItemBase::wheelEvent(QGraphicsSceneWheelEvent *event)
-{
- prepareGeometryChange();
- m_size = int(m_size * qExp(-event->delta() / 600.0));
- m_size = qBound(MIN_ITEM_SIZE, m_size, MAX_ITEM_SIZE);
-}
-
-int ItemBase::type() const
-{
- return Type;
-}
-
-
-bool ItemBase::isInResizeArea(const QPointF &pos)
-{
- return (-pos.y() < pos.x() - m_size + 9);
-}
-
-//============================================================================//
-// QtBox //
-//============================================================================//
-
-QtBox::QtBox(int size, int x, int y) : ItemBase(size, x, y)
-{
- for (int i = 0; i < 8; ++i) {
- m_vertices[i].setX(i & 1 ? 0.5f : -0.5f);
- m_vertices[i].setY(i & 2 ? 0.5f : -0.5f);
- m_vertices[i].setZ(i & 4 ? 0.5f : -0.5f);
- }
- for (int i = 0; i < 4; ++i) {
- m_texCoords[i].setX(i & 1 ? 1.0f : 0.0f);
- m_texCoords[i].setY(i & 2 ? 1.0f : 0.0f);
- }
- m_normals[0] = QVector3D(-1.0f, 0.0f, 0.0f);
- m_normals[1] = QVector3D(1.0f, 0.0f, 0.0f);
- m_normals[2] = QVector3D(0.0f, -1.0f, 0.0f);
- m_normals[3] = QVector3D(0.0f, 1.0f, 0.0f);
- m_normals[4] = QVector3D(0.0f, 0.0f, -1.0f);
- m_normals[5] = QVector3D(0.0f, 0.0f, 1.0f);
-}
-
-QtBox::~QtBox()
-{
- delete m_texture;
-}
-
-ItemBase *QtBox::createNew(int size, int x, int y)
-{
- return new QtBox(size, x, y);
-}
-
-void QtBox::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
-{
- QRectF rect = boundingRect().translated(pos());
- float width = float(painter->device()->width());
- float height = float(painter->device()->height());
-
- float left = 2.0f * float(rect.left()) / width - 1.0f;
- float right = 2.0f * float(rect.right()) / width - 1.0f;
- float top = 1.0f - 2.0f * float(rect.top()) / height;
- float bottom = 1.0f - 2.0f * float(rect.bottom()) / height;
- float moveToRectMatrix[] = {
- 0.5f * (right - left), 0.0f, 0.0f, 0.0f,
- 0.0f, 0.5f * (bottom - top), 0.0f, 0.0f,
- 0.0f, 0.0f, 1.0f, 0.0f,
- 0.5f * (right + left), 0.5f * (bottom + top), 0.0f, 1.0f
- };
-
- painter->beginNativePainting();
-
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- glLoadMatrixf(moveToRectMatrix);
- qgluPerspective(60.0, 1.0, 0.01, 10.0);
-
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
- glLoadIdentity();
-
- //glEnable(GL_DEPTH_TEST);
- glEnable(GL_CULL_FACE);
- glEnable(GL_LIGHTING);
- glEnable(GL_COLOR_MATERIAL);
- glEnable(GL_NORMALIZE);
-
- if (m_texture == nullptr)
- m_texture = new GLTexture2D(":/res/boxes/qt-logo.jpg", 64, 64);
- m_texture->bind();
- glEnable(GL_TEXTURE_2D);
-
- glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
- float lightColour[] = {1.0f, 1.0f, 1.0f, 1.0f};
- float lightDir[] = {0.0f, 0.0f, 1.0f, 0.0f};
- glLightfv(GL_LIGHT0, GL_DIFFUSE, lightColour);
- glLightfv(GL_LIGHT0, GL_POSITION, lightDir);
- glEnable(GL_LIGHT0);
-
- glTranslatef(0.0f, 0.0f, -1.5f);
- glRotatef(ROTATE_SPEED_X * m_startTime.msecsTo(QTime::currentTime()), 1.0f, 0.0f, 0.0f);
- glRotatef(ROTATE_SPEED_Y * m_startTime.msecsTo(QTime::currentTime()), 0.0f, 1.0f, 0.0f);
- glRotatef(ROTATE_SPEED_Z * m_startTime.msecsTo(QTime::currentTime()), 0.0f, 0.0f, 1.0f);
- int dt = m_startTime.msecsTo(QTime::currentTime());
- if (dt < 500)
- glScalef(dt / 500.0f, dt / 500.0f, dt / 500.0f);
-
- for (int dir = 0; dir < 3; ++dir) {
- glColor4f(1.0f, 1.0f, 1.0f, 1.0);
-
- glBegin(GL_TRIANGLE_STRIP);
- glNormal3fv(reinterpret_cast<float *>(&m_normals[2 * dir + 0]));
- for (int i = 0; i < 2; ++i) {
- for (int j = 0; j < 2; ++j) {
- glTexCoord2fv(reinterpret_cast<float *>(&m_texCoords[(j << 1) | i]));
- glVertex3fv(reinterpret_cast<float *>(&m_vertices[(i << ((dir + 2) % 3)) | (j << ((dir + 1) % 3))]));
- }
- }
- glEnd();
-
- glBegin(GL_TRIANGLE_STRIP);
- glNormal3fv(reinterpret_cast<float *>(&m_normals[2 * dir + 1]));
- for (int i = 0; i < 2; ++i) {
- for (int j = 0; j < 2; ++j) {
- glTexCoord2fv(reinterpret_cast<float *>(&m_texCoords[(j << 1) | i]));
- glVertex3fv(reinterpret_cast<float *>(&m_vertices[(1 << dir) | (i << ((dir + 1) % 3)) | (j << ((dir + 2) % 3))]));
- }
- }
- glEnd();
- }
- m_texture->unbind();
-
- //glDisable(GL_DEPTH_TEST);
- glDisable(GL_CULL_FACE);
- glDisable(GL_LIGHTING);
- glDisable(GL_COLOR_MATERIAL);
- glDisable(GL_TEXTURE_2D);
- glDisable(GL_LIGHT0);
- glDisable(GL_NORMALIZE);
-
- glPopMatrix();
-
- glMatrixMode(GL_PROJECTION);
- glPopMatrix();
-
- painter->endNativePainting();
-
- ItemBase::paint(painter, option, widget);
-}
-
-//============================================================================//
-// CircleItem //
-//============================================================================//
-
-CircleItem::CircleItem(int size, int x, int y) : ItemBase(size, x, y)
- , m_color(QColor::fromHsv(QRandomGenerator::global()->bounded(360), 255, 255))
-{}
-
-void CircleItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
-{
- int dt = m_startTime.msecsTo(QTime::currentTime());
-
- qreal r0 = 0.5 * m_size * (1.0 - qExp(-0.001 * ((dt + 3800) % 4000)));
- qreal r1 = 0.5 * m_size * (1.0 - qExp(-0.001 * ((dt + 0) % 4000)));
- qreal r2 = 0.5 * m_size * (1.0 - qExp(-0.001 * ((dt + 1800) % 4000)));
- qreal r3 = 0.5 * m_size * (1.0 - qExp(-0.001 * ((dt + 2000) % 4000)));
-
- if (r0 > r1)
- r0 = 0.0;
- if (r2 > r3)
- r2 = 0.0;
-
- QPainterPath path;
- path.moveTo(r1, 0.0);
- path.arcTo(-r1, -r1, 2 * r1, 2 * r1, 0.0, 360.0);
- path.lineTo(r0, 0.0);
- path.arcTo(-r0, -r0, 2 * r0, 2 * r0, 0.0, -360.0);
- path.closeSubpath();
- path.moveTo(r3, 0.0);
- path.arcTo(-r3, -r3, 2 * r3, 2 * r3, 0.0, 360.0);
- path.lineTo(r0, 0.0);
- path.arcTo(-r2, -r2, 2 * r2, 2 * r2, 0.0, -360.0);
- path.closeSubpath();
- painter->setRenderHint(QPainter::Antialiasing, true);
- painter->setBrush(QBrush(m_color));
- painter->setPen(Qt::NoPen);
- painter->drawPath(path);
- painter->setBrush(Qt::NoBrush);
- painter->setPen(Qt::SolidLine);
- painter->setRenderHint(QPainter::Antialiasing, false);
-
- ItemBase::paint(painter, option, widget);
-}
-
-ItemBase *CircleItem::createNew(int size, int x, int y)
-{
- return new CircleItem(size, x, y);
-}
-
-//============================================================================//
-// SquareItem //
-//============================================================================//
-
-SquareItem::SquareItem(int size, int x, int y) : ItemBase(size, x, y)
- , m_image(QPixmap(":/res/boxes/square.jpg"))
-{}
-
-void SquareItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
-{
- int dt = m_startTime.msecsTo(QTime::currentTime());
- QTransform oldTransform = painter->worldTransform();
- int dtMod = dt % 2000;
- qreal amp = 0.002 * (dtMod < 1000 ? dtMod : 2000 - dtMod) - 1.0;
-
- qreal scale = 0.6 + 0.2 * amp * amp;
- painter->setWorldTransform(QTransform().rotate(15.0 * amp).scale(scale, scale), true);
-
- painter->drawPixmap(-m_size / 2, -m_size / 2, m_size, m_size, m_image);
-
- painter->setWorldTransform(oldTransform, false);
- ItemBase::paint(painter, option, widget);
-}
-
-ItemBase *SquareItem::createNew(int size, int x, int y)
-{
- return new SquareItem(size, x, y);
-}
diff --git a/examples/widgets/graphicsview/boxes/qtbox.h b/examples/widgets/graphicsview/boxes/qtbox.h
deleted file mode 100644
index 84c8cb1d93..0000000000
--- a/examples/widgets/graphicsview/boxes/qtbox.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the demonstration applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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$
-**
-****************************************************************************/
-
-#ifndef QTBOX_H
-#define QTBOX_H
-
-#include "glbuffers.h"
-
-#include <QtWidgets>
-#include <QVector3D>
-
-class ItemBase : public QGraphicsItem
-{
-public:
- enum { Type = UserType + 1 };
-
- ItemBase(int size, int x, int y);
- QRectF boundingRect() const override;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
-protected:
- virtual ItemBase *createNew(int size, int x, int y) = 0;
- void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override;
- void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
- void hoverMoveEvent(QGraphicsSceneHoverEvent *event) override;
- void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
- void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
- void keyPressEvent(QKeyEvent *event) override;
- void wheelEvent(QGraphicsSceneWheelEvent *event) override;
- int type() const override;
- bool isInResizeArea(const QPointF &pos);
-
- static void duplicateSelectedItems(QGraphicsScene *scene);
- static void deleteSelectedItems(QGraphicsScene *scene);
- static void growSelectedItems(QGraphicsScene *scene);
- static void shrinkSelectedItems(QGraphicsScene *scene);
-
- int m_size;
- QTime m_startTime;
- bool m_isResizing = false;
-};
-
-class QtBox : public ItemBase
-{
-public:
- QtBox(int size, int x, int y);
- virtual ~QtBox();
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
-protected:
- ItemBase *createNew(int size, int x, int y) override;
-private:
- QVector3D m_vertices[8];
- QVector3D m_texCoords[4];
- QVector3D m_normals[6];
- GLTexture *m_texture = nullptr;
-};
-
-class CircleItem : public ItemBase
-{
-public:
- CircleItem(int size, int x, int y);
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
-protected:
- ItemBase *createNew(int size, int x, int y) override;
-
- QColor m_color;
-};
-
-class SquareItem : public ItemBase
-{
-public:
- SquareItem(int size, int x, int y);
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
-protected:
- ItemBase *createNew(int size, int x, int y) override;
-
- QPixmap m_image;
-};
-
-#endif
diff --git a/examples/widgets/graphicsview/boxes/reflection.fsh b/examples/widgets/graphicsview/boxes/reflection.fsh
deleted file mode 100644
index 0f0a26476f..0000000000
--- a/examples/widgets/graphicsview/boxes/reflection.fsh
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the demonstration applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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$
-**
-****************************************************************************/
-
-varying vec3 position, normal;
-varying vec4 specular, ambient, diffuse, lightDirection;
-
-uniform sampler2D tex;
-uniform samplerCube env;
-uniform mat4 view;
-
-void main()
-{
- vec3 N = normalize(normal);
- vec3 R = 2.0 * dot(-position, N) * N + position;
- gl_FragColor = textureCube(env, R * mat3(view[0].xyz, view[1].xyz, view[2].xyz));
-}
diff --git a/examples/widgets/graphicsview/boxes/refraction.fsh b/examples/widgets/graphicsview/boxes/refraction.fsh
deleted file mode 100644
index 8ba2d36329..0000000000
--- a/examples/widgets/graphicsview/boxes/refraction.fsh
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the demonstration applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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$
-**
-****************************************************************************/
-
-varying vec3 position, normal;
-varying vec4 specular, ambient, diffuse, lightDirection;
-
-uniform sampler2D tex;
-uniform samplerCube env;
-uniform mat4 view;
-
-// Arrays don't work here on glsl < 120, apparently.
-//const float coeffs[6] = float[6](1.0/2.0, 1.0/2.1, 1.0/2.2, 1.0/2.3, 1.0/2.4, 1.0/2.5);
-float coeffs(int i)
-{
- return 1.0 / (2.0 + 0.1 * float(i));
-}
-
-void main()
-{
- vec3 N = normalize(normal);
- vec3 I = -normalize(position);
- float IdotN = dot(I, N);
- float scales[6];
- vec3 C[6];
- for (int i = 0; i < 6; ++i) {
- scales[i] = (IdotN - sqrt(1.0 - coeffs(i) + coeffs(i) * (IdotN * IdotN)));
- C[i] = textureCube(env, (-I + coeffs(i) * N) * mat3(view[0].xyz, view[1].xyz, view[2].xyz)).xyz;
- }
-
- gl_FragColor = 0.25 * vec4(C[5].x + 2.0*C[0].x + C[1].x, C[1].y + 2.0*C[2].y + C[3].y,
- C[3].z + 2.0*C[4].z + C[5].z, 4.0);
-}
diff --git a/examples/widgets/graphicsview/boxes/roundedbox.cpp b/examples/widgets/graphicsview/boxes/roundedbox.cpp
deleted file mode 100644
index be96223b9f..0000000000
--- a/examples/widgets/graphicsview/boxes/roundedbox.cpp
+++ /dev/null
@@ -1,170 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the demonstration applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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 "roundedbox.h"
-
-//============================================================================//
-// P3T2N3Vertex //
-//============================================================================//
-
-VertexDescription P3T2N3Vertex::description[] = {
- {VertexDescription::Position, GL_FLOAT, SIZE_OF_MEMBER(P3T2N3Vertex, position) / sizeof(float), 0, 0},
- {VertexDescription::TexCoord, GL_FLOAT, SIZE_OF_MEMBER(P3T2N3Vertex, texCoord) / sizeof(float), sizeof(QVector3D), 0},
- {VertexDescription::Normal, GL_FLOAT, SIZE_OF_MEMBER(P3T2N3Vertex, normal) / sizeof(float), sizeof(QVector3D) + sizeof(QVector2D), 0},
-
- {VertexDescription::Null, 0, 0, 0, 0},
-};
-
-//============================================================================//
-// GLRoundedBox //
-//============================================================================//
-
-float lerp(float a, float b, float t)
-{
- return a * (1.0f - t) + b * t;
-}
-
-GLRoundedBox::GLRoundedBox(float r, float scale, int n)
- : GLTriangleMesh<P3T2N3Vertex, unsigned short>((n+2)*(n+3)*4, (n+1)*(n+1)*24+36+72*(n+1))
-{
- int vidx = 0, iidx = 0;
- int vertexCountPerCorner = (n + 2) * (n + 3) / 2;
-
- P3T2N3Vertex *vp = m_vb.lock();
- unsigned short *ip = m_ib.lock();
-
- if (!vp || !ip) {
- qWarning("GLRoundedBox::GLRoundedBox: Failed to lock vertex buffer and/or index buffer.");
- m_ib.unlock();
- m_vb.unlock();
- return;
- }
-
- for (int corner = 0; corner < 8; ++corner) {
- QVector3D centre(corner & 1 ? 1.0f : -1.0f,
- corner & 2 ? 1.0f : -1.0f,
- corner & 4 ? 1.0f : -1.0f);
- int winding = (corner & 1) ^ ((corner >> 1) & 1) ^ (corner >> 2);
- int offsX = ((corner ^ 1) - corner) * vertexCountPerCorner;
- int offsY = ((corner ^ 2) - corner) * vertexCountPerCorner;
- int offsZ = ((corner ^ 4) - corner) * vertexCountPerCorner;
-
- // Face polygons
- if (winding) {
- ip[iidx++] = vidx;
- ip[iidx++] = vidx + offsX;
- ip[iidx++] = vidx + offsY;
-
- ip[iidx++] = vidx + vertexCountPerCorner - n - 2;
- ip[iidx++] = vidx + vertexCountPerCorner - n - 2 + offsY;
- ip[iidx++] = vidx + vertexCountPerCorner - n - 2 + offsZ;
-
- ip[iidx++] = vidx + vertexCountPerCorner - 1;
- ip[iidx++] = vidx + vertexCountPerCorner - 1 + offsZ;
- ip[iidx++] = vidx + vertexCountPerCorner - 1 + offsX;
- }
-
- for (int i = 0; i < n + 2; ++i) {
-
- // Edge polygons
- if (winding && i < n + 1) {
- ip[iidx++] = vidx + i + 1;
- ip[iidx++] = vidx;
- ip[iidx++] = vidx + offsY + i + 1;
- ip[iidx++] = vidx + offsY;
- ip[iidx++] = vidx + offsY + i + 1;
- ip[iidx++] = vidx;
-
- ip[iidx++] = vidx + i;
- ip[iidx++] = vidx + 2 * i + 2;
- ip[iidx++] = vidx + i + offsX;
- ip[iidx++] = vidx + 2 * i + offsX + 2;
- ip[iidx++] = vidx + i + offsX;
- ip[iidx++] = vidx + 2 * i + 2;
-
- ip[iidx++] = (corner + 1) * vertexCountPerCorner - 1 - i;
- ip[iidx++] = (corner + 1) * vertexCountPerCorner - 2 - i;
- ip[iidx++] = (corner + 1) * vertexCountPerCorner - 1 - i + offsZ;
- ip[iidx++] = (corner + 1) * vertexCountPerCorner - 2 - i + offsZ;
- ip[iidx++] = (corner + 1) * vertexCountPerCorner - 1 - i + offsZ;
- ip[iidx++] = (corner + 1) * vertexCountPerCorner - 2 - i;
- }
-
- for (int j = 0; j <= i; ++j) {
- QVector3D normal = QVector3D(i - j, j, n + 1 - i).normalized();
- QVector3D offset(0.5f - r, 0.5f - r, 0.5f - r);
- QVector3D pos = centre * (offset + r * normal);
-
- vp[vidx].position = scale * pos;
- vp[vidx].normal = centre * normal;
- vp[vidx].texCoord = QVector2D(pos.x() + 0.5f, pos.y() + 0.5f);
-
- // Corner polygons
- if (i < n + 1) {
- ip[iidx++] = vidx;
- ip[iidx++] = vidx + i + 2 - winding;
- ip[iidx++] = vidx + i + 1 + winding;
- }
- if (i < n) {
- ip[iidx++] = vidx + i + 1 + winding;
- ip[iidx++] = vidx + i + 2 - winding;
- ip[iidx++] = vidx + 2 * i + 4;
- }
-
- ++vidx;
- }
- }
-
- }
-
- m_ib.unlock();
- m_vb.unlock();
-}
-
diff --git a/examples/widgets/graphicsview/boxes/roundedbox.h b/examples/widgets/graphicsview/boxes/roundedbox.h
deleted file mode 100644
index a1f15cd631..0000000000
--- a/examples/widgets/graphicsview/boxes/roundedbox.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the demonstration applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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$
-**
-****************************************************************************/
-
-#ifndef ROUNDEDBOX_H
-#define ROUNDEDBOX_H
-
-#include "glbuffers.h"
-#include "glextensions.h"
-#include "gltrianglemesh.h"
-
-#include <QVector2D>
-#include <QVector3D>
-
-struct P3T2N3Vertex
-{
- QVector3D position;
- QVector2D texCoord;
- QVector3D normal;
- static VertexDescription description[];
-};
-
-class GLRoundedBox : public GLTriangleMesh<P3T2N3Vertex, unsigned short>
-{
-public:
- // 0 < r < 0.5, 0 <= n <= 125
- explicit GLRoundedBox(float r = 0.25f, float scale = 1.0f, int n = 10);
-};
-
-
-#endif
diff --git a/examples/widgets/graphicsview/boxes/scene.cpp b/examples/widgets/graphicsview/boxes/scene.cpp
deleted file mode 100644
index b344f65561..0000000000
--- a/examples/widgets/graphicsview/boxes/scene.cpp
+++ /dev/null
@@ -1,1028 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the demonstration applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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 "scene.h"
-
-#include <QMatrix4x4>
-#include <QRandomGenerator>
-#include <QVector3D>
-#include <qmath.h>
-
-#include "3rdparty/fbm.h"
-
-//============================================================================//
-// ColorEdit //
-//============================================================================//
-
-ColorEdit::ColorEdit(QRgb initialColor, int id)
- : m_color(initialColor), m_id(id)
-{
- QHBoxLayout *layout = new QHBoxLayout;
- setLayout(layout);
- layout->setContentsMargins(0, 0, 0, 0);
-
- m_lineEdit = new QLineEdit(QString::number(m_color, 16));
- layout->addWidget(m_lineEdit);
-
- m_button = new QFrame;
- QPalette palette = m_button->palette();
- palette.setColor(QPalette::Window, QColor(m_color));
- m_button->setPalette(palette);
- m_button->setAutoFillBackground(true);
- m_button->setMinimumSize(32, 0);
- m_button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
- m_button->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
- layout->addWidget(m_button);
-
- connect(m_lineEdit, &QLineEdit::editingFinished, this, &ColorEdit::editDone);
-}
-
-void ColorEdit::editDone()
-{
- bool ok;
- QRgb newColor = m_lineEdit->text().toUInt(&ok, 16);
- if (ok)
- setColor(newColor);
-}
-
-void ColorEdit::mousePressEvent(QMouseEvent *event)
-{
- if (event->button() == Qt::LeftButton) {
- QColor color(m_color);
- QColorDialog dialog(color, nullptr);
- dialog.setOption(QColorDialog::ShowAlphaChannel, true);
- dialog.move(280, 120);
- if (dialog.exec() == QDialog::Rejected)
- return;
- QRgb newColor = dialog.selectedColor().rgba();
- if (newColor == m_color)
- return;
- setColor(newColor);
- }
-}
-
-void ColorEdit::setColor(QRgb color)
-{
- m_color = color;
- m_lineEdit->setText(QString::number(m_color, 16)); // "Clean up" text
- QPalette palette = m_button->palette();
- palette.setColor(QPalette::Window, QColor(m_color));
- m_button->setPalette(palette);
- emit colorChanged(m_color, m_id);
-}
-
-//============================================================================//
-// FloatEdit //
-//============================================================================//
-
-FloatEdit::FloatEdit(float initialValue, int id)
- : m_value(initialValue), m_id(id)
-{
- QHBoxLayout *layout = new QHBoxLayout;
- setLayout(layout);
- layout->setContentsMargins(0, 0, 0, 0);
-
- m_lineEdit = new QLineEdit(QString::number(m_value));
- layout->addWidget(m_lineEdit);
-
- connect(m_lineEdit, &QLineEdit::editingFinished, this, &FloatEdit::editDone);
-}
-
-void FloatEdit::editDone()
-{
- bool ok;
- float newValue = m_lineEdit->text().toFloat(&ok);
- if (ok) {
- m_value = newValue;
- m_lineEdit->setText(QString::number(m_value)); // "Clean up" text
- emit valueChanged(m_value, m_id);
- }
-}
-
-//============================================================================//
-// TwoSidedGraphicsWidget //
-//============================================================================//
-void TwoSidedGraphicsWidget::setWidget(int index, QWidget *widget)
-{
- if (index < 0 || index >= 2)
- {
- qWarning("TwoSidedGraphicsWidget::setWidget: Index out of bounds, index == %d", index);
- return;
- }
-
- GraphicsWidget *proxy = new GraphicsWidget;
- proxy->setWidget(widget);
-
- delete m_proxyWidgets[index];
- m_proxyWidgets[index] = proxy;
-
- proxy->setCacheMode(QGraphicsItem::ItemCoordinateCache);
- proxy->setZValue(1e30); // Make sure the dialog is drawn on top of all other (OpenGL) items
-
- if (index != m_current)
- proxy->setVisible(false);
-
- qobject_cast<QGraphicsScene *>(parent())->addItem(proxy);
-}
-
-QWidget *TwoSidedGraphicsWidget::widget(int index)
-{
- if (index < 0 || index >= 2)
- {
- qWarning("TwoSidedGraphicsWidget::widget: Index out of bounds, index == %d", index);
- return nullptr;
- }
- return m_proxyWidgets[index]->widget();
-}
-
-void TwoSidedGraphicsWidget::flip()
-{
- m_delta = (m_current == 0 ? 9 : -9);
- animateFlip();
-}
-
-void TwoSidedGraphicsWidget::animateFlip()
-{
- m_angle += m_delta;
- if (m_angle == 90) {
- int old = m_current;
- m_current ^= 1;
- m_proxyWidgets[old]->setVisible(false);
- m_proxyWidgets[m_current]->setVisible(true);
- m_proxyWidgets[m_current]->setGeometry(m_proxyWidgets[old]->geometry());
- }
-
- QRectF r = m_proxyWidgets[m_current]->boundingRect();
- m_proxyWidgets[m_current]->setTransform(QTransform()
- .translate(r.width() / 2, r.height() / 2)
- .rotate(m_angle - 180 * m_current, Qt::YAxis)
- .translate(-r.width() / 2, -r.height() / 2));
-
- if ((m_current == 0 && m_angle > 0) || (m_current == 1 && m_angle < 180))
- QTimer::singleShot(25, this, &TwoSidedGraphicsWidget::animateFlip);
-}
-
-QVariant GraphicsWidget::itemChange(GraphicsItemChange change, const QVariant &value)
-{
- if (change == ItemPositionChange && scene()) {
- QRectF rect = boundingRect();
- QPointF pos = value.toPointF();
- QRectF sceneRect = scene()->sceneRect();
- if (pos.x() + rect.left() < sceneRect.left())
- pos.setX(sceneRect.left() - rect.left());
- else if (pos.x() + rect.right() >= sceneRect.right())
- pos.setX(sceneRect.right() - rect.right());
- if (pos.y() + rect.top() < sceneRect.top())
- pos.setY(sceneRect.top() - rect.top());
- else if (pos.y() + rect.bottom() >= sceneRect.bottom())
- pos.setY(sceneRect.bottom() - rect.bottom());
- return pos;
- }
- return QGraphicsProxyWidget::itemChange(change, value);
-}
-
-void GraphicsWidget::resizeEvent(QGraphicsSceneResizeEvent *event)
-{
- setCacheMode(QGraphicsItem::NoCache);
- setCacheMode(QGraphicsItem::ItemCoordinateCache);
- QGraphicsProxyWidget::resizeEvent(event);
-}
-
-void GraphicsWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
-{
- painter->setRenderHint(QPainter::Antialiasing, false);
- QGraphicsProxyWidget::paint(painter, option, widget);
- //painter->setRenderHint(QPainter::Antialiasing, true);
-}
-
-//============================================================================//
-// RenderOptionsDialog //
-//============================================================================//
-
-RenderOptionsDialog::RenderOptionsDialog()
- : QDialog(nullptr, Qt::CustomizeWindowHint | Qt::WindowTitleHint)
-{
- setWindowOpacity(0.75);
- setWindowTitle(tr("Options (double click to flip)"));
- QGridLayout *layout = new QGridLayout;
- setLayout(layout);
- layout->setColumnStretch(1, 1);
-
- int row = 0;
-
- QCheckBox *check = new QCheckBox(tr("Dynamic cube map"));
- check->setCheckState(Qt::Unchecked);
- // Dynamic cube maps are only enabled when multi-texturing and render to texture are available.
- check->setEnabled(glActiveTexture && glGenFramebuffersEXT);
- connect(check, &QCheckBox::stateChanged, this, &RenderOptionsDialog::dynamicCubemapToggled);
- layout->addWidget(check, 0, 0, 1, 2);
- ++row;
-
- // Load all .par files
- // .par files have a simple syntax for specifying user adjustable uniform variables.
- const QList<QFileInfo> files = QDir(QStringLiteral(":/res/boxes/"))
- .entryInfoList({ QStringLiteral("*.par") },
- QDir::Files | QDir::Readable);
-
- for (const QFileInfo &fileInfo : files) {
- QFile file(fileInfo.absoluteFilePath());
- if (file.open(QIODevice::ReadOnly)) {
- while (!file.atEnd()) {
- QList<QByteArray> tokens = file.readLine().simplified().split(' ');
- QList<QByteArray>::const_iterator it = tokens.begin();
- if (it == tokens.end())
- continue;
- QByteArray type = *it;
- if (++it == tokens.end())
- continue;
- QByteArray name = *it;
- bool singleElement = (tokens.size() == 3); // type, name and one value
- char counter[10] = "000000000";
- int counterPos = 8; // position of last digit
- while (++it != tokens.end()) {
- m_parameterNames << name;
- if (!singleElement) {
- m_parameterNames.back() += '[';
- m_parameterNames.back() += counter + counterPos;
- m_parameterNames.back() += ']';
- int j = 8; // position of last digit
- ++counter[j];
- while (j > 0 && counter[j] > '9') {
- counter[j] = '0';
- ++counter[--j];
- }
- if (j < counterPos)
- counterPos = j;
- }
-
- if (type == "color") {
- layout->addWidget(new QLabel(m_parameterNames.back()));
- bool ok;
- ColorEdit *colorEdit = new ColorEdit(it->toUInt(&ok, 16), m_parameterNames.size() - 1);
- m_parameterEdits << colorEdit;
- layout->addWidget(colorEdit);
- connect(colorEdit, &ColorEdit::colorChanged, this, &RenderOptionsDialog::setColorParameter);
- ++row;
- } else if (type == "float") {
- layout->addWidget(new QLabel(m_parameterNames.back()));
- bool ok;
- FloatEdit *floatEdit = new FloatEdit(it->toFloat(&ok), m_parameterNames.size() - 1);
- m_parameterEdits << floatEdit;
- layout->addWidget(floatEdit);
- connect(floatEdit, &FloatEdit::valueChanged, this, &RenderOptionsDialog::setFloatParameter);
- ++row;
- }
- }
- }
- file.close();
- }
- }
-
- layout->addWidget(new QLabel(tr("Texture:")));
- m_textureCombo = new QComboBox;
- connect(m_textureCombo, QOverload<int>::of(&QComboBox::currentIndexChanged),
- this, &RenderOptionsDialog::textureChanged);
- layout->addWidget(m_textureCombo);
- ++row;
-
- layout->addWidget(new QLabel(tr("Shader:")));
- m_shaderCombo = new QComboBox;
- connect(m_shaderCombo, QOverload<int>::of(&QComboBox::currentIndexChanged),
- this, &RenderOptionsDialog::shaderChanged);
- layout->addWidget(m_shaderCombo);
- ++row;
-
- layout->setRowStretch(row, 1);
-}
-
-int RenderOptionsDialog::addTexture(const QString &name)
-{
- m_textureCombo->addItem(name);
- return m_textureCombo->count() - 1;
-}
-
-int RenderOptionsDialog::addShader(const QString &name)
-{
- m_shaderCombo->addItem(name);
- return m_shaderCombo->count() - 1;
-}
-
-void RenderOptionsDialog::emitParameterChanged()
-{
- for (ParameterEdit *edit : qAsConst(m_parameterEdits))
- edit->emitChange();
-}
-
-void RenderOptionsDialog::setColorParameter(QRgb color, int id)
-{
- emit colorParameterChanged(m_parameterNames[id], color);
-}
-
-void RenderOptionsDialog::setFloatParameter(float value, int id)
-{
- emit floatParameterChanged(m_parameterNames[id], value);
-}
-
-void RenderOptionsDialog::mouseDoubleClickEvent(QMouseEvent *event)
-{
- if (event->button() == Qt::LeftButton)
- emit doubleClicked();
-}
-
-//============================================================================//
-// ItemDialog //
-//============================================================================//
-
-ItemDialog::ItemDialog()
- : QDialog(nullptr, Qt::CustomizeWindowHint | Qt::WindowTitleHint)
-{
- setWindowTitle(tr("Items (double click to flip)"));
- setWindowOpacity(0.75);
- resize(160, 100);
-
- QVBoxLayout *layout = new QVBoxLayout;
- setLayout(layout);
- QPushButton *button;
-
- button = new QPushButton(tr("Add Qt box"));
- layout->addWidget(button);
- connect(button, &QAbstractButton::clicked, this, &ItemDialog::triggerNewQtBox);
-
- button = new QPushButton(tr("Add circle"));
- layout->addWidget(button);
- connect(button, &QAbstractButton::clicked, this, &ItemDialog::triggerNewCircleItem);
-
- button = new QPushButton(tr("Add square"));
- layout->addWidget(button);
- connect(button, &QAbstractButton::clicked, this, &ItemDialog::triggerNewSquareItem);
-
- layout->addStretch(1);
-}
-
-void ItemDialog::triggerNewQtBox()
-{
- emit newItemTriggered(QtBoxItem);
-}
-
-void ItemDialog::triggerNewCircleItem()
-{
- emit newItemTriggered(CircleItem);
-}
-
-void ItemDialog::triggerNewSquareItem()
-{
- emit newItemTriggered(SquareItem);
-}
-
-void ItemDialog::mouseDoubleClickEvent(QMouseEvent *event)
-{
- if (event->button() == Qt::LeftButton)
- emit doubleClicked();
-}
-
-//============================================================================//
-// Scene //
-//============================================================================//
-
-const static char environmentShaderText[] =
- "uniform samplerCube env;"
- "void main() {"
- "gl_FragColor = textureCube(env, gl_TexCoord[1].xyz);"
- "}";
-
-Scene::Scene(int width, int height, int maxTextureSize)
- : m_distExp(600)
- , m_frame(0)
- , m_maxTextureSize(maxTextureSize)
- , m_currentShader(0)
- , m_currentTexture(0)
- , m_dynamicCubemap(false)
- , m_updateAllCubemaps(true)
- , m_box(nullptr)
- , m_vertexShader(nullptr)
- , m_environmentShader(nullptr)
- , m_environmentProgram(nullptr)
-{
- setSceneRect(0, 0, width, height);
-
- m_trackBalls[0] = TrackBall(0.05f, QVector3D(0, 1, 0), TrackBall::Sphere);
- m_trackBalls[1] = TrackBall(0.005f, QVector3D(0, 0, 1), TrackBall::Sphere);
- m_trackBalls[2] = TrackBall(0.0f, QVector3D(0, 1, 0), TrackBall::Plane);
-
- m_renderOptions = new RenderOptionsDialog;
- m_renderOptions->move(20, 120);
- m_renderOptions->resize(m_renderOptions->sizeHint());
-
- connect(m_renderOptions, &RenderOptionsDialog::dynamicCubemapToggled, this, &Scene::toggleDynamicCubemap);
- connect(m_renderOptions, &RenderOptionsDialog::colorParameterChanged, this, &Scene::setColorParameter);
- connect(m_renderOptions, &RenderOptionsDialog::floatParameterChanged, this, &Scene::setFloatParameter);
- connect(m_renderOptions, &RenderOptionsDialog::textureChanged, this, &Scene::setTexture);
- connect(m_renderOptions, &RenderOptionsDialog::shaderChanged, this, &Scene::setShader);
-
- m_itemDialog = new ItemDialog;
- connect(m_itemDialog, &ItemDialog::newItemTriggered, this, &Scene::newItem);
-
- TwoSidedGraphicsWidget *twoSided = new TwoSidedGraphicsWidget(this);
- twoSided->setWidget(0, m_renderOptions);
- twoSided->setWidget(1, m_itemDialog);
-
- connect(m_renderOptions, &RenderOptionsDialog::doubleClicked, twoSided, &TwoSidedGraphicsWidget::flip);
- connect(m_itemDialog, &ItemDialog::doubleClicked, twoSided, &TwoSidedGraphicsWidget::flip);
-
- addItem(new QtBox(64, width - 64, height - 64));
- addItem(new QtBox(64, width - 64, 64));
- addItem(new QtBox(64, 64, height - 64));
- addItem(new QtBox(64, 64, 64));
-
- initGL();
-
- m_timer = new QTimer(this);
- m_timer->setInterval(20);
- connect(m_timer, &QTimer::timeout, this, [this](){ update(); });
- m_timer->start();
-}
-
-Scene::~Scene()
-{
- delete m_box;
- qDeleteAll(m_textures);
- delete m_mainCubemap;
- qDeleteAll(m_programs);
- delete m_vertexShader;
- qDeleteAll(m_fragmentShaders);
- qDeleteAll(m_cubemaps);
- delete m_environmentShader;
- delete m_environmentProgram;
-}
-
-void Scene::initGL()
-{
- m_box = new GLRoundedBox(0.25f, 1.0f, 10);
-
- m_vertexShader = new QGLShader(QGLShader::Vertex);
- m_vertexShader->compileSourceFile(QLatin1String(":/res/boxes/basic.vsh"));
-
- QStringList list;
- list << ":/res/boxes/cubemap_posx.jpg" << ":/res/boxes/cubemap_negx.jpg" << ":/res/boxes/cubemap_posy.jpg"
- << ":/res/boxes/cubemap_negy.jpg" << ":/res/boxes/cubemap_posz.jpg" << ":/res/boxes/cubemap_negz.jpg";
- m_environment = new GLTextureCube(list, qMin(1024, m_maxTextureSize));
- m_environmentShader = new QGLShader(QGLShader::Fragment);
- m_environmentShader->compileSourceCode(environmentShaderText);
- m_environmentProgram = new QGLShaderProgram;
- m_environmentProgram->addShader(m_vertexShader);
- m_environmentProgram->addShader(m_environmentShader);
- m_environmentProgram->link();
-
- const int NOISE_SIZE = 128; // for a different size, B and BM in fbm.c must also be changed
- m_noise = new GLTexture3D(NOISE_SIZE, NOISE_SIZE, NOISE_SIZE);
- QVector<QRgb> data(NOISE_SIZE * NOISE_SIZE * NOISE_SIZE, QRgb(0));
- QRgb *p = data.data();
- float pos[3];
- for (int k = 0; k < NOISE_SIZE; ++k) {
- pos[2] = k * (0x20 / (float)NOISE_SIZE);
- for (int j = 0; j < NOISE_SIZE; ++j) {
- for (int i = 0; i < NOISE_SIZE; ++i) {
- for (int byte = 0; byte < 4; ++byte) {
- pos[0] = (i + (byte & 1) * 16) * (0x20 / (float)NOISE_SIZE);
- pos[1] = (j + (byte & 2) * 8) * (0x20 / (float)NOISE_SIZE);
- *p |= (int)(128.0f * (noise3(pos) + 1.0f)) << (byte * 8);
- }
- ++p;
- }
- }
- }
- m_noise->load(NOISE_SIZE, NOISE_SIZE, NOISE_SIZE, data.data());
-
- m_mainCubemap = new GLRenderTargetCube(512);
-
- QList<QFileInfo> files;
-
- // Load all .png files as textures
- m_currentTexture = 0;
- files = QDir(":/res/boxes/").entryInfoList({ QStringLiteral("*.png") }, QDir::Files | QDir::Readable);
-
- for (const QFileInfo &file : qAsConst(files)) {
- GLTexture *texture = new GLTexture2D(file.absoluteFilePath(), qMin(256, m_maxTextureSize), qMin(256, m_maxTextureSize));
- if (texture->failed()) {
- delete texture;
- continue;
- }
- m_textures << texture;
- m_renderOptions->addTexture(file.baseName());
- }
-
- if (m_textures.size() == 0)
- m_textures << new GLTexture2D(qMin(64, m_maxTextureSize), qMin(64, m_maxTextureSize));
-
- // Load all .fsh files as fragment shaders
- m_currentShader = 0;
- files = QDir(":/res/boxes/").entryInfoList({ QStringLiteral("*.fsh") }, QDir::Files | QDir::Readable);
- for (const QFileInfo &file : qAsConst(files)) {
- QGLShaderProgram *program = new QGLShaderProgram;
- QGLShader* shader = new QGLShader(QGLShader::Fragment);
- shader->compileSourceFile(file.absoluteFilePath());
- // The program does not take ownership over the shaders, so store them in a vector so they can be deleted afterwards.
- program->addShader(m_vertexShader);
- program->addShader(shader);
- if (!program->link()) {
- qWarning("Failed to compile and link shader program");
- qWarning("Vertex shader log:");
- qWarning() << m_vertexShader->log();
- qWarning() << "Fragment shader log ( file =" << file.absoluteFilePath() << "):";
- qWarning() << shader->log();
- qWarning("Shader program log:");
- qWarning() << program->log();
-
- delete shader;
- delete program;
- continue;
- }
-
- m_fragmentShaders << shader;
- m_programs << program;
- m_renderOptions->addShader(file.baseName());
-
- program->bind();
- m_cubemaps << ((program->uniformLocation("env") != -1) ? new GLRenderTargetCube(qMin(256, m_maxTextureSize)) : nullptr);
- program->release();
- }
-
- if (m_programs.size() == 0)
- m_programs << new QGLShaderProgram;
-
- m_renderOptions->emitParameterChanged();
-}
-
-static void loadMatrix(const QMatrix4x4 &m)
-{
- // static to prevent glLoadMatrixf to fail on certain drivers
- static GLfloat mat[16];
- const float *data = m.constData();
- for (int index = 0; index < 16; ++index)
- mat[index] = data[index];
- glLoadMatrixf(mat);
-}
-
-// If one of the boxes should not be rendered, set excludeBox to its index.
-// If the main box should not be rendered, set excludeBox to -1.
-void Scene::renderBoxes(const QMatrix4x4 &view, int excludeBox)
-{
- QMatrix4x4 invView = view.inverted();
-
- // If multi-texturing is supported, use three saplers.
- if (glActiveTexture) {
- glActiveTexture(GL_TEXTURE0);
- m_textures[m_currentTexture]->bind();
- glActiveTexture(GL_TEXTURE2);
- m_noise->bind();
- glActiveTexture(GL_TEXTURE1);
- } else {
- m_textures[m_currentTexture]->bind();
- }
-
- glDisable(GL_LIGHTING);
- glDisable(GL_CULL_FACE);
-
- QMatrix4x4 viewRotation(view);
- viewRotation(3, 0) = viewRotation(3, 1) = viewRotation(3, 2) = 0.0f;
- viewRotation(0, 3) = viewRotation(1, 3) = viewRotation(2, 3) = 0.0f;
- viewRotation(3, 3) = 1.0f;
- loadMatrix(viewRotation);
- glScalef(20.0f, 20.0f, 20.0f);
-
- // Don't render the environment if the environment texture can't be set for the correct sampler.
- if (glActiveTexture) {
- m_environment->bind();
- m_environmentProgram->bind();
- m_environmentProgram->setUniformValue("tex", GLint(0));
- m_environmentProgram->setUniformValue("env", GLint(1));
- m_environmentProgram->setUniformValue("noise", GLint(2));
- m_box->draw();
- m_environmentProgram->release();
- m_environment->unbind();
- }
-
- loadMatrix(view);
-
- glEnable(GL_CULL_FACE);
- glEnable(GL_LIGHTING);
-
- for (int i = 0; i < m_programs.size(); ++i) {
- if (i == excludeBox)
- continue;
-
- glPushMatrix();
- QMatrix4x4 m;
- m.rotate(m_trackBalls[1].rotation());
- glMultMatrixf(m.constData());
-
- glRotatef(360.0f * i / m_programs.size(), 0.0f, 0.0f, 1.0f);
- glTranslatef(2.0f, 0.0f, 0.0f);
- glScalef(0.3f, 0.6f, 0.6f);
-
- if (glActiveTexture) {
- if (m_dynamicCubemap && m_cubemaps[i])
- m_cubemaps[i]->bind();
- else
- m_environment->bind();
- }
- m_programs[i]->bind();
- m_programs[i]->setUniformValue("tex", GLint(0));
- m_programs[i]->setUniformValue("env", GLint(1));
- m_programs[i]->setUniformValue("noise", GLint(2));
- m_programs[i]->setUniformValue("view", view);
- m_programs[i]->setUniformValue("invView", invView);
- m_box->draw();
- m_programs[i]->release();
-
- if (glActiveTexture) {
- if (m_dynamicCubemap && m_cubemaps[i])
- m_cubemaps[i]->unbind();
- else
- m_environment->unbind();
- }
- glPopMatrix();
- }
-
- if (-1 != excludeBox) {
- QMatrix4x4 m;
- m.rotate(m_trackBalls[0].rotation());
- glMultMatrixf(m.constData());
-
- if (glActiveTexture) {
- if (m_dynamicCubemap)
- m_mainCubemap->bind();
- else
- m_environment->bind();
- }
-
- m_programs[m_currentShader]->bind();
- m_programs[m_currentShader]->setUniformValue("tex", GLint(0));
- m_programs[m_currentShader]->setUniformValue("env", GLint(1));
- m_programs[m_currentShader]->setUniformValue("noise", GLint(2));
- m_programs[m_currentShader]->setUniformValue("view", view);
- m_programs[m_currentShader]->setUniformValue("invView", invView);
- m_box->draw();
- m_programs[m_currentShader]->release();
-
- if (glActiveTexture) {
- if (m_dynamicCubemap)
- m_mainCubemap->unbind();
- else
- m_environment->unbind();
- }
- }
-
- if (glActiveTexture) {
- glActiveTexture(GL_TEXTURE2);
- m_noise->unbind();
- glActiveTexture(GL_TEXTURE0);
- }
- m_textures[m_currentTexture]->unbind();
-}
-
-void Scene::setStates()
-{
- //glClearColor(0.25f, 0.25f, 0.5f, 1.0f);
-
- glEnable(GL_DEPTH_TEST);
- glEnable(GL_CULL_FACE);
- glEnable(GL_LIGHTING);
- //glEnable(GL_COLOR_MATERIAL);
- glEnable(GL_TEXTURE_2D);
- glEnable(GL_NORMALIZE);
-
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- glLoadIdentity();
-
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
- glLoadIdentity();
-
- setLights();
-
- float materialSpecular[] = {0.5f, 0.5f, 0.5f, 1.0f};
- glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, materialSpecular);
- glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 32.0f);
-}
-
-void Scene::setLights()
-{
- glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
- //float lightColour[] = {1.0f, 1.0f, 1.0f, 1.0f};
- float lightDir[] = {0.0f, 0.0f, 1.0f, 0.0f};
- //glLightfv(GL_LIGHT0, GL_DIFFUSE, lightColour);
- //glLightfv(GL_LIGHT0, GL_SPECULAR, lightColour);
- glLightfv(GL_LIGHT0, GL_POSITION, lightDir);
- glLightModelf(GL_LIGHT_MODEL_LOCAL_VIEWER, 1.0f);
- glEnable(GL_LIGHT0);
-}
-
-void Scene::defaultStates()
-{
- //glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
-
- glDisable(GL_DEPTH_TEST);
- glDisable(GL_CULL_FACE);
- glDisable(GL_LIGHTING);
- //glDisable(GL_COLOR_MATERIAL);
- glDisable(GL_TEXTURE_2D);
- glDisable(GL_LIGHT0);
- glDisable(GL_NORMALIZE);
-
- glMatrixMode(GL_MODELVIEW);
- glPopMatrix();
-
- glMatrixMode(GL_PROJECTION);
- glPopMatrix();
-
- glLightModelf(GL_LIGHT_MODEL_LOCAL_VIEWER, 0.0f);
- float defaultMaterialSpecular[] = {0.0f, 0.0f, 0.0f, 1.0f};
- glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, defaultMaterialSpecular);
- glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 0.0f);
-}
-
-void Scene::renderCubemaps()
-{
- // To speed things up, only update the cubemaps for the small cubes every N frames.
- const int N = (m_updateAllCubemaps ? 1 : 3);
-
- QMatrix4x4 mat;
- GLRenderTargetCube::getProjectionMatrix(mat, 0.1f, 100.0f);
-
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- loadMatrix(mat);
-
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
-
- QVector3D center;
-
- const float eachAngle = 2 * M_PI / m_cubemaps.size();
- for (int i = m_frame % N; i < m_cubemaps.size(); i += N) {
- if (0 == m_cubemaps[i])
- continue;
-
- float angle = i * eachAngle;
-
- center = m_trackBalls[1].rotation().rotatedVector(QVector3D(std::cos(angle), std::sin(angle), 0.0f));
-
- for (int face = 0; face < 6; ++face) {
- m_cubemaps[i]->begin(face);
-
- GLRenderTargetCube::getViewMatrix(mat, face);
- QVector4D v = QVector4D(-center.x(), -center.y(), -center.z(), 1.0);
- mat.setColumn(3, mat * v);
-
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- renderBoxes(mat, i);
-
- m_cubemaps[i]->end();
- }
- }
-
- for (int face = 0; face < 6; ++face) {
- m_mainCubemap->begin(face);
- GLRenderTargetCube::getViewMatrix(mat, face);
-
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- renderBoxes(mat, -1);
-
- m_mainCubemap->end();
- }
-
- glPopMatrix();
-
- glMatrixMode(GL_PROJECTION);
- glPopMatrix();
-
- m_updateAllCubemaps = false;
-}
-
-void Scene::drawBackground(QPainter *painter, const QRectF &)
-{
- float width = float(painter->device()->width());
- float height = float(painter->device()->height());
-
- painter->beginNativePainting();
- setStates();
-
- if (m_dynamicCubemap)
- renderCubemaps();
-
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- glMatrixMode(GL_PROJECTION);
- qgluPerspective(60.0, width / height, 0.01, 15.0);
-
- glMatrixMode(GL_MODELVIEW);
-
- QMatrix4x4 view;
- view.rotate(m_trackBalls[2].rotation());
- view(2, 3) -= 2.0f * std::exp(m_distExp / 1200.0f);
- renderBoxes(view);
-
- defaultStates();
- ++m_frame;
-
- painter->endNativePainting();
-}
-
-QPointF Scene::pixelPosToViewPos(const QPointF& p)
-{
- return QPointF(2.0 * float(p.x()) / width() - 1.0,
- 1.0 - 2.0 * float(p.y()) / height());
-}
-
-void Scene::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
-{
- QGraphicsScene::mouseMoveEvent(event);
- if (event->isAccepted())
- return;
-
- if (event->buttons() & Qt::LeftButton) {
- m_trackBalls[0].move(pixelPosToViewPos(event->scenePos()), m_trackBalls[2].rotation().conjugated());
- event->accept();
- } else {
- m_trackBalls[0].release(pixelPosToViewPos(event->scenePos()), m_trackBalls[2].rotation().conjugated());
- }
-
- if (event->buttons() & Qt::RightButton) {
- m_trackBalls[1].move(pixelPosToViewPos(event->scenePos()), m_trackBalls[2].rotation().conjugated());
- event->accept();
- } else {
- m_trackBalls[1].release(pixelPosToViewPos(event->scenePos()), m_trackBalls[2].rotation().conjugated());
- }
-
- if (event->buttons() & Qt::MidButton) {
- m_trackBalls[2].move(pixelPosToViewPos(event->scenePos()), QQuaternion());
- event->accept();
- } else {
- m_trackBalls[2].release(pixelPosToViewPos(event->scenePos()), QQuaternion());
- }
-}
-
-void Scene::mousePressEvent(QGraphicsSceneMouseEvent *event)
-{
- QGraphicsScene::mousePressEvent(event);
- if (event->isAccepted())
- return;
-
- if (event->buttons() & Qt::LeftButton) {
- m_trackBalls[0].push(pixelPosToViewPos(event->scenePos()), m_trackBalls[2].rotation().conjugated());
- event->accept();
- }
-
- if (event->buttons() & Qt::RightButton) {
- m_trackBalls[1].push(pixelPosToViewPos(event->scenePos()), m_trackBalls[2].rotation().conjugated());
- event->accept();
- }
-
- if (event->buttons() & Qt::MidButton) {
- m_trackBalls[2].push(pixelPosToViewPos(event->scenePos()), QQuaternion());
- event->accept();
- }
-}
-
-void Scene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
-{
- QGraphicsScene::mouseReleaseEvent(event);
- if (event->isAccepted())
- return;
-
- if (event->button() == Qt::LeftButton) {
- m_trackBalls[0].release(pixelPosToViewPos(event->scenePos()), m_trackBalls[2].rotation().conjugated());
- event->accept();
- }
-
- if (event->button() == Qt::RightButton) {
- m_trackBalls[1].release(pixelPosToViewPos(event->scenePos()), m_trackBalls[2].rotation().conjugated());
- event->accept();
- }
-
- if (event->button() == Qt::MidButton) {
- m_trackBalls[2].release(pixelPosToViewPos(event->scenePos()), QQuaternion());
- event->accept();
- }
-}
-
-void Scene::wheelEvent(QGraphicsSceneWheelEvent * event)
-{
- QGraphicsScene::wheelEvent(event);
- if (!event->isAccepted()) {
- m_distExp += event->delta();
- if (m_distExp < -8 * 120)
- m_distExp = -8 * 120;
- if (m_distExp > 10 * 120)
- m_distExp = 10 * 120;
- event->accept();
- }
-}
-
-void Scene::setShader(int index)
-{
- if (index >= 0 && index < m_fragmentShaders.size())
- m_currentShader = index;
-}
-
-void Scene::setTexture(int index)
-{
- if (index >= 0 && index < m_textures.size())
- m_currentTexture = index;
-}
-
-void Scene::toggleDynamicCubemap(int state)
-{
- if ((m_dynamicCubemap = (state == Qt::Checked)))
- m_updateAllCubemaps = true;
-}
-
-void Scene::setColorParameter(const QString &name, QRgb color)
-{
- // set the color in all programs
- for (QGLShaderProgram *program : qAsConst(m_programs)) {
- program->bind();
- program->setUniformValue(program->uniformLocation(name), QColor(color));
- program->release();
- }
-}
-
-void Scene::setFloatParameter(const QString &name, float value)
-{
- // set the color in all programs
- for (QGLShaderProgram *program : qAsConst(m_programs)) {
- program->bind();
- program->setUniformValue(program->uniformLocation(name), value);
- program->release();
- }
-}
-
-void Scene::newItem(ItemDialog::ItemType type)
-{
- QSize size = sceneRect().size().toSize();
- switch (type) {
- case ItemDialog::QtBoxItem:
- addItem(new QtBox(64, QRandomGenerator::global()->bounded(size.width() - 64) + 32,
- QRandomGenerator::global()->bounded(size.height() - 64) + 32));
- break;
- case ItemDialog::CircleItem:
- addItem(new CircleItem(64, QRandomGenerator::global()->bounded(size.width() - 64) + 32,
- QRandomGenerator::global()->bounded(size.height() - 64) + 32));
- break;
- case ItemDialog::SquareItem:
- addItem(new SquareItem(64, QRandomGenerator::global()->bounded(size.width() - 64) + 32,
- QRandomGenerator::global()->bounded(size.height() - 64) + 32));
- break;
- default:
- break;
- }
-}
diff --git a/examples/widgets/graphicsview/boxes/scene.h b/examples/widgets/graphicsview/boxes/scene.h
deleted file mode 100644
index 31bc3d7b66..0000000000
--- a/examples/widgets/graphicsview/boxes/scene.h
+++ /dev/null
@@ -1,246 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the demonstration applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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$
-**
-****************************************************************************/
-
-#ifndef SCENE_H
-#define SCENE_H
-
-#include "glbuffers.h"
-#include "glextensions.h"
-#include "gltrianglemesh.h"
-#include "qtbox.h"
-#include "roundedbox.h"
-#include "trackball.h"
-
-QT_BEGIN_NAMESPACE
-class QMatrix4x4;
-QT_END_NAMESPACE
-
-class ParameterEdit : public QWidget
-{
-public:
- virtual void emitChange() = 0;
-};
-
-class ColorEdit : public ParameterEdit
-{
- Q_OBJECT
-public:
- ColorEdit(QRgb initialColor, int id);
- QRgb color() const {return m_color;}
- void emitChange() override { emit colorChanged(m_color, m_id); }
-public slots:
- void editDone();
-signals:
- void colorChanged(QRgb color, int id);
-protected:
- void mousePressEvent(QMouseEvent *event) override;
- void setColor(QRgb color); // also emits colorChanged()
-private:
- QGraphicsScene *m_dialogParentScene;
- QLineEdit *m_lineEdit;
- QFrame *m_button;
- QRgb m_color;
- int m_id;
-};
-
-class FloatEdit : public ParameterEdit
-{
- Q_OBJECT
-public:
- FloatEdit(float initialValue, int id);
- float value() const {return m_value;}
- void emitChange() override { emit valueChanged(m_value, m_id); }
-public slots:
- void editDone();
-signals:
- void valueChanged(float value, int id);
-private:
- QGraphicsScene *m_dialogParentScene;
- QLineEdit *m_lineEdit;
- float m_value;
- int m_id;
-};
-
-class GraphicsWidget : public QGraphicsProxyWidget
-{
-public:
- GraphicsWidget() : QGraphicsProxyWidget(nullptr, Qt::Window) {}
-protected:
- QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
- void resizeEvent(QGraphicsSceneResizeEvent *event) override;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
-};
-
-class TwoSidedGraphicsWidget : public QObject
-{
- Q_OBJECT
-public:
- using QObject::QObject;
- void setWidget(int index, QWidget *widget);
- QWidget *widget(int index);
-public slots:
- void flip();
-protected slots:
- void animateFlip();
-private:
- GraphicsWidget *m_proxyWidgets[2] = {nullptr, nullptr};
- int m_current = 0;
- int m_angle = 0; // angle in degrees
- int m_delta = 0;
-};
-
-class RenderOptionsDialog : public QDialog
-{
- Q_OBJECT
-public:
- RenderOptionsDialog();
- int addTexture(const QString &name);
- int addShader(const QString &name);
- void emitParameterChanged();
-protected slots:
- void setColorParameter(QRgb color, int id);
- void setFloatParameter(float value, int id);
-signals:
- void dynamicCubemapToggled(int);
- void colorParameterChanged(const QString &, QRgb);
- void floatParameterChanged(const QString &, float);
- void textureChanged(int);
- void shaderChanged(int);
- void doubleClicked();
-protected:
- void mouseDoubleClickEvent(QMouseEvent *event) override;
-
- QVector<QByteArray> m_parameterNames;
- QComboBox *m_textureCombo;
- QComboBox *m_shaderCombo;
- QVector<ParameterEdit *> m_parameterEdits;
-};
-
-class ItemDialog : public QDialog
-{
- Q_OBJECT
-public:
- enum ItemType {
- QtBoxItem,
- CircleItem,
- SquareItem,
- };
-
- ItemDialog();
-public slots:
- void triggerNewQtBox();
- void triggerNewCircleItem();
- void triggerNewSquareItem();
-signals:
- void doubleClicked();
- void newItemTriggered(ItemDialog::ItemType type);
-protected:
- void mouseDoubleClickEvent(QMouseEvent *event) override;
-};
-
-class Scene : public QGraphicsScene
-{
- Q_OBJECT
-public:
- Scene(int width, int height, int maxTextureSize);
- ~Scene();
- void drawBackground(QPainter *painter, const QRectF &rect) override;
-
-public slots:
- void setShader(int index);
- void setTexture(int index);
- void toggleDynamicCubemap(int state);
- void setColorParameter(const QString &name, QRgb color);
- void setFloatParameter(const QString &name, float value);
- void newItem(ItemDialog::ItemType type);
-protected:
- void renderBoxes(const QMatrix4x4 &view, int excludeBox = -2);
- void setStates();
- void setLights();
- void defaultStates();
- void renderCubemaps();
-
- void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
- void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
- void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
- void wheelEvent(QGraphicsSceneWheelEvent * event) override;
-private:
- void initGL();
- QPointF pixelPosToViewPos(const QPointF& p);
-
- int m_lastTime;
- int m_mouseEventTime;
- int m_distExp;
- int m_frame;
- int m_maxTextureSize;
-
- int m_currentShader;
- int m_currentTexture;
- bool m_dynamicCubemap;
- bool m_updateAllCubemaps;
-
- RenderOptionsDialog *m_renderOptions;
- ItemDialog *m_itemDialog;
- QTimer *m_timer;
- GLRoundedBox *m_box;
- TrackBall m_trackBalls[3];
- QVector<GLTexture *> m_textures;
- GLTextureCube *m_environment;
- GLTexture3D *m_noise;
- GLRenderTargetCube *m_mainCubemap;
- QVector<GLRenderTargetCube *> m_cubemaps;
- QVector<QGLShaderProgram *> m_programs;
- QGLShader *m_vertexShader;
- QVector<QGLShader *> m_fragmentShaders;
- QGLShader *m_environmentShader;
- QGLShaderProgram *m_environmentProgram;
-};
-
-#endif
diff --git a/examples/widgets/graphicsview/boxes/smiley.png b/examples/widgets/graphicsview/boxes/smiley.png
deleted file mode 100644
index 41cfda6b23..0000000000
--- a/examples/widgets/graphicsview/boxes/smiley.png
+++ /dev/null
Binary files differ
diff --git a/examples/widgets/graphicsview/boxes/square.jpg b/examples/widgets/graphicsview/boxes/square.jpg
deleted file mode 100644
index 03f53bd530..0000000000
--- a/examples/widgets/graphicsview/boxes/square.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/widgets/graphicsview/boxes/trackball.cpp b/examples/widgets/graphicsview/boxes/trackball.cpp
deleted file mode 100644
index b9dfc1fc7f..0000000000
--- a/examples/widgets/graphicsview/boxes/trackball.cpp
+++ /dev/null
@@ -1,159 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the demonstration applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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 "trackball.h"
-#include "scene.h"
-
-//============================================================================//
-// TrackBall //
-//============================================================================//
-
-TrackBall::TrackBall(TrackMode mode)
- : TrackBall(0, QVector3D(0, 1, 0), mode)
-{
-}
-
-TrackBall::TrackBall(float angularVelocity, const QVector3D& axis, TrackMode mode)
- : m_axis(axis)
- , m_angularVelocity(angularVelocity)
- , m_mode(mode)
-{}
-
-void TrackBall::push(const QPointF& p, const QQuaternion &)
-{
- m_rotation = rotation();
- m_pressed = true;
- m_lastTime = QTime::currentTime();
- m_lastPos = p;
- m_angularVelocity = 0.0f;
-}
-
-void TrackBall::move(const QPointF& p, const QQuaternion &transformation)
-{
- if (!m_pressed)
- return;
-
- QTime currentTime = QTime::currentTime();
- int msecs = m_lastTime.msecsTo(currentTime);
- if (msecs <= 20)
- return;
-
- switch (m_mode) {
- case Plane:
- {
- QLineF delta(m_lastPos, p);
- const float angleDelta = qRadiansToDegrees(float(delta.length()));
- m_angularVelocity = angleDelta / msecs;
- m_axis = QVector3D(-delta.dy(), delta.dx(), 0.0f).normalized();
- m_axis = transformation.rotatedVector(m_axis);
- m_rotation = QQuaternion::fromAxisAndAngle(m_axis, angleDelta) * m_rotation;
- }
- break;
- case Sphere:
- {
- QVector3D lastPos3D = QVector3D(m_lastPos.x(), m_lastPos.y(), 0.0f);
- float sqrZ = 1 - QVector3D::dotProduct(lastPos3D, lastPos3D);
- if (sqrZ > 0)
- lastPos3D.setZ(std::sqrt(sqrZ));
- else
- lastPos3D.normalize();
-
- QVector3D currentPos3D = QVector3D(p.x(), p.y(), 0.0f);
- sqrZ = 1 - QVector3D::dotProduct(currentPos3D, currentPos3D);
- if (sqrZ > 0)
- currentPos3D.setZ(std::sqrt(sqrZ));
- else
- currentPos3D.normalize();
-
- m_axis = QVector3D::crossProduct(lastPos3D, currentPos3D);
- float angle = qRadiansToDegrees(std::asin(m_axis.length()));
-
- m_angularVelocity = angle / msecs;
- m_axis.normalize();
- m_axis = transformation.rotatedVector(m_axis);
- m_rotation = QQuaternion::fromAxisAndAngle(m_axis, angle) * m_rotation;
- }
- break;
- }
-
-
- m_lastPos = p;
- m_lastTime = currentTime;
-}
-
-void TrackBall::release(const QPointF& p, const QQuaternion &transformation)
-{
- // Calling move() caused the rotation to stop if the framerate was too low.
- move(p, transformation);
- m_pressed = false;
-}
-
-void TrackBall::start()
-{
- m_lastTime = QTime::currentTime();
- m_paused = false;
-}
-
-void TrackBall::stop()
-{
- m_rotation = rotation();
- m_paused = true;
-}
-
-QQuaternion TrackBall::rotation() const
-{
- if (m_paused || m_pressed)
- return m_rotation;
-
- QTime currentTime = QTime::currentTime();
- float angle = m_angularVelocity * m_lastTime.msecsTo(currentTime);
- return QQuaternion::fromAxisAndAngle(m_axis, angle) * m_rotation;
-}
-
diff --git a/examples/widgets/graphicsview/boxes/trackball.h b/examples/widgets/graphicsview/boxes/trackball.h
deleted file mode 100644
index af90e4d842..0000000000
--- a/examples/widgets/graphicsview/boxes/trackball.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the demonstration applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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$
-**
-****************************************************************************/
-
-#ifndef TRACKBALL_H
-#define TRACKBALL_H
-
-#include <QQuaternion>
-#include <QTime>
-#include <QVector3D>
-
-class TrackBall
-{
-public:
- enum TrackMode
- {
- Plane,
- Sphere,
- };
- TrackBall(TrackMode mode = Sphere);
- TrackBall(float angularVelocity, const QVector3D &axis, TrackMode mode = Sphere);
- // coordinates in [-1,1]x[-1,1]
- void push(const QPointF &p, const QQuaternion &transformation);
- void move(const QPointF &p, const QQuaternion &transformation);
- void release(const QPointF &p, const QQuaternion &transformation);
- void start(); // starts clock
- void stop(); // stops clock
- QQuaternion rotation() const;
-private:
- QQuaternion m_rotation;
- QVector3D m_axis = QVector3D(0, 1, 0);
- float m_angularVelocity = 0;
-
- QPointF m_lastPos;
- QTime m_lastTime = QTime::currentTime();
- TrackMode m_mode;
- bool m_paused = false;
- bool m_pressed = false;
-};
-
-#endif
diff --git a/examples/widgets/graphicsview/boxes/wood.fsh b/examples/widgets/graphicsview/boxes/wood.fsh
deleted file mode 100644
index fbb5195f3a..0000000000
--- a/examples/widgets/graphicsview/boxes/wood.fsh
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the demonstration applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** 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$
-**
-****************************************************************************/
-
-varying vec3 position, normal;
-varying vec4 specular, ambient, diffuse, lightDirection;
-
-uniform sampler2D tex;
-uniform sampler3D noise;
-
-//const vec4 woodColors[2] = {vec4(0.37,0.24,0.20,1), vec4(0.8,0.6,0.4,1)};
-uniform vec4 woodColors[2];
-//const float woodTubulence = 0.1;
-uniform float woodTubulence;
-
-void main()
-{
- float r = length(gl_TexCoord[1].yz);
- r += woodTubulence * texture3D(noise, 0.25 * gl_TexCoord[1].xyz).x;
-
- vec3 N = normalize(normal);
- // assume directional light
-
- gl_MaterialParameters M = gl_FrontMaterial;
-
- float NdotL = dot(N, lightDirection.xyz);
- float RdotL = dot(reflect(normalize(position), N), lightDirection.xyz);
-
- float f = fract(16.0 * r);
- vec4 unlitColor = mix(woodColors[0], woodColors[1], min(1.25 * f, 5.0 - 5.0 * f));
- gl_FragColor = (ambient + diffuse * max(NdotL, 0.0)) * unlitColor +
- M.specular * specular * pow(max(RdotL, 0.0), M.shininess);
-}
diff --git a/examples/widgets/graphicsview/chip/.prev_CMakeLists.txt b/examples/widgets/graphicsview/chip/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..b82c3eced8
--- /dev/null
+++ b/examples/widgets/graphicsview/chip/.prev_CMakeLists.txt
@@ -0,0 +1,58 @@
+# Generated from chip.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(chip LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/graphicsview/chip")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(chip
+ chip.cpp chip.h
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ view.cpp view.h
+)
+target_link_libraries(chip PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(images_resource_files
+ "fileprint.png"
+ "qt4logo.png"
+ "rotateleft.png"
+ "rotateright.png"
+ "zoomin.png"
+ "zoomout.png"
+)
+
+qt6_add_resources(chip "images"
+ PREFIX
+ "/"
+ FILES
+ ${images_resource_files}
+)
+
+if(TARGET Qt::PrintSupport)
+ target_link_libraries(chip PUBLIC
+ Qt::PrintSupport
+ )
+endif()
+
+install(TARGETS chip
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/graphicsview/chip/CMakeLists.txt b/examples/widgets/graphicsview/chip/CMakeLists.txt
new file mode 100644
index 0000000000..41af2553ee
--- /dev/null
+++ b/examples/widgets/graphicsview/chip/CMakeLists.txt
@@ -0,0 +1,60 @@
+# Generated from chip.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(chip LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/graphicsview/chip")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS OpenGL) # special case
+find_package(Qt6 COMPONENTS PrintSupport) # special case
+
+add_qt_gui_executable(chip
+ chip.cpp chip.h
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ view.cpp view.h
+)
+target_link_libraries(chip PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(images_resource_files
+ "fileprint.png"
+ "qt4logo.png"
+ "rotateleft.png"
+ "rotateright.png"
+ "zoomin.png"
+ "zoomout.png"
+)
+
+qt6_add_resources(chip "images"
+ PREFIX
+ "/"
+ FILES
+ ${images_resource_files}
+)
+
+if(TARGET Qt::PrintSupport)
+ target_link_libraries(chip PUBLIC
+ Qt::PrintSupport
+ )
+endif()
+
+install(TARGETS chip
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/graphicsview/chip/chip.pro b/examples/widgets/graphicsview/chip/chip.pro
index a46f07ce35..508928d026 100644
--- a/examples/widgets/graphicsview/chip/chip.pro
+++ b/examples/widgets/graphicsview/chip/chip.pro
@@ -6,7 +6,6 @@ SOURCES += mainwindow.cpp view.cpp chip.cpp
QT += widgets
qtHaveModule(printsupport): QT += printsupport
-qtHaveModule(opengl): QT += opengl
build_all:!build_pass {
CONFIG -= build_all
diff --git a/examples/widgets/graphicsview/chip/view.cpp b/examples/widgets/graphicsview/chip/view.cpp
index 3b1718bdbd..186b24655b 100644
--- a/examples/widgets/graphicsview/chip/view.cpp
+++ b/examples/widgets/graphicsview/chip/view.cpp
@@ -57,11 +57,7 @@
#include <QPrintDialog>
#endif
#endif
-#ifndef QT_NO_OPENGL
-#include <QtOpenGL>
-#else
#include <QtWidgets>
-#endif
#include <QtMath>
#if QT_CONFIG(wheelevent)
@@ -156,14 +152,6 @@ View::View(const QString &name, QWidget *parent)
antialiasButton->setText(tr("Antialiasing"));
antialiasButton->setCheckable(true);
antialiasButton->setChecked(false);
- openGlButton = new QToolButton;
- openGlButton->setText(tr("OpenGL"));
- openGlButton->setCheckable(true);
-#ifndef QT_NO_OPENGL
- openGlButton->setEnabled(QGLFormat::hasOpenGL());
-#else
- openGlButton->setEnabled(false);
-#endif
printButton = new QToolButton;
printButton->setIcon(QIcon(QPixmap(":/fileprint.png")));
@@ -179,7 +167,6 @@ View::View(const QString &name, QWidget *parent)
labelLayout->addWidget(dragModeButton);
labelLayout->addStretch();
labelLayout->addWidget(antialiasButton);
- labelLayout->addWidget(openGlButton);
labelLayout->addWidget(printButton);
QGridLayout *topLayout = new QGridLayout;
@@ -200,7 +187,6 @@ View::View(const QString &name, QWidget *parent)
connect(selectModeButton, &QAbstractButton::toggled, this, &View::togglePointerMode);
connect(dragModeButton, &QAbstractButton::toggled, this, &View::togglePointerMode);
connect(antialiasButton, &QAbstractButton::toggled, this, &View::toggleAntialiasing);
- connect(openGlButton, &QAbstractButton::toggled, this, &View::toggleOpenGL);
connect(rotateLeftIcon, &QAbstractButton::clicked, this, &View::rotateLeft);
connect(rotateRightIcon, &QAbstractButton::clicked, this, &View::rotateRight);
connect(zoomInIcon, &QAbstractButton::clicked, this, &View::zoomIn);
@@ -250,13 +236,6 @@ void View::togglePointerMode()
graphicsView->setInteractive(selectModeButton->isChecked());
}
-void View::toggleOpenGL()
-{
-#ifndef QT_NO_OPENGL
- graphicsView->setViewport(openGlButton->isChecked() ? new QGLWidget(QGLFormat(QGL::SampleBuffers)) : new QWidget);
-#endif
-}
-
void View::toggleAntialiasing()
{
graphicsView->setRenderHint(QPainter::Antialiasing, antialiasButton->isChecked());
diff --git a/examples/widgets/graphicsview/chip/view.h b/examples/widgets/graphicsview/chip/view.h
index ea7bd414f5..b780702c34 100644
--- a/examples/widgets/graphicsview/chip/view.h
+++ b/examples/widgets/graphicsview/chip/view.h
@@ -94,7 +94,6 @@ private slots:
void setResetButtonEnabled();
void setupMatrix();
void togglePointerMode();
- void toggleOpenGL();
void toggleAntialiasing();
void print();
void rotateLeft();
@@ -106,7 +105,6 @@ private:
QLabel *label2;
QToolButton *selectModeButton;
QToolButton *dragModeButton;
- QToolButton *openGlButton;
QToolButton *antialiasButton;
QToolButton *printButton;
QToolButton *resetButton;
diff --git a/examples/widgets/graphicsview/collidingmice/CMakeLists.txt b/examples/widgets/graphicsview/collidingmice/CMakeLists.txt
new file mode 100644
index 0000000000..c2b0479e76
--- /dev/null
+++ b/examples/widgets/graphicsview/collidingmice/CMakeLists.txt
@@ -0,0 +1,45 @@
+# Generated from collidingmice.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(collidingmice LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/graphicsview/collidingmice")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(collidingmice
+ main.cpp
+ mouse.cpp mouse.h
+)
+target_link_libraries(collidingmice PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(mice_resource_files
+ "images/cheese.jpg"
+)
+
+qt6_add_resources(collidingmice "mice"
+ PREFIX
+ "/"
+ FILES
+ ${mice_resource_files}
+)
+
+install(TARGETS collidingmice
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/graphicsview/diagramscene/CMakeLists.txt b/examples/widgets/graphicsview/diagramscene/CMakeLists.txt
new file mode 100644
index 0000000000..26afe90016
--- /dev/null
+++ b/examples/widgets/graphicsview/diagramscene/CMakeLists.txt
@@ -0,0 +1,63 @@
+# Generated from diagramscene.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(diagramscene LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/graphicsview/diagramscene")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(diagramscene
+ arrow.cpp arrow.h
+ diagramitem.cpp diagramitem.h
+ diagramscene.cpp diagramscene.h
+ diagramtextitem.cpp diagramtextitem.h
+ main.cpp
+ mainwindow.cpp mainwindow.h
+)
+target_link_libraries(diagramscene PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(diagramscene_resource_files
+ "images/background1.png"
+ "images/background2.png"
+ "images/background3.png"
+ "images/background4.png"
+ "images/bold.png"
+ "images/bringtofront.png"
+ "images/delete.png"
+ "images/floodfill.png"
+ "images/italic.png"
+ "images/linecolor.png"
+ "images/linepointer.png"
+ "images/pointer.png"
+ "images/sendtoback.png"
+ "images/textpointer.png"
+ "images/underline.png"
+)
+
+qt6_add_resources(diagramscene "diagramscene"
+ PREFIX
+ "/"
+ FILES
+ ${diagramscene_resource_files}
+)
+
+install(TARGETS diagramscene
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/graphicsview/dragdroprobot/CMakeLists.txt b/examples/widgets/graphicsview/dragdroprobot/CMakeLists.txt
new file mode 100644
index 0000000000..db6c34065e
--- /dev/null
+++ b/examples/widgets/graphicsview/dragdroprobot/CMakeLists.txt
@@ -0,0 +1,46 @@
+# Generated from dragdroprobot.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(dragdroprobot LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/graphicsview/dragdroprobot")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(dragdroprobot
+ coloritem.cpp coloritem.h
+ main.cpp
+ robot.cpp robot.h
+)
+target_link_libraries(dragdroprobot PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(robot_resource_files
+ "images/head.png"
+)
+
+qt6_add_resources(dragdroprobot "robot"
+ PREFIX
+ "/"
+ FILES
+ ${robot_resource_files}
+)
+
+install(TARGETS dragdroprobot
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/graphicsview/elasticnodes/CMakeLists.txt b/examples/widgets/graphicsview/elasticnodes/CMakeLists.txt
new file mode 100644
index 0000000000..5dc52c9755
--- /dev/null
+++ b/examples/widgets/graphicsview/elasticnodes/CMakeLists.txt
@@ -0,0 +1,34 @@
+# Generated from elasticnodes.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(elasticnodes LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/graphicsview/elasticnodes")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(elasticnodes
+ edge.cpp edge.h
+ graphwidget.cpp graphwidget.h
+ main.cpp
+ node.cpp node.h
+)
+target_link_libraries(elasticnodes PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS elasticnodes
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt b/examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt
new file mode 100644
index 0000000000..0b9df4b4d6
--- /dev/null
+++ b/examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt
@@ -0,0 +1,46 @@
+# Generated from embeddeddialogs.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(embeddeddialogs LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/graphicsview/embeddeddialogs")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(embeddeddialogs
+ customproxy.cpp customproxy.h
+ embeddeddialog.cpp embeddeddialog.h embeddeddialog.ui
+ main.cpp
+)
+target_link_libraries(embeddeddialogs PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(embeddeddialogs_resource_files
+ "No-Ones-Laughing-3.jpg"
+)
+
+qt6_add_resources(embeddeddialogs "embeddeddialogs"
+ PREFIX
+ "/"
+ FILES
+ ${embeddeddialogs_resource_files}
+)
+
+install(TARGETS embeddeddialogs
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/graphicsview/embeddeddialogs/embeddeddialog.cpp b/examples/widgets/graphicsview/embeddeddialogs/embeddeddialog.cpp
index 9fa24fcd17..2f1d9a330c 100644
--- a/examples/widgets/graphicsview/embeddeddialogs/embeddeddialog.cpp
+++ b/examples/widgets/graphicsview/embeddeddialogs/embeddeddialog.cpp
@@ -67,7 +67,7 @@ EmbeddedDialog::EmbeddedDialog(QWidget *parent)
ui->style->setCurrentIndex(ui->style->count() - 1);
}
- connect(ui->layoutDirection, QOverload<int>::of(&QComboBox::activated),
+ connect(ui->layoutDirection, &QComboBox::activated,
this, &EmbeddedDialog::layoutDirectionChanged);
connect(ui->spacing, &QSlider::valueChanged,
this, &EmbeddedDialog::spacingChanged);
diff --git a/examples/widgets/graphicsview/flowlayout/.prev_CMakeLists.txt b/examples/widgets/graphicsview/flowlayout/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..ce24a9fcb2
--- /dev/null
+++ b/examples/widgets/graphicsview/flowlayout/.prev_CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from flowlayout.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(flowlayout LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/graphicsview/flowlayout")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(flowlayout
+ flowlayout.cpp flowlayout.h
+ main.cpp
+ window.cpp window.h
+)
+target_link_libraries(flowlayout PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS flowlayout
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/graphicsview/flowlayout/CMakeLists.txt b/examples/widgets/graphicsview/flowlayout/CMakeLists.txt
new file mode 100644
index 0000000000..50f41f7782
--- /dev/null
+++ b/examples/widgets/graphicsview/flowlayout/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from flowlayout.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(flowlayout LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/graphicsview/graphicsview_flowlayout") # special case
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(graphicsview_flowlayout # special case: renamed flowlayout
+ flowlayout.cpp flowlayout.h
+ main.cpp
+ window.cpp window.h
+)
+target_link_libraries(graphicsview_flowlayout PUBLIC # special case
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS graphicsview_flowlayout # special case: renamed flowlayout
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/graphicsview/graphicsview.pro b/examples/widgets/graphicsview/graphicsview.pro
index b9bef70a0e..d591450559 100644
--- a/examples/widgets/graphicsview/graphicsview.pro
+++ b/examples/widgets/graphicsview/graphicsview.pro
@@ -14,7 +14,3 @@ SUBDIRS = \
weatheranchorlayout
contains(DEFINES, QT_NO_CURSOR)|!qtConfig(draganddrop): SUBDIRS -= dragdroprobot
-
-qtHaveModule(opengl):!qtConfig(opengles.):!qtConfig(dynamicgl) {
- SUBDIRS += boxes
-}
diff --git a/examples/widgets/graphicsview/padnavigator/.prev_CMakeLists.txt b/examples/widgets/graphicsview/padnavigator/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..6514f07a5a
--- /dev/null
+++ b/examples/widgets/graphicsview/padnavigator/.prev_CMakeLists.txt
@@ -0,0 +1,64 @@
+# Generated from padnavigator.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(padnavigator LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/graphicsview/padnavigator")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_executable(padnavigator
+ flippablepad.cpp flippablepad.h
+ form.ui
+ main.cpp
+ padnavigator.cpp padnavigator.h
+ roundrectitem.cpp roundrectitem.h
+ splashitem.cpp splashitem.h
+)
+target_link_libraries(padnavigator PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(padnavigator_resource_files
+ "images/artsfftscope.png"
+ "images/blue_angle_swirl.jpg"
+ "images/kontact_contacts.png"
+ "images/kontact_journal.png"
+ "images/kontact_mail.png"
+ "images/kontact_notes.png"
+ "images/kopeteavailable.png"
+ "images/metacontact_online.png"
+ "images/minitools.png"
+)
+
+qt6_add_resources(padnavigator "padnavigator"
+ PREFIX
+ "/"
+ FILES
+ ${padnavigator_resource_files}
+)
+
+if(TARGET Qt::OpenGL)
+ target_link_libraries(padnavigator PUBLIC
+ Qt::OpenGL
+ Qt::OpenGLWidgets
+ )
+endif()
+
+install(TARGETS padnavigator
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/graphicsview/padnavigator/CMakeLists.txt b/examples/widgets/graphicsview/padnavigator/CMakeLists.txt
new file mode 100644
index 0000000000..a84d3f08d1
--- /dev/null
+++ b/examples/widgets/graphicsview/padnavigator/CMakeLists.txt
@@ -0,0 +1,65 @@
+# Generated from padnavigator.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(padnavigator LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/graphicsview/padnavigator")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS OpenGL) # special case
+
+add_executable(padnavigator
+ flippablepad.cpp flippablepad.h
+ form.ui
+ main.cpp
+ padnavigator.cpp padnavigator.h
+ roundrectitem.cpp roundrectitem.h
+ splashitem.cpp splashitem.h
+)
+target_link_libraries(padnavigator PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(padnavigator_resource_files
+ "images/artsfftscope.png"
+ "images/blue_angle_swirl.jpg"
+ "images/kontact_contacts.png"
+ "images/kontact_journal.png"
+ "images/kontact_mail.png"
+ "images/kontact_notes.png"
+ "images/kopeteavailable.png"
+ "images/metacontact_online.png"
+ "images/minitools.png"
+)
+
+qt6_add_resources(padnavigator "padnavigator"
+ PREFIX
+ "/"
+ FILES
+ ${padnavigator_resource_files}
+)
+
+if(TARGET Qt::OpenGL)
+ target_link_libraries(padnavigator PUBLIC
+ Qt::OpenGL
+ Qt::OpenGLWidgets
+ )
+endif()
+
+install(TARGETS padnavigator
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/graphicsview/padnavigator/padnavigator.pro b/examples/widgets/graphicsview/padnavigator/padnavigator.pro
index 53a57c85d7..d957be4593 100644
--- a/examples/widgets/graphicsview/padnavigator/padnavigator.pro
+++ b/examples/widgets/graphicsview/padnavigator/padnavigator.pro
@@ -18,7 +18,7 @@ FORMS += \
QT += widgets
requires(qtConfig(treewidget))
-qtHaveModule(opengl): QT += opengl
+qtHaveModule(opengl): QT += opengl openglwidgets
# install
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/graphicsview/padnavigator
diff --git a/examples/widgets/graphicsview/simpleanchorlayout/CMakeLists.txt b/examples/widgets/graphicsview/simpleanchorlayout/CMakeLists.txt
new file mode 100644
index 0000000000..c7ea760ede
--- /dev/null
+++ b/examples/widgets/graphicsview/simpleanchorlayout/CMakeLists.txt
@@ -0,0 +1,31 @@
+# Generated from simpleanchorlayout.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(simpleanchorlayout LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/graphicsview/simpleanchorlayout")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(simpleanchorlayout
+ main.cpp
+)
+target_link_libraries(simpleanchorlayout PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS simpleanchorlayout
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/graphicsview/weatheranchorlayout/CMakeLists.txt b/examples/widgets/graphicsview/weatheranchorlayout/CMakeLists.txt
new file mode 100644
index 0000000000..d6ca46ab22
--- /dev/null
+++ b/examples/widgets/graphicsview/weatheranchorlayout/CMakeLists.txt
@@ -0,0 +1,49 @@
+# Generated from weatheranchorlayout.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(weatheranchorlayout LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/graphicsview/weatheranchorlayout")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(weatheranchorlayout
+ main.cpp
+)
+target_link_libraries(weatheranchorlayout PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(weatheranchorlayout_resource_files
+ "images/5days.jpg"
+ "images/details.jpg"
+ "images/place.jpg"
+ "images/tabbar.jpg"
+ "images/title.jpg"
+ "images/weather-few-clouds.png"
+)
+
+qt6_add_resources(weatheranchorlayout "weatheranchorlayout"
+ PREFIX
+ "/"
+ FILES
+ ${weatheranchorlayout_resource_files}
+)
+
+install(TARGETS weatheranchorlayout
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/itemviews/CMakeLists.txt b/examples/widgets/itemviews/CMakeLists.txt
new file mode 100644
index 0000000000..a1bd0c4dca
--- /dev/null
+++ b/examples/widgets/itemviews/CMakeLists.txt
@@ -0,0 +1,27 @@
+# Generated from itemviews.pro.
+
+add_subdirectory(addressbook)
+add_subdirectory(basicsortfiltermodel)
+add_subdirectory(chart)
+add_subdirectory(coloreditorfactory)
+add_subdirectory(combowidgetmapper)
+add_subdirectory(customsortfiltermodel)
+add_subdirectory(dirview)
+add_subdirectory(editabletreemodel)
+add_subdirectory(fetchmore)
+add_subdirectory(flattreeview)
+add_subdirectory(frozencolumn)
+add_subdirectory(interview)
+add_subdirectory(pixelator)
+if(QT_FEATURE_draganddrop) # special case
+ add_subdirectory(puzzle)
+endif()
+if(TARGET Qt::Xml) # special case
+ add_subdirectory(simpledommodel)
+endif()
+add_subdirectory(simpletreemodel)
+add_subdirectory(simplewidgetmapper)
+add_subdirectory(spinboxdelegate)
+add_subdirectory(spreadsheet)
+add_subdirectory(stardelegate)
+add_subdirectory(storageview)
diff --git a/examples/widgets/itemviews/addressbook/CMakeLists.txt b/examples/widgets/itemviews/addressbook/CMakeLists.txt
new file mode 100644
index 0000000000..5c14da9ac5
--- /dev/null
+++ b/examples/widgets/itemviews/addressbook/CMakeLists.txt
@@ -0,0 +1,36 @@
+# Generated from addressbook.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(addressbook LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/itemviews/addressbook")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(addressbook
+ adddialog.cpp adddialog.h
+ addresswidget.cpp addresswidget.h
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ newaddresstab.cpp newaddresstab.h
+ tablemodel.cpp tablemodel.h
+)
+target_link_libraries(addressbook PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS addressbook
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/itemviews/basicsortfiltermodel/CMakeLists.txt b/examples/widgets/itemviews/basicsortfiltermodel/CMakeLists.txt
new file mode 100644
index 0000000000..90862ac0b0
--- /dev/null
+++ b/examples/widgets/itemviews/basicsortfiltermodel/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from basicsortfiltermodel.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(basicsortfiltermodel LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/itemviews/basicsortfiltermodel")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(basicsortfiltermodel
+ main.cpp
+ window.cpp window.h
+)
+target_link_libraries(basicsortfiltermodel PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS basicsortfiltermodel
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/itemviews/basicsortfiltermodel/window.cpp b/examples/widgets/itemviews/basicsortfiltermodel/window.cpp
index b45ee47ee2..bfc9044724 100644
--- a/examples/widgets/itemviews/basicsortfiltermodel/window.cpp
+++ b/examples/widgets/itemviews/basicsortfiltermodel/window.cpp
@@ -89,9 +89,9 @@ Window::Window()
connect(filterPatternLineEdit, &QLineEdit::textChanged,
this, &Window::filterRegExpChanged);
- connect(filterSyntaxComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
+ connect(filterSyntaxComboBox, &QComboBox::currentIndexChanged,
this, &Window::filterRegExpChanged);
- connect(filterColumnComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
+ connect(filterColumnComboBox, &QComboBox::currentIndexChanged,
this, &Window::filterColumnChanged);
connect(filterCaseSensitivityCheckBox, &QAbstractButton::toggled,
this, &Window::filterRegExpChanged);
diff --git a/examples/widgets/itemviews/chart/CMakeLists.txt b/examples/widgets/itemviews/chart/CMakeLists.txt
new file mode 100644
index 0000000000..5788215de6
--- /dev/null
+++ b/examples/widgets/itemviews/chart/CMakeLists.txt
@@ -0,0 +1,52 @@
+# Generated from chart.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(chart LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/itemviews/chart")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(chart
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ pieview.cpp pieview.h
+)
+target_link_libraries(chart PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(chart_resource_files
+ "qtdata.cht"
+)
+
+qt6_add_resources(chart "chart"
+ PREFIX
+ "/Charts"
+ FILES
+ ${chart_resource_files}
+)
+
+if(UNIX AND NOT APPLE AND NOT HAIKU AND NOT INTEGRITY AND NOT VXWORKS)
+ target_link_libraries(chart PUBLIC
+ m
+ )
+endif()
+
+install(TARGETS chart
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/itemviews/coloreditorfactory/CMakeLists.txt b/examples/widgets/itemviews/coloreditorfactory/CMakeLists.txt
new file mode 100644
index 0000000000..3ec96a2fc4
--- /dev/null
+++ b/examples/widgets/itemviews/coloreditorfactory/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from coloreditorfactory.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(coloreditorfactory LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/itemviews/coloreditorfactory")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(coloreditorfactory
+ colorlisteditor.cpp colorlisteditor.h
+ main.cpp
+ window.cpp window.h
+)
+target_link_libraries(coloreditorfactory PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS coloreditorfactory
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/itemviews/combowidgetmapper/CMakeLists.txt b/examples/widgets/itemviews/combowidgetmapper/CMakeLists.txt
new file mode 100644
index 0000000000..c8a0bc1438
--- /dev/null
+++ b/examples/widgets/itemviews/combowidgetmapper/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from combowidgetmapper.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(combowidgetmapper LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/itemviews/combowidgetmapper")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(combowidgetmapper
+ main.cpp
+ window.cpp window.h
+)
+target_link_libraries(combowidgetmapper PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS combowidgetmapper
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/itemviews/customsortfiltermodel/CMakeLists.txt b/examples/widgets/itemviews/customsortfiltermodel/CMakeLists.txt
new file mode 100644
index 0000000000..859b88a397
--- /dev/null
+++ b/examples/widgets/itemviews/customsortfiltermodel/CMakeLists.txt
@@ -0,0 +1,47 @@
+# Generated from customsortfiltermodel.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(customsortfiltermodel LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/itemviews/customsortfiltermodel")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(customsortfiltermodel
+ filterwidget.cpp filterwidget.h
+ main.cpp
+ mysortfilterproxymodel.cpp mysortfilterproxymodel.h
+ window.cpp window.h
+)
+target_link_libraries(customsortfiltermodel PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(customsortfiltermodel_resource_files
+ "images/find.png"
+)
+
+qt6_add_resources(customsortfiltermodel "customsortfiltermodel"
+ PREFIX
+ "/"
+ FILES
+ ${customsortfiltermodel_resource_files}
+)
+
+install(TARGETS customsortfiltermodel
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/itemviews/dirview/CMakeLists.txt b/examples/widgets/itemviews/dirview/CMakeLists.txt
new file mode 100644
index 0000000000..6cb902c092
--- /dev/null
+++ b/examples/widgets/itemviews/dirview/CMakeLists.txt
@@ -0,0 +1,31 @@
+# Generated from dirview.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(dirview LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/itemviews/dirview")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(dirview
+ main.cpp
+)
+target_link_libraries(dirview PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS dirview
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/itemviews/editabletreemodel/CMakeLists.txt b/examples/widgets/itemviews/editabletreemodel/CMakeLists.txt
new file mode 100644
index 0000000000..faae8e1a80
--- /dev/null
+++ b/examples/widgets/itemviews/editabletreemodel/CMakeLists.txt
@@ -0,0 +1,47 @@
+# Generated from editabletreemodel.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(editabletreemodel LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/itemviews/editabletreemodel")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(editabletreemodel
+ main.cpp
+ mainwindow.cpp mainwindow.h mainwindow.ui
+ treeitem.cpp treeitem.h
+ treemodel.cpp treemodel.h
+)
+target_link_libraries(editabletreemodel PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(editabletreemodel_resource_files
+ "default.txt"
+)
+
+qt6_add_resources(editabletreemodel "editabletreemodel"
+ PREFIX
+ "/"
+ FILES
+ ${editabletreemodel_resource_files}
+)
+
+install(TARGETS editabletreemodel
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/itemviews/fetchmore/CMakeLists.txt b/examples/widgets/itemviews/fetchmore/CMakeLists.txt
new file mode 100644
index 0000000000..fea985d049
--- /dev/null
+++ b/examples/widgets/itemviews/fetchmore/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from fetchmore.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(fetchmore LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/itemviews/fetchmore")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(fetchmore
+ filelistmodel.cpp filelistmodel.h
+ main.cpp
+ window.cpp window.h
+)
+target_link_libraries(fetchmore PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS fetchmore
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/itemviews/flattreeview/CMakeLists.txt b/examples/widgets/itemviews/flattreeview/CMakeLists.txt
new file mode 100644
index 0000000000..c0c4ef6146
--- /dev/null
+++ b/examples/widgets/itemviews/flattreeview/CMakeLists.txt
@@ -0,0 +1,31 @@
+# Generated from flattreeview.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(flattreeview LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/itemviews/flattreeview")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(flattreeview
+ main.cpp
+)
+target_link_libraries(flattreeview PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS flattreeview
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/itemviews/frozencolumn/CMakeLists.txt b/examples/widgets/itemviews/frozencolumn/CMakeLists.txt
new file mode 100644
index 0000000000..dab2e0a153
--- /dev/null
+++ b/examples/widgets/itemviews/frozencolumn/CMakeLists.txt
@@ -0,0 +1,45 @@
+# Generated from frozencolumn.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(frozencolumn LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/itemviews/frozencolumn")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(frozencolumn
+ freezetablewidget.cpp freezetablewidget.h
+ main.cpp
+)
+target_link_libraries(frozencolumn PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(grades_resource_files
+ "grades.txt"
+)
+
+qt6_add_resources(frozencolumn "grades"
+ PREFIX
+ "/"
+ FILES
+ ${grades_resource_files}
+)
+
+install(TARGETS frozencolumn
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/itemviews/interview/CMakeLists.txt b/examples/widgets/itemviews/interview/CMakeLists.txt
new file mode 100644
index 0000000000..c27018ffa4
--- /dev/null
+++ b/examples/widgets/itemviews/interview/CMakeLists.txt
@@ -0,0 +1,47 @@
+# Generated from interview.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(interview LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/itemviews/interview")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(interview
+ main.cpp
+ model.cpp model.h
+)
+target_link_libraries(interview PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(interview_resource_files
+ "images/folder.png"
+ "images/interview.png"
+ "images/services.png"
+)
+
+qt6_add_resources(interview "interview"
+ PREFIX
+ "/"
+ FILES
+ ${interview_resource_files}
+)
+
+install(TARGETS interview
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/itemviews/pixelator/.prev_CMakeLists.txt b/examples/widgets/itemviews/pixelator/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..1c8ccc6f81
--- /dev/null
+++ b/examples/widgets/itemviews/pixelator/.prev_CMakeLists.txt
@@ -0,0 +1,53 @@
+# Generated from pixelator.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(pixelator LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/itemviews/pixelator")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(pixelator
+ imagemodel.cpp imagemodel.h
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ pixeldelegate.cpp pixeldelegate.h
+)
+target_link_libraries(pixelator PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(images_resource_files
+ "images/qt.png"
+)
+
+qt6_add_resources(pixelator "images"
+ PREFIX
+ "/"
+ FILES
+ ${images_resource_files}
+)
+
+if(TARGET Qt::PrintSupport)
+ target_link_libraries(pixelator PUBLIC
+ Qt::PrintSupport
+ )
+endif()
+
+install(TARGETS pixelator
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/itemviews/pixelator/CMakeLists.txt b/examples/widgets/itemviews/pixelator/CMakeLists.txt
new file mode 100644
index 0000000000..aba494c31a
--- /dev/null
+++ b/examples/widgets/itemviews/pixelator/CMakeLists.txt
@@ -0,0 +1,54 @@
+# Generated from pixelator.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(pixelator LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/itemviews/pixelator")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS PrintSupport) # special case
+
+add_qt_gui_executable(pixelator
+ imagemodel.cpp imagemodel.h
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ pixeldelegate.cpp pixeldelegate.h
+)
+target_link_libraries(pixelator PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(images_resource_files
+ "images/qt.png"
+)
+
+qt6_add_resources(pixelator "images"
+ PREFIX
+ "/"
+ FILES
+ ${images_resource_files}
+)
+
+if(TARGET Qt::PrintSupport)
+ target_link_libraries(pixelator PUBLIC
+ Qt::PrintSupport
+ )
+endif()
+
+install(TARGETS pixelator
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/itemviews/pixelator/mainwindow.cpp b/examples/widgets/itemviews/pixelator/mainwindow.cpp
index abd4a8b1ab..e590a1397b 100644
--- a/examples/widgets/itemviews/pixelator/mainwindow.cpp
+++ b/examples/widgets/itemviews/pixelator/mainwindow.cpp
@@ -116,9 +116,9 @@ MainWindow::MainWindow()
connect(quitAction, &QAction::triggered, qApp, &QCoreApplication::quit);
connect(aboutAction, &QAction::triggered, this, &MainWindow::showAboutBox);
//! [4]
- connect(pixelSizeSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
+ connect(pixelSizeSpinBox, &QSpinBox::valueChanged,
delegate, &PixelDelegate::setPixelSize);
- connect(pixelSizeSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
+ connect(pixelSizeSpinBox, &QSpinBox::valueChanged,
this, &MainWindow::updateView);
//! [4]
diff --git a/examples/widgets/itemviews/puzzle/.prev_CMakeLists.txt b/examples/widgets/itemviews/puzzle/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..17765e9d47
--- /dev/null
+++ b/examples/widgets/itemviews/puzzle/.prev_CMakeLists.txt
@@ -0,0 +1,47 @@
+# Generated from puzzle.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(puzzle LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/itemviews/puzzle")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(puzzle
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ piecesmodel.cpp piecesmodel.h
+ puzzlewidget.cpp puzzlewidget.h
+)
+target_link_libraries(puzzle PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(puzzle_resource_files
+ "example.jpg"
+)
+
+qt6_add_resources(puzzle "puzzle"
+ PREFIX
+ "/images"
+ FILES
+ ${puzzle_resource_files}
+)
+
+install(TARGETS puzzle
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/itemviews/puzzle/CMakeLists.txt b/examples/widgets/itemviews/puzzle/CMakeLists.txt
new file mode 100644
index 0000000000..53494d37f1
--- /dev/null
+++ b/examples/widgets/itemviews/puzzle/CMakeLists.txt
@@ -0,0 +1,47 @@
+# Generated from puzzle.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(puzzle LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/itemviews/puzzle")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(itemviews_puzzle # special case: renamed puzzle
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ piecesmodel.cpp piecesmodel.h
+ puzzlewidget.cpp puzzlewidget.h
+)
+target_link_libraries(itemviews_puzzle PUBLIC # special case
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(puzzle_resource_files
+ "example.jpg"
+)
+
+qt6_add_resources(itemviews_puzzle "puzzle"
+ PREFIX
+ "/images"
+ FILES
+ ${puzzle_resource_files}
+)
+
+install(TARGETS itemviews_puzzle # special case: renamed puzzle
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/itemviews/simpledommodel/CMakeLists.txt b/examples/widgets/itemviews/simpledommodel/CMakeLists.txt
new file mode 100644
index 0000000000..e22e3fe1ad
--- /dev/null
+++ b/examples/widgets/itemviews/simpledommodel/CMakeLists.txt
@@ -0,0 +1,36 @@
+# Generated from simpledommodel.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(simpledommodel LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/itemviews/simpledommodel")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Xml)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(simpledommodel
+ domitem.cpp domitem.h
+ dommodel.cpp dommodel.h
+ main.cpp
+ mainwindow.cpp mainwindow.h
+)
+target_link_libraries(simpledommodel PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+ Qt::Xml
+)
+
+install(TARGETS simpledommodel
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/itemviews/simpletreemodel/CMakeLists.txt b/examples/widgets/itemviews/simpletreemodel/CMakeLists.txt
new file mode 100644
index 0000000000..8a6607e584
--- /dev/null
+++ b/examples/widgets/itemviews/simpletreemodel/CMakeLists.txt
@@ -0,0 +1,46 @@
+# Generated from simpletreemodel.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(simpletreemodel LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/itemviews/simpletreemodel")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(simpletreemodel
+ main.cpp
+ treeitem.cpp treeitem.h
+ treemodel.cpp treemodel.h
+)
+target_link_libraries(simpletreemodel PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(simpletreemodel_resource_files
+ "default.txt"
+)
+
+qt6_add_resources(simpletreemodel "simpletreemodel"
+ PREFIX
+ "/"
+ FILES
+ ${simpletreemodel_resource_files}
+)
+
+install(TARGETS simpletreemodel
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/itemviews/simplewidgetmapper/CMakeLists.txt b/examples/widgets/itemviews/simplewidgetmapper/CMakeLists.txt
new file mode 100644
index 0000000000..163dc98e2c
--- /dev/null
+++ b/examples/widgets/itemviews/simplewidgetmapper/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from simplewidgetmapper.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(simplewidgetmapper LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/itemviews/simplewidgetmapper")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(simplewidgetmapper
+ main.cpp
+ window.cpp window.h
+)
+target_link_libraries(simplewidgetmapper PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS simplewidgetmapper
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/itemviews/spinboxdelegate/CMakeLists.txt b/examples/widgets/itemviews/spinboxdelegate/CMakeLists.txt
new file mode 100644
index 0000000000..b73158cd5a
--- /dev/null
+++ b/examples/widgets/itemviews/spinboxdelegate/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from spinboxdelegate.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(spinboxdelegate LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/itemviews/spinboxdelegate")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(spinboxdelegate
+ delegate.cpp delegate.h
+ main.cpp
+)
+target_link_libraries(spinboxdelegate PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS spinboxdelegate
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/itemviews/spreadsheet/.prev_CMakeLists.txt b/examples/widgets/itemviews/spreadsheet/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..acf5f187fe
--- /dev/null
+++ b/examples/widgets/itemviews/spreadsheet/.prev_CMakeLists.txt
@@ -0,0 +1,54 @@
+# Generated from spreadsheet.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(spreadsheet LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/itemviews/spreadsheet")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(spreadsheet
+ main.cpp
+ printview.cpp printview.h
+ spreadsheet.cpp spreadsheet.h
+ spreadsheetdelegate.cpp spreadsheetdelegate.h
+ spreadsheetitem.cpp spreadsheetitem.h
+)
+target_link_libraries(spreadsheet PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(spreadsheet_resource_files
+ "images/interview.png"
+)
+
+qt6_add_resources(spreadsheet "spreadsheet"
+ PREFIX
+ "/"
+ FILES
+ ${spreadsheet_resource_files}
+)
+
+if(TARGET Qt::PrintSupport)
+ target_link_libraries(spreadsheet PUBLIC
+ Qt::PrintSupport
+ )
+endif()
+
+install(TARGETS spreadsheet
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/itemviews/spreadsheet/CMakeLists.txt b/examples/widgets/itemviews/spreadsheet/CMakeLists.txt
new file mode 100644
index 0000000000..b1fc6ff01a
--- /dev/null
+++ b/examples/widgets/itemviews/spreadsheet/CMakeLists.txt
@@ -0,0 +1,60 @@
+# Generated from spreadsheet.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(spreadsheet LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/itemviews/spreadsheet")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS PrintSupport) # special case
+
+add_qt_gui_executable(spreadsheet
+ main.cpp
+ printview.cpp printview.h
+ spreadsheet.cpp spreadsheet.h
+ spreadsheetdelegate.cpp spreadsheetdelegate.h
+ spreadsheetitem.cpp spreadsheetitem.h
+)
+target_link_libraries(spreadsheet PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+# special case begin
+if (TARGET Qt::PrintSupport)
+ target_link_libraries(spreadsheet PUBLIC Qt::PrintSupport)
+endif()
+# special case end
+
+
+# Resources:
+set(spreadsheet_resource_files
+ "images/interview.png"
+)
+
+qt6_add_resources(spreadsheet "spreadsheet"
+ PREFIX
+ "/"
+ FILES
+ ${spreadsheet_resource_files}
+)
+
+if(TARGET Qt::PrintSupport)
+ target_link_libraries(spreadsheet PUBLIC
+ Qt::PrintSupport
+ )
+endif()
+
+install(TARGETS spreadsheet
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/itemviews/stardelegate/CMakeLists.txt b/examples/widgets/itemviews/stardelegate/CMakeLists.txt
new file mode 100644
index 0000000000..5f6f660488
--- /dev/null
+++ b/examples/widgets/itemviews/stardelegate/CMakeLists.txt
@@ -0,0 +1,34 @@
+# Generated from stardelegate.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(stardelegate LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/itemviews/stardelegate")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(stardelegate
+ main.cpp
+ stardelegate.cpp stardelegate.h
+ stareditor.cpp stareditor.h
+ starrating.cpp starrating.h
+)
+target_link_libraries(stardelegate PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS stardelegate
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/itemviews/storageview/CMakeLists.txt b/examples/widgets/itemviews/storageview/CMakeLists.txt
new file mode 100644
index 0000000000..99b4f13861
--- /dev/null
+++ b/examples/widgets/itemviews/storageview/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from storageview.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(storageview LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/itemviews/storageview")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(storageview
+ main.cpp
+ storagemodel.cpp storagemodel.h
+)
+target_link_libraries(storageview PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS storageview
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/layouts/CMakeLists.txt b/examples/widgets/layouts/CMakeLists.txt
new file mode 100644
index 0000000000..eaca669248
--- /dev/null
+++ b/examples/widgets/layouts/CMakeLists.txt
@@ -0,0 +1,6 @@
+# Generated from layouts.pro.
+
+add_subdirectory(basiclayouts)
+add_subdirectory(borderlayout)
+add_subdirectory(dynamiclayouts)
+add_subdirectory(flowlayout)
diff --git a/examples/widgets/layouts/basiclayouts/CMakeLists.txt b/examples/widgets/layouts/basiclayouts/CMakeLists.txt
new file mode 100644
index 0000000000..beb8a0ca90
--- /dev/null
+++ b/examples/widgets/layouts/basiclayouts/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from basiclayouts.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(basiclayouts LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/layouts/basiclayouts")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(basiclayouts
+ dialog.cpp dialog.h
+ main.cpp
+)
+target_link_libraries(basiclayouts PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS basiclayouts
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/layouts/borderlayout/CMakeLists.txt b/examples/widgets/layouts/borderlayout/CMakeLists.txt
new file mode 100644
index 0000000000..f4e51d2fab
--- /dev/null
+++ b/examples/widgets/layouts/borderlayout/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from borderlayout.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(borderlayout LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/layouts/borderlayout")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(borderlayout
+ borderlayout.cpp borderlayout.h
+ main.cpp
+ window.cpp window.h
+)
+target_link_libraries(borderlayout PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS borderlayout
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/layouts/dynamiclayouts/CMakeLists.txt b/examples/widgets/layouts/dynamiclayouts/CMakeLists.txt
new file mode 100644
index 0000000000..c2bcd050d5
--- /dev/null
+++ b/examples/widgets/layouts/dynamiclayouts/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from dynamiclayouts.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(dynamiclayouts LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/layouts/dynamiclayouts")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(dynamiclayouts
+ dialog.cpp dialog.h
+ main.cpp
+)
+target_link_libraries(dynamiclayouts PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS dynamiclayouts
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/layouts/dynamiclayouts/dialog.cpp b/examples/widgets/layouts/dynamiclayouts/dialog.cpp
index baf3b4cf1e..bd9baa9faf 100644
--- a/examples/widgets/layouts/dynamiclayouts/dialog.cpp
+++ b/examples/widgets/layouts/dynamiclayouts/dialog.cpp
@@ -155,7 +155,7 @@ void Dialog::createOptionsGroupBox()
buttonsOrientationComboBox->addItem(tr("Vertical"), Qt::Vertical);
connect(buttonsOrientationComboBox,
- QOverload<int>::of(&QComboBox::currentIndexChanged),
+ &QComboBox::currentIndexChanged,
this,
&Dialog::buttonsOrientationChanged);
diff --git a/examples/widgets/layouts/flowlayout/CMakeLists.txt b/examples/widgets/layouts/flowlayout/CMakeLists.txt
new file mode 100644
index 0000000000..85104eb3eb
--- /dev/null
+++ b/examples/widgets/layouts/flowlayout/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from flowlayout.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(flowlayout LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/layouts/flowlayout")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(flowlayout
+ flowlayout.cpp flowlayout.h
+ main.cpp
+ window.cpp window.h
+)
+target_link_libraries(flowlayout PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS flowlayout
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/mac/CMakeLists.txt b/examples/widgets/mac/CMakeLists.txt
new file mode 100644
index 0000000000..82038acfae
--- /dev/null
+++ b/examples/widgets/mac/CMakeLists.txt
@@ -0,0 +1,7 @@
+# Generated from mac.pro.
+
+
+if(APPLE_OSX)
+ add_subdirectory(qmaccocoaviewcontainer)
+ add_subdirectory(qmacnativewidget)
+endif()
diff --git a/examples/widgets/mac/qmaccocoaviewcontainer/CMakeLists.txt b/examples/widgets/mac/qmaccocoaviewcontainer/CMakeLists.txt
new file mode 100644
index 0000000000..158ddc3adf
--- /dev/null
+++ b/examples/widgets/mac/qmaccocoaviewcontainer/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from qmaccocoaviewcontainer.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(qmaccocoaviewcontainer LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/mac/qmaccocoaviewcontainer")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(qmaccocoaviewcontainer
+ main.mm
+)
+target_link_libraries(qmaccocoaviewcontainer PUBLIC
+ "-framework AppKit"
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS qmaccocoaviewcontainer
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/mac/qmacnativewidget/CMakeLists.txt b/examples/widgets/mac/qmacnativewidget/CMakeLists.txt
new file mode 100644
index 0000000000..5ed3e0f4cc
--- /dev/null
+++ b/examples/widgets/mac/qmacnativewidget/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from qmacnativewidget.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(qmacnativewidget LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/mac/qmacnativewidget")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(qmacnativewidget
+ main.mm
+)
+target_link_libraries(qmacnativewidget PUBLIC
+ "-framework AppKit"
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS qmacnativewidget
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/mainwindows/CMakeLists.txt b/examples/widgets/mainwindows/CMakeLists.txt
new file mode 100644
index 0000000000..8bb5f52f92
--- /dev/null
+++ b/examples/widgets/mainwindows/CMakeLists.txt
@@ -0,0 +1,8 @@
+# Generated from mainwindows.pro.
+
+add_subdirectory(application)
+add_subdirectory(dockwidgets)
+add_subdirectory(mainwindow)
+add_subdirectory(mdi)
+add_subdirectory(menus)
+add_subdirectory(sdi)
diff --git a/examples/widgets/mainwindows/application/CMakeLists.txt b/examples/widgets/mainwindows/application/CMakeLists.txt
new file mode 100644
index 0000000000..d66c2ff38a
--- /dev/null
+++ b/examples/widgets/mainwindows/application/CMakeLists.txt
@@ -0,0 +1,50 @@
+# Generated from application.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(application LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/mainwindows/application")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(application
+ main.cpp
+ mainwindow.cpp mainwindow.h
+)
+target_link_libraries(application PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(application_resource_files
+ "images/copy.png"
+ "images/cut.png"
+ "images/new.png"
+ "images/open.png"
+ "images/paste.png"
+ "images/save.png"
+)
+
+qt6_add_resources(application "application"
+ PREFIX
+ "/"
+ FILES
+ ${application_resource_files}
+)
+
+install(TARGETS application
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/mainwindows/dockwidgets/.prev_CMakeLists.txt b/examples/widgets/mainwindows/dockwidgets/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..7bd57f1439
--- /dev/null
+++ b/examples/widgets/mainwindows/dockwidgets/.prev_CMakeLists.txt
@@ -0,0 +1,54 @@
+# Generated from dockwidgets.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(dockwidgets LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/mainwindows/dockwidgets")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(dockwidgets
+ main.cpp
+ mainwindow.cpp mainwindow.h
+)
+target_link_libraries(dockwidgets PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(dockwidgets_resource_files
+ "images/new.png"
+ "images/print.png"
+ "images/save.png"
+ "images/undo.png"
+)
+
+qt6_add_resources(dockwidgets "dockwidgets"
+ PREFIX
+ "/"
+ FILES
+ ${dockwidgets_resource_files}
+)
+
+if(TARGET Qt::PrintSupport)
+ target_link_libraries(dockwidgets PUBLIC
+ Qt::PrintSupport
+ )
+endif()
+
+install(TARGETS dockwidgets
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/mainwindows/dockwidgets/CMakeLists.txt b/examples/widgets/mainwindows/dockwidgets/CMakeLists.txt
new file mode 100644
index 0000000000..b811094658
--- /dev/null
+++ b/examples/widgets/mainwindows/dockwidgets/CMakeLists.txt
@@ -0,0 +1,60 @@
+# Generated from dockwidgets.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(dockwidgets LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/mainwindows/dockwidgets")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS PrintSupport) # special case
+
+add_qt_gui_executable(dockwidgets
+ main.cpp
+ mainwindow.cpp mainwindow.h
+)
+target_link_libraries(dockwidgets PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+# special case begin
+if (TARGET Qt::PrintSupport)
+ target_link_libraries(dockwidgets PUBLIC Qt::PrintSupport)
+endif()
+# special case end
+
+
+# Resources:
+set(dockwidgets_resource_files
+ "images/new.png"
+ "images/print.png"
+ "images/save.png"
+ "images/undo.png"
+)
+
+qt6_add_resources(dockwidgets "dockwidgets"
+ PREFIX
+ "/"
+ FILES
+ ${dockwidgets_resource_files}
+)
+
+if(TARGET Qt::PrintSupport)
+ target_link_libraries(dockwidgets PUBLIC
+ Qt::PrintSupport
+ )
+endif()
+
+install(TARGETS dockwidgets
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/mainwindows/mainwindow/CMakeLists.txt b/examples/widgets/mainwindows/mainwindow/CMakeLists.txt
new file mode 100644
index 0000000000..3152fb0904
--- /dev/null
+++ b/examples/widgets/mainwindows/mainwindow/CMakeLists.txt
@@ -0,0 +1,50 @@
+# Generated from mainwindow.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(mainwindow LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/mainwindows/mainwindow")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(mainwindow
+ colorswatch.cpp colorswatch.h
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ toolbar.cpp toolbar.h
+)
+target_link_libraries(mainwindow PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(mainwindow_resource_files
+ "qt.png"
+ "titlebarCenter.png"
+ "titlebarLeft.png"
+ "titlebarRight.png"
+)
+
+qt6_add_resources(mainwindow "mainwindow"
+ PREFIX
+ "/res"
+ FILES
+ ${mainwindow_resource_files}
+)
+
+install(TARGETS mainwindow
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/mainwindows/mdi/CMakeLists.txt b/examples/widgets/mainwindows/mdi/CMakeLists.txt
new file mode 100644
index 0000000000..c75049285d
--- /dev/null
+++ b/examples/widgets/mainwindows/mdi/CMakeLists.txt
@@ -0,0 +1,51 @@
+# Generated from mdi.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(mdi LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/mainwindows/mdi")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(mdi
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ mdichild.cpp mdichild.h
+)
+target_link_libraries(mdi PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(mdi_resource_files
+ "images/copy.png"
+ "images/cut.png"
+ "images/new.png"
+ "images/open.png"
+ "images/paste.png"
+ "images/save.png"
+)
+
+qt6_add_resources(mdi "mdi"
+ PREFIX
+ "/"
+ FILES
+ ${mdi_resource_files}
+)
+
+install(TARGETS mdi
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/mainwindows/menus/CMakeLists.txt b/examples/widgets/mainwindows/menus/CMakeLists.txt
new file mode 100644
index 0000000000..0e76c3a447
--- /dev/null
+++ b/examples/widgets/mainwindows/menus/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from menus.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(menus LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/mainwindows/menus")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(menus
+ main.cpp
+ mainwindow.cpp mainwindow.h
+)
+target_link_libraries(menus PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS menus
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/mainwindows/sdi/CMakeLists.txt b/examples/widgets/mainwindows/sdi/CMakeLists.txt
new file mode 100644
index 0000000000..f9d7d5ff3f
--- /dev/null
+++ b/examples/widgets/mainwindows/sdi/CMakeLists.txt
@@ -0,0 +1,50 @@
+# Generated from sdi.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(sdi LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/mainwindows/sdi")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(sdi
+ main.cpp
+ mainwindow.cpp mainwindow.h
+)
+target_link_libraries(sdi PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(sdi_resource_files
+ "images/copy.png"
+ "images/cut.png"
+ "images/new.png"
+ "images/open.png"
+ "images/paste.png"
+ "images/save.png"
+)
+
+qt6_add_resources(sdi "sdi"
+ PREFIX
+ "/"
+ FILES
+ ${sdi_resource_files}
+)
+
+install(TARGETS sdi
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/painting/CMakeLists.txt b/examples/widgets/painting/CMakeLists.txt
new file mode 100644
index 0000000000..e7d612da3b
--- /dev/null
+++ b/examples/widgets/painting/CMakeLists.txt
@@ -0,0 +1,14 @@
+# Generated from painting.pro.
+
+add_subdirectory(shared) # special case
+add_subdirectory(basicdrawing)
+add_subdirectory(concentriccircles)
+add_subdirectory(affine)
+# add_subdirectory(composition) # FIXME: Seems buggy wrt. usesOpenGL function
+add_subdirectory(deform)
+add_subdirectory(gradients)
+add_subdirectory(pathstroke)
+add_subdirectory(imagecomposition)
+add_subdirectory(painterpaths)
+add_subdirectory(transformations)
+add_subdirectory(fontsampler)
diff --git a/examples/widgets/painting/affine/.prev_CMakeLists.txt b/examples/widgets/painting/affine/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..948456d821
--- /dev/null
+++ b/examples/widgets/painting/affine/.prev_CMakeLists.txt
@@ -0,0 +1,215 @@
+# Generated from affine.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(affine LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/painting/affine")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(affine
+ ../shared/arthurstyle.cpp ../shared/arthurstyle.h
+ ../shared/arthurwidgets.cpp ../shared/arthurwidgets.h
+ ../shared/hoverpoints.cpp ../shared/hoverpoints.h
+ main.cpp
+ xform.cpp xform.h
+)
+target_include_directories(affine PUBLIC
+ ../shared
+)
+
+target_link_libraries(affine PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set_source_files_properties("../shared/images/button_normal_cap_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_normal_cap_left.png"
+)
+set_source_files_properties("../shared/images/button_normal_cap_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_normal_cap_right.png"
+)
+set_source_files_properties("../shared/images/button_normal_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_normal_stretch.png"
+)
+set_source_files_properties("../shared/images/button_pressed_cap_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_pressed_cap_left.png"
+)
+set_source_files_properties("../shared/images/button_pressed_cap_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_pressed_cap_right.png"
+)
+set_source_files_properties("../shared/images/button_pressed_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_pressed_stretch.png"
+)
+set_source_files_properties("../shared/images/frame_bottom.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_bottom.png"
+)
+set_source_files_properties("../shared/images/frame_bottomleft.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_bottomleft.png"
+)
+set_source_files_properties("../shared/images/frame_bottomright.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_bottomright.png"
+)
+set_source_files_properties("../shared/images/frame_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_left.png"
+)
+set_source_files_properties("../shared/images/frame_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_right.png"
+)
+set_source_files_properties("../shared/images/frame_top.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_top.png"
+)
+set_source_files_properties("../shared/images/frame_topleft.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_topleft.png"
+)
+set_source_files_properties("../shared/images/frame_topright.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_topright.png"
+)
+set_source_files_properties("../shared/images/groupframe_bottom_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_bottom_left.png"
+)
+set_source_files_properties("../shared/images/groupframe_bottom_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_bottom_right.png"
+)
+set_source_files_properties("../shared/images/groupframe_bottom_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_bottom_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_left_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_left_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_right_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_right_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_top_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_top_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_topleft.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_topleft.png"
+)
+set_source_files_properties("../shared/images/groupframe_topright.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_topright.png"
+)
+set_source_files_properties("../shared/images/line_dash_dot.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dash_dot.png"
+)
+set_source_files_properties("../shared/images/line_dash_dot_dot.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dash_dot_dot.png"
+)
+set_source_files_properties("../shared/images/line_dashed.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dashed.png"
+)
+set_source_files_properties("../shared/images/line_dotted.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dotted.png"
+)
+set_source_files_properties("../shared/images/line_solid.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_solid.png"
+)
+set_source_files_properties("../shared/images/radiobutton-on.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/radiobutton-on.png"
+)
+set_source_files_properties("../shared/images/radiobutton_off.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/radiobutton_off.png"
+)
+set_source_files_properties("../shared/images/radiobutton_on.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/radiobutton_on.png"
+)
+set_source_files_properties("../shared/images/slider_bar.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/slider_bar.png"
+)
+set_source_files_properties("../shared/images/slider_thumb_on.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/slider_thumb_on.png"
+)
+set_source_files_properties("../shared/images/title_cap_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/title_cap_left.png"
+)
+set_source_files_properties("../shared/images/title_cap_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/title_cap_right.png"
+)
+set_source_files_properties("../shared/images/title_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/title_stretch.png"
+)
+set(shared_resource_files
+ "images/button_normal_cap_left.png"
+ "images/button_normal_cap_right.png"
+ "images/button_normal_stretch.png"
+ "images/button_pressed_cap_left.png"
+ "images/button_pressed_cap_right.png"
+ "images/button_pressed_stretch.png"
+ "images/frame_bottom.png"
+ "images/frame_bottomleft.png"
+ "images/frame_bottomright.png"
+ "images/frame_left.png"
+ "images/frame_right.png"
+ "images/frame_top.png"
+ "images/frame_topleft.png"
+ "images/frame_topright.png"
+ "images/groupframe_bottom_left.png"
+ "images/groupframe_bottom_right.png"
+ "images/groupframe_bottom_stretch.png"
+ "images/groupframe_left_stretch.png"
+ "images/groupframe_right_stretch.png"
+ "images/groupframe_top_stretch.png"
+ "images/groupframe_topleft.png"
+ "images/groupframe_topright.png"
+ "images/line_dash_dot.png"
+ "images/line_dash_dot_dot.png"
+ "images/line_dashed.png"
+ "images/line_dotted.png"
+ "images/line_solid.png"
+ "images/radiobutton-on.png"
+ "images/radiobutton_off.png"
+ "images/radiobutton_on.png"
+ "images/slider_bar.png"
+ "images/slider_thumb_on.png"
+ "images/title_cap_left.png"
+ "images/title_cap_right.png"
+ "images/title_stretch.png"
+)
+
+qt6_add_resources(affine "shared"
+ PREFIX
+ "/res"
+ BASE
+ "../shared"
+ FILES
+ ${shared_resource_files}
+)
+set(affine_resource_files
+ "bg1.jpg"
+ "xform.cpp"
+ "xform.html"
+)
+
+qt6_add_resources(affine "affine"
+ PREFIX
+ "/res/affine"
+ FILES
+ ${affine_resource_files}
+)
+
+if(QT_FEATURE_opengl)
+ target_sources(affine PUBLIC
+ ../shared/fbopaintdevice.cpp ../shared/fbopaintdevice.h
+ )
+
+ target_link_libraries(affine PUBLIC
+ Qt::OpenGL
+ )
+endif()
+
+install(TARGETS affine
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/painting/affine/CMakeLists.txt b/examples/widgets/painting/affine/CMakeLists.txt
new file mode 100644
index 0000000000..56e862d20f
--- /dev/null
+++ b/examples/widgets/painting/affine/CMakeLists.txt
@@ -0,0 +1,214 @@
+# Generated from affine.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(affine LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/painting/affine")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(affine
+ # special case: remove files from ../shared
+ main.cpp
+ xform.cpp xform.h
+)
+target_include_directories(affine PUBLIC
+ ../shared
+)
+
+target_link_libraries(affine PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+ painting_shared # special case
+)
+
+
+# Resources:
+set_source_files_properties("../shared/images/button_normal_cap_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_normal_cap_left.png"
+)
+set_source_files_properties("../shared/images/button_normal_cap_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_normal_cap_right.png"
+)
+set_source_files_properties("../shared/images/button_normal_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_normal_stretch.png"
+)
+set_source_files_properties("../shared/images/button_pressed_cap_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_pressed_cap_left.png"
+)
+set_source_files_properties("../shared/images/button_pressed_cap_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_pressed_cap_right.png"
+)
+set_source_files_properties("../shared/images/button_pressed_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_pressed_stretch.png"
+)
+set_source_files_properties("../shared/images/frame_bottom.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_bottom.png"
+)
+set_source_files_properties("../shared/images/frame_bottomleft.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_bottomleft.png"
+)
+set_source_files_properties("../shared/images/frame_bottomright.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_bottomright.png"
+)
+set_source_files_properties("../shared/images/frame_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_left.png"
+)
+set_source_files_properties("../shared/images/frame_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_right.png"
+)
+set_source_files_properties("../shared/images/frame_top.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_top.png"
+)
+set_source_files_properties("../shared/images/frame_topleft.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_topleft.png"
+)
+set_source_files_properties("../shared/images/frame_topright.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_topright.png"
+)
+set_source_files_properties("../shared/images/groupframe_bottom_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_bottom_left.png"
+)
+set_source_files_properties("../shared/images/groupframe_bottom_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_bottom_right.png"
+)
+set_source_files_properties("../shared/images/groupframe_bottom_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_bottom_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_left_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_left_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_right_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_right_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_top_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_top_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_topleft.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_topleft.png"
+)
+set_source_files_properties("../shared/images/groupframe_topright.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_topright.png"
+)
+set_source_files_properties("../shared/images/line_dash_dot.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dash_dot.png"
+)
+set_source_files_properties("../shared/images/line_dash_dot_dot.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dash_dot_dot.png"
+)
+set_source_files_properties("../shared/images/line_dashed.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dashed.png"
+)
+set_source_files_properties("../shared/images/line_dotted.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dotted.png"
+)
+set_source_files_properties("../shared/images/line_solid.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_solid.png"
+)
+set_source_files_properties("../shared/images/radiobutton-on.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/radiobutton-on.png"
+)
+set_source_files_properties("../shared/images/radiobutton_off.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/radiobutton_off.png"
+)
+set_source_files_properties("../shared/images/radiobutton_on.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/radiobutton_on.png"
+)
+set_source_files_properties("../shared/images/slider_bar.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/slider_bar.png"
+)
+set_source_files_properties("../shared/images/slider_thumb_on.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/slider_thumb_on.png"
+)
+set_source_files_properties("../shared/images/title_cap_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/title_cap_left.png"
+)
+set_source_files_properties("../shared/images/title_cap_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/title_cap_right.png"
+)
+set_source_files_properties("../shared/images/title_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/title_stretch.png"
+)
+set(shared_resource_files
+ "images/button_normal_cap_left.png"
+ "images/button_normal_cap_right.png"
+ "images/button_normal_stretch.png"
+ "images/button_pressed_cap_left.png"
+ "images/button_pressed_cap_right.png"
+ "images/button_pressed_stretch.png"
+ "images/frame_bottom.png"
+ "images/frame_bottomleft.png"
+ "images/frame_bottomright.png"
+ "images/frame_left.png"
+ "images/frame_right.png"
+ "images/frame_top.png"
+ "images/frame_topleft.png"
+ "images/frame_topright.png"
+ "images/groupframe_bottom_left.png"
+ "images/groupframe_bottom_right.png"
+ "images/groupframe_bottom_stretch.png"
+ "images/groupframe_left_stretch.png"
+ "images/groupframe_right_stretch.png"
+ "images/groupframe_top_stretch.png"
+ "images/groupframe_topleft.png"
+ "images/groupframe_topright.png"
+ "images/line_dash_dot.png"
+ "images/line_dash_dot_dot.png"
+ "images/line_dashed.png"
+ "images/line_dotted.png"
+ "images/line_solid.png"
+ "images/radiobutton-on.png"
+ "images/radiobutton_off.png"
+ "images/radiobutton_on.png"
+ "images/slider_bar.png"
+ "images/slider_thumb_on.png"
+ "images/title_cap_left.png"
+ "images/title_cap_right.png"
+ "images/title_stretch.png"
+)
+
+qt6_add_resources(affine "shared"
+ PREFIX
+ "/res"
+ BASE
+ "../shared"
+ FILES
+ ${shared_resource_files}
+)
+set(affine_resource_files
+ "bg1.jpg"
+ "xform.cpp"
+ "xform.html"
+)
+
+qt6_add_resources(affine "affine"
+ PREFIX
+ "/res/affine"
+ FILES
+ ${affine_resource_files}
+)
+
+if(QT_FEATURE_opengl)
+ target_sources(affine PUBLIC
+ ../shared/fbopaintdevice.cpp ../shared/fbopaintdevice.h
+ )
+
+ target_link_libraries(affine PUBLIC
+ Qt::OpenGL
+ )
+endif()
+
+install(TARGETS affine
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/painting/basicdrawing/CMakeLists.txt b/examples/widgets/painting/basicdrawing/CMakeLists.txt
new file mode 100644
index 0000000000..b7d4f0a24a
--- /dev/null
+++ b/examples/widgets/painting/basicdrawing/CMakeLists.txt
@@ -0,0 +1,47 @@
+# Generated from basicdrawing.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(basicdrawing LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/painting/basicdrawing")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(basicdrawing
+ main.cpp
+ renderarea.cpp renderarea.h
+ window.cpp window.h
+)
+target_link_libraries(basicdrawing PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(basicdrawing_resource_files
+ "images/brick.png"
+ "images/qt-logo.png"
+)
+
+qt6_add_resources(basicdrawing "basicdrawing"
+ PREFIX
+ "/"
+ FILES
+ ${basicdrawing_resource_files}
+)
+
+install(TARGETS basicdrawing
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/painting/basicdrawing/window.cpp b/examples/widgets/painting/basicdrawing/window.cpp
index 65f6971d13..0a035cc299 100644
--- a/examples/widgets/painting/basicdrawing/window.cpp
+++ b/examples/widgets/painting/basicdrawing/window.cpp
@@ -157,17 +157,17 @@ Window::Window()
//! [7]
//! [8]
- connect(shapeComboBox, QOverload<int>::of(&QComboBox::activated),
+ connect(shapeComboBox, &QComboBox::activated,
this, &Window::shapeChanged);
- connect(penWidthSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
+ connect(penWidthSpinBox, &QSpinBox::valueChanged,
this, &Window::penChanged);
- connect(penStyleComboBox, QOverload<int>::of(&QComboBox::activated),
+ connect(penStyleComboBox, &QComboBox::activated,
this, &Window::penChanged);
- connect(penCapComboBox, QOverload<int>::of(&QComboBox::activated),
+ connect(penCapComboBox, &QComboBox::activated,
this, &Window::penChanged);
- connect(penJoinComboBox, QOverload<int>::of(&QComboBox::activated),
+ connect(penJoinComboBox, &QComboBox::activated,
this, &Window::penChanged);
- connect(brushStyleComboBox, QOverload<int>::of(&QComboBox::activated),
+ connect(brushStyleComboBox, &QComboBox::activated,
this, &Window::brushChanged);
connect(antialiasingCheckBox, &QAbstractButton::toggled,
renderArea, &RenderArea::setAntialiased);
diff --git a/examples/widgets/painting/composition/.prev_CMakeLists.txt b/examples/widgets/painting/composition/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..c5b1d12e4a
--- /dev/null
+++ b/examples/widgets/painting/composition/.prev_CMakeLists.txt
@@ -0,0 +1,216 @@
+# Generated from composition.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(composition LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/painting/composition")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(composition
+ ../shared/arthurstyle.cpp ../shared/arthurstyle.h
+ ../shared/arthurwidgets.cpp ../shared/arthurwidgets.h
+ ../shared/hoverpoints.cpp ../shared/hoverpoints.h
+ composition.cpp composition.h
+ main.cpp
+)
+target_include_directories(composition PUBLIC
+ ../shared
+)
+
+target_link_libraries(composition PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set_source_files_properties("../shared/images/button_normal_cap_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_normal_cap_left.png"
+)
+set_source_files_properties("../shared/images/button_normal_cap_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_normal_cap_right.png"
+)
+set_source_files_properties("../shared/images/button_normal_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_normal_stretch.png"
+)
+set_source_files_properties("../shared/images/button_pressed_cap_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_pressed_cap_left.png"
+)
+set_source_files_properties("../shared/images/button_pressed_cap_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_pressed_cap_right.png"
+)
+set_source_files_properties("../shared/images/button_pressed_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_pressed_stretch.png"
+)
+set_source_files_properties("../shared/images/frame_bottom.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_bottom.png"
+)
+set_source_files_properties("../shared/images/frame_bottomleft.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_bottomleft.png"
+)
+set_source_files_properties("../shared/images/frame_bottomright.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_bottomright.png"
+)
+set_source_files_properties("../shared/images/frame_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_left.png"
+)
+set_source_files_properties("../shared/images/frame_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_right.png"
+)
+set_source_files_properties("../shared/images/frame_top.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_top.png"
+)
+set_source_files_properties("../shared/images/frame_topleft.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_topleft.png"
+)
+set_source_files_properties("../shared/images/frame_topright.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_topright.png"
+)
+set_source_files_properties("../shared/images/groupframe_bottom_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_bottom_left.png"
+)
+set_source_files_properties("../shared/images/groupframe_bottom_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_bottom_right.png"
+)
+set_source_files_properties("../shared/images/groupframe_bottom_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_bottom_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_left_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_left_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_right_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_right_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_top_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_top_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_topleft.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_topleft.png"
+)
+set_source_files_properties("../shared/images/groupframe_topright.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_topright.png"
+)
+set_source_files_properties("../shared/images/line_dash_dot.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dash_dot.png"
+)
+set_source_files_properties("../shared/images/line_dash_dot_dot.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dash_dot_dot.png"
+)
+set_source_files_properties("../shared/images/line_dashed.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dashed.png"
+)
+set_source_files_properties("../shared/images/line_dotted.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dotted.png"
+)
+set_source_files_properties("../shared/images/line_solid.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_solid.png"
+)
+set_source_files_properties("../shared/images/radiobutton-on.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/radiobutton-on.png"
+)
+set_source_files_properties("../shared/images/radiobutton_off.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/radiobutton_off.png"
+)
+set_source_files_properties("../shared/images/radiobutton_on.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/radiobutton_on.png"
+)
+set_source_files_properties("../shared/images/slider_bar.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/slider_bar.png"
+)
+set_source_files_properties("../shared/images/slider_thumb_on.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/slider_thumb_on.png"
+)
+set_source_files_properties("../shared/images/title_cap_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/title_cap_left.png"
+)
+set_source_files_properties("../shared/images/title_cap_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/title_cap_right.png"
+)
+set_source_files_properties("../shared/images/title_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/title_stretch.png"
+)
+set(shared_resource_files
+ "images/button_normal_cap_left.png"
+ "images/button_normal_cap_right.png"
+ "images/button_normal_stretch.png"
+ "images/button_pressed_cap_left.png"
+ "images/button_pressed_cap_right.png"
+ "images/button_pressed_stretch.png"
+ "images/frame_bottom.png"
+ "images/frame_bottomleft.png"
+ "images/frame_bottomright.png"
+ "images/frame_left.png"
+ "images/frame_right.png"
+ "images/frame_top.png"
+ "images/frame_topleft.png"
+ "images/frame_topright.png"
+ "images/groupframe_bottom_left.png"
+ "images/groupframe_bottom_right.png"
+ "images/groupframe_bottom_stretch.png"
+ "images/groupframe_left_stretch.png"
+ "images/groupframe_right_stretch.png"
+ "images/groupframe_top_stretch.png"
+ "images/groupframe_topleft.png"
+ "images/groupframe_topright.png"
+ "images/line_dash_dot.png"
+ "images/line_dash_dot_dot.png"
+ "images/line_dashed.png"
+ "images/line_dotted.png"
+ "images/line_solid.png"
+ "images/radiobutton-on.png"
+ "images/radiobutton_off.png"
+ "images/radiobutton_on.png"
+ "images/slider_bar.png"
+ "images/slider_thumb_on.png"
+ "images/title_cap_left.png"
+ "images/title_cap_right.png"
+ "images/title_stretch.png"
+)
+
+qt6_add_resources(composition "shared"
+ PREFIX
+ "/res"
+ BASE
+ "../shared"
+ FILES
+ ${shared_resource_files}
+)
+set(composition_resource_files
+ "composition.cpp"
+ "composition.html"
+ "flower.jpg"
+ "flower_alpha.jpg"
+)
+
+qt6_add_resources(composition "composition"
+ PREFIX
+ "/res/composition"
+ FILES
+ ${composition_resource_files}
+)
+
+if(QT_FEATURE_opengl)
+ target_sources(composition PUBLIC
+ ../shared/fbopaintdevice.cpp ../shared/fbopaintdevice.h
+ )
+
+ target_link_libraries(composition PUBLIC
+ Qt::OpenGL
+ )
+endif()
+
+install(TARGETS composition
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/painting/composition/CMakeLists.txt b/examples/widgets/painting/composition/CMakeLists.txt
new file mode 100644
index 0000000000..89e356b7ae
--- /dev/null
+++ b/examples/widgets/painting/composition/CMakeLists.txt
@@ -0,0 +1,215 @@
+# Generated from composition.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(composition LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/painting/composition")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(composition
+ # special case: remove files from ../shared
+ composition.cpp composition.h
+ main.cpp
+)
+target_include_directories(composition PUBLIC
+ ../shared
+)
+
+target_link_libraries(composition PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+ painting_shared # special case
+)
+
+
+# Resources:
+set_source_files_properties("../shared/images/button_normal_cap_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_normal_cap_left.png"
+)
+set_source_files_properties("../shared/images/button_normal_cap_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_normal_cap_right.png"
+)
+set_source_files_properties("../shared/images/button_normal_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_normal_stretch.png"
+)
+set_source_files_properties("../shared/images/button_pressed_cap_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_pressed_cap_left.png"
+)
+set_source_files_properties("../shared/images/button_pressed_cap_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_pressed_cap_right.png"
+)
+set_source_files_properties("../shared/images/button_pressed_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_pressed_stretch.png"
+)
+set_source_files_properties("../shared/images/frame_bottom.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_bottom.png"
+)
+set_source_files_properties("../shared/images/frame_bottomleft.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_bottomleft.png"
+)
+set_source_files_properties("../shared/images/frame_bottomright.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_bottomright.png"
+)
+set_source_files_properties("../shared/images/frame_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_left.png"
+)
+set_source_files_properties("../shared/images/frame_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_right.png"
+)
+set_source_files_properties("../shared/images/frame_top.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_top.png"
+)
+set_source_files_properties("../shared/images/frame_topleft.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_topleft.png"
+)
+set_source_files_properties("../shared/images/frame_topright.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_topright.png"
+)
+set_source_files_properties("../shared/images/groupframe_bottom_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_bottom_left.png"
+)
+set_source_files_properties("../shared/images/groupframe_bottom_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_bottom_right.png"
+)
+set_source_files_properties("../shared/images/groupframe_bottom_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_bottom_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_left_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_left_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_right_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_right_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_top_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_top_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_topleft.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_topleft.png"
+)
+set_source_files_properties("../shared/images/groupframe_topright.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_topright.png"
+)
+set_source_files_properties("../shared/images/line_dash_dot.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dash_dot.png"
+)
+set_source_files_properties("../shared/images/line_dash_dot_dot.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dash_dot_dot.png"
+)
+set_source_files_properties("../shared/images/line_dashed.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dashed.png"
+)
+set_source_files_properties("../shared/images/line_dotted.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dotted.png"
+)
+set_source_files_properties("../shared/images/line_solid.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_solid.png"
+)
+set_source_files_properties("../shared/images/radiobutton-on.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/radiobutton-on.png"
+)
+set_source_files_properties("../shared/images/radiobutton_off.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/radiobutton_off.png"
+)
+set_source_files_properties("../shared/images/radiobutton_on.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/radiobutton_on.png"
+)
+set_source_files_properties("../shared/images/slider_bar.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/slider_bar.png"
+)
+set_source_files_properties("../shared/images/slider_thumb_on.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/slider_thumb_on.png"
+)
+set_source_files_properties("../shared/images/title_cap_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/title_cap_left.png"
+)
+set_source_files_properties("../shared/images/title_cap_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/title_cap_right.png"
+)
+set_source_files_properties("../shared/images/title_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/title_stretch.png"
+)
+set(shared_resource_files
+ "images/button_normal_cap_left.png"
+ "images/button_normal_cap_right.png"
+ "images/button_normal_stretch.png"
+ "images/button_pressed_cap_left.png"
+ "images/button_pressed_cap_right.png"
+ "images/button_pressed_stretch.png"
+ "images/frame_bottom.png"
+ "images/frame_bottomleft.png"
+ "images/frame_bottomright.png"
+ "images/frame_left.png"
+ "images/frame_right.png"
+ "images/frame_top.png"
+ "images/frame_topleft.png"
+ "images/frame_topright.png"
+ "images/groupframe_bottom_left.png"
+ "images/groupframe_bottom_right.png"
+ "images/groupframe_bottom_stretch.png"
+ "images/groupframe_left_stretch.png"
+ "images/groupframe_right_stretch.png"
+ "images/groupframe_top_stretch.png"
+ "images/groupframe_topleft.png"
+ "images/groupframe_topright.png"
+ "images/line_dash_dot.png"
+ "images/line_dash_dot_dot.png"
+ "images/line_dashed.png"
+ "images/line_dotted.png"
+ "images/line_solid.png"
+ "images/radiobutton-on.png"
+ "images/radiobutton_off.png"
+ "images/radiobutton_on.png"
+ "images/slider_bar.png"
+ "images/slider_thumb_on.png"
+ "images/title_cap_left.png"
+ "images/title_cap_right.png"
+ "images/title_stretch.png"
+)
+
+qt6_add_resources(composition "shared"
+ PREFIX
+ "/res"
+ BASE
+ "../shared"
+ FILES
+ ${shared_resource_files}
+)
+set(composition_resource_files
+ "composition.cpp"
+ "composition.html"
+ "flower.jpg"
+ "flower_alpha.jpg"
+)
+
+qt6_add_resources(composition "composition"
+ PREFIX
+ "/res/composition"
+ FILES
+ ${composition_resource_files}
+)
+
+if(QT_FEATURE_opengl)
+ target_sources(composition PUBLIC
+ ../shared/fbopaintdevice.cpp ../shared/fbopaintdevice.h
+ )
+
+ target_link_libraries(composition PUBLIC
+ Qt::OpenGL
+ )
+endif()
+
+install(TARGETS composition
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/painting/concentriccircles/CMakeLists.txt b/examples/widgets/painting/concentriccircles/CMakeLists.txt
new file mode 100644
index 0000000000..44d907f12f
--- /dev/null
+++ b/examples/widgets/painting/concentriccircles/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from concentriccircles.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(concentriccircles LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/painting/concentriccircles")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(concentriccircles
+ circlewidget.cpp circlewidget.h
+ main.cpp
+ window.cpp window.h
+)
+target_link_libraries(concentriccircles PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS concentriccircles
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/painting/deform/.prev_CMakeLists.txt b/examples/widgets/painting/deform/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..4a223487ab
--- /dev/null
+++ b/examples/widgets/painting/deform/.prev_CMakeLists.txt
@@ -0,0 +1,214 @@
+# Generated from deform.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(deform LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/painting/deform")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(deform
+ ../shared/arthurstyle.cpp ../shared/arthurstyle.h
+ ../shared/arthurwidgets.cpp ../shared/arthurwidgets.h
+ ../shared/hoverpoints.cpp ../shared/hoverpoints.h
+ main.cpp
+ pathdeform.cpp pathdeform.h
+)
+target_include_directories(deform PUBLIC
+ ../shared
+)
+
+target_link_libraries(deform PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set_source_files_properties("../shared/images/button_normal_cap_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_normal_cap_left.png"
+)
+set_source_files_properties("../shared/images/button_normal_cap_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_normal_cap_right.png"
+)
+set_source_files_properties("../shared/images/button_normal_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_normal_stretch.png"
+)
+set_source_files_properties("../shared/images/button_pressed_cap_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_pressed_cap_left.png"
+)
+set_source_files_properties("../shared/images/button_pressed_cap_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_pressed_cap_right.png"
+)
+set_source_files_properties("../shared/images/button_pressed_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_pressed_stretch.png"
+)
+set_source_files_properties("../shared/images/frame_bottom.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_bottom.png"
+)
+set_source_files_properties("../shared/images/frame_bottomleft.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_bottomleft.png"
+)
+set_source_files_properties("../shared/images/frame_bottomright.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_bottomright.png"
+)
+set_source_files_properties("../shared/images/frame_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_left.png"
+)
+set_source_files_properties("../shared/images/frame_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_right.png"
+)
+set_source_files_properties("../shared/images/frame_top.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_top.png"
+)
+set_source_files_properties("../shared/images/frame_topleft.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_topleft.png"
+)
+set_source_files_properties("../shared/images/frame_topright.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_topright.png"
+)
+set_source_files_properties("../shared/images/groupframe_bottom_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_bottom_left.png"
+)
+set_source_files_properties("../shared/images/groupframe_bottom_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_bottom_right.png"
+)
+set_source_files_properties("../shared/images/groupframe_bottom_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_bottom_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_left_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_left_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_right_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_right_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_top_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_top_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_topleft.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_topleft.png"
+)
+set_source_files_properties("../shared/images/groupframe_topright.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_topright.png"
+)
+set_source_files_properties("../shared/images/line_dash_dot.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dash_dot.png"
+)
+set_source_files_properties("../shared/images/line_dash_dot_dot.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dash_dot_dot.png"
+)
+set_source_files_properties("../shared/images/line_dashed.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dashed.png"
+)
+set_source_files_properties("../shared/images/line_dotted.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dotted.png"
+)
+set_source_files_properties("../shared/images/line_solid.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_solid.png"
+)
+set_source_files_properties("../shared/images/radiobutton-on.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/radiobutton-on.png"
+)
+set_source_files_properties("../shared/images/radiobutton_off.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/radiobutton_off.png"
+)
+set_source_files_properties("../shared/images/radiobutton_on.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/radiobutton_on.png"
+)
+set_source_files_properties("../shared/images/slider_bar.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/slider_bar.png"
+)
+set_source_files_properties("../shared/images/slider_thumb_on.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/slider_thumb_on.png"
+)
+set_source_files_properties("../shared/images/title_cap_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/title_cap_left.png"
+)
+set_source_files_properties("../shared/images/title_cap_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/title_cap_right.png"
+)
+set_source_files_properties("../shared/images/title_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/title_stretch.png"
+)
+set(shared_resource_files
+ "images/button_normal_cap_left.png"
+ "images/button_normal_cap_right.png"
+ "images/button_normal_stretch.png"
+ "images/button_pressed_cap_left.png"
+ "images/button_pressed_cap_right.png"
+ "images/button_pressed_stretch.png"
+ "images/frame_bottom.png"
+ "images/frame_bottomleft.png"
+ "images/frame_bottomright.png"
+ "images/frame_left.png"
+ "images/frame_right.png"
+ "images/frame_top.png"
+ "images/frame_topleft.png"
+ "images/frame_topright.png"
+ "images/groupframe_bottom_left.png"
+ "images/groupframe_bottom_right.png"
+ "images/groupframe_bottom_stretch.png"
+ "images/groupframe_left_stretch.png"
+ "images/groupframe_right_stretch.png"
+ "images/groupframe_top_stretch.png"
+ "images/groupframe_topleft.png"
+ "images/groupframe_topright.png"
+ "images/line_dash_dot.png"
+ "images/line_dash_dot_dot.png"
+ "images/line_dashed.png"
+ "images/line_dotted.png"
+ "images/line_solid.png"
+ "images/radiobutton-on.png"
+ "images/radiobutton_off.png"
+ "images/radiobutton_on.png"
+ "images/slider_bar.png"
+ "images/slider_thumb_on.png"
+ "images/title_cap_left.png"
+ "images/title_cap_right.png"
+ "images/title_stretch.png"
+)
+
+qt6_add_resources(deform "shared"
+ PREFIX
+ "/res"
+ BASE
+ "../shared"
+ FILES
+ ${shared_resource_files}
+)
+set(deform_resource_files
+ "pathdeform.cpp"
+ "pathdeform.html"
+)
+
+qt6_add_resources(deform "deform"
+ PREFIX
+ "/res/deform"
+ FILES
+ ${deform_resource_files}
+)
+
+if(QT_FEATURE_opengl)
+ target_sources(deform PUBLIC
+ ../shared/fbopaintdevice.cpp ../shared/fbopaintdevice.h
+ )
+
+ target_link_libraries(deform PUBLIC
+ Qt::OpenGL
+ )
+endif()
+
+install(TARGETS deform
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/painting/deform/CMakeLists.txt b/examples/widgets/painting/deform/CMakeLists.txt
new file mode 100644
index 0000000000..79c14d2196
--- /dev/null
+++ b/examples/widgets/painting/deform/CMakeLists.txt
@@ -0,0 +1,213 @@
+# Generated from deform.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(deform LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/painting/deform")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(deform
+ # special case: remove files from ../shared
+ main.cpp
+ pathdeform.cpp pathdeform.h
+)
+target_include_directories(deform PUBLIC
+ ../shared
+)
+
+target_link_libraries(deform PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+ painting_shared # special case
+)
+
+
+# Resources:
+set_source_files_properties("../shared/images/button_normal_cap_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_normal_cap_left.png"
+)
+set_source_files_properties("../shared/images/button_normal_cap_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_normal_cap_right.png"
+)
+set_source_files_properties("../shared/images/button_normal_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_normal_stretch.png"
+)
+set_source_files_properties("../shared/images/button_pressed_cap_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_pressed_cap_left.png"
+)
+set_source_files_properties("../shared/images/button_pressed_cap_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_pressed_cap_right.png"
+)
+set_source_files_properties("../shared/images/button_pressed_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_pressed_stretch.png"
+)
+set_source_files_properties("../shared/images/frame_bottom.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_bottom.png"
+)
+set_source_files_properties("../shared/images/frame_bottomleft.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_bottomleft.png"
+)
+set_source_files_properties("../shared/images/frame_bottomright.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_bottomright.png"
+)
+set_source_files_properties("../shared/images/frame_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_left.png"
+)
+set_source_files_properties("../shared/images/frame_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_right.png"
+)
+set_source_files_properties("../shared/images/frame_top.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_top.png"
+)
+set_source_files_properties("../shared/images/frame_topleft.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_topleft.png"
+)
+set_source_files_properties("../shared/images/frame_topright.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_topright.png"
+)
+set_source_files_properties("../shared/images/groupframe_bottom_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_bottom_left.png"
+)
+set_source_files_properties("../shared/images/groupframe_bottom_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_bottom_right.png"
+)
+set_source_files_properties("../shared/images/groupframe_bottom_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_bottom_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_left_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_left_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_right_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_right_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_top_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_top_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_topleft.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_topleft.png"
+)
+set_source_files_properties("../shared/images/groupframe_topright.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_topright.png"
+)
+set_source_files_properties("../shared/images/line_dash_dot.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dash_dot.png"
+)
+set_source_files_properties("../shared/images/line_dash_dot_dot.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dash_dot_dot.png"
+)
+set_source_files_properties("../shared/images/line_dashed.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dashed.png"
+)
+set_source_files_properties("../shared/images/line_dotted.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dotted.png"
+)
+set_source_files_properties("../shared/images/line_solid.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_solid.png"
+)
+set_source_files_properties("../shared/images/radiobutton-on.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/radiobutton-on.png"
+)
+set_source_files_properties("../shared/images/radiobutton_off.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/radiobutton_off.png"
+)
+set_source_files_properties("../shared/images/radiobutton_on.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/radiobutton_on.png"
+)
+set_source_files_properties("../shared/images/slider_bar.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/slider_bar.png"
+)
+set_source_files_properties("../shared/images/slider_thumb_on.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/slider_thumb_on.png"
+)
+set_source_files_properties("../shared/images/title_cap_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/title_cap_left.png"
+)
+set_source_files_properties("../shared/images/title_cap_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/title_cap_right.png"
+)
+set_source_files_properties("../shared/images/title_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/title_stretch.png"
+)
+set(shared_resource_files
+ "images/button_normal_cap_left.png"
+ "images/button_normal_cap_right.png"
+ "images/button_normal_stretch.png"
+ "images/button_pressed_cap_left.png"
+ "images/button_pressed_cap_right.png"
+ "images/button_pressed_stretch.png"
+ "images/frame_bottom.png"
+ "images/frame_bottomleft.png"
+ "images/frame_bottomright.png"
+ "images/frame_left.png"
+ "images/frame_right.png"
+ "images/frame_top.png"
+ "images/frame_topleft.png"
+ "images/frame_topright.png"
+ "images/groupframe_bottom_left.png"
+ "images/groupframe_bottom_right.png"
+ "images/groupframe_bottom_stretch.png"
+ "images/groupframe_left_stretch.png"
+ "images/groupframe_right_stretch.png"
+ "images/groupframe_top_stretch.png"
+ "images/groupframe_topleft.png"
+ "images/groupframe_topright.png"
+ "images/line_dash_dot.png"
+ "images/line_dash_dot_dot.png"
+ "images/line_dashed.png"
+ "images/line_dotted.png"
+ "images/line_solid.png"
+ "images/radiobutton-on.png"
+ "images/radiobutton_off.png"
+ "images/radiobutton_on.png"
+ "images/slider_bar.png"
+ "images/slider_thumb_on.png"
+ "images/title_cap_left.png"
+ "images/title_cap_right.png"
+ "images/title_stretch.png"
+)
+
+qt6_add_resources(deform "shared"
+ PREFIX
+ "/res"
+ BASE
+ "../shared"
+ FILES
+ ${shared_resource_files}
+)
+set(deform_resource_files
+ "pathdeform.cpp"
+ "pathdeform.html"
+)
+
+qt6_add_resources(deform "deform"
+ PREFIX
+ "/res/deform"
+ FILES
+ ${deform_resource_files}
+)
+
+if(QT_FEATURE_opengl)
+ target_sources(deform PUBLIC
+ ../shared/fbopaintdevice.cpp ../shared/fbopaintdevice.h
+ )
+
+ target_link_libraries(deform PUBLIC
+ Qt::OpenGL
+ )
+endif()
+
+install(TARGETS deform
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/painting/fontsampler/CMakeLists.txt b/examples/widgets/painting/fontsampler/CMakeLists.txt
new file mode 100644
index 0000000000..11ad8a3242
--- /dev/null
+++ b/examples/widgets/painting/fontsampler/CMakeLists.txt
@@ -0,0 +1,39 @@
+# Generated from fontsampler.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(fontsampler LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/painting/fontsampler")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(fontsampler
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ mainwindowbase.ui
+)
+target_link_libraries(fontsampler PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+if(TARGET Qt::PrintSupport)
+ target_link_libraries(fontsampler PUBLIC
+ Qt::PrintSupport
+ )
+endif()
+
+install(TARGETS fontsampler
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/painting/gradients/.prev_CMakeLists.txt b/examples/widgets/painting/gradients/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..f28694a96b
--- /dev/null
+++ b/examples/widgets/painting/gradients/.prev_CMakeLists.txt
@@ -0,0 +1,214 @@
+# Generated from gradients.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(gradients LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/painting/gradients")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(gradients
+ ../shared/arthurstyle.cpp ../shared/arthurstyle.h
+ ../shared/arthurwidgets.cpp ../shared/arthurwidgets.h
+ ../shared/hoverpoints.cpp ../shared/hoverpoints.h
+ gradients.cpp gradients.h
+ main.cpp
+)
+target_include_directories(gradients PUBLIC
+ ../shared
+)
+
+target_link_libraries(gradients PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set_source_files_properties("../shared/images/button_normal_cap_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_normal_cap_left.png"
+)
+set_source_files_properties("../shared/images/button_normal_cap_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_normal_cap_right.png"
+)
+set_source_files_properties("../shared/images/button_normal_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_normal_stretch.png"
+)
+set_source_files_properties("../shared/images/button_pressed_cap_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_pressed_cap_left.png"
+)
+set_source_files_properties("../shared/images/button_pressed_cap_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_pressed_cap_right.png"
+)
+set_source_files_properties("../shared/images/button_pressed_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_pressed_stretch.png"
+)
+set_source_files_properties("../shared/images/frame_bottom.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_bottom.png"
+)
+set_source_files_properties("../shared/images/frame_bottomleft.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_bottomleft.png"
+)
+set_source_files_properties("../shared/images/frame_bottomright.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_bottomright.png"
+)
+set_source_files_properties("../shared/images/frame_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_left.png"
+)
+set_source_files_properties("../shared/images/frame_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_right.png"
+)
+set_source_files_properties("../shared/images/frame_top.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_top.png"
+)
+set_source_files_properties("../shared/images/frame_topleft.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_topleft.png"
+)
+set_source_files_properties("../shared/images/frame_topright.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_topright.png"
+)
+set_source_files_properties("../shared/images/groupframe_bottom_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_bottom_left.png"
+)
+set_source_files_properties("../shared/images/groupframe_bottom_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_bottom_right.png"
+)
+set_source_files_properties("../shared/images/groupframe_bottom_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_bottom_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_left_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_left_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_right_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_right_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_top_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_top_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_topleft.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_topleft.png"
+)
+set_source_files_properties("../shared/images/groupframe_topright.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_topright.png"
+)
+set_source_files_properties("../shared/images/line_dash_dot.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dash_dot.png"
+)
+set_source_files_properties("../shared/images/line_dash_dot_dot.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dash_dot_dot.png"
+)
+set_source_files_properties("../shared/images/line_dashed.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dashed.png"
+)
+set_source_files_properties("../shared/images/line_dotted.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dotted.png"
+)
+set_source_files_properties("../shared/images/line_solid.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_solid.png"
+)
+set_source_files_properties("../shared/images/radiobutton-on.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/radiobutton-on.png"
+)
+set_source_files_properties("../shared/images/radiobutton_off.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/radiobutton_off.png"
+)
+set_source_files_properties("../shared/images/radiobutton_on.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/radiobutton_on.png"
+)
+set_source_files_properties("../shared/images/slider_bar.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/slider_bar.png"
+)
+set_source_files_properties("../shared/images/slider_thumb_on.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/slider_thumb_on.png"
+)
+set_source_files_properties("../shared/images/title_cap_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/title_cap_left.png"
+)
+set_source_files_properties("../shared/images/title_cap_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/title_cap_right.png"
+)
+set_source_files_properties("../shared/images/title_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/title_stretch.png"
+)
+set(shared_resource_files
+ "images/button_normal_cap_left.png"
+ "images/button_normal_cap_right.png"
+ "images/button_normal_stretch.png"
+ "images/button_pressed_cap_left.png"
+ "images/button_pressed_cap_right.png"
+ "images/button_pressed_stretch.png"
+ "images/frame_bottom.png"
+ "images/frame_bottomleft.png"
+ "images/frame_bottomright.png"
+ "images/frame_left.png"
+ "images/frame_right.png"
+ "images/frame_top.png"
+ "images/frame_topleft.png"
+ "images/frame_topright.png"
+ "images/groupframe_bottom_left.png"
+ "images/groupframe_bottom_right.png"
+ "images/groupframe_bottom_stretch.png"
+ "images/groupframe_left_stretch.png"
+ "images/groupframe_right_stretch.png"
+ "images/groupframe_top_stretch.png"
+ "images/groupframe_topleft.png"
+ "images/groupframe_topright.png"
+ "images/line_dash_dot.png"
+ "images/line_dash_dot_dot.png"
+ "images/line_dashed.png"
+ "images/line_dotted.png"
+ "images/line_solid.png"
+ "images/radiobutton-on.png"
+ "images/radiobutton_off.png"
+ "images/radiobutton_on.png"
+ "images/slider_bar.png"
+ "images/slider_thumb_on.png"
+ "images/title_cap_left.png"
+ "images/title_cap_right.png"
+ "images/title_stretch.png"
+)
+
+qt6_add_resources(gradients "shared"
+ PREFIX
+ "/res"
+ BASE
+ "../shared"
+ FILES
+ ${shared_resource_files}
+)
+set(gradients_resource_files
+ "gradients.cpp"
+ "gradients.html"
+)
+
+qt6_add_resources(gradients "gradients"
+ PREFIX
+ "/res/gradients"
+ FILES
+ ${gradients_resource_files}
+)
+
+if(QT_FEATURE_opengl)
+ target_sources(gradients PUBLIC
+ ../shared/fbopaintdevice.cpp ../shared/fbopaintdevice.h
+ )
+
+ target_link_libraries(gradients PUBLIC
+ Qt::OpenGL
+ )
+endif()
+
+install(TARGETS gradients
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/painting/gradients/CMakeLists.txt b/examples/widgets/painting/gradients/CMakeLists.txt
new file mode 100644
index 0000000000..0b6c06e5b9
--- /dev/null
+++ b/examples/widgets/painting/gradients/CMakeLists.txt
@@ -0,0 +1,213 @@
+# Generated from gradients.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(gradients LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/painting/gradients")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(gradients
+ # special case: remove files from ../shared
+ gradients.cpp gradients.h
+ main.cpp
+)
+target_include_directories(gradients PUBLIC
+ ../shared
+)
+
+target_link_libraries(gradients PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+ painting_shared # special case
+)
+
+
+# Resources:
+set_source_files_properties("../shared/images/button_normal_cap_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_normal_cap_left.png"
+)
+set_source_files_properties("../shared/images/button_normal_cap_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_normal_cap_right.png"
+)
+set_source_files_properties("../shared/images/button_normal_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_normal_stretch.png"
+)
+set_source_files_properties("../shared/images/button_pressed_cap_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_pressed_cap_left.png"
+)
+set_source_files_properties("../shared/images/button_pressed_cap_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_pressed_cap_right.png"
+)
+set_source_files_properties("../shared/images/button_pressed_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_pressed_stretch.png"
+)
+set_source_files_properties("../shared/images/frame_bottom.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_bottom.png"
+)
+set_source_files_properties("../shared/images/frame_bottomleft.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_bottomleft.png"
+)
+set_source_files_properties("../shared/images/frame_bottomright.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_bottomright.png"
+)
+set_source_files_properties("../shared/images/frame_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_left.png"
+)
+set_source_files_properties("../shared/images/frame_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_right.png"
+)
+set_source_files_properties("../shared/images/frame_top.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_top.png"
+)
+set_source_files_properties("../shared/images/frame_topleft.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_topleft.png"
+)
+set_source_files_properties("../shared/images/frame_topright.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_topright.png"
+)
+set_source_files_properties("../shared/images/groupframe_bottom_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_bottom_left.png"
+)
+set_source_files_properties("../shared/images/groupframe_bottom_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_bottom_right.png"
+)
+set_source_files_properties("../shared/images/groupframe_bottom_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_bottom_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_left_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_left_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_right_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_right_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_top_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_top_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_topleft.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_topleft.png"
+)
+set_source_files_properties("../shared/images/groupframe_topright.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_topright.png"
+)
+set_source_files_properties("../shared/images/line_dash_dot.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dash_dot.png"
+)
+set_source_files_properties("../shared/images/line_dash_dot_dot.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dash_dot_dot.png"
+)
+set_source_files_properties("../shared/images/line_dashed.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dashed.png"
+)
+set_source_files_properties("../shared/images/line_dotted.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dotted.png"
+)
+set_source_files_properties("../shared/images/line_solid.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_solid.png"
+)
+set_source_files_properties("../shared/images/radiobutton-on.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/radiobutton-on.png"
+)
+set_source_files_properties("../shared/images/radiobutton_off.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/radiobutton_off.png"
+)
+set_source_files_properties("../shared/images/radiobutton_on.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/radiobutton_on.png"
+)
+set_source_files_properties("../shared/images/slider_bar.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/slider_bar.png"
+)
+set_source_files_properties("../shared/images/slider_thumb_on.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/slider_thumb_on.png"
+)
+set_source_files_properties("../shared/images/title_cap_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/title_cap_left.png"
+)
+set_source_files_properties("../shared/images/title_cap_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/title_cap_right.png"
+)
+set_source_files_properties("../shared/images/title_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/title_stretch.png"
+)
+set(shared_resource_files
+ "images/button_normal_cap_left.png"
+ "images/button_normal_cap_right.png"
+ "images/button_normal_stretch.png"
+ "images/button_pressed_cap_left.png"
+ "images/button_pressed_cap_right.png"
+ "images/button_pressed_stretch.png"
+ "images/frame_bottom.png"
+ "images/frame_bottomleft.png"
+ "images/frame_bottomright.png"
+ "images/frame_left.png"
+ "images/frame_right.png"
+ "images/frame_top.png"
+ "images/frame_topleft.png"
+ "images/frame_topright.png"
+ "images/groupframe_bottom_left.png"
+ "images/groupframe_bottom_right.png"
+ "images/groupframe_bottom_stretch.png"
+ "images/groupframe_left_stretch.png"
+ "images/groupframe_right_stretch.png"
+ "images/groupframe_top_stretch.png"
+ "images/groupframe_topleft.png"
+ "images/groupframe_topright.png"
+ "images/line_dash_dot.png"
+ "images/line_dash_dot_dot.png"
+ "images/line_dashed.png"
+ "images/line_dotted.png"
+ "images/line_solid.png"
+ "images/radiobutton-on.png"
+ "images/radiobutton_off.png"
+ "images/radiobutton_on.png"
+ "images/slider_bar.png"
+ "images/slider_thumb_on.png"
+ "images/title_cap_left.png"
+ "images/title_cap_right.png"
+ "images/title_stretch.png"
+)
+
+qt6_add_resources(gradients "shared"
+ PREFIX
+ "/res"
+ BASE
+ "../shared"
+ FILES
+ ${shared_resource_files}
+)
+set(gradients_resource_files
+ "gradients.cpp"
+ "gradients.html"
+)
+
+qt6_add_resources(gradients "gradients"
+ PREFIX
+ "/res/gradients"
+ FILES
+ ${gradients_resource_files}
+)
+
+if(QT_FEATURE_opengl)
+ target_sources(gradients PUBLIC
+ ../shared/fbopaintdevice.cpp ../shared/fbopaintdevice.h
+ )
+
+ target_link_libraries(gradients PUBLIC
+ Qt::OpenGL
+ )
+endif()
+
+install(TARGETS gradients
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/painting/imagecomposition/CMakeLists.txt b/examples/widgets/painting/imagecomposition/CMakeLists.txt
new file mode 100644
index 0000000000..1b3d06da8f
--- /dev/null
+++ b/examples/widgets/painting/imagecomposition/CMakeLists.txt
@@ -0,0 +1,46 @@
+# Generated from imagecomposition.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(imagecomposition LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/painting/imagecomposition")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(imagecomposition
+ imagecomposer.cpp imagecomposer.h
+ main.cpp
+)
+target_link_libraries(imagecomposition PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(imagecomposition_resource_files
+ "images/butterfly.png"
+ "images/checker.png"
+)
+
+qt6_add_resources(imagecomposition "imagecomposition"
+ PREFIX
+ "/"
+ FILES
+ ${imagecomposition_resource_files}
+)
+
+install(TARGETS imagecomposition
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/painting/imagecomposition/imagecomposer.cpp b/examples/widgets/painting/imagecomposition/imagecomposer.cpp
index ffdc8f433c..f0935147cf 100644
--- a/examples/widgets/painting/imagecomposition/imagecomposer.cpp
+++ b/examples/widgets/painting/imagecomposition/imagecomposer.cpp
@@ -102,7 +102,7 @@ ImageComposer::ImageComposer()
//! [3]
connect(sourceButton, &QAbstractButton::clicked,
this, &ImageComposer::chooseSource);
- connect(operatorComboBox, QOverload<int>::of(&QComboBox::activated),
+ connect(operatorComboBox, &QComboBox::activated,
this, &ImageComposer::recalculateResult);
connect(destinationButton, &QAbstractButton::clicked,
this, &ImageComposer::chooseDestination);
diff --git a/examples/widgets/painting/painterpaths/CMakeLists.txt b/examples/widgets/painting/painterpaths/CMakeLists.txt
new file mode 100644
index 0000000000..7ae6f0a016
--- /dev/null
+++ b/examples/widgets/painting/painterpaths/CMakeLists.txt
@@ -0,0 +1,39 @@
+# Generated from painterpaths.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(painterpaths LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/painting/painterpaths")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(painterpaths
+ main.cpp
+ renderarea.cpp renderarea.h
+ window.cpp window.h
+)
+target_link_libraries(painterpaths PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+if(UNIX AND NOT APPLE AND NOT HAIKU AND NOT INTEGRITY AND NOT VXWORKS)
+ target_link_libraries(painterpaths PUBLIC
+ m
+ )
+endif()
+
+install(TARGETS painterpaths
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/painting/painterpaths/window.cpp b/examples/widgets/painting/painterpaths/window.cpp
index 6fb3218313..07d3c5aaa8 100644
--- a/examples/widgets/painting/painterpaths/window.cpp
+++ b/examples/widgets/painting/painterpaths/window.cpp
@@ -194,19 +194,19 @@ Window::Window()
//! [12]
//! [16]
- connect(fillRuleComboBox, QOverload<int>::of(&QComboBox::activated),
+ connect(fillRuleComboBox, &QComboBox::activated,
this, &Window::fillRuleChanged);
- connect(fillColor1ComboBox, QOverload<int>::of(&QComboBox::activated),
+ connect(fillColor1ComboBox, &QComboBox::activated,
this, &Window::fillGradientChanged);
- connect(fillColor2ComboBox, QOverload<int>::of(&QComboBox::activated),
+ connect(fillColor2ComboBox, &QComboBox::activated,
this, &Window::fillGradientChanged);
- connect(penColorComboBox, QOverload<int>::of(&QComboBox::activated),
+ connect(penColorComboBox, &QComboBox::activated,
this, &Window::penColorChanged);
for (RenderArea *area : qAsConst(renderAreas)) {
- connect(penWidthSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
+ connect(penWidthSpinBox, &QSpinBox::valueChanged,
area, &RenderArea::setPenWidth);
- connect(rotationAngleSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
+ connect(rotationAngleSpinBox, &QSpinBox::valueChanged,
area, &RenderArea::setRotationAngle);
}
diff --git a/examples/widgets/painting/pathstroke/CMakeLists.txt b/examples/widgets/painting/pathstroke/CMakeLists.txt
new file mode 100644
index 0000000000..9f5c24fe88
--- /dev/null
+++ b/examples/widgets/painting/pathstroke/CMakeLists.txt
@@ -0,0 +1,214 @@
+# Generated from pathstroke.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(pathstroke LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/painting/pathstroke")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(pathstroke
+ ../shared/arthurstyle.cpp ../shared/arthurstyle.h
+ ../shared/arthurwidgets.cpp ../shared/arthurwidgets.h
+ ../shared/hoverpoints.cpp ../shared/hoverpoints.h
+ main.cpp
+ pathstroke.cpp pathstroke.h
+)
+target_include_directories(pathstroke PUBLIC
+ ../shared
+)
+
+target_link_libraries(pathstroke PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set_source_files_properties("../shared/images/button_normal_cap_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_normal_cap_left.png"
+)
+set_source_files_properties("../shared/images/button_normal_cap_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_normal_cap_right.png"
+)
+set_source_files_properties("../shared/images/button_normal_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_normal_stretch.png"
+)
+set_source_files_properties("../shared/images/button_pressed_cap_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_pressed_cap_left.png"
+)
+set_source_files_properties("../shared/images/button_pressed_cap_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_pressed_cap_right.png"
+)
+set_source_files_properties("../shared/images/button_pressed_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/button_pressed_stretch.png"
+)
+set_source_files_properties("../shared/images/frame_bottom.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_bottom.png"
+)
+set_source_files_properties("../shared/images/frame_bottomleft.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_bottomleft.png"
+)
+set_source_files_properties("../shared/images/frame_bottomright.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_bottomright.png"
+)
+set_source_files_properties("../shared/images/frame_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_left.png"
+)
+set_source_files_properties("../shared/images/frame_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_right.png"
+)
+set_source_files_properties("../shared/images/frame_top.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_top.png"
+)
+set_source_files_properties("../shared/images/frame_topleft.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_topleft.png"
+)
+set_source_files_properties("../shared/images/frame_topright.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/frame_topright.png"
+)
+set_source_files_properties("../shared/images/groupframe_bottom_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_bottom_left.png"
+)
+set_source_files_properties("../shared/images/groupframe_bottom_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_bottom_right.png"
+)
+set_source_files_properties("../shared/images/groupframe_bottom_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_bottom_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_left_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_left_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_right_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_right_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_top_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_top_stretch.png"
+)
+set_source_files_properties("../shared/images/groupframe_topleft.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_topleft.png"
+)
+set_source_files_properties("../shared/images/groupframe_topright.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_topright.png"
+)
+set_source_files_properties("../shared/images/line_dash_dot.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dash_dot.png"
+)
+set_source_files_properties("../shared/images/line_dash_dot_dot.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dash_dot_dot.png"
+)
+set_source_files_properties("../shared/images/line_dashed.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dashed.png"
+)
+set_source_files_properties("../shared/images/line_dotted.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_dotted.png"
+)
+set_source_files_properties("../shared/images/line_solid.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/line_solid.png"
+)
+set_source_files_properties("../shared/images/radiobutton-on.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/radiobutton-on.png"
+)
+set_source_files_properties("../shared/images/radiobutton_off.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/radiobutton_off.png"
+)
+set_source_files_properties("../shared/images/radiobutton_on.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/radiobutton_on.png"
+)
+set_source_files_properties("../shared/images/slider_bar.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/slider_bar.png"
+)
+set_source_files_properties("../shared/images/slider_thumb_on.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/slider_thumb_on.png"
+)
+set_source_files_properties("../shared/images/title_cap_left.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/title_cap_left.png"
+)
+set_source_files_properties("../shared/images/title_cap_right.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/title_cap_right.png"
+)
+set_source_files_properties("../shared/images/title_stretch.png"
+ PROPERTIES QT_RESOURCE_ALIAS "images/title_stretch.png"
+)
+set(shared_resource_files
+ "images/button_normal_cap_left.png"
+ "images/button_normal_cap_right.png"
+ "images/button_normal_stretch.png"
+ "images/button_pressed_cap_left.png"
+ "images/button_pressed_cap_right.png"
+ "images/button_pressed_stretch.png"
+ "images/frame_bottom.png"
+ "images/frame_bottomleft.png"
+ "images/frame_bottomright.png"
+ "images/frame_left.png"
+ "images/frame_right.png"
+ "images/frame_top.png"
+ "images/frame_topleft.png"
+ "images/frame_topright.png"
+ "images/groupframe_bottom_left.png"
+ "images/groupframe_bottom_right.png"
+ "images/groupframe_bottom_stretch.png"
+ "images/groupframe_left_stretch.png"
+ "images/groupframe_right_stretch.png"
+ "images/groupframe_top_stretch.png"
+ "images/groupframe_topleft.png"
+ "images/groupframe_topright.png"
+ "images/line_dash_dot.png"
+ "images/line_dash_dot_dot.png"
+ "images/line_dashed.png"
+ "images/line_dotted.png"
+ "images/line_solid.png"
+ "images/radiobutton-on.png"
+ "images/radiobutton_off.png"
+ "images/radiobutton_on.png"
+ "images/slider_bar.png"
+ "images/slider_thumb_on.png"
+ "images/title_cap_left.png"
+ "images/title_cap_right.png"
+ "images/title_stretch.png"
+)
+
+qt6_add_resources(pathstroke "shared"
+ PREFIX
+ "/res"
+ BASE
+ "../shared"
+ FILES
+ ${shared_resource_files}
+)
+set(pathstroke_resource_files
+ "pathstroke.cpp"
+ "pathstroke.html"
+)
+
+qt6_add_resources(pathstroke "pathstroke"
+ PREFIX
+ "/res/pathstroke"
+ FILES
+ ${pathstroke_resource_files}
+)
+
+if(QT_FEATURE_opengl)
+ target_sources(pathstroke PUBLIC
+ ../shared/fbopaintdevice.cpp ../shared/fbopaintdevice.h
+ )
+
+ target_link_libraries(pathstroke PUBLIC
+ Qt::OpenGL
+ )
+endif()
+
+install(TARGETS pathstroke
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/painting/shared/CMakeLists.txt b/examples/widgets/painting/shared/CMakeLists.txt
new file mode 100644
index 0000000000..4c7049e01d
--- /dev/null
+++ b/examples/widgets/painting/shared/CMakeLists.txt
@@ -0,0 +1,24 @@
+# special case: Entire file!
+
+# special case:
+add_library(painting_shared OBJECT)
+qt6_wrap_cpp(moc_files arthurwidgets.h hoverpoints.h) # no automoc for OBJECT libs:-/
+target_sources(painting_shared PRIVATE
+ arthurstyle.cpp arthurstyle.h
+ arthurwidgets.cpp arthurwidgets.h
+ hoverpoints.cpp hoverpoints.h
+ ${moc_files}
+)
+target_link_libraries(painting_shared PUBLIC Qt::Widgets)
+target_include_directories(painting_shared PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
+
+## Scopes:
+#####################################################################
+
+if (TARGET Qt::OpenGL OR QT_FEATURE_opengles2)
+ target_compile_definitions(painting_shared PRIVATE QT_OPENGL_SUPPORT)
+ target_link_libraries(painting_shared PRIVATE
+ Qt::OpenGL
+ Qt::Widgets
+ )
+endif()
diff --git a/examples/widgets/painting/shared/arthurwidgets.cpp b/examples/widgets/painting/shared/arthurwidgets.cpp
index 40d712c9e3..e24130e464 100644
--- a/examples/widgets/painting/shared/arthurwidgets.cpp
+++ b/examples/widgets/painting/shared/arthurwidgets.cpp
@@ -62,8 +62,10 @@
#include <QRegularExpression>
#include <QOffscreenSurface>
#include <QOpenGLContext>
-#include <QOpenGLPaintDevice>
-#include <QOpenGLWindow>
+#if QT_CONFIG(opengl)
+#include <QtOpenGL/QOpenGLPaintDevice>
+#include <QtOpenGL/QOpenGLWindow>
+#endif
extern QPixmap cached(const QString &img);
diff --git a/examples/widgets/painting/shared/hoverpoints.cpp b/examples/widgets/painting/shared/hoverpoints.cpp
index 2bf3963e9e..f834f315f9 100644
--- a/examples/widgets/painting/shared/hoverpoints.cpp
+++ b/examples/widgets/painting/shared/hoverpoints.cpp
@@ -53,6 +53,10 @@
#include <algorithm>
+#if QT_CONFIG(opengl)
+#include <QtOpenGL/QOpenGLWindow>
+#endif
+
#define printf
HoverPoints::HoverPoints(QWidget *widget, PointShape shape)
diff --git a/examples/widgets/painting/shared/shared.pri b/examples/widgets/painting/shared/shared.pri
index cb08b00348..7e2b4df8cb 100644
--- a/examples/widgets/painting/shared/shared.pri
+++ b/examples/widgets/painting/shared/shared.pri
@@ -1,6 +1,7 @@
INCLUDEPATH += $$PWD
qtConfig(opengl) {
+ QT += opengl
SOURCES += $$PWD/fbopaintdevice.cpp
HEADERS += $$PWD/fbopaintdevice.h
}
diff --git a/examples/widgets/painting/transformations/CMakeLists.txt b/examples/widgets/painting/transformations/CMakeLists.txt
new file mode 100644
index 0000000000..b5725967ea
--- /dev/null
+++ b/examples/widgets/painting/transformations/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from transformations.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(transformations LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/painting/transformations")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(transformations
+ main.cpp
+ renderarea.cpp renderarea.h
+ window.cpp window.h
+)
+target_link_libraries(transformations PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS transformations
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/painting/transformations/window.cpp b/examples/widgets/painting/transformations/window.cpp
index 8261c4e12e..a07e4dd5d1 100644
--- a/examples/widgets/painting/transformations/window.cpp
+++ b/examples/widgets/painting/transformations/window.cpp
@@ -79,7 +79,7 @@ Window::Window()
operationComboBoxes[i]->addItem(tr("Scale to 75%"));
operationComboBoxes[i]->addItem(tr("Translate by (50, 50)"));
- connect(operationComboBoxes[i], QOverload<int>::of(&QComboBox::activated),
+ connect(operationComboBoxes[i], &QComboBox::activated,
this, &Window::operationChanged);
layout->addWidget(transformedRenderAreas[i], 0, i + 1);
@@ -159,7 +159,7 @@ void Window::setupShapes()
shapes.append(text);
shapes.append(truck);
- connect(shapeComboBox, QOverload<int>::of(&QComboBox::activated),
+ connect(shapeComboBox, &QComboBox::activated,
this, &Window::shapeSelected);
}
//! [7]
diff --git a/examples/widgets/richtext/CMakeLists.txt b/examples/widgets/richtext/CMakeLists.txt
new file mode 100644
index 0000000000..adb98e38f9
--- /dev/null
+++ b/examples/widgets/richtext/CMakeLists.txt
@@ -0,0 +1,6 @@
+# Generated from richtext.pro.
+
+add_subdirectory(calendar)
+add_subdirectory(orderform)
+add_subdirectory(syntaxhighlighter)
+add_subdirectory(textedit)
diff --git a/examples/widgets/richtext/calendar/CMakeLists.txt b/examples/widgets/richtext/calendar/CMakeLists.txt
new file mode 100644
index 0000000000..9cfc150a0e
--- /dev/null
+++ b/examples/widgets/richtext/calendar/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from calendar.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(calendar LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/richtext/calendar")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(calendar
+ main.cpp
+ mainwindow.cpp mainwindow.h
+)
+target_link_libraries(calendar PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS calendar
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/richtext/calendar/mainwindow.cpp b/examples/widgets/richtext/calendar/mainwindow.cpp
index 3ddb1cf7ad..8ac5a8cdce 100644
--- a/examples/widgets/richtext/calendar/mainwindow.cpp
+++ b/examples/widgets/richtext/calendar/mainwindow.cpp
@@ -86,11 +86,11 @@ MainWindow::MainWindow()
//! [2]
//! [3]
- connect(monthCombo, QOverload<int>::of(&QComboBox::activated),
+ connect(monthCombo, &QComboBox::activated,
this, &MainWindow::setMonth);
connect(yearEdit, &QDateTimeEdit::dateChanged,
this, &MainWindow::setYear);
- connect(fontSizeSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
+ connect(fontSizeSpinBox, &QSpinBox::valueChanged,
this, &MainWindow::setFontSize);
//! [3]
diff --git a/examples/widgets/richtext/orderform/CMakeLists.txt b/examples/widgets/richtext/orderform/CMakeLists.txt
new file mode 100644
index 0000000000..fc92c60c30
--- /dev/null
+++ b/examples/widgets/richtext/orderform/CMakeLists.txt
@@ -0,0 +1,39 @@
+# Generated from orderform.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(orderform LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/richtext/orderform")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(orderform
+ detailsdialog.cpp detailsdialog.h
+ main.cpp
+ mainwindow.cpp mainwindow.h
+)
+target_link_libraries(orderform PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+if(TARGET Qt::PrintSupport)
+ target_link_libraries(orderform PUBLIC
+ Qt::PrintSupport
+ )
+endif()
+
+install(TARGETS orderform
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/richtext/syntaxhighlighter/CMakeLists.txt b/examples/widgets/richtext/syntaxhighlighter/CMakeLists.txt
new file mode 100644
index 0000000000..ec98b1af4f
--- /dev/null
+++ b/examples/widgets/richtext/syntaxhighlighter/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from syntaxhighlighter.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(syntaxhighlighter LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/richtext/syntaxhighlighter")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(syntaxhighlighter
+ highlighter.cpp highlighter.h
+ main.cpp
+ mainwindow.cpp mainwindow.h
+)
+target_link_libraries(syntaxhighlighter PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS syntaxhighlighter
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/richtext/textedit/.prev_CMakeLists.txt b/examples/widgets/richtext/textedit/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..dcb2b628ef
--- /dev/null
+++ b/examples/widgets/richtext/textedit/.prev_CMakeLists.txt
@@ -0,0 +1,98 @@
+# Generated from textedit.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(textedit LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/richtext/textedit")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(textedit
+ main.cpp
+ textedit.cpp textedit.h
+)
+target_link_libraries(textedit PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(textedit_resource_files
+ "example.html"
+ "images/logo32.png"
+ "images/mac/checkbox-checked.png"
+ "images/mac/checkbox.png"
+ "images/mac/editcopy.png"
+ "images/mac/editcut.png"
+ "images/mac/editpaste.png"
+ "images/mac/editredo.png"
+ "images/mac/editundo.png"
+ "images/mac/exportpdf.png"
+ "images/mac/filenew.png"
+ "images/mac/fileopen.png"
+ "images/mac/fileprint.png"
+ "images/mac/filesave.png"
+ "images/mac/format-indent-less.png"
+ "images/mac/format-indent-more.png"
+ "images/mac/textbold.png"
+ "images/mac/textcenter.png"
+ "images/mac/textitalic.png"
+ "images/mac/textjustify.png"
+ "images/mac/textleft.png"
+ "images/mac/textright.png"
+ "images/mac/textunder.png"
+ "images/mac/zoomin.png"
+ "images/mac/zoomout.png"
+ "images/win/checkbox-checked.png"
+ "images/win/checkbox.png"
+ "images/win/editcopy.png"
+ "images/win/editcut.png"
+ "images/win/editpaste.png"
+ "images/win/editredo.png"
+ "images/win/editundo.png"
+ "images/win/exportpdf.png"
+ "images/win/filenew.png"
+ "images/win/fileopen.png"
+ "images/win/fileprint.png"
+ "images/win/filesave.png"
+ "images/win/format-indent-less.png"
+ "images/win/format-indent-more.png"
+ "images/win/textbold.png"
+ "images/win/textcenter.png"
+ "images/win/textitalic.png"
+ "images/win/textjustify.png"
+ "images/win/textleft.png"
+ "images/win/textright.png"
+ "images/win/textunder.png"
+ "images/win/zoomin.png"
+ "images/win/zoomout.png"
+)
+
+qt6_add_resources(textedit "textedit"
+ PREFIX
+ "/"
+ FILES
+ ${textedit_resource_files}
+)
+
+if(TARGET Qt::PrintSupport)
+ target_link_libraries(textedit PUBLIC
+ Qt::PrintSupport
+ )
+endif()
+
+install(TARGETS textedit
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/richtext/textedit/CMakeLists.txt b/examples/widgets/richtext/textedit/CMakeLists.txt
new file mode 100644
index 0000000000..8aa4e016fe
--- /dev/null
+++ b/examples/widgets/richtext/textedit/CMakeLists.txt
@@ -0,0 +1,104 @@
+# Generated from textedit.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(textedit LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/richtext/textedit")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS PrintSupport) # special case
+
+add_qt_gui_executable(textedit
+ main.cpp
+ textedit.cpp textedit.h
+)
+target_link_libraries(textedit PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+# special case begin
+if (TARGET Qt::PrintSupport)
+ target_link_libraries(textedit PUBLIC Qt::PrintSupport)
+endif()
+# special case end
+
+
+# Resources:
+set(textedit_resource_files
+ "example.html"
+ "images/logo32.png"
+ "images/mac/checkbox-checked.png"
+ "images/mac/checkbox.png"
+ "images/mac/editcopy.png"
+ "images/mac/editcut.png"
+ "images/mac/editpaste.png"
+ "images/mac/editredo.png"
+ "images/mac/editundo.png"
+ "images/mac/exportpdf.png"
+ "images/mac/filenew.png"
+ "images/mac/fileopen.png"
+ "images/mac/fileprint.png"
+ "images/mac/filesave.png"
+ "images/mac/format-indent-less.png"
+ "images/mac/format-indent-more.png"
+ "images/mac/textbold.png"
+ "images/mac/textcenter.png"
+ "images/mac/textitalic.png"
+ "images/mac/textjustify.png"
+ "images/mac/textleft.png"
+ "images/mac/textright.png"
+ "images/mac/textunder.png"
+ "images/mac/zoomin.png"
+ "images/mac/zoomout.png"
+ "images/win/checkbox-checked.png"
+ "images/win/checkbox.png"
+ "images/win/editcopy.png"
+ "images/win/editcut.png"
+ "images/win/editpaste.png"
+ "images/win/editredo.png"
+ "images/win/editundo.png"
+ "images/win/exportpdf.png"
+ "images/win/filenew.png"
+ "images/win/fileopen.png"
+ "images/win/fileprint.png"
+ "images/win/filesave.png"
+ "images/win/format-indent-less.png"
+ "images/win/format-indent-more.png"
+ "images/win/textbold.png"
+ "images/win/textcenter.png"
+ "images/win/textitalic.png"
+ "images/win/textjustify.png"
+ "images/win/textleft.png"
+ "images/win/textright.png"
+ "images/win/textunder.png"
+ "images/win/zoomin.png"
+ "images/win/zoomout.png"
+)
+
+qt6_add_resources(textedit "textedit"
+ PREFIX
+ "/"
+ FILES
+ ${textedit_resource_files}
+)
+
+if(TARGET Qt::PrintSupport)
+ target_link_libraries(textedit PUBLIC
+ Qt::PrintSupport
+ )
+endif()
+
+install(TARGETS textedit
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/richtext/textedit/textedit.cpp b/examples/widgets/richtext/textedit/textedit.cpp
index 7708b25a24..5d27e7df0c 100644
--- a/examples/widgets/richtext/textedit/textedit.cpp
+++ b/examples/widgets/richtext/textedit/textedit.cpp
@@ -389,7 +389,7 @@ void TextEdit::setupTextActions()
comboStyle->addItem("Heading 5");
comboStyle->addItem("Heading 6");
- connect(comboStyle, QOverload<int>::of(&QComboBox::activated), this, &TextEdit::textStyle);
+ connect(comboStyle, &QComboBox::activated, this, &TextEdit::textStyle);
comboFont = new QFontComboBox(tb);
tb->addWidget(comboFont);
diff --git a/examples/widgets/scroller/CMakeLists.txt b/examples/widgets/scroller/CMakeLists.txt
new file mode 100644
index 0000000000..f663cd9890
--- /dev/null
+++ b/examples/widgets/scroller/CMakeLists.txt
@@ -0,0 +1,3 @@
+# Generated from scroller.pro.
+
+add_subdirectory(graphicsview)
diff --git a/examples/widgets/scroller/graphicsview/CMakeLists.txt b/examples/widgets/scroller/graphicsview/CMakeLists.txt
new file mode 100644
index 0000000000..6e389956e9
--- /dev/null
+++ b/examples/widgets/scroller/graphicsview/CMakeLists.txt
@@ -0,0 +1,31 @@
+# Generated from graphicsview.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(graphicsview LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/scroller/graphicsview")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(graphicsview
+ main.cpp
+)
+target_link_libraries(graphicsview PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS graphicsview
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/statemachine/CMakeLists.txt b/examples/widgets/statemachine/CMakeLists.txt
new file mode 100644
index 0000000000..8527fcbc69
--- /dev/null
+++ b/examples/widgets/statemachine/CMakeLists.txt
@@ -0,0 +1,11 @@
+# Generated from statemachine.pro.
+
+add_subdirectory(factorial)
+add_subdirectory(pingpong)
+
+if(TARGET Qt::Widgets)
+ add_subdirectory(eventtransitions)
+ add_subdirectory(rogue)
+ add_subdirectory(trafficlight)
+ add_subdirectory(twowaybutton)
+endif()
diff --git a/examples/widgets/statemachine/eventtransitions/CMakeLists.txt b/examples/widgets/statemachine/eventtransitions/CMakeLists.txt
new file mode 100644
index 0000000000..c011eb1e0f
--- /dev/null
+++ b/examples/widgets/statemachine/eventtransitions/CMakeLists.txt
@@ -0,0 +1,31 @@
+# Generated from eventtransitions.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(eventtransitions LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/statemachine/eventtransitions")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(eventtransitions
+ main.cpp
+)
+target_link_libraries(eventtransitions PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS eventtransitions
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/statemachine/factorial/CMakeLists.txt b/examples/widgets/statemachine/factorial/CMakeLists.txt
new file mode 100644
index 0000000000..e4c5ddc92d
--- /dev/null
+++ b/examples/widgets/statemachine/factorial/CMakeLists.txt
@@ -0,0 +1,27 @@
+# Generated from factorial.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(factorial LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/statemachine/factorial")
+
+find_package(Qt6 COMPONENTS Core)
+
+add_executable(factorial
+ main.cpp
+)
+target_link_libraries(factorial PUBLIC
+ Qt::Core
+)
+
+install(TARGETS factorial
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/statemachine/pingpong/CMakeLists.txt b/examples/widgets/statemachine/pingpong/CMakeLists.txt
new file mode 100644
index 0000000000..e194afb59e
--- /dev/null
+++ b/examples/widgets/statemachine/pingpong/CMakeLists.txt
@@ -0,0 +1,27 @@
+# Generated from pingpong.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(pingpong LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/statemachine/pingpong")
+
+find_package(Qt6 COMPONENTS Core)
+
+add_executable(pingpong
+ main.cpp
+)
+target_link_libraries(pingpong PUBLIC
+ Qt::Core
+)
+
+install(TARGETS pingpong
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/statemachine/rogue/CMakeLists.txt b/examples/widgets/statemachine/rogue/CMakeLists.txt
new file mode 100644
index 0000000000..0142f60f63
--- /dev/null
+++ b/examples/widgets/statemachine/rogue/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from rogue.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(rogue LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/statemachine/rogue")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(rogue
+ main.cpp
+ movementtransition.h
+ window.cpp window.h
+)
+target_link_libraries(rogue PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS rogue
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/statemachine/trafficlight/CMakeLists.txt b/examples/widgets/statemachine/trafficlight/CMakeLists.txt
new file mode 100644
index 0000000000..4069f601ef
--- /dev/null
+++ b/examples/widgets/statemachine/trafficlight/CMakeLists.txt
@@ -0,0 +1,31 @@
+# Generated from trafficlight.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(trafficlight LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/statemachine/trafficlight")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(trafficlight
+ main.cpp
+)
+target_link_libraries(trafficlight PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS trafficlight
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/statemachine/twowaybutton/CMakeLists.txt b/examples/widgets/statemachine/twowaybutton/CMakeLists.txt
new file mode 100644
index 0000000000..05a8b87004
--- /dev/null
+++ b/examples/widgets/statemachine/twowaybutton/CMakeLists.txt
@@ -0,0 +1,31 @@
+# Generated from twowaybutton.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(twowaybutton LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/statemachine/twowaybutton")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(twowaybutton
+ main.cpp
+)
+target_link_libraries(twowaybutton PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS twowaybutton
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tools/CMakeLists.txt b/examples/widgets/tools/CMakeLists.txt
new file mode 100644
index 0000000000..042f751b0f
--- /dev/null
+++ b/examples/widgets/tools/CMakeLists.txt
@@ -0,0 +1,22 @@
+# Generated from tools.pro.
+
+add_subdirectory(codecs)
+add_subdirectory(completer)
+add_subdirectory(customcompleter)
+if(QT_FEATURE_translation) # special case
+ add_subdirectory(i18n)
+endif()
+add_subdirectory(regexp)
+add_subdirectory(regularexpression)
+add_subdirectory(settingseditor)
+add_subdirectory(styleplugin)
+add_subdirectory(treemodelcompleter)
+add_subdirectory(undo)
+add_subdirectory(undoframework)
+
+if(QT_FEATURE_library) # special case
+ add_subdirectory(echoplugin)
+ # FIXME: Currently broken # special case
+ # Fails to link (ld: error: undefined symbol: qt_static_plugin_BasicToolsPlugin()) # special case
+ #add_subdirectory(plugandpaint) # special case
+endif()
diff --git a/examples/widgets/tools/codecs/CMakeLists.txt b/examples/widgets/tools/codecs/CMakeLists.txt
new file mode 100644
index 0000000000..7e2714fc4b
--- /dev/null
+++ b/examples/widgets/tools/codecs/CMakeLists.txt
@@ -0,0 +1,47 @@
+# Generated from codecs.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(codecs LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tools/codecs")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(codecs
+ encodingdialog.cpp encodingdialog.h
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ previewform.cpp previewform.h
+)
+target_link_libraries(codecs PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(codecs_resource_files
+ "images/editcopy.png"
+)
+
+qt6_add_resources(codecs "codecs"
+ PREFIX
+ "/"
+ FILES
+ ${codecs_resource_files}
+)
+
+install(TARGETS codecs
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tools/codecs/previewform.cpp b/examples/widgets/tools/codecs/previewform.cpp
index f48651335a..80a99bf271 100644
--- a/examples/widgets/tools/codecs/previewform.cpp
+++ b/examples/widgets/tools/codecs/previewform.cpp
@@ -167,7 +167,7 @@ PreviewForm::PreviewForm(QWidget *parent)
new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
okButton = buttonBox->button(QDialogButtonBox::Ok);
- connect(encodingComboBox, QOverload<int>::of(&QComboBox::activated),
+ connect(encodingComboBox, &QComboBox::activated,
this, &PreviewForm::updateTextEdit);
connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
diff --git a/examples/widgets/tools/completer/CMakeLists.txt b/examples/widgets/tools/completer/CMakeLists.txt
new file mode 100644
index 0000000000..b60d38cfdc
--- /dev/null
+++ b/examples/widgets/tools/completer/CMakeLists.txt
@@ -0,0 +1,47 @@
+# Generated from completer.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(completer LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tools/completer")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(completer
+ fsmodel.cpp fsmodel.h
+ main.cpp
+ mainwindow.cpp mainwindow.h
+)
+target_link_libraries(completer PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(completer_resource_files
+ "resources/countries.txt"
+ "resources/wordlist.txt"
+)
+
+qt6_add_resources(completer "completer"
+ PREFIX
+ "/"
+ FILES
+ ${completer_resource_files}
+)
+
+install(TARGETS completer
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tools/completer/mainwindow.cpp b/examples/widgets/tools/completer/mainwindow.cpp
index b50e0a5456..8e9c0e0615 100644
--- a/examples/widgets/tools/completer/mainwindow.cpp
+++ b/examples/widgets/tools/completer/mainwindow.cpp
@@ -117,13 +117,13 @@ MainWindow::MainWindow(QWidget *parent)
contentsLabel = new QLabel;
contentsLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
- connect(modelCombo, QOverload<int>::of(&QComboBox::activated),
+ connect(modelCombo, &QComboBox::activated,
this, &MainWindow::changeModel);
- connect(modeCombo, QOverload<int>::of(&QComboBox::activated),
+ connect(modeCombo, &QComboBox::activated,
this, &MainWindow::changeMode);
- connect(caseCombo, QOverload<int>::of(&QComboBox::activated),
+ connect(caseCombo, &QComboBox::activated,
this, &MainWindow::changeCase);
- connect(maxVisibleSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
+ connect(maxVisibleSpinBox, &QSpinBox::valueChanged,
this, &MainWindow::changeMaxVisible);
//! [2]
diff --git a/examples/widgets/tools/customcompleter/CMakeLists.txt b/examples/widgets/tools/customcompleter/CMakeLists.txt
new file mode 100644
index 0000000000..a1b1deee12
--- /dev/null
+++ b/examples/widgets/tools/customcompleter/CMakeLists.txt
@@ -0,0 +1,46 @@
+# Generated from customcompleter.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(customcompleter LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tools/customcompleter")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(customcompleter
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ textedit.cpp textedit.h
+)
+target_link_libraries(customcompleter PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(customcompleter_resource_files
+ "resources/wordlist.txt"
+)
+
+qt6_add_resources(customcompleter "customcompleter"
+ PREFIX
+ "/"
+ FILES
+ ${customcompleter_resource_files}
+)
+
+install(TARGETS customcompleter
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tools/echoplugin/CMakeLists.txt b/examples/widgets/tools/echoplugin/CMakeLists.txt
new file mode 100644
index 0000000000..b848e08e72
--- /dev/null
+++ b/examples/widgets/tools/echoplugin/CMakeLists.txt
@@ -0,0 +1,4 @@
+# Generated from echoplugin.pro.
+
+add_subdirectory(echowindow)
+add_subdirectory(plugin)
diff --git a/examples/widgets/tools/echoplugin/echowindow/.prev_CMakeLists.txt b/examples/widgets/tools/echoplugin/echowindow/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..cd116482d8
--- /dev/null
+++ b/examples/widgets/tools/echoplugin/echowindow/.prev_CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from echowindow.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(echoplugin LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tools/echoplugin")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(echoplugin
+ echointerface.h
+ echowindow.cpp echowindow.h
+ main.cpp
+)
+target_link_libraries(echoplugin PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS echoplugin
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt b/examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt
new file mode 100644
index 0000000000..5ca9e75073
--- /dev/null
+++ b/examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from echowindow.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(echoplugin LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tools/echoplugin")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(echopluginwindow # special case: renamed target
+ echointerface.h
+ echowindow.cpp echowindow.h
+ main.cpp
+)
+target_link_libraries(echopluginwindow PUBLIC # special case
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS echopluginwindow # special case: renamed target
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tools/echoplugin/plugin/.prev_CMakeLists.txt b/examples/widgets/tools/echoplugin/plugin/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..9f3a93b3bd
--- /dev/null
+++ b/examples/widgets/tools/echoplugin/plugin/.prev_CMakeLists.txt
@@ -0,0 +1,35 @@
+# Generated from plugin.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(echoplugin LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tools/echoplugin/plugins")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_library(echoplugin MODULE
+ echoplugin.cpp echoplugin.h
+)
+target_include_directories(echoplugin PUBLIC
+ ../echowindow
+)
+
+target_link_libraries(echoplugin PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS echoplugin
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tools/echoplugin/plugin/CMakeLists.txt b/examples/widgets/tools/echoplugin/plugin/CMakeLists.txt
new file mode 100644
index 0000000000..9f3a93b3bd
--- /dev/null
+++ b/examples/widgets/tools/echoplugin/plugin/CMakeLists.txt
@@ -0,0 +1,35 @@
+# Generated from plugin.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(echoplugin LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tools/echoplugin/plugins")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_library(echoplugin MODULE
+ echoplugin.cpp echoplugin.h
+)
+target_include_directories(echoplugin PUBLIC
+ ../echowindow
+)
+
+target_link_libraries(echoplugin PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS echoplugin
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tools/i18n/CMakeLists.txt b/examples/widgets/tools/i18n/CMakeLists.txt
new file mode 100644
index 0000000000..783829fe10
--- /dev/null
+++ b/examples/widgets/tools/i18n/CMakeLists.txt
@@ -0,0 +1,59 @@
+# Generated from i18n.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(i18n LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tools/i18n")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(i18n
+ languagechooser.cpp languagechooser.h
+ main.cpp
+ mainwindow.cpp mainwindow.h
+)
+target_link_libraries(i18n PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(i18n_resource_files
+ "translations/i18n_ar.qm"
+ "translations/i18n_cs.qm"
+ "translations/i18n_de.qm"
+ "translations/i18n_el.qm"
+ "translations/i18n_en.qm"
+ "translations/i18n_eo.qm"
+ "translations/i18n_fr.qm"
+ "translations/i18n_it.qm"
+ "translations/i18n_jp.qm"
+ "translations/i18n_ko.qm"
+ "translations/i18n_no.qm"
+ "translations/i18n_ru.qm"
+ "translations/i18n_sv.qm"
+ "translations/i18n_zh.qm"
+)
+
+qt6_add_resources(i18n "i18n"
+ PREFIX
+ "/"
+ FILES
+ ${i18n_resource_files}
+)
+
+install(TARGETS i18n
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tools/plugandpaint/CMakeLists.txt b/examples/widgets/tools/plugandpaint/CMakeLists.txt
new file mode 100644
index 0000000000..2bde4718b2
--- /dev/null
+++ b/examples/widgets/tools/plugandpaint/CMakeLists.txt
@@ -0,0 +1,4 @@
+# Generated from plugandpaint.pro.
+
+add_subdirectory(plugins)
+add_subdirectory(app)
diff --git a/examples/widgets/tools/plugandpaint/app/.prev_CMakeLists.txt b/examples/widgets/tools/plugandpaint/app/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..0a7a7155ad
--- /dev/null
+++ b/examples/widgets/tools/plugandpaint/app/.prev_CMakeLists.txt
@@ -0,0 +1,66 @@
+# Generated from app.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(plugandpaint LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tools/plugandpaint")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(plugandpaint
+ interfaces.h
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ paintarea.cpp paintarea.h
+ plugindialog.cpp plugindialog.h
+)
+target_link_libraries(plugandpaint PUBLIC
+ # Remove: L../plugins
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+if(macx-xcode)
+ target_link_libraries(plugandpaint PUBLIC
+ (
+ )
+ pnp_basictools$
+ )
+endif()
+
+if(NOT macx-xcode)
+ target_link_libraries(plugandpaint PUBLIC
+ pnp_basictools
+ )
+endif()
+
+if(((NOT (macx-xcode)) AND (( NOT debug_and_release OR build_pass ) AND CONFIG(debug,debug OR release))) AND (APPLE))
+ target_link_libraries(plugandpaint PUBLIC
+ (LIBS, 0)
+ (LIBS, 1)
+ _debug
+ )
+endif()
+
+if(((NOT (macx-xcode)) AND (( NOT debug_and_release OR build_pass ) AND CONFIG(debug,debug OR release))) AND (WIN32))
+ target_link_libraries(plugandpaint PUBLIC
+ (LIBS, 0)
+ (LIBS, 1)
+ d
+ )
+endif()
+
+install(TARGETS plugandpaint
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tools/plugandpaint/app/CMakeLists.txt b/examples/widgets/tools/plugandpaint/app/CMakeLists.txt
new file mode 100644
index 0000000000..5548074446
--- /dev/null
+++ b/examples/widgets/tools/plugandpaint/app/CMakeLists.txt
@@ -0,0 +1,68 @@
+# Generated from app.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(plugandpaint LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tools/plugandpaint")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(plugandpaint
+ interfaces.h
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ paintarea.cpp paintarea.h
+ plugindialog.cpp plugindialog.h
+)
+target_link_libraries(plugandpaint PUBLIC
+ # Remove: L../plugins
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+ pnp_basictools # special case
+)
+target_link_libraries(plugandpaint PUBLIC pnp_basictools) # special case
+
+if(macx-xcode)
+ target_link_libraries(plugandpaint PUBLIC
+ (
+ )
+ pnp_basictools$
+ )
+endif()
+
+if(NOT macx-xcode)
+ target_link_libraries(plugandpaint PUBLIC
+ pnp_basictools
+ )
+endif()
+
+if(((NOT (macx-xcode)) AND (( NOT debug_and_release OR build_pass ) AND CONFIG(debug,debug OR release))) AND (APPLE))
+ target_link_libraries(plugandpaint PUBLIC
+ (LIBS, 0)
+ (LIBS, 1)
+ _debug
+ )
+endif()
+
+if(((NOT (macx-xcode)) AND (( NOT debug_and_release OR build_pass ) AND CONFIG(debug,debug OR release))) AND (WIN32))
+ target_link_libraries(plugandpaint PUBLIC
+ (LIBS, 0)
+ (LIBS, 1)
+ d
+ )
+endif()
+
+install(TARGETS plugandpaint
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tools/plugandpaint/plugins/CMakeLists.txt b/examples/widgets/tools/plugandpaint/plugins/CMakeLists.txt
new file mode 100644
index 0000000000..1e63da97ca
--- /dev/null
+++ b/examples/widgets/tools/plugandpaint/plugins/CMakeLists.txt
@@ -0,0 +1,4 @@
+# Generated from plugins.pro.
+
+add_subdirectory(basictools)
+add_subdirectory(extrafilters)
diff --git a/examples/widgets/tools/plugandpaint/plugins/basictools/.prev_CMakeLists.txt b/examples/widgets/tools/plugandpaint/plugins/basictools/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..fefa30e2a4
--- /dev/null
+++ b/examples/widgets/tools/plugandpaint/plugins/basictools/.prev_CMakeLists.txt
@@ -0,0 +1,35 @@
+# Generated from basictools.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(pnp_basictools LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tools/plugandpaint/plugins")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_library(pnp_basictools MODULE
+ basictoolsplugin.cpp basictoolsplugin.h
+)
+target_include_directories(pnp_basictools PUBLIC
+ ../../app
+)
+
+target_link_libraries(pnp_basictools PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS pnp_basictools
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tools/plugandpaint/plugins/basictools/CMakeLists.txt b/examples/widgets/tools/plugandpaint/plugins/basictools/CMakeLists.txt
new file mode 100644
index 0000000000..fefa30e2a4
--- /dev/null
+++ b/examples/widgets/tools/plugandpaint/plugins/basictools/CMakeLists.txt
@@ -0,0 +1,35 @@
+# Generated from basictools.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(pnp_basictools LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tools/plugandpaint/plugins")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_library(pnp_basictools MODULE
+ basictoolsplugin.cpp basictoolsplugin.h
+)
+target_include_directories(pnp_basictools PUBLIC
+ ../../app
+)
+
+target_link_libraries(pnp_basictools PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS pnp_basictools
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tools/plugandpaint/plugins/extrafilters/.prev_CMakeLists.txt b/examples/widgets/tools/plugandpaint/plugins/extrafilters/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..2f689893bb
--- /dev/null
+++ b/examples/widgets/tools/plugandpaint/plugins/extrafilters/.prev_CMakeLists.txt
@@ -0,0 +1,35 @@
+# Generated from extrafilters.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(pnp_extrafilters LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tools/plugandpaint/plugins")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_library(pnp_extrafilters MODULE
+ extrafiltersplugin.cpp extrafiltersplugin.h
+)
+target_include_directories(pnp_extrafilters PUBLIC
+ ../../app
+)
+
+target_link_libraries(pnp_extrafilters PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS pnp_extrafilters
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tools/plugandpaint/plugins/extrafilters/CMakeLists.txt b/examples/widgets/tools/plugandpaint/plugins/extrafilters/CMakeLists.txt
new file mode 100644
index 0000000000..2f689893bb
--- /dev/null
+++ b/examples/widgets/tools/plugandpaint/plugins/extrafilters/CMakeLists.txt
@@ -0,0 +1,35 @@
+# Generated from extrafilters.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(pnp_extrafilters LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tools/plugandpaint/plugins")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_library(pnp_extrafilters MODULE
+ extrafiltersplugin.cpp extrafiltersplugin.h
+)
+target_include_directories(pnp_extrafilters PUBLIC
+ ../../app
+)
+
+target_link_libraries(pnp_extrafilters PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS pnp_extrafilters
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tools/regexp/CMakeLists.txt b/examples/widgets/tools/regexp/CMakeLists.txt
new file mode 100644
index 0000000000..7c0ca31c39
--- /dev/null
+++ b/examples/widgets/tools/regexp/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from regexp.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(regexp LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tools/regexp")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(regexp
+ main.cpp
+ regexpdialog.cpp regexpdialog.h
+)
+target_link_libraries(regexp PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS regexp
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tools/regexp/regexpdialog.cpp b/examples/widgets/tools/regexp/regexpdialog.cpp
index bf61d09974..e70bb7a530 100644
--- a/examples/widgets/tools/regexp/regexpdialog.cpp
+++ b/examples/widgets/tools/regexp/regexpdialog.cpp
@@ -142,7 +142,7 @@ RegExpDialog::RegExpDialog(QWidget *parent)
connect(caseSensitiveCheckBox, &QAbstractButton::toggled,
this, &RegExpDialog::refresh);
connect(minimalCheckBox, &QAbstractButton::toggled, this, &RegExpDialog::refresh);
- connect(syntaxComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
+ connect(syntaxComboBox, &QComboBox::currentIndexChanged,
this, &RegExpDialog::refresh);
patternComboBox->addItem(tr("[A-Za-z_]+([A-Za-z_0-9]*)"));
diff --git a/examples/widgets/tools/regularexpression/CMakeLists.txt b/examples/widgets/tools/regularexpression/CMakeLists.txt
new file mode 100644
index 0000000000..be8fb60a44
--- /dev/null
+++ b/examples/widgets/tools/regularexpression/CMakeLists.txt
@@ -0,0 +1,45 @@
+# Generated from regularexpression.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(regularexpression LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tools/regularexpression")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(regularexpression
+ main.cpp
+ regularexpressiondialog.cpp regularexpressiondialog.h
+)
+target_link_libraries(regularexpression PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(regularexpression_resource_files
+ "images/copy.png"
+)
+
+qt6_add_resources(regularexpression "regularexpression"
+ PREFIX
+ "/"
+ FILES
+ ${regularexpression_resource_files}
+)
+
+install(TARGETS regularexpression
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tools/regularexpression/regularexpressiondialog.cpp b/examples/widgets/tools/regularexpression/regularexpressiondialog.cpp
index 6398098eee..ff83193152 100644
--- a/examples/widgets/tools/regularexpression/regularexpressiondialog.cpp
+++ b/examples/widgets/tools/regularexpression/regularexpressiondialog.cpp
@@ -222,10 +222,10 @@ RegularExpressionDialog::RegularExpressionDialog(QWidget *parent)
connect(optimizeOnFirstUsageOptionCheckBox, &QCheckBox::toggled, this, &RegularExpressionDialog::refresh);
connect(dontAutomaticallyOptimizeOptionCheckBox, &QCheckBox::toggled, this, &RegularExpressionDialog::refresh);
- connect(offsetSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
+ connect(offsetSpinBox, &QSpinBox::valueChanged,
this, &RegularExpressionDialog::refresh);
- connect(matchTypeComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
+ connect(matchTypeComboBox, &QComboBox::currentIndexChanged,
this, &RegularExpressionDialog::refresh);
connect(anchoredMatchOptionCheckBox, &QCheckBox::toggled, this, &RegularExpressionDialog::refresh);
diff --git a/examples/widgets/tools/settingseditor/CMakeLists.txt b/examples/widgets/tools/settingseditor/CMakeLists.txt
new file mode 100644
index 0000000000..3ded759084
--- /dev/null
+++ b/examples/widgets/tools/settingseditor/CMakeLists.txt
@@ -0,0 +1,35 @@
+# Generated from settingseditor.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(settingseditor LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tools/settingseditor")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(settingseditor
+ locationdialog.cpp locationdialog.h
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ settingstree.cpp settingstree.h
+ variantdelegate.cpp variantdelegate.h
+)
+target_link_libraries(settingseditor PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS settingseditor
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tools/settingseditor/locationdialog.cpp b/examples/widgets/tools/settingseditor/locationdialog.cpp
index 99c9834a63..86119a1afd 100644
--- a/examples/widgets/tools/settingseditor/locationdialog.cpp
+++ b/examples/widgets/tools/settingseditor/locationdialog.cpp
@@ -115,9 +115,9 @@ LocationDialog::LocationDialog(QWidget *parent)
buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
- connect(formatComboBox, QOverload<int>::of(&QComboBox::activated),
+ connect(formatComboBox, &QComboBox::activated,
this, &LocationDialog::updateLocationsTable);
- connect(scopeComboBox, QOverload<int>::of(&QComboBox::activated),
+ connect(scopeComboBox, &QComboBox::activated,
this, &LocationDialog::updateLocationsTable);
connect(organizationComboBox->lineEdit(),
&QLineEdit::editingFinished,
@@ -125,7 +125,7 @@ LocationDialog::LocationDialog(QWidget *parent)
connect(applicationComboBox->lineEdit(),
&QLineEdit::editingFinished,
this, &LocationDialog::updateLocationsTable);
- connect(applicationComboBox, QOverload<int>::of(&QComboBox::activated),
+ connect(applicationComboBox, &QComboBox::activated,
this, &LocationDialog::updateLocationsTable);
connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
diff --git a/examples/widgets/tools/styleplugin/CMakeLists.txt b/examples/widgets/tools/styleplugin/CMakeLists.txt
new file mode 100644
index 0000000000..af10d38700
--- /dev/null
+++ b/examples/widgets/tools/styleplugin/CMakeLists.txt
@@ -0,0 +1,19 @@
+# Generated from styleplugin.pro.
+
+# special case begin
+cmake_minimum_required(VERSION 3.14)
+project(styleplugin LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples")
+
+find_package(Qt6 COMPONENTS Widgets)
+# special case end
+
+add_subdirectory(stylewindow)
+add_subdirectory(plugin)
diff --git a/examples/widgets/tools/styleplugin/plugin/.prev_CMakeLists.txt b/examples/widgets/tools/styleplugin/plugin/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..c1be706fde
--- /dev/null
+++ b/examples/widgets/tools/styleplugin/plugin/.prev_CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from plugin.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(simplestyleplugin LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tools/styleplugin/styles")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_library(simplestyleplugin MODULE
+ simplestyle.cpp simplestyle.h
+ simplestyleplugin.cpp simplestyleplugin.h
+)
+target_link_libraries(simplestyleplugin PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS simplestyleplugin
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tools/styleplugin/plugin/CMakeLists.txt b/examples/widgets/tools/styleplugin/plugin/CMakeLists.txt
new file mode 100644
index 0000000000..c1be706fde
--- /dev/null
+++ b/examples/widgets/tools/styleplugin/plugin/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from plugin.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(simplestyleplugin LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tools/styleplugin/styles")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_library(simplestyleplugin MODULE
+ simplestyle.cpp simplestyle.h
+ simplestyleplugin.cpp simplestyleplugin.h
+)
+target_link_libraries(simplestyleplugin PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS simplestyleplugin
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt b/examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt
new file mode 100644
index 0000000000..06ae198b42
--- /dev/null
+++ b/examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from stylewindow.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(styleplugin LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tools/styleplugin")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(styleplugin
+ main.cpp
+ stylewindow.cpp stylewindow.h
+)
+target_link_libraries(styleplugin PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS styleplugin
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tools/treemodelcompleter/CMakeLists.txt b/examples/widgets/tools/treemodelcompleter/CMakeLists.txt
new file mode 100644
index 0000000000..71528b14b9
--- /dev/null
+++ b/examples/widgets/tools/treemodelcompleter/CMakeLists.txt
@@ -0,0 +1,46 @@
+# Generated from treemodelcompleter.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(treemodelcompleter LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tools/treemodelcompleter")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(treemodelcompleter
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ treemodelcompleter.cpp treemodelcompleter.h
+)
+target_link_libraries(treemodelcompleter PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(treemodelcompleter_resource_files
+ "resources/treemodel.txt"
+)
+
+qt6_add_resources(treemodelcompleter "treemodelcompleter"
+ PREFIX
+ "/"
+ FILES
+ ${treemodelcompleter_resource_files}
+)
+
+install(TARGETS treemodelcompleter
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tools/treemodelcompleter/mainwindow.cpp b/examples/widgets/tools/treemodelcompleter/mainwindow.cpp
index 302ccc436c..3305ac9032 100644
--- a/examples/widgets/tools/treemodelcompleter/mainwindow.cpp
+++ b/examples/widgets/tools/treemodelcompleter/mainwindow.cpp
@@ -126,9 +126,9 @@ MainWindow::MainWindow(QWidget *parent)
//! [1]
//! [2]
- connect(modeCombo, QOverload<int>::of(&QComboBox::activated),
+ connect(modeCombo, &QComboBox::activated,
this, &MainWindow::changeMode);
- connect(caseCombo, QOverload<int>::of(&QComboBox::activated),
+ connect(caseCombo, &QComboBox::activated,
this, &MainWindow::changeMode);
lineEdit = new QLineEdit;
diff --git a/examples/widgets/tools/undo/CMakeLists.txt b/examples/widgets/tools/undo/CMakeLists.txt
new file mode 100644
index 0000000000..34bcac326c
--- /dev/null
+++ b/examples/widgets/tools/undo/CMakeLists.txt
@@ -0,0 +1,62 @@
+# Generated from undo.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(undo LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tools/undo")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(undo
+ commands.cpp commands.h
+ document.cpp document.h
+ main.cpp
+ mainwindow.cpp mainwindow.h mainwindow.ui
+)
+target_link_libraries(undo PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(undo_resource_files
+ "icons/background.png"
+ "icons/blue.png"
+ "icons/circle.png"
+ "icons/exit.png"
+ "icons/fileclose.png"
+ "icons/filenew.png"
+ "icons/fileopen.png"
+ "icons/filesave.png"
+ "icons/green.png"
+ "icons/ok.png"
+ "icons/rectangle.png"
+ "icons/red.png"
+ "icons/redo.png"
+ "icons/remove.png"
+ "icons/triangle.png"
+ "icons/undo.png"
+)
+
+qt6_add_resources(undo "undo"
+ PREFIX
+ "/"
+ FILES
+ ${undo_resource_files}
+)
+
+install(TARGETS undo
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tools/undo/mainwindow.cpp b/examples/widgets/tools/undo/mainwindow.cpp
index 9d83e3067a..5623a09ad2 100644
--- a/examples/widgets/tools/undo/mainwindow.cpp
+++ b/examples/widgets/tools/undo/mainwindow.cpp
@@ -86,7 +86,7 @@ MainWindow::MainWindow(QWidget *parent)
connect(actionAbout, &QAction::triggered, this, &MainWindow::about);
connect(actionAboutQt, &QAction::triggered, this, &MainWindow::aboutQt);
- connect(undoLimit, QOverload<int>::of(&QSpinBox::valueChanged), this, &MainWindow::updateActions);
+ connect(undoLimit, &QSpinBox::valueChanged, this, &MainWindow::updateActions);
connect(documentTabs, &QTabWidget::currentChanged, this, &MainWindow::updateActions);
actionOpen->setShortcut(QString("Ctrl+O"));
diff --git a/examples/widgets/tools/undoframework/CMakeLists.txt b/examples/widgets/tools/undoframework/CMakeLists.txt
new file mode 100644
index 0000000000..33b315d4e5
--- /dev/null
+++ b/examples/widgets/tools/undoframework/CMakeLists.txt
@@ -0,0 +1,48 @@
+# Generated from undoframework.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(undoframework LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tools/undoframework")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(undoframework
+ commands.cpp commands.h
+ diagramitem.cpp diagramitem.h
+ diagramscene.cpp diagramscene.h
+ main.cpp
+ mainwindow.cpp mainwindow.h
+)
+target_link_libraries(undoframework PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(undoframework_resource_files
+ "images/cross.png"
+)
+
+qt6_add_resources(undoframework "undoframework"
+ PREFIX
+ "/"
+ FILES
+ ${undoframework_resource_files}
+)
+
+install(TARGETS undoframework
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/touch/CMakeLists.txt b/examples/widgets/touch/CMakeLists.txt
new file mode 100644
index 0000000000..06b72cada7
--- /dev/null
+++ b/examples/widgets/touch/CMakeLists.txt
@@ -0,0 +1,6 @@
+# Generated from touch.pro.
+
+add_subdirectory(pinchzoom)
+add_subdirectory(fingerpaint)
+add_subdirectory(knobs)
+add_subdirectory(dials)
diff --git a/examples/widgets/touch/dials/CMakeLists.txt b/examples/widgets/touch/dials/CMakeLists.txt
new file mode 100644
index 0000000000..cad784f9ec
--- /dev/null
+++ b/examples/widgets/touch/dials/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from dials.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(dials LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/touch/dials")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(dials
+ dials.ui
+ main.cpp
+)
+target_link_libraries(dials PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS dials
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/touch/fingerpaint/.prev_CMakeLists.txt b/examples/widgets/touch/fingerpaint/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..f66e866cab
--- /dev/null
+++ b/examples/widgets/touch/fingerpaint/.prev_CMakeLists.txt
@@ -0,0 +1,39 @@
+# Generated from fingerpaint.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(fingerpaint LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/touch/fingerpaint")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(fingerpaint
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ scribblearea.cpp scribblearea.h
+)
+target_link_libraries(fingerpaint PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+if(TARGET Qt::PrintSupport)
+ target_link_libraries(fingerpaint PUBLIC
+ Qt::PrintSupport
+ )
+endif()
+
+install(TARGETS fingerpaint
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/touch/fingerpaint/CMakeLists.txt b/examples/widgets/touch/fingerpaint/CMakeLists.txt
new file mode 100644
index 0000000000..cc2c8caacf
--- /dev/null
+++ b/examples/widgets/touch/fingerpaint/CMakeLists.txt
@@ -0,0 +1,45 @@
+# Generated from fingerpaint.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(fingerpaint LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/touch/fingerpaint")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS PrintSupport) # special case
+
+add_qt_gui_executable(fingerpaint
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ scribblearea.cpp scribblearea.h
+)
+target_link_libraries(fingerpaint PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+# special case begin
+if (TARGET Qt::PrintSupport)
+ target_link_libraries(fingerpaint PUBLIC Qt::PrintSupport)
+endif()
+# special case end
+
+if(TARGET Qt::PrintSupport)
+ target_link_libraries(fingerpaint PUBLIC
+ Qt::PrintSupport
+ )
+endif()
+
+install(TARGETS fingerpaint
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/touch/knobs/CMakeLists.txt b/examples/widgets/touch/knobs/CMakeLists.txt
new file mode 100644
index 0000000000..a3d44bf650
--- /dev/null
+++ b/examples/widgets/touch/knobs/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from knobs.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(knobs LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/touch/knobs")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(knobs
+ knob.cpp knob.h
+ main.cpp
+)
+target_link_libraries(knobs PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS knobs
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/touch/pinchzoom/CMakeLists.txt b/examples/widgets/touch/pinchzoom/CMakeLists.txt
new file mode 100644
index 0000000000..08663b75af
--- /dev/null
+++ b/examples/widgets/touch/pinchzoom/CMakeLists.txt
@@ -0,0 +1,46 @@
+# Generated from pinchzoom.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(pinchzoom LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/touch/pinchzoom")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(pinchzoom
+ graphicsview.cpp graphicsview.h
+ main.cpp
+ mouse.cpp mouse.h
+)
+target_link_libraries(pinchzoom PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(mice_resource_files
+ "images/cheese.jpg"
+)
+
+qt6_add_resources(pinchzoom "mice"
+ PREFIX
+ "/"
+ FILES
+ ${mice_resource_files}
+)
+
+install(TARGETS pinchzoom
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tutorials/CMakeLists.txt b/examples/widgets/tutorials/CMakeLists.txt
new file mode 100644
index 0000000000..c2fa4a81d7
--- /dev/null
+++ b/examples/widgets/tutorials/CMakeLists.txt
@@ -0,0 +1,7 @@
+# Generated from tutorials.pro.
+
+add_subdirectory(addressbook)
+add_subdirectory(widgets)
+add_subdirectory(modelview)
+add_subdirectory(gettingStarted)
+add_subdirectory(notepad)
diff --git a/examples/widgets/tutorials/addressbook/CMakeLists.txt b/examples/widgets/tutorials/addressbook/CMakeLists.txt
new file mode 100644
index 0000000000..a8823d059a
--- /dev/null
+++ b/examples/widgets/tutorials/addressbook/CMakeLists.txt
@@ -0,0 +1,9 @@
+# Generated from addressbook.pro.
+
+add_subdirectory(part1)
+add_subdirectory(part2)
+add_subdirectory(part3)
+add_subdirectory(part4)
+add_subdirectory(part5)
+add_subdirectory(part6)
+add_subdirectory(part7)
diff --git a/examples/widgets/tutorials/addressbook/part1/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part1/CMakeLists.txt
new file mode 100644
index 0000000000..f07c38f508
--- /dev/null
+++ b/examples/widgets/tutorials/addressbook/part1/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from part1.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(part1 LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tutorials/addressbook/part1")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(part1
+ addressbook.cpp addressbook.h
+ main.cpp
+)
+target_link_libraries(part1 PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS part1
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tutorials/addressbook/part2/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part2/CMakeLists.txt
new file mode 100644
index 0000000000..07fb93d02f
--- /dev/null
+++ b/examples/widgets/tutorials/addressbook/part2/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from part2.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(part2 LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tutorials/addressbook/part2")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(part2
+ addressbook.cpp addressbook.h
+ main.cpp
+)
+target_link_libraries(part2 PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS part2
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tutorials/addressbook/part3/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part3/CMakeLists.txt
new file mode 100644
index 0000000000..89d76cc9ee
--- /dev/null
+++ b/examples/widgets/tutorials/addressbook/part3/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from part3.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(part3 LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tutorials/addressbook/part3")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(part3
+ addressbook.cpp addressbook.h
+ main.cpp
+)
+target_link_libraries(part3 PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS part3
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tutorials/addressbook/part4/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part4/CMakeLists.txt
new file mode 100644
index 0000000000..325490517b
--- /dev/null
+++ b/examples/widgets/tutorials/addressbook/part4/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from part4.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(part4 LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tutorials/addressbook/part4")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(part4
+ addressbook.cpp addressbook.h
+ main.cpp
+)
+target_link_libraries(part4 PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS part4
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tutorials/addressbook/part5/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part5/CMakeLists.txt
new file mode 100644
index 0000000000..d2ac0f18d8
--- /dev/null
+++ b/examples/widgets/tutorials/addressbook/part5/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from part5.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(part5 LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tutorials/addressbook/part5")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(part5
+ addressbook.cpp addressbook.h
+ finddialog.cpp finddialog.h
+ main.cpp
+)
+target_link_libraries(part5 PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS part5
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tutorials/addressbook/part6/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part6/CMakeLists.txt
new file mode 100644
index 0000000000..a9375d8913
--- /dev/null
+++ b/examples/widgets/tutorials/addressbook/part6/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from part6.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(part6 LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tutorials/addressbook/part6")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(part6
+ addressbook.cpp addressbook.h
+ finddialog.cpp finddialog.h
+ main.cpp
+)
+target_link_libraries(part6 PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS part6
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tutorials/addressbook/part7/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part7/CMakeLists.txt
new file mode 100644
index 0000000000..16cc1391e5
--- /dev/null
+++ b/examples/widgets/tutorials/addressbook/part7/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from part7.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(part7 LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tutorials/addressbook/part7")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(part7
+ addressbook.cpp addressbook.h
+ finddialog.cpp finddialog.h
+ main.cpp
+)
+target_link_libraries(part7 PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS part7
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tutorials/gettingStarted/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/CMakeLists.txt
new file mode 100644
index 0000000000..2aa8163029
--- /dev/null
+++ b/examples/widgets/tutorials/gettingStarted/CMakeLists.txt
@@ -0,0 +1,2 @@
+# Generated from gettingStarted.pro.
+
diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/CMakeLists.txt
new file mode 100644
index 0000000000..7a9ade8511
--- /dev/null
+++ b/examples/widgets/tutorials/gettingStarted/gsQt/CMakeLists.txt
@@ -0,0 +1,7 @@
+# Generated from gsqt.pro.
+
+add_subdirectory(part1)
+add_subdirectory(part2)
+add_subdirectory(part3)
+add_subdirectory(part4)
+add_subdirectory(part5)
diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part1/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/part1/CMakeLists.txt
new file mode 100644
index 0000000000..4cf9a49d1e
--- /dev/null
+++ b/examples/widgets/tutorials/gettingStarted/gsQt/part1/CMakeLists.txt
@@ -0,0 +1,31 @@
+# Generated from part1.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(part1 LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tutorials/gettingStarted/gsQt/part1")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(part1
+ main.cpp
+)
+target_link_libraries(part1 PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS part1
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part2/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/part2/CMakeLists.txt
new file mode 100644
index 0000000000..f5ab1d10d1
--- /dev/null
+++ b/examples/widgets/tutorials/gettingStarted/gsQt/part2/CMakeLists.txt
@@ -0,0 +1,31 @@
+# Generated from part2.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(part2 LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tutorials/gettingStarted/gsQt/part2")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(part2
+ main.cpp
+)
+target_link_libraries(part2 PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS part2
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part3/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/part3/CMakeLists.txt
new file mode 100644
index 0000000000..c152c765e2
--- /dev/null
+++ b/examples/widgets/tutorials/gettingStarted/gsQt/part3/CMakeLists.txt
@@ -0,0 +1,31 @@
+# Generated from part3.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(part3 LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tutorials/gettingStarted/gsQt/part3")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(part3
+ main.cpp
+)
+target_link_libraries(part3 PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS part3
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part4/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/part4/CMakeLists.txt
new file mode 100644
index 0000000000..770d9590b7
--- /dev/null
+++ b/examples/widgets/tutorials/gettingStarted/gsQt/part4/CMakeLists.txt
@@ -0,0 +1,31 @@
+# Generated from part4.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(part4 LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tutorials/gettingStarted/gsQt/part4")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(part4
+ main.cpp
+)
+target_link_libraries(part4 PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS part4
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part5/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/part5/CMakeLists.txt
new file mode 100644
index 0000000000..3369838e95
--- /dev/null
+++ b/examples/widgets/tutorials/gettingStarted/gsQt/part5/CMakeLists.txt
@@ -0,0 +1,31 @@
+# Generated from part5.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(part5 LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tutorials/gettingStarted/gsQt/part5")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(part5
+ main.cpp
+)
+target_link_libraries(part5 PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS part5
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tutorials/modelview/1_readonly/CMakeLists.txt b/examples/widgets/tutorials/modelview/1_readonly/CMakeLists.txt
new file mode 100644
index 0000000000..cc34842bcf
--- /dev/null
+++ b/examples/widgets/tutorials/modelview/1_readonly/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from 1_readonly.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(mv_readonly LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tutorials/modelview/1_readonly")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(mv_readonly
+ main.cpp
+ mymodel.cpp mymodel.h
+)
+target_link_libraries(mv_readonly PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS mv_readonly
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tutorials/modelview/2_formatting/CMakeLists.txt b/examples/widgets/tutorials/modelview/2_formatting/CMakeLists.txt
new file mode 100644
index 0000000000..7f8d68b6f8
--- /dev/null
+++ b/examples/widgets/tutorials/modelview/2_formatting/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from 2_formatting.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(mv_formatting LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tutorials/modelview/2_formatting")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(mv_formatting
+ main.cpp
+ mymodel.cpp mymodel.h
+)
+target_link_libraries(mv_formatting PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS mv_formatting
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tutorials/modelview/3_changingmodel/CMakeLists.txt b/examples/widgets/tutorials/modelview/3_changingmodel/CMakeLists.txt
new file mode 100644
index 0000000000..aace87e2ab
--- /dev/null
+++ b/examples/widgets/tutorials/modelview/3_changingmodel/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from 3_changingmodel.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(mv_changingmodel LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tutorials/modelview/3_changingmodel")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(mv_changingmodel
+ main.cpp
+ mymodel.cpp mymodel.h
+)
+target_link_libraries(mv_changingmodel PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS mv_changingmodel
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tutorials/modelview/4_headers/CMakeLists.txt b/examples/widgets/tutorials/modelview/4_headers/CMakeLists.txt
new file mode 100644
index 0000000000..9d2f9cd7e8
--- /dev/null
+++ b/examples/widgets/tutorials/modelview/4_headers/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from 4_headers.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(mv_headers LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tutorials/modelview/4_headers")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(mv_headers
+ main.cpp
+ mymodel.cpp mymodel.h
+)
+target_link_libraries(mv_headers PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS mv_headers
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tutorials/modelview/5_edit/CMakeLists.txt b/examples/widgets/tutorials/modelview/5_edit/CMakeLists.txt
new file mode 100644
index 0000000000..50af3c39a4
--- /dev/null
+++ b/examples/widgets/tutorials/modelview/5_edit/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from 5_edit.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(mv_edit LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tutorials/modelview/5_edit")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(mv_edit
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ mymodel.cpp mymodel.h
+)
+target_link_libraries(mv_edit PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS mv_edit
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tutorials/modelview/6_treeview/CMakeLists.txt b/examples/widgets/tutorials/modelview/6_treeview/CMakeLists.txt
new file mode 100644
index 0000000000..435ff71c0f
--- /dev/null
+++ b/examples/widgets/tutorials/modelview/6_treeview/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from 6_treeview.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(mv_tree LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tutorials/modelview/6_treeview")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(mv_tree
+ main.cpp
+ mainwindow.cpp mainwindow.h
+)
+target_link_libraries(mv_tree PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS mv_tree
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tutorials/modelview/7_selections/CMakeLists.txt b/examples/widgets/tutorials/modelview/7_selections/CMakeLists.txt
new file mode 100644
index 0000000000..e0d591ab29
--- /dev/null
+++ b/examples/widgets/tutorials/modelview/7_selections/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from 7_selections.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(mv_selections LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tutorials/modelview/7_selections")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(mv_selections
+ main.cpp
+ mainwindow.cpp mainwindow.h
+)
+target_link_libraries(mv_selections PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS mv_selections
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tutorials/modelview/CMakeLists.txt b/examples/widgets/tutorials/modelview/CMakeLists.txt
new file mode 100644
index 0000000000..10f2cf6ecf
--- /dev/null
+++ b/examples/widgets/tutorials/modelview/CMakeLists.txt
@@ -0,0 +1,9 @@
+# Generated from modelview.pro.
+
+add_subdirectory(1_readonly)
+add_subdirectory(2_formatting)
+add_subdirectory(3_changingmodel)
+add_subdirectory(4_headers)
+add_subdirectory(5_edit)
+add_subdirectory(6_treeview)
+add_subdirectory(7_selections)
diff --git a/examples/widgets/tutorials/notepad/.prev_CMakeLists.txt b/examples/widgets/tutorials/notepad/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..32df7ad615
--- /dev/null
+++ b/examples/widgets/tutorials/notepad/.prev_CMakeLists.txt
@@ -0,0 +1,66 @@
+# Generated from notepad.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(notepad LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tutorials/notepad")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+
+add_qt_gui_executable(notepad
+ main.cpp
+ notepad.cpp notepad.h notepad.ui
+)
+target_link_libraries(notepad PUBLIC
+ Qt::Core
+ Qt::Gui
+)
+
+
+# Resources:
+set(notepad_resource_files
+ "images/bold.png"
+ "images/copy.png"
+ "images/create.png"
+ "images/cut.png"
+ "images/edit_redo.png"
+ "images/edit_undo.png"
+ "images/exit.png"
+ "images/font.png"
+ "images/info.png"
+ "images/italic.png"
+ "images/new.png"
+ "images/open.png"
+ "images/paste.png"
+ "images/pencil.png"
+ "images/print.png"
+ "images/save.png"
+ "images/save_as.png"
+ "images/underline.png"
+)
+
+qt6_add_resources(notepad "notepad"
+ PREFIX
+ "/"
+ FILES
+ ${notepad_resource_files}
+)
+
+if(TARGET Qt::PrintSupport)
+ target_link_libraries(notepad PUBLIC
+ Qt::PrintSupport
+ )
+endif()
+
+install(TARGETS notepad
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tutorials/notepad/CMakeLists.txt b/examples/widgets/tutorials/notepad/CMakeLists.txt
new file mode 100644
index 0000000000..2a277efb26
--- /dev/null
+++ b/examples/widgets/tutorials/notepad/CMakeLists.txt
@@ -0,0 +1,67 @@
+# Generated from notepad.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(notepad LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tutorials/notepad")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS PrintSupport) # special case: add
+
+add_qt_gui_executable(notepad
+ main.cpp
+ notepad.cpp notepad.h notepad.ui
+)
+target_link_libraries(notepad PUBLIC
+ Qt::Core
+ Qt::Gui
+)
+
+
+# Resources:
+set(notepad_resource_files
+ "images/bold.png"
+ "images/copy.png"
+ "images/create.png"
+ "images/cut.png"
+ "images/edit_redo.png"
+ "images/edit_undo.png"
+ "images/exit.png"
+ "images/font.png"
+ "images/info.png"
+ "images/italic.png"
+ "images/new.png"
+ "images/open.png"
+ "images/paste.png"
+ "images/pencil.png"
+ "images/print.png"
+ "images/save.png"
+ "images/save_as.png"
+ "images/underline.png"
+)
+
+qt6_add_resources(notepad "notepad"
+ PREFIX
+ "/"
+ FILES
+ ${notepad_resource_files}
+)
+
+if(TARGET Qt::PrintSupport)
+ target_link_libraries(notepad PUBLIC
+ Qt::PrintSupport
+ )
+endif()
+
+install(TARGETS notepad
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tutorials/widgets/CMakeLists.txt b/examples/widgets/tutorials/widgets/CMakeLists.txt
new file mode 100644
index 0000000000..1f4afee780
--- /dev/null
+++ b/examples/widgets/tutorials/widgets/CMakeLists.txt
@@ -0,0 +1,6 @@
+# Generated from widgets.pro.
+
+add_subdirectory(toplevel)
+add_subdirectory(childwidget)
+add_subdirectory(windowlayout)
+add_subdirectory(nestedlayouts)
diff --git a/examples/widgets/tutorials/widgets/childwidget/CMakeLists.txt b/examples/widgets/tutorials/widgets/childwidget/CMakeLists.txt
new file mode 100644
index 0000000000..4119f69fd5
--- /dev/null
+++ b/examples/widgets/tutorials/widgets/childwidget/CMakeLists.txt
@@ -0,0 +1,31 @@
+# Generated from childwidget.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(childwidget LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tutorials/widgets/childwidget")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(childwidget
+ main.cpp
+)
+target_link_libraries(childwidget PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS childwidget
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tutorials/widgets/nestedlayouts/CMakeLists.txt b/examples/widgets/tutorials/widgets/nestedlayouts/CMakeLists.txt
new file mode 100644
index 0000000000..75387bd9e5
--- /dev/null
+++ b/examples/widgets/tutorials/widgets/nestedlayouts/CMakeLists.txt
@@ -0,0 +1,31 @@
+# Generated from nestedlayouts.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(nestedlayouts LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tutorials/widgets/nestedlayouts")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(nestedlayouts
+ main.cpp
+)
+target_link_libraries(nestedlayouts PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS nestedlayouts
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tutorials/widgets/toplevel/CMakeLists.txt b/examples/widgets/tutorials/widgets/toplevel/CMakeLists.txt
new file mode 100644
index 0000000000..6d2bdb5ba5
--- /dev/null
+++ b/examples/widgets/tutorials/widgets/toplevel/CMakeLists.txt
@@ -0,0 +1,31 @@
+# Generated from toplevel.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(toplevel LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tutorials/widgets/toplevel")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(toplevel
+ main.cpp
+)
+target_link_libraries(toplevel PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS toplevel
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/tutorials/widgets/windowlayout/CMakeLists.txt b/examples/widgets/tutorials/widgets/windowlayout/CMakeLists.txt
new file mode 100644
index 0000000000..07b50185f3
--- /dev/null
+++ b/examples/widgets/tutorials/widgets/windowlayout/CMakeLists.txt
@@ -0,0 +1,31 @@
+# Generated from windowlayout.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(windowlayout LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/tutorials/widgets/windowlayout")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(windowlayout
+ main.cpp
+)
+target_link_libraries(windowlayout PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS windowlayout
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/widgets/CMakeLists.txt b/examples/widgets/widgets/CMakeLists.txt
new file mode 100644
index 0000000000..8daf6a69ae
--- /dev/null
+++ b/examples/widgets/widgets/CMakeLists.txt
@@ -0,0 +1,27 @@
+# Generated from widgets.pro.
+
+add_subdirectory(analogclock)
+add_subdirectory(calculator)
+add_subdirectory(calendarwidget)
+add_subdirectory(charactermap)
+add_subdirectory(codeeditor)
+add_subdirectory(digitalclock)
+add_subdirectory(elidedlabel)
+add_subdirectory(groupbox)
+add_subdirectory(icons)
+add_subdirectory(imageviewer)
+add_subdirectory(lineedits)
+add_subdirectory(movie)
+add_subdirectory(mousebuttons)
+add_subdirectory(scribble)
+add_subdirectory(shapedclock)
+add_subdirectory(sliders)
+add_subdirectory(spinboxes)
+add_subdirectory(styles)
+add_subdirectory(stylesheet)
+add_subdirectory(tablet)
+add_subdirectory(tetrix)
+add_subdirectory(tooltips)
+add_subdirectory(validators)
+add_subdirectory(wiggly)
+add_subdirectory(windowflags)
diff --git a/examples/widgets/widgets/analogclock/CMakeLists.txt b/examples/widgets/widgets/analogclock/CMakeLists.txt
new file mode 100644
index 0000000000..8f7639df70
--- /dev/null
+++ b/examples/widgets/widgets/analogclock/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from analogclock.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(analogclock LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/widgets/analogclock")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(analogclock
+ analogclock.cpp analogclock.h
+ main.cpp
+)
+target_link_libraries(analogclock PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS analogclock
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/widgets/calculator/CMakeLists.txt b/examples/widgets/widgets/calculator/CMakeLists.txt
new file mode 100644
index 0000000000..89ee6e9ccb
--- /dev/null
+++ b/examples/widgets/widgets/calculator/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from calculator.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(calculator LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/widgets/calculator")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(calculator
+ button.cpp button.h
+ calculator.cpp calculator.h
+ main.cpp
+)
+target_link_libraries(calculator PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS calculator
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/widgets/calendarwidget/CMakeLists.txt b/examples/widgets/widgets/calendarwidget/CMakeLists.txt
new file mode 100644
index 0000000000..00c1b8154a
--- /dev/null
+++ b/examples/widgets/widgets/calendarwidget/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from calendarwidget.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(calendarwidget LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/widgets/calendarwidget")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(calendarwidget
+ main.cpp
+ window.cpp window.h
+)
+target_link_libraries(calendarwidget PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS calendarwidget
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/widgets/calendarwidget/window.cpp b/examples/widgets/widgets/calendarwidget/window.cpp
index ae10223dd4..23010a6e1a 100644
--- a/examples/widgets/widgets/calendarwidget/window.cpp
+++ b/examples/widgets/widgets/calendarwidget/window.cpp
@@ -313,19 +313,19 @@ void Window::createGeneralOptionsGroupBox()
verticalHeaderLabel->setBuddy(verticalHeaderCombo);
//! [11]
- connect(localeCombo, QOverload<int>::of(&QComboBox::currentIndexChanged),
+ connect(localeCombo, &QComboBox::currentIndexChanged,
this, &Window::localeChanged);
- connect(firstDayCombo, QOverload<int>::of(&QComboBox::currentIndexChanged),
+ connect(firstDayCombo, &QComboBox::currentIndexChanged,
this, &Window::firstDayChanged);
- connect(selectionModeCombo, QOverload<int>::of(&QComboBox::currentIndexChanged),
+ connect(selectionModeCombo, &QComboBox::currentIndexChanged,
this, &Window::selectionModeChanged);
connect(gridCheckBox, &QCheckBox::toggled,
calendar, &QCalendarWidget::setGridVisible);
connect(navigationCheckBox, &QCheckBox::toggled,
calendar, &QCalendarWidget::setNavigationBarVisible);
- connect(horizontalHeaderCombo, QOverload<int>::of(&QComboBox::currentIndexChanged),
+ connect(horizontalHeaderCombo, &QComboBox::currentIndexChanged,
this, &Window::horizontalHeaderChanged);
- connect(verticalHeaderCombo, QOverload<int>::of(&QComboBox::currentIndexChanged),
+ connect(verticalHeaderCombo, &QComboBox::currentIndexChanged,
this, &Window::verticalHeaderChanged);
//! [11]
@@ -446,15 +446,15 @@ void Window::createTextFormatsGroupBox()
mayFirstCheckBox = new QCheckBox(tr("May &1 in red"));
//! [17] //! [18]
- connect(weekdayColorCombo, QOverload<int>::of(&QComboBox::currentIndexChanged),
+ connect(weekdayColorCombo, &QComboBox::currentIndexChanged,
this, &Window::weekdayFormatChanged);
- connect(weekdayColorCombo, QOverload<int>::of(&QComboBox::currentIndexChanged),
+ connect(weekdayColorCombo, &QComboBox::currentIndexChanged,
this, &Window::reformatCalendarPage);
- connect(weekendColorCombo, QOverload<int>::of(&QComboBox::currentIndexChanged),
+ connect(weekendColorCombo, &QComboBox::currentIndexChanged,
this, &Window::weekendFormatChanged);
- connect(weekendColorCombo, QOverload<int>::of(&QComboBox::currentIndexChanged),
+ connect(weekendColorCombo, &QComboBox::currentIndexChanged,
this, &Window::reformatCalendarPage);
- connect(headerTextFormatCombo, QOverload<int>::of(&QComboBox::currentIndexChanged),
+ connect(headerTextFormatCombo, &QComboBox::currentIndexChanged,
this, &Window::reformatHeaders);
connect(firstFridayCheckBox, &QCheckBox::toggled,
this, &Window::reformatCalendarPage);
diff --git a/examples/widgets/widgets/charactermap/CMakeLists.txt b/examples/widgets/widgets/charactermap/CMakeLists.txt
new file mode 100644
index 0000000000..8ecaf5af20
--- /dev/null
+++ b/examples/widgets/widgets/charactermap/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from charactermap.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(charactermap LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/widgets/charactermap")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(charactermap
+ characterwidget.cpp characterwidget.h
+ main.cpp
+ mainwindow.cpp mainwindow.h
+)
+target_link_libraries(charactermap PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS charactermap
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/widgets/charactermap/mainwindow.cpp b/examples/widgets/widgets/charactermap/mainwindow.cpp
index 702b50156b..47f7001a34 100644
--- a/examples/widgets/widgets/charactermap/mainwindow.cpp
+++ b/examples/widgets/widgets/charactermap/mainwindow.cpp
@@ -90,7 +90,7 @@ MainWindow::MainWindow(QWidget *parent)
filterCombo->addItem(tr("Monospaced"), QVariant::fromValue(QFontComboBox::MonospacedFonts));
filterCombo->addItem(tr("Proportional"), QVariant::fromValue(QFontComboBox::ProportionalFonts));
filterCombo->setCurrentIndex(0);
- connect(filterCombo, QOverload<int>::of(&QComboBox::currentIndexChanged),
+ connect(filterCombo, &QComboBox::currentIndexChanged,
this, &MainWindow::filterChanged);
QLabel *fontLabel = new QLabel(tr("Font:"));
diff --git a/examples/widgets/widgets/codeeditor/CMakeLists.txt b/examples/widgets/widgets/codeeditor/CMakeLists.txt
new file mode 100644
index 0000000000..790b9bc103
--- /dev/null
+++ b/examples/widgets/widgets/codeeditor/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from codeeditor.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(codeeditor LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/widgets/codeeditor")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(codeeditor
+ codeeditor.cpp codeeditor.h
+ main.cpp
+)
+target_link_libraries(codeeditor PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS codeeditor
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/widgets/digitalclock/CMakeLists.txt b/examples/widgets/widgets/digitalclock/CMakeLists.txt
new file mode 100644
index 0000000000..904c53890d
--- /dev/null
+++ b/examples/widgets/widgets/digitalclock/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from digitalclock.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(digitalclock LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/widgets/digitalclock")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(digitalclock
+ digitalclock.cpp digitalclock.h
+ main.cpp
+)
+target_link_libraries(digitalclock PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS digitalclock
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/widgets/elidedlabel/CMakeLists.txt b/examples/widgets/widgets/elidedlabel/CMakeLists.txt
new file mode 100644
index 0000000000..b9841c00f1
--- /dev/null
+++ b/examples/widgets/widgets/elidedlabel/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from elidedlabel.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(elidedlabel LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/widgets/elidedlabel")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(elidedlabel
+ elidedlabel.cpp elidedlabel.h
+ main.cpp
+ testwidget.cpp testwidget.h
+)
+target_link_libraries(elidedlabel PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS elidedlabel
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/widgets/groupbox/CMakeLists.txt b/examples/widgets/widgets/groupbox/CMakeLists.txt
new file mode 100644
index 0000000000..dbccf0b222
--- /dev/null
+++ b/examples/widgets/widgets/groupbox/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from groupbox.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(groupbox LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/widgets/groupbox")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(groupbox
+ main.cpp
+ window.cpp window.h
+)
+target_link_libraries(groupbox PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS groupbox
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/widgets/icons/.prev_CMakeLists.txt b/examples/widgets/widgets/icons/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..01cc94abdb
--- /dev/null
+++ b/examples/widgets/widgets/icons/.prev_CMakeLists.txt
@@ -0,0 +1,39 @@
+# Generated from icons.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(icons LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/widgets/icons")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(icons
+ iconpreviewarea.cpp iconpreviewarea.h
+ iconsizespinbox.cpp iconsizespinbox.h
+ imagedelegate.cpp imagedelegate.h
+ main.cpp
+ mainwindow.cpp mainwindow.h
+)
+target_compile_definitions(icons PUBLIC
+ SRCDIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/\\\"
+)
+
+target_link_libraries(icons PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS icons
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/widgets/icons/CMakeLists.txt b/examples/widgets/widgets/icons/CMakeLists.txt
new file mode 100644
index 0000000000..f154c534f9
--- /dev/null
+++ b/examples/widgets/widgets/icons/CMakeLists.txt
@@ -0,0 +1,39 @@
+# Generated from icons.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(icons LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/widgets/icons")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(icons
+ iconpreviewarea.cpp iconpreviewarea.h
+ iconsizespinbox.cpp iconsizespinbox.h
+ imagedelegate.cpp imagedelegate.h
+ main.cpp
+ mainwindow.cpp mainwindow.h
+)
+target_compile_definitions(icons PUBLIC
+ SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}" # special case
+)
+
+target_link_libraries(icons PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS icons
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/widgets/icons/imagedelegate.cpp b/examples/widgets/widgets/icons/imagedelegate.cpp
index 4fd251aa1b..9f1e19c9eb 100644
--- a/examples/widgets/widgets/icons/imagedelegate.cpp
+++ b/examples/widgets/widgets/icons/imagedelegate.cpp
@@ -70,7 +70,7 @@ QWidget *ImageDelegate::createEditor(QWidget *parent,
else if (index.column() == 2)
comboBox->addItems(IconPreviewArea::iconStateNames());
- connect(comboBox, QOverload<int>::of(&QComboBox::activated),
+ connect(comboBox, &QComboBox::activated,
this, &ImageDelegate::emitCommitData);
return comboBox;
diff --git a/examples/widgets/widgets/icons/mainwindow.cpp b/examples/widgets/widgets/icons/mainwindow.cpp
index 4f990f7320..be92f83c75 100644
--- a/examples/widgets/widgets/icons/mainwindow.cpp
+++ b/examples/widgets/widgets/icons/mainwindow.cpp
@@ -172,15 +172,16 @@ void MainWindow::changeStyle(bool checked)
//! [4]
//! [5]
-void MainWindow::changeSize(int id, bool checked)
+void MainWindow::changeSize(QAbstractButton *button, bool checked)
{
if (!checked)
return;
- const bool other = id == int(OtherSize);
+ const int index = sizeButtonGroup->id(button);
+ const bool other = index == int(OtherSize);
const int extent = other
? otherSpinBox->value()
- : QApplication::style()->pixelMetric(static_cast<QStyle::PixelMetric>(id));
+ : QApplication::style()->pixelMetric(static_cast<QStyle::PixelMetric>(index));
previewArea->setSize(QSize(extent, extent));
otherSpinBox->setEnabled(other);
@@ -188,7 +189,7 @@ void MainWindow::changeSize(int id, bool checked)
void MainWindow::triggerChangeSize()
{
- changeSize(sizeButtonGroup->checkedId(), true);
+ changeSize(sizeButtonGroup->checkedButton(), true);
}
//! [5]
@@ -372,7 +373,7 @@ QWidget *MainWindow::createIconSizeGroupBox()
sizeButtonGroup = new QButtonGroup(this);
sizeButtonGroup->setExclusive(true);
- connect(sizeButtonGroup, QOverload<int, bool>::of(&QButtonGroup::buttonToggled),
+ connect(sizeButtonGroup, &QButtonGroup::buttonToggled,
this, &MainWindow::changeSize);
QRadioButton *smallRadioButton = new QRadioButton;
@@ -400,7 +401,7 @@ QWidget *MainWindow::createIconSizeGroupBox()
//! [26]
//! [27]
- connect(otherSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
+ connect(otherSpinBox, &QSpinBox::valueChanged,
this, &MainWindow::triggerChangeSize);
QHBoxLayout *otherSizeLayout = new QHBoxLayout;
diff --git a/examples/widgets/widgets/icons/mainwindow.h b/examples/widgets/widgets/icons/mainwindow.h
index c67d828cab..9250711ecc 100644
--- a/examples/widgets/widgets/icons/mainwindow.h
+++ b/examples/widgets/widgets/icons/mainwindow.h
@@ -62,6 +62,7 @@ class QActionGroup;
class QLabel;
class QButtonGroup;
class QTableWidget;
+class QAbstractButton;
QT_END_NAMESPACE
class IconPreviewArea;
class IconSizeSpinBox;
@@ -81,7 +82,7 @@ public:
private slots:
void about();
void changeStyle(bool checked);
- void changeSize(int, bool);
+ void changeSize(QAbstractButton *button, bool);
void triggerChangeSize();
void changeIcon();
void addSampleImages();
diff --git a/examples/widgets/widgets/imageviewer/.prev_CMakeLists.txt b/examples/widgets/widgets/imageviewer/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..d5911d117f
--- /dev/null
+++ b/examples/widgets/widgets/imageviewer/.prev_CMakeLists.txt
@@ -0,0 +1,38 @@
+# Generated from imageviewer.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(imageviewer LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/widgets/imageviewer")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(imageviewer
+ imageviewer.cpp imageviewer.h
+ main.cpp
+)
+target_link_libraries(imageviewer PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+if(TARGET Qt::PrintSupport)
+ target_link_libraries(imageviewer PUBLIC
+ Qt::PrintSupport
+ )
+endif()
+
+install(TARGETS imageviewer
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/widgets/imageviewer/CMakeLists.txt b/examples/widgets/widgets/imageviewer/CMakeLists.txt
new file mode 100644
index 0000000000..fefccbbd1b
--- /dev/null
+++ b/examples/widgets/widgets/imageviewer/CMakeLists.txt
@@ -0,0 +1,44 @@
+# Generated from imageviewer.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(imageviewer LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/widgets/imageviewer")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS PrintSupport) # special case
+
+add_qt_gui_executable(imageviewer
+ imageviewer.cpp imageviewer.h
+ main.cpp
+)
+target_link_libraries(imageviewer PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+# special case begin
+if (TARGET Qt::PrintSupport)
+ target_link_libraries(imageviewer PUBLIC Qt::PrintSupport)
+endif()
+# special case end
+
+if(TARGET Qt::PrintSupport)
+ target_link_libraries(imageviewer PUBLIC
+ Qt::PrintSupport
+ )
+endif()
+
+install(TARGETS imageviewer
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/widgets/lineedits/CMakeLists.txt b/examples/widgets/widgets/lineedits/CMakeLists.txt
new file mode 100644
index 0000000000..ca9393c323
--- /dev/null
+++ b/examples/widgets/widgets/lineedits/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from lineedits.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(lineedits LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/widgets/lineedits")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(lineedits
+ main.cpp
+ window.cpp window.h
+)
+target_link_libraries(lineedits PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS lineedits
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/widgets/lineedits/window.cpp b/examples/widgets/widgets/lineedits/window.cpp
index bb9396411a..765f867deb 100644
--- a/examples/widgets/widgets/lineedits/window.cpp
+++ b/examples/widgets/widgets/lineedits/window.cpp
@@ -127,15 +127,15 @@ Window::Window(QWidget *parent)
//! [4]
//! [5]
- connect(echoComboBox, QOverload<int>::of(&QComboBox::activated),
+ connect(echoComboBox, &QComboBox::activated,
this, &Window::echoChanged);
- connect(validatorComboBox, QOverload<int>::of(&QComboBox::activated),
+ connect(validatorComboBox, &QComboBox::activated,
this, &Window::validatorChanged);
- connect(alignmentComboBox, QOverload<int>::of(&QComboBox::activated),
+ connect(alignmentComboBox, &QComboBox::activated,
this, &Window::alignmentChanged);
- connect(inputMaskComboBox, QOverload<int>::of(&QComboBox::activated),
+ connect(inputMaskComboBox, &QComboBox::activated,
this, &Window::inputMaskChanged);
- connect(accessComboBox, QOverload<int>::of(&QComboBox::activated),
+ connect(accessComboBox, &QComboBox::activated,
this, &Window::accessChanged);
//! [5]
diff --git a/examples/widgets/widgets/mousebuttons/CMakeLists.txt b/examples/widgets/widgets/mousebuttons/CMakeLists.txt
new file mode 100644
index 0000000000..625e068cc0
--- /dev/null
+++ b/examples/widgets/widgets/mousebuttons/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from mousebuttons.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(mousebuttons LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/widgets/mousebuttons")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(mousebuttons
+ buttontester.cpp buttontester.h
+ main.cpp
+)
+target_link_libraries(mousebuttons PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS mousebuttons
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/widgets/movie/CMakeLists.txt b/examples/widgets/widgets/movie/CMakeLists.txt
new file mode 100644
index 0000000000..140fff2cc8
--- /dev/null
+++ b/examples/widgets/widgets/movie/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from movie.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(movie LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/widgets/movie")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(movie
+ main.cpp
+ movieplayer.cpp movieplayer.h
+)
+target_link_libraries(movie PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS movie
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/widgets/movie/movieplayer.cpp b/examples/widgets/widgets/movie/movieplayer.cpp
index 41cd7923ee..76849268ab 100644
--- a/examples/widgets/widgets/movie/movieplayer.cpp
+++ b/examples/widgets/widgets/movie/movieplayer.cpp
@@ -81,7 +81,7 @@ MoviePlayer::MoviePlayer(QWidget *parent)
connect(movie, &QMovie::stateChanged, this, &MoviePlayer::updateButtons);
connect(fitCheckBox, &QCheckBox::clicked, this, &MoviePlayer::fitToWindow);
connect(frameSlider, &QSlider::valueChanged, this, &MoviePlayer::goToFrame);
- connect(speedSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
+ connect(speedSpinBox, &QSpinBox::valueChanged,
movie, &QMovie::setSpeed);
mainLayout = new QVBoxLayout;
diff --git a/examples/widgets/widgets/scribble/.prev_CMakeLists.txt b/examples/widgets/widgets/scribble/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..dff1bccec7
--- /dev/null
+++ b/examples/widgets/widgets/scribble/.prev_CMakeLists.txt
@@ -0,0 +1,39 @@
+# Generated from scribble.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(scribble LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/widgets/scribble")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(scribble
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ scribblearea.cpp scribblearea.h
+)
+target_link_libraries(scribble PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+if(TARGET Qt::PrintSupport)
+ target_link_libraries(scribble PUBLIC
+ Qt::PrintSupport
+ )
+endif()
+
+install(TARGETS scribble
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/widgets/scribble/CMakeLists.txt b/examples/widgets/widgets/scribble/CMakeLists.txt
new file mode 100644
index 0000000000..ca2f7b590e
--- /dev/null
+++ b/examples/widgets/widgets/scribble/CMakeLists.txt
@@ -0,0 +1,45 @@
+# Generated from scribble.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(scribble LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/widgets/scribble")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS PrintSupport) # special case
+
+add_qt_gui_executable(scribble
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ scribblearea.cpp scribblearea.h
+)
+target_link_libraries(scribble PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+# special case begin
+if (TARGET Qt::PrintSupport)
+ target_link_libraries(scribble PUBLIC Qt::PrintSupport)
+endif()
+# special case end
+
+if(TARGET Qt::PrintSupport)
+ target_link_libraries(scribble PUBLIC
+ Qt::PrintSupport
+ )
+endif()
+
+install(TARGETS scribble
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/widgets/shapedclock/CMakeLists.txt b/examples/widgets/widgets/shapedclock/CMakeLists.txt
new file mode 100644
index 0000000000..211c0cc432
--- /dev/null
+++ b/examples/widgets/widgets/shapedclock/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from shapedclock.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(shapedclock LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/widgets/shapedclock")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(shapedclock
+ main.cpp
+ shapedclock.cpp shapedclock.h
+)
+target_link_libraries(shapedclock PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS shapedclock
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/widgets/sliders/CMakeLists.txt b/examples/widgets/widgets/sliders/CMakeLists.txt
new file mode 100644
index 0000000000..a47ada2d48
--- /dev/null
+++ b/examples/widgets/widgets/sliders/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from sliders.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(sliders LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/widgets/sliders")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(sliders
+ main.cpp
+ slidersgroup.cpp slidersgroup.h
+ window.cpp window.h
+)
+target_link_libraries(sliders PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS sliders
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/widgets/sliders/window.cpp b/examples/widgets/widgets/sliders/window.cpp
index 4a28a61f3d..916f206379 100644
--- a/examples/widgets/widgets/sliders/window.cpp
+++ b/examples/widgets/widgets/sliders/window.cpp
@@ -78,7 +78,7 @@ Window::Window(QWidget *parent)
verticalSliders, &SlidersGroup::setValue);
connect(verticalSliders, &SlidersGroup::valueChanged,
valueSpinBox, &QSpinBox::setValue);
- connect(valueSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
+ connect(valueSpinBox, &QSpinBox::valueChanged,
horizontalSliders, &SlidersGroup::setValue);
QHBoxLayout *layout = new QHBoxLayout;
@@ -126,16 +126,16 @@ void Window::createControls(const QString &title)
orientationCombo->addItem(tr("Vertical slider-like widgets"));
//! [6] //! [7]
- connect(orientationCombo, QOverload<int>::of(&QComboBox::activated),
+ connect(orientationCombo, &QComboBox::activated,
//! [7] //! [8]
stackedWidget, &QStackedWidget::setCurrentIndex);
- connect(minimumSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
+ connect(minimumSpinBox, &QSpinBox::valueChanged,
horizontalSliders, &SlidersGroup::setMinimum);
- connect(minimumSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
+ connect(minimumSpinBox, &QSpinBox::valueChanged,
verticalSliders, &SlidersGroup::setMinimum);
- connect(maximumSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
+ connect(maximumSpinBox, &QSpinBox::valueChanged,
horizontalSliders, &SlidersGroup::setMaximum);
- connect(maximumSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
+ connect(maximumSpinBox, &QSpinBox::valueChanged,
verticalSliders, &SlidersGroup::setMaximum);
connect(invertedAppearance, &QCheckBox::toggled,
horizontalSliders, &SlidersGroup::invertAppearance);
diff --git a/examples/widgets/widgets/spinboxes/CMakeLists.txt b/examples/widgets/widgets/spinboxes/CMakeLists.txt
new file mode 100644
index 0000000000..050c4a8866
--- /dev/null
+++ b/examples/widgets/widgets/spinboxes/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from spinboxes.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(spinboxes LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/widgets/spinboxes")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(spinboxes
+ main.cpp
+ window.cpp window.h
+)
+target_link_libraries(spinboxes PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS spinboxes
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/widgets/spinboxes/window.cpp b/examples/widgets/widgets/spinboxes/window.cpp
index 40c02aba70..6aeb5a8f69 100644
--- a/examples/widgets/widgets/spinboxes/window.cpp
+++ b/examples/widgets/widgets/spinboxes/window.cpp
@@ -262,7 +262,7 @@ void Window::createDoubleSpinBoxes()
priceSpinBox->setPrefix("$");
priceSpinBox->setValue(99.99);
- connect(precisionSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
+ connect(precisionSpinBox, &QSpinBox::valueChanged,
//! [17]
this, &Window::changePrecision);
diff --git a/examples/widgets/widgets/styles/CMakeLists.txt b/examples/widgets/widgets/styles/CMakeLists.txt
new file mode 100644
index 0000000000..fc48780487
--- /dev/null
+++ b/examples/widgets/widgets/styles/CMakeLists.txt
@@ -0,0 +1,47 @@
+# Generated from styles.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(styles LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/widgets/styles")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(styles
+ main.cpp
+ norwegianwoodstyle.cpp norwegianwoodstyle.h
+ widgetgallery.cpp widgetgallery.h
+)
+target_link_libraries(styles PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(styles_resource_files
+ "images/woodbackground.png"
+ "images/woodbutton.png"
+)
+
+qt6_add_resources(styles "styles"
+ PREFIX
+ "/"
+ FILES
+ ${styles_resource_files}
+)
+
+install(TARGETS styles
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/widgets/stylesheet/CMakeLists.txt b/examples/widgets/widgets/stylesheet/CMakeLists.txt
new file mode 100644
index 0000000000..1cdf8ff8dd
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/CMakeLists.txt
@@ -0,0 +1,80 @@
+# Generated from stylesheet.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(stylesheet LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/widgets/stylesheet")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(stylesheet
+ main.cpp
+ mainwindow.cpp mainwindow.h mainwindow.ui
+ stylesheeteditor.cpp stylesheeteditor.h stylesheeteditor.ui
+)
+target_link_libraries(stylesheet PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(stylesheet_resource_files
+ "images/checkbox_checked.png"
+ "images/checkbox_checked_hover.png"
+ "images/checkbox_checked_pressed.png"
+ "images/checkbox_unchecked.png"
+ "images/checkbox_unchecked_hover.png"
+ "images/checkbox_unchecked_pressed.png"
+ "images/down_arrow.png"
+ "images/down_arrow_disabled.png"
+ "images/frame.png"
+ "images/pagefold.png"
+ "images/pushbutton.png"
+ "images/pushbutton_hover.png"
+ "images/pushbutton_pressed.png"
+ "images/radiobutton_checked.png"
+ "images/radiobutton_checked_hover.png"
+ "images/radiobutton_checked_pressed.png"
+ "images/radiobutton_unchecked.png"
+ "images/radiobutton_unchecked_hover.png"
+ "images/radiobutton_unchecked_pressed.png"
+ "images/sizegrip.png"
+ "images/spindown.png"
+ "images/spindown_hover.png"
+ "images/spindown_off.png"
+ "images/spindown_pressed.png"
+ "images/spinup.png"
+ "images/spinup_hover.png"
+ "images/spinup_off.png"
+ "images/spinup_pressed.png"
+ "images/up_arrow.png"
+ "images/up_arrow_disabled.png"
+ "layouts/default.ui"
+ "layouts/pagefold.ui"
+ "qss/coffee.qss"
+ "qss/default.qss"
+ "qss/pagefold.qss"
+)
+
+qt6_add_resources(stylesheet "stylesheet"
+ PREFIX
+ "/"
+ FILES
+ ${stylesheet_resource_files}
+)
+
+install(TARGETS stylesheet
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/widgets/tablet/CMakeLists.txt b/examples/widgets/widgets/tablet/CMakeLists.txt
new file mode 100644
index 0000000000..3de5d16523
--- /dev/null
+++ b/examples/widgets/widgets/tablet/CMakeLists.txt
@@ -0,0 +1,50 @@
+# Generated from tablet.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(qttablet LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/widgets/tablet")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(qttablet
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ tabletapplication.cpp tabletapplication.h
+ tabletcanvas.cpp tabletcanvas.h
+)
+target_link_libraries(qttablet PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(images_resource_files
+ "images/cursor-airbrush.png"
+ "images/cursor-eraser.png"
+ "images/cursor-felt-marker.png"
+ "images/cursor-pencil.png"
+)
+
+qt6_add_resources(qttablet "images"
+ PREFIX
+ "/"
+ FILES
+ ${images_resource_files}
+)
+
+install(TARGETS qttablet
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/widgets/tetrix/CMakeLists.txt b/examples/widgets/widgets/tetrix/CMakeLists.txt
new file mode 100644
index 0000000000..d36b82b90b
--- /dev/null
+++ b/examples/widgets/widgets/tetrix/CMakeLists.txt
@@ -0,0 +1,34 @@
+# Generated from tetrix.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(tetrix LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/widgets/tetrix")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(tetrix
+ main.cpp
+ tetrixboard.cpp tetrixboard.h
+ tetrixpiece.cpp tetrixpiece.h
+ tetrixwindow.cpp tetrixwindow.h
+)
+target_link_libraries(tetrix PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS tetrix
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/widgets/tooltips/CMakeLists.txt b/examples/widgets/widgets/tooltips/CMakeLists.txt
new file mode 100644
index 0000000000..9543bef5da
--- /dev/null
+++ b/examples/widgets/widgets/tooltips/CMakeLists.txt
@@ -0,0 +1,48 @@
+# Generated from tooltips.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(tooltips LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/widgets/tooltips")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(tooltips
+ main.cpp
+ shapeitem.cpp shapeitem.h
+ sortingbox.cpp sortingbox.h
+)
+target_link_libraries(tooltips PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(tooltips_resource_files
+ "images/circle.png"
+ "images/square.png"
+ "images/triangle.png"
+)
+
+qt6_add_resources(tooltips "tooltips"
+ PREFIX
+ "/"
+ FILES
+ ${tooltips_resource_files}
+)
+
+install(TARGETS tooltips
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/widgets/validators/CMakeLists.txt b/examples/widgets/widgets/validators/CMakeLists.txt
new file mode 100644
index 0000000000..085eac4e66
--- /dev/null
+++ b/examples/widgets/widgets/validators/CMakeLists.txt
@@ -0,0 +1,49 @@
+# Generated from validators.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(validators LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/widgets/validators")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(validators
+ ledwidget.cpp ledwidget.h
+ localeselector.cpp localeselector.h
+ main.cpp
+ validators.ui
+ validatorwidget.cpp validatorwidget.h
+)
+target_link_libraries(validators PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(validators_resource_files
+ "ledoff.png"
+ "ledon.png"
+)
+
+qt6_add_resources(validators "validators"
+ PREFIX
+ "/"
+ FILES
+ ${validators_resource_files}
+)
+
+install(TARGETS validators
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/widgets/validators/validatorwidget.cpp b/examples/widgets/widgets/validators/validatorwidget.cpp
index 9ddd640924..504eec4fe7 100644
--- a/examples/widgets/widgets/validators/validatorwidget.cpp
+++ b/examples/widgets/widgets/validators/validatorwidget.cpp
@@ -75,9 +75,9 @@ ValidatorWidget::ValidatorWidget(QWidget *parent)
this, &ValidatorWidget::updateDoubleValidator);
connect(doubleMinVal, &QDoubleSpinBox::editingFinished,
this, &ValidatorWidget::updateDoubleValidator);
- connect(doubleDecimals, QOverload<int>::of(&QSpinBox::valueChanged),
+ connect(doubleDecimals, &QSpinBox::valueChanged,
this, &ValidatorWidget::updateDoubleValidator);
- connect(doubleFormat, QOverload<int>::of(&QComboBox::activated),
+ connect(doubleFormat, &QComboBox::activated,
this, &ValidatorWidget::updateDoubleValidator);
connect(doubleEditor, &QLineEdit::editingFinished,
doubleLedWidget, &LEDWidget::flash);
diff --git a/examples/widgets/widgets/wiggly/CMakeLists.txt b/examples/widgets/widgets/wiggly/CMakeLists.txt
new file mode 100644
index 0000000000..3d00965a34
--- /dev/null
+++ b/examples/widgets/widgets/wiggly/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from wiggly.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(wiggly LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/widgets/wiggly")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(wiggly
+ dialog.cpp dialog.h
+ main.cpp
+ wigglywidget.cpp wigglywidget.h
+)
+target_link_libraries(wiggly PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS wiggly
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/widgets/windowflags/CMakeLists.txt b/examples/widgets/widgets/windowflags/CMakeLists.txt
new file mode 100644
index 0000000000..0c2cb2b95b
--- /dev/null
+++ b/examples/widgets/widgets/windowflags/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Generated from windowflags.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(windowflags LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/widgets/windowflags")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(windowflags
+ controllerwindow.cpp controllerwindow.h
+ main.cpp
+ previewwindow.cpp previewwindow.h
+)
+target_link_libraries(windowflags PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS windowflags
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/windowcontainer/CMakeLists.txt b/examples/widgets/windowcontainer/CMakeLists.txt
new file mode 100644
index 0000000000..399cade1c5
--- /dev/null
+++ b/examples/widgets/windowcontainer/CMakeLists.txt
@@ -0,0 +1,38 @@
+# Generated from windowcontainer.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(windowcontainer LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/windowcontainer")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS OpenGL)
+
+add_qt_gui_executable(windowcontainer
+ ../../opengl/openglwindow/openglwindow.cpp ../../opengl/openglwindow/openglwindow.h
+ windowcontainer.cpp
+)
+target_include_directories(windowcontainer PUBLIC
+ ../../opengl/openglwindow
+)
+
+target_link_libraries(windowcontainer PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::OpenGL
+ Qt::Widgets
+)
+
+install(TARGETS windowcontainer
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/windowcontainer/windowcontainer.cpp b/examples/widgets/windowcontainer/windowcontainer.cpp
index b920c85420..f7c146e2a9 100644
--- a/examples/widgets/windowcontainer/windowcontainer.cpp
+++ b/examples/widgets/windowcontainer/windowcontainer.cpp
@@ -60,7 +60,7 @@
#include <QWidget>
-// Making use of the class from the opengl example in gui.
+// Making use of the class from the openglwindow example
class Window : public OpenGLWindow
{
Q_OBJECT
diff --git a/examples/widgets/windowcontainer/windowcontainer.pro b/examples/widgets/windowcontainer/windowcontainer.pro
index 9ac7e4a5ab..664ac938a2 100644
--- a/examples/widgets/windowcontainer/windowcontainer.pro
+++ b/examples/widgets/windowcontainer/windowcontainer.pro
@@ -6,4 +6,4 @@ QT += widgets
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/windowcontainer
INSTALLS += target
-include(../../gui/openglwindow/openglwindow.pri)
+include(../../opengl/openglwindow/openglwindow.pri)
diff --git a/examples/xml/CMakeLists.txt b/examples/xml/CMakeLists.txt
new file mode 100644
index 0000000000..9291c191e0
--- /dev/null
+++ b/examples/xml/CMakeLists.txt
@@ -0,0 +1,13 @@
+# Generated from xml.pro.
+
+add_subdirectory(htmlinfo)
+add_subdirectory(xmlstreamlint)
+
+if(TARGET Qt::Widgets)
+ add_subdirectory(dombookmarks)
+ add_subdirectory(streambookmarks)
+
+ if(TARGET Qt::Network)
+ add_subdirectory(rsslisting)
+ endif()
+endif()
diff --git a/examples/xml/dombookmarks/CMakeLists.txt b/examples/xml/dombookmarks/CMakeLists.txt
new file mode 100644
index 0000000000..24d34443de
--- /dev/null
+++ b/examples/xml/dombookmarks/CMakeLists.txt
@@ -0,0 +1,35 @@
+# Generated from dombookmarks.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(dombookmarks LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/xml/dombookmarks")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Xml)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(dombookmarks
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ xbeltree.cpp xbeltree.h
+)
+target_link_libraries(dombookmarks PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+ Qt::Xml
+)
+
+install(TARGETS dombookmarks
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/xml/htmlinfo/.prev_CMakeLists.txt b/examples/xml/htmlinfo/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..77fa423eff
--- /dev/null
+++ b/examples/xml/htmlinfo/.prev_CMakeLists.txt
@@ -0,0 +1,44 @@
+# Generated from htmlinfo.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(htmlinfo LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/xml/htmlinfo")
+
+find_package(Qt6 COMPONENTS Core)
+
+add_executable(htmlinfo
+ main.cpp
+)
+target_link_libraries(htmlinfo PUBLIC
+ Qt::Core
+)
+
+
+# Resources:
+set(resources_resource_files
+ "apache_org.html"
+ "simpleexample.html"
+ "trolltech_com.html"
+ "w3c_org.html"
+ "youtube_com.html"
+)
+
+qt6_add_resources(htmlinfo "resources"
+ PREFIX
+ "/"
+ FILES
+ ${resources_resource_files}
+)
+
+install(TARGETS htmlinfo
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/xml/htmlinfo/CMakeLists.txt b/examples/xml/htmlinfo/CMakeLists.txt
new file mode 100644
index 0000000000..77fa423eff
--- /dev/null
+++ b/examples/xml/htmlinfo/CMakeLists.txt
@@ -0,0 +1,44 @@
+# Generated from htmlinfo.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(htmlinfo LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/xml/htmlinfo")
+
+find_package(Qt6 COMPONENTS Core)
+
+add_executable(htmlinfo
+ main.cpp
+)
+target_link_libraries(htmlinfo PUBLIC
+ Qt::Core
+)
+
+
+# Resources:
+set(resources_resource_files
+ "apache_org.html"
+ "simpleexample.html"
+ "trolltech_com.html"
+ "w3c_org.html"
+ "youtube_com.html"
+)
+
+qt6_add_resources(htmlinfo "resources"
+ PREFIX
+ "/"
+ FILES
+ ${resources_resource_files}
+)
+
+install(TARGETS htmlinfo
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/xml/rsslisting/CMakeLists.txt b/examples/xml/rsslisting/CMakeLists.txt
new file mode 100644
index 0000000000..96f79d2043
--- /dev/null
+++ b/examples/xml/rsslisting/CMakeLists.txt
@@ -0,0 +1,36 @@
+# Generated from rsslisting.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(rsslisting LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/xml/rsslisting")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Network)
+find_package(Qt6 COMPONENTS Xml)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(rsslisting
+ main.cpp
+ rsslisting.cpp rsslisting.h
+)
+target_link_libraries(rsslisting PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Network
+ Qt::Widgets
+ Qt::Xml
+)
+
+install(TARGETS rsslisting
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/xml/streambookmarks/CMakeLists.txt b/examples/xml/streambookmarks/CMakeLists.txt
new file mode 100644
index 0000000000..22ba383558
--- /dev/null
+++ b/examples/xml/streambookmarks/CMakeLists.txt
@@ -0,0 +1,36 @@
+# Generated from streambookmarks.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(streambookmarks LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/xml/streambookmarks")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Xml)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(streambookmarks
+ main.cpp
+ mainwindow.cpp mainwindow.h
+ xbelreader.cpp xbelreader.h
+ xbelwriter.cpp xbelwriter.h
+)
+target_link_libraries(streambookmarks PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+ Qt::Xml
+)
+
+install(TARGETS streambookmarks
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/xml/xmlstreamlint/.prev_CMakeLists.txt b/examples/xml/xmlstreamlint/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..bb5cad16da
--- /dev/null
+++ b/examples/xml/xmlstreamlint/.prev_CMakeLists.txt
@@ -0,0 +1,27 @@
+# Generated from xmlstreamlint.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(xmlstreamlint LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/xml/xmlstreamlint")
+
+find_package(Qt6 COMPONENTS Core)
+
+add_executable(xmlstreamlint
+ main.cpp
+)
+target_link_libraries(xmlstreamlint PUBLIC
+ Qt::Core
+)
+
+install(TARGETS xmlstreamlint
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/xml/xmlstreamlint/CMakeLists.txt b/examples/xml/xmlstreamlint/CMakeLists.txt
new file mode 100644
index 0000000000..b100943537
--- /dev/null
+++ b/examples/xml/xmlstreamlint/CMakeLists.txt
@@ -0,0 +1,28 @@
+# Generated from xmlstreamlint.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(xmlstreamlint LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/xml/xmlstreamlint")
+
+find_package(Qt6 COMPONENTS Core Xml) # special case
+
+add_executable(xmlstreamlint
+ main.cpp
+)
+target_link_libraries(xmlstreamlint PUBLIC
+ Qt::Core
+ Qt::Xml # special case: add
+)
+
+install(TARGETS xmlstreamlint
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)