aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/doc
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside6/doc')
-rw-r--r--sources/pyside6/doc/CMakeLists.txt188
-rw-r--r--sources/pyside6/doc/_templates/layout.html40
-rw-r--r--sources/pyside6/doc/_themes/pysidedocs/domainindex.html57
-rw-r--r--sources/pyside6/doc/_themes/pysidedocs/searchbox.html12
-rw-r--r--sources/pyside6/doc/_themes/pysidedocs/static/bg_header.pngbin0 -> 36012 bytes
-rw-r--r--sources/pyside6/doc/_themes/pysidedocs/static/bg_topo.jpgbin0 -> 14237 bytes
-rw-r--r--sources/pyside6/doc/_themes/pysidedocs/static/fakebar.pngbin0 -> 101 bytes
-rw-r--r--sources/pyside6/doc/_themes/pysidedocs/static/logo_python.jpgbin0 -> 2660 bytes
-rw-r--r--sources/pyside6/doc/_themes/pysidedocs/static/logo_qt.pngbin0 -> 1936 bytes
-rw-r--r--sources/pyside6/doc/_themes/pysidedocs/static/minus.pngbin0 -> 199 bytes
-rw-r--r--sources/pyside6/doc/_themes/pysidedocs/static/plus.pngbin0 -> 199 bytes
-rw-r--r--sources/pyside6/doc/_themes/pysidedocs/static/pyside.css2076
-rw-r--r--sources/pyside6/doc/_themes/pysidedocs/static/pysidelogo.pngbin0 -> 4936 bytes
-rw-r--r--sources/pyside6/doc/_themes/pysidedocs/static/relbar_bg.pngbin0 -> 130 bytes
-rw-r--r--sources/pyside6/doc/_themes/pysidedocs/theme.conf7
-rw-r--r--sources/pyside6/doc/_themes/pysidedocs_qthelp/domainindex.html57
-rw-r--r--sources/pyside6/doc/_themes/pysidedocs_qthelp/static/fakebar.pngbin0 -> 101 bytes
-rw-r--r--sources/pyside6/doc/_themes/pysidedocs_qthelp/static/logo_python.jpgbin0 -> 2660 bytes
-rw-r--r--sources/pyside6/doc/_themes/pysidedocs_qthelp/static/logo_qt.pngbin0 -> 1936 bytes
-rw-r--r--sources/pyside6/doc/_themes/pysidedocs_qthelp/static/minus.pngbin0 -> 199 bytes
-rw-r--r--sources/pyside6/doc/_themes/pysidedocs_qthelp/static/plus.pngbin0 -> 199 bytes
-rw-r--r--sources/pyside6/doc/_themes/pysidedocs_qthelp/static/pyside.css1943
-rw-r--r--sources/pyside6/doc/_themes/pysidedocs_qthelp/static/pysidelogo.pngbin0 -> 4936 bytes
-rw-r--r--sources/pyside6/doc/_themes/pysidedocs_qthelp/static/relbar_bg.pngbin0 -> 130 bytes
-rw-r--r--sources/pyside6/doc/_themes/pysidedocs_qthelp/theme.conf7
-rw-r--r--sources/pyside6/doc/additionaldocs.lst597
-rw-r--r--sources/pyside6/doc/api.rst90
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/accessibilityslidersnippet.cpp271
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/alphachannel.cpp64
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/audio/main.cpp104
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/brushstyles/qt-logo.pngbin0 -> 15518 bytes
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/brushstyles/renderarea.h71
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/brushstyles/stylewidget.h108
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/clipboard/clipwindow.h82
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/clipboard/clipwindow.py105
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qnamespace.qdoc67
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtcore.py53
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtnetwork.py53
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtopengl.py53
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtprintsupport.py53
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtqml.py53
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtquick.py53
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtsql.py52
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qttest.py53
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtwidgets.py53
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtxml.py53
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src.gui.text.qtextdocumentwriter.cpp55
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src.qdbus.qdbuspendingcall.cpp74
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src.qdbus.qdbuspendingreply.cpp73
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src.scripttools.qscriptenginedebugger.cpp59
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_codecs_qtextcodec.cpp82
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_codecs_qtextcodecplugin.cpp62
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qfuture.cpp74
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qfuturesynchronizer.cpp63
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qfuturewatcher.cpp60
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentexception.cpp85
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentfilter.cpp181
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentmap.cpp194
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentrun.cpp110
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qthreadpool.cpp59
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qabstractfileengine.cpp112
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qdatastream.cpp135
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qdir.cpp179
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qdiriterator.cpp62
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qfile.cpp82
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qfileinfo.cpp148
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qiodevice.cpp98
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qprocess.cpp132
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qsettings.cpp327
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qtemporaryfile.cpp62
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qtextstream.cpp140
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qurl.cpp96
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qabstracteventdispatcher.cpp3
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp98
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp128
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qmetaobject.cpp132
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp119
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qmimedata.cpp107
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qobject.py375
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qsystemsemaphore.cpp71
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qtimer.cpp60
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_plugin_qlibrary.cpp94
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_plugin_quuid.cpp54
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_statemachine_qstatemachine.cpp65
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qatomic.cpp108
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qmutex.cpp165
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qmutexpool.cpp62
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qreadwritelock.cpp111
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qsemaphore.cpp83
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qthread.cpp59
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qwaitcondition_unix.cpp95
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qbitarray.cpp239
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qbytearray.cpp402
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qdatetime.cpp156
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qhash.cpp309
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qlinkedlist.cpp214
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qlistdata.cpp277
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qlocale.cpp101
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qmap.cpp323
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qpoint.cpp161
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qqueue.cpp58
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qrect.cpp60
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qregexp.cpp225
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qsize.cpp146
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qstring.cpp95
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qtimeline.cpp65
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qvector.cpp193
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_xml_qxmlstream.cpp77
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_accessible_qaccessible.cpp57
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_dialogs_qabstractprintdialog.cpp55
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp136
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_dialogs_qfontdialog.cpp90
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_dialogs_qwizard.cpp81
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_effects_qgraphicseffect.cpp87
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsgridlayout.cpp63
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp249
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicslinearlayout.cpp63
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsproxywidget.cpp96
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsscene.cpp125
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicssceneevent.cpp55
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsview.cpp136
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicswidget.cpp75
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qbitmap.cpp54
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qicon.cpp82
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qimage.cpp86
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qimagereader.cpp75
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qimagewriter.cpp69
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qmovie.cpp63
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qpixmap.cpp68
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qpixmapcache.cpp66
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qpixmapfilter.cpp72
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qabstractitemview.cpp67
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qdatawidgetmapper.cpp73
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qitemeditorfactory.cpp73
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qitemselectionmodel.cpp60
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qstandarditemmodel.cpp86
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qtablewidget.cpp55
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qtreewidget.cpp58
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qaction.cpp59
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qapplication.cpp167
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qapplication_x11.cpp55
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qclipboard.cpp63
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qevent.cpp61
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qformlayout.cpp86
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qkeysequence.cpp69
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qlayout.cpp75
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qlayoutitem.cpp58
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qshortcut.cpp65
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qshortcutmap.cpp3
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qsound.cpp59
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qwidget.cpp150
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qbrush.cpp61
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qcolor.cpp59
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qdrawutil.cpp108
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qmatrix.cpp72
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qpainter.cpp261
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qpainterpath.cpp160
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qpen.cpp85
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qregion.cpp63
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qregion_unix.cpp68
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qtransform.cpp88
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_styles_qstyle.cpp58
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_styles_qstyleoption.cpp57
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_text_qfont.cpp77
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_text_qfontmetrics.cpp64
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_text_qsyntaxhighlighter.cpp124
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_text_qtextcursor.cpp90
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_text_qtextlayout.cpp73
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_util_qcompleter.cpp74
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_util_qdesktopservices.cpp65
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_util_qundostack.cpp120
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_util_qvalidator.cpp155
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qabstractbutton.cpp69
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qabstractspinbox.cpp58
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qcalendarwidget.cpp83
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qcheckbox.cpp3
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qdatetimeedit.cpp89
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qdockwidget.cpp57
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qframe.cpp58
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qgroupbox.cpp3
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qlabel.cpp74
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qlineedit.cpp57
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qmainwindow.cpp65
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qmenu.cpp87
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qmenubar.cpp58
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qplaintextedit.cpp64
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qpushbutton.cpp3
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qradiobutton.cpp3
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qrubberband.cpp67
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qscrollarea.cpp59
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qspinbox.cpp90
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qsplashscreen.cpp65
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qsplitter.cpp57
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qstatusbar.cpp3
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qtextbrowser.cpp54
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qtextedit.cpp69
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qworkspace.cpp57
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_access_qftp.cpp109
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_access_qhttp.cpp132
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_access_qnetworkaccessmanager.cpp86
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_access_qnetworkdiskcache.cpp74
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_access_qnetworkrequest.cpp3
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_bearer_qnetworkconfigmanager.cpp58
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_kernel_qhostaddress.cpp57
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_kernel_qhostinfo.cpp92
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_kernel_qnetworkproxy.cpp64
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_socket_qabstractsocket.cpp78
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_socket_qlocalsocket_unix.cpp62
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_socket_qnativesocketengine.cpp71
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_socket_qtcpserver.cpp3
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_socket_qudpsocket.cpp67
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_ssl_qsslcertificate.cpp54
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_ssl_qsslconfiguration.cpp55
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_ssl_qsslsocket.cpp100
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_opengl_qgl.cpp168
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_opengl_qglcolormap.cpp74
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_opengl_qglpixelbuffer.cpp69
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_opengl_qglshaderprogram.cpp103
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_qtestlib_qtestcase.cpp237
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptable.cpp69
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptclass.cpp59
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptcontext.cpp73
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptengine.cpp320
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptengineagent.cpp62
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptvalue.cpp91
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptvalueiterator.cpp78
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqldriver.cpp73
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqlerror.cpp56
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqlindex.cpp55
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqlquery.cpp88
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqlresult.cpp88
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_models_qsqlquerymodel.cpp62
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xml_dom_qdom.cpp230
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xml_sax_qxml.cpp3
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qabstracturiresolver.cpp3
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qabstractxmlforwarditerator.cpp3
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qabstractxmlnodemodel.cpp72
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qabstractxmlreceiver.cpp57
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qsimplexmlnodemodel.cpp69
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlformatter.cpp58
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlname.cpp58
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlquery.cpp202
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlresultitems.cpp66
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlserializer.cpp57
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_assistant_compat_lib_qassistantclient.cpp75
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_extension_default_extensionfactory.cpp85
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_extension_extension.cpp65
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_extension_qextensionmanager.cpp67
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformeditor.cpp61
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformwindow.py74
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformwindowcursor.cpp58
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformwindowmanager.cpp61
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractobjectinspector.cpp61
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractpropertyeditor.py71
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractwidgetbox.cpp80
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_uilib_abstractformbuilder.cpp67
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_uilib_formbuilder.cpp76
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_patternist_qapplicationargumentparser.cpp55
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_shared_qtgradienteditor_qtgradientdialog.cpp94
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_shared_qtpropertybrowser_qtpropertybrowser.cpp97
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_shared_qtpropertybrowser_qtvariantproperty.cpp66
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_shared_qttoolbardialog_qttoolbardialog.cpp62
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/console/dbus_pingpong.txt3
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/customstyle/customstyle.h69
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/designer/autoconnection/imagedialog.h69
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/designer/autoconnection/imagedialog.ui389
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/designer/imagedialog/imagedialog.ui389
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/designer/multipleinheritance/imagedialog.h64
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/designer/multipleinheritance/imagedialog.ui389
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/designer/noautoconnection/imagedialog.h69
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/designer/noautoconnection/imagedialog.ui389
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/designer/singleinheritance/imagedialog.h67
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/designer/singleinheritance/imagedialog.ui389
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/dialogs/dialogs.py123
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/doc_src_qtcharts.py43
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/doc_src_qtgui.py53
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/doc_src_qtmultimedia.py53
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/doc_src_qtxmlpatterns.py54
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/modules.html28
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtcore.html122
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtgui.html276
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtnetwork.html35
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtopengl.html27
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtsql.html39
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtxml.html53
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/titles.txt7
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/dockwidgets.qrc12
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/mainwindow.h80
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/draganddrop/dragwidget.h89
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/draganddrop/mainwindow.h81
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/dragging/images.qrc5
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/dragging/images/file.pngbin0 -> 313 bytes
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/dragging/mainwindow.cpp72
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/dragging/mainwindow.h81
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/dropactions/window.h81
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/droparea.cpp147
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/dropevents/window.py65
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/droprectangle/window.h81
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/eventfilters/filterobject.h69
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/explicitlysharedemployee/employee.h84
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/i18n-non-qt-class/myclass.h69
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/i18n-non-qt-class/myclass.ts12
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/i18n-non-qt-class/resources.qrc6
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/i18n-non-qt-class/translations/i18n-non-qt-class_en.ts12
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/i18n-non-qt-class/translations/i18n-non-qt-class_fr.ts13
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/image/image.cpp69
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/image/supportedformat.cpp56
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/inherited-slot/button.h69
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/itemselection/model.h84
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/layouts/layouts.cpp126
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/mainwindowsnippet.cpp58
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/matrix/matrix.cpp112
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/mdiareasnippets.cpp66
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/moc/myclass1.h75
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/moc/myclass2.h76
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/moc/myclass3.h69
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/modelview-subclasses/model.h80
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/modelview-subclasses/view.h100
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/modelview-subclasses/window.h78
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/myscrollarea.cpp112
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/network/tcpwait.cpp71
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/ntfsp.cpp60
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/anyHTMLElement.xq1
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/anyXLinkAttribute.xq2
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/bracesIncluded.xq1
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/bracesIncludedResult.xml1
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/bracesOmitted.xq1
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/bracesOmittedResult.xml2
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/computedTreeFragment.xq14
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/copyAttribute.xq9
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/copyID.xq3
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/directTreeFragment.xq7
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/doc.txt35
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/docPlainHTML.xq1
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/docPlainHTML2.xq1
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/embedDataInXHTML.xq10
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/embedDataInXHTML2.xq10
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/emptyParagraphs.xq1
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/escapeCurlyBraces.xq4
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/escapeStringLiterals.xml2
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/escapeStringLiterals.xq7
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/expressionInsideAttribute.xq2
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/filterOnPath.xq2
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/filterOnStep.xq2
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/firstParagraph.xq1
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/fnStringOnAttribute.xq9
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/forClause.xq3
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/forClause2.xq3
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/forClauseOnFeed.xq6
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/indented.xml5
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introAcneRemover.xq8
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introExample2.xq5
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introFileHierarchy.xml14
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introNavigateFS.xq12
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introductionExample.xq3
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/invalidLetOrderBy.xq3
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/items.xq5
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/letOrderBy.xq4
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/literalsAndOperators.xq2
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/mobeyDick.xml4
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/nextLastParagraph.xq1
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/nodeConstructorsAreExpressions.xq4
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/nodeConstructorsInPaths.xq1
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/nodeTestChildElement.xq1
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/notIndented.xml1
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/oneElementConstructor.xq1
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/paragraphsExceptTheFiveFirst.xq1
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/paragraphsWithTables.xq1
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/pathAB.xq1
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/pathsAllParagraphs.xq1
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/simpleHTML.xq1
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/simpleXHTML.xq2
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/svgDocumentElement.xml1
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/tablesInParagraphs.xq1
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/twoSVGElements.xq5
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/xmlStylesheet.xq1
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/xsBooleanTrue.xq1
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/xsvgDocumentElement.xml1
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/persistentindexes/mainwindow.h80
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/persistentindexes/model.h81
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/picture/picture.cpp121
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/plaintextlayout/window.h71
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/polygon/polygon.cpp96
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/porting4-dropevents/window.h82
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/printing-qprinter/errors.cpp68
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/printing-qprinter/object.h62
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qabstractsliderisnippet.cpp519
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qdir-listfiles/main.cpp64
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qdir-namefilters/main.cpp68
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qfontdatabase/main.cpp74
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qlineargradient/paintwidget.h69
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qlistview-dnd/mainwindow.h71
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qlistview-dnd/model.h73
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qlistview-using/mainwindow.h82
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qlistview-using/model.h82
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qlistwidget-dnd/mainwindow.h72
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qlistwidget-using/mainwindow.h82
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qmacnativewidget/main.mm144
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/delegate.h50
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/main.cpp50
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/model.cpp50
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/model.h50
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/paintwidget_unix.cpp54
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/view.h50
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qmetaobject-invokable/window.h68
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qquickview-ex.cpp67
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qsignalmapper/buttonwidget.h70
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qsignalmapper/mainwindow.h69
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qsortfilterproxymodel-details/main.cpp79
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qsplashscreen/main.cpp66
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qsplashscreen/mainwindow.h64
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qsplashscreen/qsplashscreen.qrc5
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qsplashscreen/splash.pngbin0 -> 27926 bytes
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qstackedlayout/main.py87
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qstackedwidget/main.py77
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qstatustipevent/main.cpp74
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qstyleoption/main.cpp105
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qsvgwidget/qsvgwidget.qrc5
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qsvgwidget/spheres.svg79
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qsvgwidget/sunflower.svg188
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-dnd/Images/cubed.pngbin0 -> 437 bytes
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-dnd/Images/squared.pngbin0 -> 440 bytes
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-dnd/images.qrc6
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-dnd/mainwindow.h78
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-resizing/mainwindow.h77
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-using/Images/cubed.pngbin0 -> 437 bytes
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-using/Images/squared.pngbin0 -> 440 bytes
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-using/images.qrc6
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-using/mainwindow.h80
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qtcast/qtcast.h64
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qtreeview-dnd/dragdropmodel.h72
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qtreeview-dnd/mainwindow.h71
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qtreeview-dnd/treeitem.h81
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qtreeview-dnd/treemodel.h89
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qtreewidget-using/mainwindow.cpp111
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qtreewidget-using/mainwindow.h87
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qtreewidgetitemiterator-using/mainwindow.cpp59
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qtreewidgetitemiterator-using/mainwindow.h87
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qtscript/registeringobjects/myobject.h67
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qtscript/scriptedslot/object.js18
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qtscript/scriptedslot/scriptedslot.qrc5
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/quiloader/doc_src_qtuiloader.py53
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/quiloader/myform.ui130
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/quiloader/mywidget.h62
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/quiloader/mywidget.qrc5
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qx11embedwidget/embedwidget.h75
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qxmlquery/bindingExample.py59
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/qxmlschemavalidator/main.cpp112
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/reading-selections/model.h84
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/reading-selections/window.h77
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/separations/finalwidget.h87
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/separations/screenwidget.h96
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/separations/viewer.h99
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/shareddirmodel/main.cpp90
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/sharedemployee/employee.h104
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/sharedtablemodel/model.h84
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/signalmapper/accountsfile.txt1
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/signalmapper/filereader.h78
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/signalmapper/reportfile.txt2
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/signalmapper/taxfile.txt1
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/signalsandslots/lcdnumber.h98
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/signalsandslots/signalsandslots.h99
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/simpleparse/handler.h77
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/splitter/splitter.cpp76
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/splitterhandle/splitter.h61
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/sqldatabase/sqldatabase.py489
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/stringlistmodel/model.cpp170
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/stringlistmodel/model.h82
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/styles/styles.cpp80
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/stylesheet/common-mistakes.cpp62
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/textblock-fragments/mainwindow.h75
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/textblock-fragments/xmlwriter.h74
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-blocks/mainwindow.h75
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-blocks/xmlwriter.h71
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-css/main.cpp58
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-frames/mainwindow.h74
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-frames/xmlwriter.h74
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-imagedrop/textedit.h66
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-imageformat/images.qrc6
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-imageformat/images/advert.pngbin0 -> 16291 bytes
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-imageformat/images/newimage.pngbin0 -> 5490 bytes
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-images/images.qrc5
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-images/images/advert.pngbin0 -> 16291 bytes
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-listitems/mainwindow.h85
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-lists/mainwindow.h89
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-printing/mainwindow.h82
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-selections/mainwindow.h89
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-tables/mainwindow.cpp125
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-tables/mainwindow.h75
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-tables/xmlwriter.h74
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-texttable/main.cpp56
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/threads/threads.h61
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/timers/timers.cpp88
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/transform/main.cpp110
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/uitools/calculatorform/calculatorform.ui303
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/updating-selections/model.h84
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/updating-selections/window.h77
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/whatsthis/whatsthis.cpp57
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/widget-mask/mask.qrc5
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/widget-mask/tux.pngbin0 -> 12191 bytes
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/widgetdelegate.cpp72
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/widgets-tutorial/template.py66
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/xml/rsslisting/handler.h84
-rw-r--r--sources/pyside6/doc/codesnippets/doc/src/snippets/xml/rsslisting/rsslisting.h96
-rw-r--r--sources/pyside6/doc/codesnippets/examples/dbus/example-client.py100
-rw-r--r--sources/pyside6/doc/codesnippets/examples/dbus/example-server.py119
-rw-r--r--sources/pyside6/doc/codesnippets/examples/declarative/cppextensions/plugins/plugin.cpp68
-rw-r--r--sources/pyside6/doc/codesnippets/examples/declarative/cppextensions/plugins/plugins.qml62
-rw-r--r--sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/classwizard.py254
-rw-r--r--sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/classwizard.qrc11
-rw-r--r--sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/background.pngbin0 -> 22578 bytes
-rw-r--r--sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/banner.pngbin0 -> 3947 bytes
-rw-r--r--sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/logo1.pngbin0 -> 1619 bytes
-rw-r--r--sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/logo2.pngbin0 -> 1619 bytes
-rw-r--r--sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/logo3.pngbin0 -> 1619 bytes
-rw-r--r--sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/watermark1.pngbin0 -> 14516 bytes
-rw-r--r--sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/watermark2.pngbin0 -> 14912 bytes
-rw-r--r--sources/pyside6/doc/codesnippets/examples/dialogs/extension/finddialog.py119
-rw-r--r--sources/pyside6/doc/codesnippets/examples/dialogs/licensewizard/images/logo.pngbin0 -> 1810 bytes
-rw-r--r--sources/pyside6/doc/codesnippets/examples/dialogs/licensewizard/images/watermark.pngbin0 -> 34998 bytes
-rw-r--r--sources/pyside6/doc/codesnippets/examples/dialogs/licensewizard/licensewizard.h173
-rw-r--r--sources/pyside6/doc/codesnippets/examples/dialogs/licensewizard/licensewizard.qrc6
-rw-r--r--sources/pyside6/doc/codesnippets/examples/dialogs/standarddialogs/dialog.cpp80
-rw-r--r--sources/pyside6/doc/codesnippets/examples/dialogs/tabdialog/tabdialog.cpp193
-rw-r--r--sources/pyside6/doc/codesnippets/examples/graphicsview/simpleanchorlayout/main.cpp72
-rw-r--r--sources/pyside6/doc/codesnippets/examples/imageprovider/imageprovider-example.qml59
-rw-r--r--sources/pyside6/doc/codesnippets/examples/imageprovider/imageprovider.cpp83
-rw-r--r--sources/pyside6/doc/codesnippets/examples/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp109
-rw-r--r--sources/pyside6/doc/codesnippets/examples/itemviews/pixelator/pixeldelegate.cpp103
-rw-r--r--sources/pyside6/doc/codesnippets/examples/mainwindows/application/mainwindow.h113
-rw-r--r--sources/pyside6/doc/codesnippets/examples/mainwindows/application/mainwindow.py357
-rw-r--r--sources/pyside6/doc/codesnippets/examples/mainwindows/dockwidgets/mainwindow.py253
-rw-r--r--sources/pyside6/doc/codesnippets/examples/mainwindows/mainwindow.py366
-rw-r--r--sources/pyside6/doc/codesnippets/examples/mainwindows/mdi/mainwindow.py360
-rw-r--r--sources/pyside6/doc/codesnippets/examples/mainwindows/menus/mainwindow.py366
-rw-r--r--sources/pyside6/doc/codesnippets/examples/mainwindows/sdi/mainwindow.cpp60
-rw-r--r--sources/pyside6/doc/codesnippets/examples/quick/plugins/plugins.qml61
-rw-r--r--sources/pyside6/doc/codesnippets/examples/relationaltablemodel/relationaltablemodel.cpp120
-rw-r--r--sources/pyside6/doc/codesnippets/examples/richtext/textobject/svgtextobject.h79
-rw-r--r--sources/pyside6/doc/codesnippets/examples/widgets/groupbox/window.cpp187
-rw-r--r--sources/pyside6/doc/codesnippets/examples/widgets/icons/iconsizespinbox.cpp72
-rw-r--r--sources/pyside6/doc/codesnippets/examples/widgets/spinboxes/window.py247
-rw-r--r--sources/pyside6/doc/codesnippets/examples/xml/streambookmarks/xbelreader.h90
-rw-r--r--sources/pyside6/doc/codesnippets/snippets/customstyle/main.cpp61
-rw-r--r--sources/pyside6/doc/conf.py.in190
-rw-r--r--sources/pyside6/doc/considerations.rst149
-rw-r--r--sources/pyside6/doc/contents.rst23
-rw-r--r--sources/pyside6/doc/deployment-briefcase.rst199
-rw-r--r--sources/pyside6/doc/deployment-cxfreeze.rst130
-rw-r--r--sources/pyside6/doc/deployment-fbs.rst97
-rw-r--r--sources/pyside6/doc/deployment-pyinstaller.rst145
-rw-r--r--sources/pyside6/doc/deployment.rst120
-rw-r--r--sources/pyside6/doc/examples/images/tabbedbrowser.pngbin0 -> 37147 bytes
-rw-r--r--sources/pyside6/doc/examples/index.rst14
-rw-r--r--sources/pyside6/doc/examples/tabbedbrowser.rst58
-rw-r--r--sources/pyside6/doc/extras/QtCore.ClassInfo.rst23
-rw-r--r--sources/pyside6/doc/extras/QtCore.Property.rst62
-rw-r--r--sources/pyside6/doc/extras/QtCore.QEnum.rst92
-rw-r--r--sources/pyside6/doc/extras/QtCore.Signal.rst39
-rw-r--r--sources/pyside6/doc/extras/QtCore.Slot.rst39
-rw-r--r--sources/pyside6/doc/extras/QtCore.rst5
-rw-r--r--sources/pyside6/doc/extras/QtGui.rst7
-rw-r--r--sources/pyside6/doc/extras/QtHelp.rst5
-rw-r--r--sources/pyside6/doc/extras/QtMultimedia.rst7
-rw-r--r--sources/pyside6/doc/extras/QtNetwork.rst5
-rw-r--r--sources/pyside6/doc/extras/QtOpenGL.rst14
-rw-r--r--sources/pyside6/doc/extras/QtQml.QmlElement.rst28
-rw-r--r--sources/pyside6/doc/extras/QtQml.qmlRegisterSingletonType.rst44
-rw-r--r--sources/pyside6/doc/extras/QtQml.qmlRegisterType.rst41
-rw-r--r--sources/pyside6/doc/extras/QtQml.qmlRegisterUncreatableType.rst36
-rw-r--r--sources/pyside6/doc/extras/QtScript.rst21
-rw-r--r--sources/pyside6/doc/extras/QtScriptTools.rst5
-rw-r--r--sources/pyside6/doc/extras/QtSql.rst5
-rw-r--r--sources/pyside6/doc/extras/QtSvg.rst5
-rw-r--r--sources/pyside6/doc/extras/QtTest.rst7
-rw-r--r--sources/pyside6/doc/extras/QtUiTools.loadUiType.rst36
-rw-r--r--sources/pyside6/doc/extras/QtUiTools.rst9
-rw-r--r--sources/pyside6/doc/extras/QtXml.rst5
-rw-r--r--sources/pyside6/doc/extras/QtXmlPatterns.rst12
-rw-r--r--sources/pyside6/doc/faq.rst37
-rw-r--r--sources/pyside6/doc/gettingstarted-linux.rst96
-rw-r--r--sources/pyside6/doc/gettingstarted-macOS.rst95
-rw-r--r--sources/pyside6/doc/gettingstarted-windows.rst97
-rw-r--r--sources/pyside6/doc/gettingstarted.rst218
-rw-r--r--sources/pyside6/doc/index.rst104
-rw-r--r--sources/pyside6/doc/inheritance_diagram.py372
-rw-r--r--sources/pyside6/doc/modules.rst97
-rw-r--r--sources/pyside6/doc/pyside-config.qdocconf.in19
-rw-r--r--sources/pyside6/doc/pyside-examples/examples.qdoc37
-rw-r--r--sources/pyside6/doc/pyside-examples/images/pysideexample-classwizard.pngbin0 -> 57931 bytes
-rw-r--r--sources/pyside6/doc/pyside-examples/images/pysideexample-stardelegate.pngbin0 -> 22482 bytes
-rw-r--r--sources/pyside6/doc/pyside-examples/images/screenshot_hello.pngbin0 -> 21193 bytes
-rw-r--r--sources/pyside6/doc/pyside-examples/pyside-classwizard.qdoc39
-rw-r--r--sources/pyside6/doc/pyside-examples/pyside-stardelegate.qdoc39
-rw-r--r--sources/pyside6/doc/pysideinclude.py147
-rw-r--r--sources/pyside6/doc/qtattributionsscannertorst.py131
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-examples.qdocconf.in12
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-qt3dextras.qdocconf.in3
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-qtcharts.qdocconf.in2
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-qtconcurrent.qdocconf.in2
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-qtcore.qdocconf.in2
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-qtdatavisualization.qdocconf.in2
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-qtgui.qdocconf.in2
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-qthelp.qdocconf.in2
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-qtlocation.qdocconf.in3
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-qtmacextras.qdocconf.in2
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-qtmultimediawidgets.qdocconf.in3
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-qtnetwork.qdocconf.in2
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-qtopengl.qdocconf.in2
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-qtpositioning.qdocconf.in3
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-qtprintsupport.qdocconf.in2
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-qtqml.qdocconf.in5
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-qtquickwidgets.qdocconf.in3
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-qtscxml.qdocconf.in3
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-qtsensors.qdocconf.in3
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-qtsql.qdocconf.in2
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-qtsvg.qdocconf.in2
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-qttest.qdocconf.in2
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-qttexttospeech.qdocconf.in3
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-qtuitools.qdocconf.in2
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-qtwebchannel.qdocconf.in2
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-qtwebenginewidgets.qdocconf.in3
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-qtwebsockets.qdocconf.in2
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-qtwidgets.qdocconf.in2
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-qtwinextras.qdocconf.in2
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-qtx11extras.qdocconf.in2
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-qtxml.qdocconf.in2
-rw-r--r--sources/pyside6/doc/quickstart.rst118
-rw-r--r--sources/pyside6/doc/src/README.md1
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/clickablebutton.rst90
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/dialog.rst145
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/icons.pngbin0 -> 3202 bytes
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/icons/forward.pngbin0 -> 1113 bytes
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/icons/pause.pngbin0 -> 1001 bytes
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/icons/play.pngbin0 -> 970 bytes
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/icons/previous.pngbin0 -> 1050 bytes
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/icons/stop.pngbin0 -> 1064 bytes
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/player-new.pngbin0 -> 7818 bytes
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/player.pngbin0 -> 5835 bytes
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/qml.rst67
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/qrcfiles.rst169
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/style.qss23
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/uifiles.rst187
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/widgets.rst45
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/widgetstyling-no.pngbin0 -> 26444 bytes
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/widgetstyling-simple-no.pngbin0 -> 3834 bytes
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/widgetstyling-simple-yes.pngbin0 -> 4743 bytes
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/widgetstyling-yes.pngbin0 -> 32311 bytes
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/widgetstyling.py95
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/widgetstyling.rst169
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/add_chart.rst20
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/add_mainwindow.rst32
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/add_tableview.rst70
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/all_hour.csv8
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize.tar.bz2bin0 -> 6086 bytes
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize1/main.py55
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize2/main.py78
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize3/main.py88
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize3/main_window.py69
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize4/main.py90
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize4/main_widget.py80
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize4/main_window.py69
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize4/table_model.py88
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize5/main.py90
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize5/main_widget.py91
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize5/main_window.py69
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize5/table_model.py88
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize6/main.py92
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize6/main_widget.py131
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize6/main_window.py70
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize6/table_model.py88
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/filter_data.rst29
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/images/QMainWindow-layout.pngbin0 -> 17272 bytes
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/images/datavisualization_app.pngbin0 -> 40458 bytes
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/index.rst26
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/plot_datapoints.rst25
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/read_data.rst41
-rw-r--r--sources/pyside6/doc/tutorials/expenses/expenses.rst314
-rw-r--r--sources/pyside6/doc/tutorials/expenses/expenses_tool.pngbin0 -> 47826 bytes
-rw-r--r--sources/pyside6/doc/tutorials/expenses/main.py207
-rw-r--r--sources/pyside6/doc/tutorials/expenses/main_snake_prop.py210
-rw-r--r--sources/pyside6/doc/tutorials/expenses/steps/01-expenses.py59
-rw-r--r--sources/pyside6/doc/tutorials/expenses/steps/02-expenses.py71
-rw-r--r--sources/pyside6/doc/tutorials/expenses/steps/03-expenses.py78
-rw-r--r--sources/pyside6/doc/tutorials/expenses/steps/04-expenses.py90
-rw-r--r--sources/pyside6/doc/tutorials/expenses/steps/05-expenses.py118
-rw-r--r--sources/pyside6/doc/tutorials/expenses/steps/06-expenses.py138
-rw-r--r--sources/pyside6/doc/tutorials/expenses/steps/07-expenses.py165
-rw-r--r--sources/pyside6/doc/tutorials/expenses/steps/08-expenses.py178
-rw-r--r--sources/pyside6/doc/tutorials/expenses/steps/09-expenses.py185
-rw-r--r--sources/pyside6/doc/tutorials/expenses/steps/10-expenses.py207
-rw-r--r--sources/pyside6/doc/tutorials/index.rst42
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter1/chapter1.rst89
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter1/createdb.py131
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter1/images/chapter1_books.pngbin0 -> 25391 bytes
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter1/initdb.h160
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter1/main.py59
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter2/bookdelegate.cpp143
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter2/bookdelegate.h83
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter2/bookdelegate.py134
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter2/chapter2.rst93
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter2/createdb.py131
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter2/images/chapter2_books.pngbin0 -> 34658 bytes
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter2/images/chapter2_books_with_relation.pngbin0 -> 44122 bytes
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter2/images/star.pngbin0 -> 782 bytes
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter2/main.py63
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter3/bookdelegate-old.py134
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter3/bookdelegate.py133
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter3/books.qrc5
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter3/bookwindow.cpp171
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter3/bookwindow.py138
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter3/bookwindow.ui149
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter3/chapter3.rst121
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter3/createdb.py131
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter3/images/chapter3-books.pngbin0 -> 34624 bytes
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter3/images/star.pngbin0 -> 782 bytes
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter3/main-old.py52
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter3/main.py53
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/hello_world_ex.py76
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/index.rst194
-rw-r--r--sources/pyside6/doc/tutorials/qmlapp/logo.pngbin0 -> 6208 bytes
-rw-r--r--sources/pyside6/doc/tutorials/qmlapp/main.py82
-rw-r--r--sources/pyside6/doc/tutorials/qmlapp/newpyproject.pngbin0 -> 16091 bytes
-rw-r--r--sources/pyside6/doc/tutorials/qmlapp/projectsmode.pngbin0 -> 8848 bytes
-rw-r--r--sources/pyside6/doc/tutorials/qmlapp/pyprojname.pngbin0 -> 8068 bytes
-rw-r--r--sources/pyside6/doc/tutorials/qmlapp/pyprojxplor.pngbin0 -> 10062 bytes
-rw-r--r--sources/pyside6/doc/tutorials/qmlapp/qmlapplication.pngbin0 -> 10950 bytes
-rw-r--r--sources/pyside6/doc/tutorials/qmlapp/qmlapplication.rst132
-rw-r--r--sources/pyside6/doc/tutorials/qmlapp/view.qml102
-rw-r--r--sources/pyside6/doc/tutorials/qmlintegration/main.py113
-rw-r--r--sources/pyside6/doc/tutorials/qmlintegration/qmlintegration.rst111
-rw-r--r--sources/pyside6/doc/tutorials/qmlintegration/qtquickcontrols2.conf10
-rw-r--r--sources/pyside6/doc/tutorials/qmlintegration/style.qrc5
-rw-r--r--sources/pyside6/doc/tutorials/qmlintegration/textproperties_default.pngbin0 -> 19347 bytes
-rw-r--r--sources/pyside6/doc/tutorials/qmlintegration/textproperties_material.pngbin0 -> 21170 bytes
-rw-r--r--sources/pyside6/doc/tutorials/qmlintegration/view.qml183
-rw-r--r--sources/pyside6/doc/tutorials/qmlsqlintegration/chat.qml127
-rw-r--r--sources/pyside6/doc/tutorials/qmlsqlintegration/example_list_view.pngbin0 -> 6954 bytes
-rw-r--r--sources/pyside6/doc/tutorials/qmlsqlintegration/main.py85
-rw-r--r--sources/pyside6/doc/tutorials/qmlsqlintegration/qmlsqlintegration.rst225
-rw-r--r--sources/pyside6/doc/tutorials/qmlsqlintegration/sqlDialog.py146
-rw-r--r--sources/pyside6/doc/typesystem_doc.xml.in63
-rw-r--r--sources/pyside6/doc/videos.rst96
743 files changed, 57989 insertions, 0 deletions
diff --git a/sources/pyside6/doc/CMakeLists.txt b/sources/pyside6/doc/CMakeLists.txt
new file mode 100644
index 000000000..49ad1dcd7
--- /dev/null
+++ b/sources/pyside6/doc/CMakeLists.txt
@@ -0,0 +1,188 @@
+cmake_minimum_required(VERSION 3.16)
+cmake_policy(VERSION 3.16)
+
+project(doc)
+
+if (WIN32)
+ set(PATH_SEP "\;")
+else()
+ set(PATH_SEP ":")
+endif()
+
+set(DOC_DATA_DIR "${CMAKE_CURRENT_BINARY_DIR}/qdoc-output")
+
+get_filename_component(ROOT ${CMAKE_CURRENT_BINARY_DIR} DIRECTORY)
+set(TS_ROOT "${ROOT}/PySide6")
+
+file(REMOVE ${CMAKE_CURRENT_LIST_DIR}/pyside.qdocconf ${CMAKE_CURRENT_LIST_DIR}/pyside.qdocconf.in)
+
+set(SHIBOKEN_INTERSPHINX_FILE "${ROOT}/pyside6/shiboken6/objects.inv")
+set(HAS_WEBENGINE_WIDGETS 0)
+set(SKIP_SPHINX_WARNINGS 1)
+if (FULLDOCSBUILD)
+ set(SKIP_SPHINX_WARNINGS 0)
+ set(SHIBOKEN_INTERSPHINX_FILE "${CMAKE_BINARY_DIR}/doc/html/shiboken6/doc/html/objects.inv")
+ # For Qt modules that are part of the documentation build:
+ # - Configure the module docconf file
+ # - Write shiboken header consisting of pyside6_global.h and module includes
+ # - Build include path for qdoc for shiboken
+
+ # The last element of the include list is the mkspec directory containing qplatformdefs.h
+ list(GET Qt${QT_MAJOR_VERSION}Core_INCLUDE_DIRS -1 mkspecInclude)
+ configure_file("pyside-config.qdocconf.in" "${CMAKE_CURRENT_LIST_DIR}/pyside-config.qdocconf" @ONLY)
+
+ file(READ "${pyside6_BINARY_DIR}/pyside6_global.h" docHeaderContents)
+ file(READ "typesystem_doc.xml.in" typeSystemDocXmlContents)
+
+
+ foreach(moduleIn ${all_module_shortnames})
+ string(TOLOWER "${moduleIn}" lowerModuleIn)
+ set(docConf "${CMAKE_CURRENT_LIST_DIR}/qtmodules/pyside-qt${lowerModuleIn}.qdocconf.in")
+ if(EXISTS "${docConf}")
+ string(REGEX REPLACE "(^.*)\.in" "\\1" OUTFILE ${docConf})
+ get_filename_component(BASENAME ${OUTFILE} NAME)
+ configure_file(${docConf} "${CMAKE_CURRENT_LIST_DIR}/qtmodules/${BASENAME}" @ONLY)
+ file(APPEND "pyside.qdocconf.in" "\@CMAKE_CURRENT_LIST_DIR\@/qtmodules/${BASENAME}\n")
+ # Handle docconf files in Qt that contain multiple modules
+ if ("${moduleIn}" STREQUAL "3DExtras")
+ set(modules 3DCore 3DRender 3DInput 3DLogic 3DAnimation "${moduleIn}")
+ elseif ("${moduleIn}" STREQUAL "QuickWidgets")
+ set(modules Qml Quick "${moduleIn}")
+ elseif ("${moduleIn}" STREQUAL "MultimediaWidgets")
+ set(modules Multimedia "${moduleIn}")
+ elseif ("${moduleIn}" STREQUAL "WebEngineWidgets")
+ set(modules WebEngine WebEngineCore "${moduleIn}")
+ set(HAS_WEBENGINE_WIDGETS 1)
+ else()
+ set(modules "${moduleIn}")
+ endif()
+ foreach(module ${modules})
+ string(TOLOWER "${module}" lowerModule)
+ # -- @TODO fix this for macOS frameworks.
+ file(APPEND "${CMAKE_CURRENT_LIST_DIR}/pyside-config.qdocconf"
+ " -I ${QT_INCLUDE_DIR}Qt${module} \\\n"
+ " -I ${QT_INCLUDE_DIR}Qt${module}/${Qt${QT_MAJOR_VERSION}Core_VERSION} \\\n"
+ " -I ${QT_INCLUDE_DIR}Qt${module}/${Qt${QT_MAJOR_VERSION}Core_VERSION}/Qt${module} \\\n")
+
+ if (${moduleIn} STREQUAL "X11Extras")
+ set(globalHeader "QX11Info")
+ else()
+ set(globalHeader "Qt${module}")
+ endif()
+ set(docHeaderContents "${docHeaderContents}\n#include <Qt${module}/${globalHeader}>")
+ set(typeSystemDocXmlContents "${typeSystemDocXmlContents}\n<load-typesystem name=\"Qt${module}/typesystem_${lowerModule}.xml\" generate=\"yes\"/>")
+ endforeach()
+ endif()
+ endforeach()
+
+ #Appending the additional qdocconf that describes the pyside-examples
+ #doc project.
+ configure_file("qtmodules/pyside-examples.qdocconf.in" "${CMAKE_CURRENT_LIST_DIR}/qtmodules/pyside-examples.qdocconf" @ONLY)
+ file(APPEND "pyside.qdocconf.in" "\@CMAKE_CURRENT_LIST_DIR\@/qtmodules/pyside-examples.qdocconf\n")
+
+ set(typeSystemDocXmlContents "${typeSystemDocXmlContents}\n</typesystem>\n")
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/typesystem_doc.xml" "${typeSystemDocXmlContents}")
+
+ set(docHeader "${pyside6_BINARY_DIR}/qdoc.h")
+ file(WRITE ${docHeader} "${docHeaderContents}")
+ configure_file("pyside.qdocconf.in" "pyside.qdocconf" @ONLY)
+
+
+ set(QDOC_TYPESYSTEM_PATH "${pyside6_SOURCE_DIR}${PATH_SEP}${pyside6_BINARY_DIR}")
+
+ add_custom_target(qdoc
+ # Use dummy Qt version information, QDoc needs it but has no effect on WebXML output
+ COMMAND ${CMAKE_COMMAND} -E env BUILDDIR=${CMAKE_CURRENT_LIST_DIR}/src QT_INSTALL_DOCS=${QT_SRC_DIR}/doc
+ QT_VERSION=${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}
+ QT_VER=${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}
+ QT_VERSION_TAG=${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}
+ qdoc pyside.qdocconf -single-exec -installdir ${DOC_DATA_DIR} -outputdir ${DOC_DATA_DIR}
+ COMMENT "Running qdoc against Qt source code..."
+ SOURCE "pyside.qdocconf")
+endif()
+
+# conditional tag for sphinx build
+#string(JOIN "_" SPHINX_TAG ${DOC_OUTPUT_FORMAT} "format")
+# Python script to replace the virtualFolder string in the QHP
+set(py_cmd "from __future__ import print_function
+import fileinput
+import re
+try:
+\tfor line in fileinput.input('html/PySide.qhp',inplace=True,backup='.bak'):
+\t\tline_copy=line.strip()
+\t\tif not line_copy: # check for empty line
+\t\t\tcontinue
+\t\tmatch=re.match('(^.*virtualFolder.)doc(.*$)',line)
+\t\tif match:
+\t\t\trepl=''.join([match.group(1),'pyside6',match.group(2)])
+\t\t\tprint(line.replace(match.group(0),repl),end='')
+\t\telse:
+\t\t\tprint(line)
+except:
+\tpass\n")
+file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/py_script.py CONTENT ${py_cmd})
+
+add_custom_target(apidoc
+ COMMAND ${SHIBOKEN_PYTHON_INTERPRETER} ${SPHINX_BUILD} -b ${DOC_OUTPUT_FORMAT} ${CMAKE_CURRENT_BINARY_DIR}/rst html
+ COMMENT "Generating PySide htmls..."
+ )
+
+# create a custom commands to copy the shiboken docs
+# and generate offline help based on the output format.
+if(DOC_OUTPUT_FORMAT STREQUAL "html")
+ add_custom_command(TARGET apidoc POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/html/shiboken6
+ COMMAND ${CMAKE_COMMAND} -E copy_directory
+ ${CMAKE_CURRENT_BINARY_DIR}/../../shiboken6/doc/html
+ ${CMAKE_CURRENT_BINARY_DIR}/html/shiboken6
+ COMMENT "Copying Shiboken docs..."
+ VERBATIM)
+else()
+ file(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/html/PySide.qhp QHP_FILE)
+ add_custom_command(TARGET apidoc POST_BUILD
+ COMMAND ${PYTHON_EXECUTABLE} py_script.py
+ COMMAND qhelpgenerator ${QHP_FILE}
+ COMMENT "Generating QCH from a QHP file..."
+ VERBATIM)
+endif()
+
+# create conf.py based on conf.py.in
+configure_file("conf.py.in" "rst/conf.py" @ONLY)
+
+add_custom_target("docrsts"
+ COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/rst
+ COMMAND Shiboken6::shiboken6 --generator-set=qtdoc ${docHeader}
+ --include-paths="${QT_INCLUDE_DIR}${PATH_SEP}${pyside6_SOURCE_DIR}${PATH_SEP}${TS_ROOT}"
+ --api-version=${SUPPORTED_QT_VERSION}
+ --typesystem-paths="${QDOC_TYPESYSTEM_PATH}"
+ --library-source-dir=${QT_SRC_DIR}
+ --documentation-data-dir=${DOC_DATA_DIR}/webxml
+ --output-directory=${CMAKE_CURRENT_BINARY_DIR}/rst
+ --documentation-code-snippets-dir=${CMAKE_CURRENT_BINARY_DIR}/rst/codesnippets/doc/src/snippets${PATH_SEP}${CMAKE_CURRENT_BINARY_DIR}/rst/codesnippets/examples
+ --documentation-extra-sections-dir=${CMAKE_CURRENT_BINARY_DIR}/rst/extras
+ --additional-documentation=${CMAKE_CURRENT_BINARY_DIR}/rst/additionaldocs.lst
+ ${CMAKE_CURRENT_BINARY_DIR}/typesystem_doc.xml
+ WORKING_DIRECTORY ${${module}_SOURCE_DIR}
+ COMMENT "Running generator to generate documentation..."
+)
+
+add_custom_target("licensedocrsts"
+ COMMAND ${PYTHON_EXECUTABLE}
+ ${CMAKE_CURRENT_LIST_DIR}/qtattributionsscannertorst.py
+ ${CMAKE_CURRENT_LIST_DIR}/../../..
+ ${CMAKE_CURRENT_BINARY_DIR}/rst/licenses.rst
+ COMMENT "Creating 3rdparty license documentation..."
+)
+
+if (FULLDOCSBUILD)
+ add_dependencies(apidoc docrsts licensedocrsts)
+ add_dependencies(licensedocrsts docrsts)
+ add_dependencies(docrsts qdoc)
+endif()
+
+#install files
+add_custom_target(apidocinstall
+ COMMAND mkdir -p ${CMAKE_INSTALL_PREFIX}/share/doc/PySide6-${BINDING_API_VERSION} && cp -rv ${CMAKE_CURRENT_BINARY_DIR}/html/* ${CMAKE_INSTALL_PREFIX}/share/doc/PySide-${BINDING_API_VERSION}
+)
+
+add_dependencies(apidocinstall apidoc)
diff --git a/sources/pyside6/doc/_templates/layout.html b/sources/pyside6/doc/_templates/layout.html
new file mode 100644
index 000000000..6ab1276a3
--- /dev/null
+++ b/sources/pyside6/doc/_templates/layout.html
@@ -0,0 +1,40 @@
+{% extends "!layout.html" %}
+
+# Invert sidebars
+{%- block sidebar1 %}{{ sidebar() }}{%- endblock %}
+{%- block sidebar2 %}{%- endblock %}
+
+{%- block header %}
+<div id="container">
+<div class="header">
+ <div class="header_container">
+ <div class="logo"><a href="http://www.pyside.org"><img alt="PySide" src="{{ pathto('_static/pysidelogo.png', 1) }}"/></a></div>
+ <div class="related">
+ <ul>
+ {%- block rootrellink %}
+ <li><a href="{{ pathto( 'index' ) }}">{{ shorttitle|e }}</a></li>
+ {%- endblock %}
+ {%- for parent in parents %}
+ <li>{{ reldelim1 }} <a href="{{ parent.link|e }}" {% if loop.last %}{{ accesskey("U") }}{% endif %}>{{ parent.title }}</a></li>
+ {%- endfor %}
+ {%- block relbaritems %} {% endblock %}
+ </ul>
+ </div>
+ </div>
+</div>
+{%- endblock -%}
+
+{%- block footer %}
+ <div class="footer">
+ <a href="http://www.qt.io/"><img src="{{ pathto('_static/logo_qt.png', 1) }}" alt="Qt" border="0" /></a>
+ <a href="http://www.python.org"><img src="{{ pathto('_static/logo_python.jpg', 1) }}" alt="Python" border="0" /></a>
+ <p>{{ copyright }}</p>
+ </div>
+</div>
+{%- endblock %}
+
+# No top relbar.
+{%- block relbar1 %}{%- endblock %}
+
+# No bottom relbar.
+{%- block relbar2 %}{%- endblock %}
diff --git a/sources/pyside6/doc/_themes/pysidedocs/domainindex.html b/sources/pyside6/doc/_themes/pysidedocs/domainindex.html
new file mode 100644
index 000000000..c136cdd1c
--- /dev/null
+++ b/sources/pyside6/doc/_themes/pysidedocs/domainindex.html
@@ -0,0 +1,57 @@
+{#
+ basic/domainindex.html
+ ~~~~~~~~~~~~~~~~~~~~~~
+
+ Template for domain indices (module index, ...).
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+#}
+{% extends "layout.html" %}
+{% set title = indextitle %}
+{% block extrahead %}
+{{ super() }}
+{% if not embedded and collapse_index %}
+ <script type="text/javascript">
+ DOCUMENTATION_OPTIONS.COLLAPSE_INDEX = true;
+ </script>
+{% endif %}
+{% endblock %}
+{% block body %}
+<div class="section">
+ {%- set curr_group = 0 %}
+
+ <h1>{{ indextitle }}</h1>
+
+ <div class="modindex-jumpbox">
+ {%- for (letter, entries) in content %}
+ <a href="#cap-{{ letter }}"><strong>{{ letter }}</strong></a>
+ {%- if not loop.last %} | {% endif %}
+ {%- endfor %}
+ </div>
+
+ <table class="indextable modindextable" cellspacing="0" cellpadding="2">
+ {%- for letter, entries in content %}
+ <tr class="pcap"><td></td><td>&nbsp;</td><td></td></tr>
+ <tr class="cap"><td></td><td><a name="cap-{{ letter }}">
+ <strong>{{ letter }}</strong></a></td><td></td></tr>
+ {%- for (name, grouptype, page, anchor, extra, qualifier, description)
+ in entries %}
+ {%- if grouptype == 1 %}{% set curr_group = curr_group + 1 %}{% endif %}
+ <tr{% if grouptype == 2 %} class="cg-{{ curr_group }}"{% endif %}>
+ <td>{% if grouptype == 1 -%}
+ <img src="{{ pathto('_static/minus.png', 1) }}" id="toggle-{{ curr_group }}"
+ class="toggler" style="display: none" alt="-" />
+ {%- endif %}</td>
+ <td>{% if grouptype == 2 %}&nbsp;&nbsp;&nbsp;{% endif %}
+ {% if page %}<a href="{{ pathto(page) }}#{{ anchor }}">{% endif -%}
+ <tt class="xref">{{ name|e }}</tt>
+ {%- if page %}</a>{% endif %}
+ {%- if extra %} <em>({{ extra|e }})</em>{% endif -%}
+ </td><td>{% if qualifier %}<strong>{{ qualifier|e }}:</strong>{% endif %}
+ <em>{{ description|e }}</em></td></tr>
+ {%- endfor %}
+ {%- endfor %}
+ </table>
+</div>
+{% endblock %}
diff --git a/sources/pyside6/doc/_themes/pysidedocs/searchbox.html b/sources/pyside6/doc/_themes/pysidedocs/searchbox.html
new file mode 100644
index 000000000..55a972156
--- /dev/null
+++ b/sources/pyside6/doc/_themes/pysidedocs/searchbox.html
@@ -0,0 +1,12 @@
+{%- if pagename != "search" %}
+<div id="searchbox" style="display: none">
+ <h3>{{ _('Quick search') }}</h3>
+ <form class="search" action="{{ pathto('search') }}" method="get">
+ <input type="text" name="q" id="q" size="18" />
+ <input type="submit" value="{{ _('Go') }}" id="search_button" />
+ <input type="hidden" name="check_keywords" value="yes" />
+ <input type="hidden" name="area" value="default" />
+ </form>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+{%- endif %}
diff --git a/sources/pyside6/doc/_themes/pysidedocs/static/bg_header.png b/sources/pyside6/doc/_themes/pysidedocs/static/bg_header.png
new file mode 100644
index 000000000..843e7e2c5
--- /dev/null
+++ b/sources/pyside6/doc/_themes/pysidedocs/static/bg_header.png
Binary files differ
diff --git a/sources/pyside6/doc/_themes/pysidedocs/static/bg_topo.jpg b/sources/pyside6/doc/_themes/pysidedocs/static/bg_topo.jpg
new file mode 100644
index 000000000..4229ae8db
--- /dev/null
+++ b/sources/pyside6/doc/_themes/pysidedocs/static/bg_topo.jpg
Binary files differ
diff --git a/sources/pyside6/doc/_themes/pysidedocs/static/fakebar.png b/sources/pyside6/doc/_themes/pysidedocs/static/fakebar.png
new file mode 100644
index 000000000..b45830e00
--- /dev/null
+++ b/sources/pyside6/doc/_themes/pysidedocs/static/fakebar.png
Binary files differ
diff --git a/sources/pyside6/doc/_themes/pysidedocs/static/logo_python.jpg b/sources/pyside6/doc/_themes/pysidedocs/static/logo_python.jpg
new file mode 100644
index 000000000..cd474efba
--- /dev/null
+++ b/sources/pyside6/doc/_themes/pysidedocs/static/logo_python.jpg
Binary files differ
diff --git a/sources/pyside6/doc/_themes/pysidedocs/static/logo_qt.png b/sources/pyside6/doc/_themes/pysidedocs/static/logo_qt.png
new file mode 100644
index 000000000..3bc03b7c7
--- /dev/null
+++ b/sources/pyside6/doc/_themes/pysidedocs/static/logo_qt.png
Binary files differ
diff --git a/sources/pyside6/doc/_themes/pysidedocs/static/minus.png b/sources/pyside6/doc/_themes/pysidedocs/static/minus.png
new file mode 100644
index 000000000..da1c5620d
--- /dev/null
+++ b/sources/pyside6/doc/_themes/pysidedocs/static/minus.png
Binary files differ
diff --git a/sources/pyside6/doc/_themes/pysidedocs/static/plus.png b/sources/pyside6/doc/_themes/pysidedocs/static/plus.png
new file mode 100644
index 000000000..b3cb37425
--- /dev/null
+++ b/sources/pyside6/doc/_themes/pysidedocs/static/plus.png
Binary files differ
diff --git a/sources/pyside6/doc/_themes/pysidedocs/static/pyside.css b/sources/pyside6/doc/_themes/pysidedocs/static/pyside.css
new file mode 100644
index 000000000..f6a1c5ae4
--- /dev/null
+++ b/sources/pyside6/doc/_themes/pysidedocs/static/pyside.css
@@ -0,0 +1,2076 @@
+@import url('cookie-confirm.css') screen;
+
+/* -- admonitions -- */
+
+div.admonition {
+ margin: 1.5em 0 1.5em;
+ padding: 0;
+}
+
+div.admonition dt {
+ font-weight: bold;
+}
+
+div.admonition dl {
+ margin-bottom: 0;
+}
+
+p.admonition-title {
+ margin: 0px 10px 5px 0px;
+ font-weight: bold;
+}
+
+div.admonition code {
+ font-family: inherit;
+}
+
+p.admonition-title + p {
+ padding-left: 1em;
+}
+
+div.admonition a:after {
+ content: ', ';
+}
+
+div.admonition a:last-child:after {
+ content: '';
+}
+
+.body {
+ width: 100%
+}
+.bodywrapper .admonition p.admonition-title {
+ margin-bottom:5px
+}
+
+.bodywrapper .admonition p {
+ margin:0
+}
+
+div.body p.centered {
+ text-align: center;
+ margin-top: 25px;
+}
+
+div.warning, div.seealso, div.note {
+ padding: 6px 0px 6px 10px;
+ border: none;
+}
+
+div.warning {
+ background-color: #ffe4e4;
+}
+
+div.seealso {
+ background-color: #fff2d6;
+}
+
+div.note {
+ background-color: #f3f3f4;
+}
+
+table.docutils {
+ margin-right: auto;
+ margin-bottom: 10px;
+ border: none;
+ width: initial;
+}
+
+table.docutils.colwidths-given td {
+ float: none;
+}
+
+table.docutils th,
+table.docutils td {
+ padding-left:0;
+ border: none;
+}
+
+table.docutils td ul {
+ margin:0
+}
+
+table.docutils td ul > li {
+ margin: 0 0 0.5em;
+}
+h2 em {
+ float: right;
+ font-size: 10px;
+ position: relative;
+ top: -20px;
+}
+
+.document {
+ padding-bottom: 20px;
+}
+
+.documentwrapper {
+ margin-left: 255px;
+}
+
+.body blockquote {
+ border: none;
+ padding-left: 0;
+ margin-bottom: 1.5em;
+}
+
+.sphinxsidebar {
+ float: left;
+ width: 186px;
+ padding: 25px;
+ text-align: left;
+ background-color: #fff;
+}
+
+.sphinxsidebar ul {
+ padding: 0px;
+ margin: 0px;
+ list-style-position: inside;
+}
+
+.sphinxsidebar > ul {
+ padding: 0px;
+ margin: 0px;
+}
+
+.sphinxsidebar ul li li {
+ margin-left: 10px;
+ padding: 0px;
+ font-size: 0.95em;
+}
+
+.sphinxsidebar ul a,
+.sphinxsidebar p.topless a {
+ word-break: break-word;
+}
+
+.sphinxsidebar h3, .sphinxsidebar h3 a {
+ color: #333;
+}
+
+.sphinxsidebar p.topless {
+ margin: 1em 0 1em;
+}
+
+.pysidetoc ul {
+ list-style: none;
+ padding: 0px;
+ margin: 0px;
+}
+
+.pysidetoc em {
+ font-style: normal;
+}
+
+.pysidetoc strong {
+ display: block;
+ padding: 5px;
+ margin: 0 10px 10px 0;
+ border: none;
+ background-color: #e2e2e2;
+}
+
+.section .docutils.container td {
+ float:left;
+}
+
+.hide {
+ display: none;
+}
+
+/* copy-notice */
+.document + p {
+ margin-left: 255px;
+ width: 70%;
+ font-size: 0.75em;
+ margin: 0 35px 15px 280px;
+}
+
+#searchbox {
+ border-top: 1px solid #989898;
+ padding-top: 10px;
+ margin-left: -10px;
+ margin-right: -10px;
+ padding-left: 10px;
+ padding-right: 10px;
+}
+
+#search_button {
+ border: 1px solid #3A393A;
+ background-color: #3A393A;
+ color: white;
+ cursor: pointer;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -khtml-border-radius: 5px;
+
+}
+
+form {
+ margin: 0px;
+ padding: 0px;
+}
+
+#searchbox h3 {
+ padding: 10px 0 0 0;
+ margin-bottom: 5px;
+}
+
+/* search field */
+form #q {
+ width: 136px;
+ /* height: 22px; */
+ /* border: none; */
+ margin: 0px;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -khtml-border-radius: 5px;
+ margin-top: 2px;
+ padding: 4px;
+ line-height: 22px;
+}
+
+#search-results h2 {
+ display: none;
+}
+
+#search-results h2 {
+ display: none;
+}
+
+#search-results ul.search {
+ margin: 0px;
+ padding: 0px;
+}
+
+ul.search div.context {
+ padding-left: 40px;
+}
+
+#installation td {
+ text-align: center;
+ font-weight: bold;
+}
+
+em {
+ color: inherit;
+ font-style:italic;
+}
+
+/******** REL bar *********/
+
+.related {
+ display: inline;
+}
+
+.related h3 {
+ display: none;
+}
+
+.align-center {
+ text-align: center;
+}
+
+.contentstable {
+ width: 100%;
+}
+
+.contentstable td {
+ padding-left: 30px;
+ vertical-align: top;
+}
+
+p.biglink a {
+ font-size: 20px;
+}
+
+dt:target, .highlight {
+ background-color: #fbe54e;
+}
+
+p.highlight-link {
+ margin-top: 10px;
+ font-size: 0.8em;
+}
+
+#synopsis table, table.field-list {
+ margin: 1em 0 1em 0;
+}
+
+table.field-list tr {
+ text-align: left;
+}
+
+tt.descname {
+ font-size: 120%;
+ font-weight: bold;
+}
+
+#functions ul, #virtual-functions ul, #slots ul, #signals ul, #static-functions ul {
+ margin: 0;
+ padding: 6px;
+ border: 1px solid #ddd;
+ border-radius: 0;
+ background-color: #e2e2e2;
+}
+
+#functions p, #virtual-functions p, #slots p, #signals p, #static-functions p {
+ margin: 0;
+ padding: 0;
+}
+
+#functions li, #virtual-functions li, #slots li, #signals li, #static-functions li {
+ list-style: none;
+ margin: 5px;
+ padding: 0;
+ font-size: 90%;
+}
+
+#synopsis span.pre {
+ color: #009491;
+ font-weight: bolder;
+}
+
+#detailed-description .class dt,
+#detailed-description .method dt,
+#detailed-description .staticmethod dt,
+#detailed-description .attribute dt {
+ margin: 0px;
+ margin-bottom: 10px;
+ padding: 10px;
+ font-weight: bold;
+ background-color: #e2e2e2;
+ border: none;
+ border-radius: 0;
+}
+
+#detailed-description dd > blockquote,
+#detailed-description dd > .field-list {
+ font-family: 'Droid Sans Mono';
+ font-size: small;
+ border-left: 10px solid #e2e2e2;
+ padding-left: 10px;
+ margin-bottom: 1.5em;
+}
+
+#detailed-description dd > blockquote blockquote {
+ border: none;
+ padding: 0;
+}
+
+#detailed-description .class .field-odd,
+#detailed-description .method .field-odd,
+#detailed-description .staticmethod .field-odd,
+#detailed-description .attribute .field-odd {
+ margin: 0;
+ padding: 1px 0 0 0;
+ background-color: #ffffff;
+
+}
+
+#detailed-description .class .field-even,
+#detailed-description .method .field-even,
+#detailed-description .staticmethod .field-even,
+#detailed-description .attribute .field-even {
+ margin: 0;
+ padding: 1px 0 0 0;
+ background-color: #ffffff;
+}
+
+#detailed-description .class .field-odd li,
+#detailed-description .method .field-odd li,
+#detailed-description .staticmethod .field-odd li,
+#detailed-description .attribute .field-odd li {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+
+}
+
+#detailed-description .class .field-even li,
+#detailed-description .method .field-even li,
+#detailed-description .staticmethod .field-even li,
+#detailed-description .attribute .field-even li {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+}
+
+#detailed-description .class .field-odd p,
+#detailed-description .method .field-odd p,
+#detailed-description .staticmethod .field-odd p,
+#detailed-description .attribute .field-odd p{
+ margin: 0;
+ margin-left: 20px;
+
+}
+
+#detailed-description .class .field-even p,
+#detailed-description .method .field-even p,
+#detailed-description .staticmethod .field-even p,
+#detailed-description .attribute .field-even p{
+ margin: 0;
+ margin-left: 20px;
+}
+
+#detailed-description .class .field-odd p:last-child,
+#detailed-description .method .field-odd p:last-child,
+#detailed-description .staticmethod .field-odd p:last-child,
+#detailed-description .attribute .field-odd p:last-child {
+ margin-bottom: 10px;
+
+}
+
+#detailed-description .class .field-even p:last-child,
+#detailed-description .method .field-even p:last-child,
+#detailed-description .staticmethod .field-even p:last-child,
+#detailed-description .attribute .field-even p:last-child{
+ margin-bottom: 10px;
+}
+
+.document dl.attribute,
+.document dl.class,
+.document dl.method,
+.document dl.staticmethod {
+ margin-top: 2em;
+}
+
+.document dl.attribute dd,
+.document dl.class dd,
+.document dl.method dd,
+.document dl.staticmethod dd {
+ padding-left: 1em;
+}
+
+#detailed-description .attribute td:nth-child(1) {
+ font-family: 'Droid Sans Mono';
+}
+
+/* Qt theme */
+#navbar {
+ position:fixed;
+ top:0;
+ left:0;
+ z-index:100;
+ background:#fff;
+ width:100%
+}
+#navbar .container, .fixed .container {
+ max-width:1280px;
+ margin:0 auto;
+ padding:0 3.9%; /* 0? */
+ position:relative;
+ overflow:visible
+}
+#navbar .navbar-header {
+ position:relative
+}
+#menuextras li a:hover span {
+ color: #41cd52;
+}
+/* new header */
+#mm-wrap, #mm-wrap #mm-helper,
+#mm-wrap #mm-helper li.mm-item,
+#mm-wrap #mm-helper a.mm-link {
+ -moz-transition: none;
+ -o-transition: none;
+ -webkit-transition: none;
+ transition: none;
+ -webkit-border-radius: 0 0 0 0;
+ -moz-border-radius: 0 0 0 0;
+ -ms-border-radius: 0 0 0 0;
+ -o-border-radius: 0 0 0 0;
+ border-radius: 0 0 0 0;
+ -webkit-box-shadow: none;
+ -moz-box-shadow: none;
+ -ms-box-shadow: none;
+ -o-box-shadow: none;
+ box-shadow: none;
+ background: none;
+ border: 0;
+ bottom: auto;
+ box-sizing: border-box;
+ clip: auto;
+ color: #090e21;
+ display: block;
+ float: none;
+ font-family: inherit;
+ font-size: 14px;
+ height: auto;
+ left: auto;
+ line-height: 1.7;
+ list-style-type: none;
+ margin: 0;
+ min-height: 0;
+ opacity: 1;
+ outline: none;
+ overflow: visible;
+ padding: 0;
+ position: relative;
+ right: auto;
+ text-align: left;
+ text-decoration: none;
+ text-transform: none;
+ top: auto;
+ vertical-align: baseline;
+ visibility: inherit;
+ width: auto;
+}
+#mm-wrap #mm-helper {
+ visibility:visible;
+ text-align:right;
+ padding:0 0px 0 0px
+}
+#navbar #mm-wrap #mm-helper li.mm-item {
+ border-right:solid #f3f3f4 1px;
+ padding-right:30px;
+ padding-left:30px
+}
+#navbar #mm-wrap #mm-helper li.mm-item > a:hover {
+ opacity: .5
+}
+#mm-wrap #mm-helper > li.mm-item {
+ margin:0 0 0 0;
+ display:inline-block;
+ height:auto;
+ vertical-align:middle
+}
+#navbar #mm-wrap #mm-helper li.mm-item:nth-child(3) {
+ border-right:0
+}
+#mm-wrap #mm-helper a.mm-link {
+ cursor: pointer
+}
+@media (max-width: 1279px) {
+ #navbar {
+ padding:0;
+ position:relative;
+ }
+ #navbar .container {
+ max-width:100%
+ }
+ .container {
+ padding:0 2%
+ }
+ .sphinxsidebar {
+ top: 16px !important;
+ }
+}
+#navbar .navbar-oneQt {
+ display:inline;
+ float:left;
+ width:31px;
+ color:#41cd52
+}
+#navbar .navbar-oneQt:before {
+ content:attr(data-icon);
+ position:absolute;
+ top:14px;
+ left:0;
+ color:#41cd52;
+ font-family:'Qt Icons';
+ line-height:1;
+ font-size:40px;
+ transition:all 0.3s ease-in-out;
+}
+#mm-wrap {
+ clear:both;
+ background:rgba(255, 255, 255, 0.1);
+ -webkit-border-radius:0px 0px 0px 0px;
+ -moz-border-radius:0px 0px 0px 0px;
+ -ms-border-radius:0px 0px 0px 0px;
+ -o-border-radius:0px 0px 0px 0px;
+ border-radius:0px 0px 0px 0px
+}
+#mm-wrap #mm-helper li.mm-item:last-child a {
+ background:transparent url("icon_avatar.png") 50% 50% no-repeat !important;
+ background-size:24px !important;
+ width:24px !important;
+ height:24px !important;
+}
+#navbar #mm-wrap #mm-helper li.mm-item > a {
+ opacity:1;
+ -webkit-transition:all 0.3s ease-in-out;
+ -moz-transition:all 0.3s ease-in-out;
+ -ms-transition:all 0.3s ease-in-out;
+ -o-transition:all 0.3s ease-in-out;
+ transition:all 0.3s ease-in-out;
+}
+#mm-wrap #mm-helper > li.mm-item > a.mm-link {
+ border-top:0px solid #fff;
+ border-left:0px solid #fff;
+ border-right:0px solid #fff;
+ border-bottom:0px solid #fff;
+ outline:none;
+ text-decoration:none;
+ padding:0 0 0 0;
+ line-height:70px;
+ font-weight:normal;
+ height:70px;
+ vertical-align:baseline;
+ text-align:left;
+ width:auto;
+ display:block;
+ color:#090e21;
+ text-transform:none;
+ text-decoration:none;
+ background:rgba(0, 0, 0, 0);
+ -webkit-border-radius:0px 0px 0px 0px;
+ -moz-border-radius:0px 0px 0px 0px;
+ -ms-border-radius:0px 0px 0px 0px;
+ -o-border-radius:0px 0px 0px 0px;
+ border-radius:0px 0px 0px 0px;
+ font-family:inherit;
+ font-size:14px;
+}
+/* end new header */
+@media (min-width: 1320px) {
+ .body .flowListDiv dl.flowList {
+ -webkit-column-count:3;
+ -moz-column-count:3;
+ column-count:3
+ }
+}
+@media (min-width: 1120px) {
+ #navbar.fixed {
+ -moz-box-shadow:0px 0px 8px rgba(0,0,0,0.23);
+ -webkit-box-shadow:0px 0px 8px rgba(0,0,0,0.23);
+ box-shadow:0px 0px 8px rgba(0,0,0,0.23)
+ }
+ #navbar.fixed #mm-wrap #mm-helper > li.mm-item > a.mm-link {
+ height:50px;
+ line-height:50px
+ }
+ #navbar.fixed .navbar-oneQt:before {
+ font-size:35px;
+ top:7px
+ }
+
+ .flowListDiv dl.flowList {
+ -webkit-column-count:2;
+ -moz-column-count:2;
+ column-count:2
+ }
+}
+@media (max-width: 1120px) {
+ #navbar {
+ padding:0;
+ position:relative
+ }
+ #navbar .navbar-oneQt:before {
+ left:10px
+ }
+ #navbar .container {
+ max-width:100%;
+ padding:0
+ }
+ #footerbar .container {
+ padding:0
+ }
+ body .main {
+ margin-top:0px
+ }
+ #footerbar .footer-main .footer-nav {
+ padding:3.9% 0 3.9% 3%;
+ border-bottom:1px solid #413d3b;
+ float:none;
+ display:block;
+ width:auto
+ }
+ #footerbar .footer-main .theqtcompany {
+ clear:both;
+ float:left;
+ margin:30px 0 8px 3%
+ }
+ #footerbar .footer-main .footer-social {
+ float:left;
+ padding:50px 0px 0px 3%
+ }
+ #footerbar #menu-footer-submenu {
+ clear:both;
+ float:none;
+ display:block;
+ padding:0px 0px 3.9% 3%
+ }
+ ul#menu-footer-submenu {
+ margin-left: 0
+ }
+}
+.cookies_yum {
+ background-color:#cecfd5;
+ display:none;
+ width:100%
+}
+.cookies_yum img {
+ width:25px;
+ top:6px;
+ display:inline-block;
+ position:absolute;
+ left:13px
+}
+.cookies_yum div {
+ margin:0 auto;
+ max-width:1280px;
+ min-height:30px;
+ padding:6px 0px 6px 0px;
+ position:relative
+}
+.cookies_yum p {
+ color:#09102b;
+ margin:0px;
+ font-size:0.79em;
+ display:inline-block;
+ line-height:1.2;
+ padding:0 30px 0 50px
+}
+.cookies_yum p a {
+ white-space:nowrap
+}
+.cookies_yum a:hover {
+ color:#46a2da
+}
+.cookies_yum .close {
+ width:15px;
+ height:15px;
+ background-image:url("cookiebar-x.png");
+ background-size:15px 30px;
+ background-position:top left;
+ cursor:pointer;
+ top:13px;
+ right:13px;
+ position:absolute;
+ transition:none
+}
+.cookies_yum .close:hover {
+ background-position:bottom left
+}
+#sidebar-toggle,#toc-toggle {
+ width:24px;
+ height:14px;
+ background-size:24px 28px;
+ cursor:pointer;
+ background-image:url("list_expand.png");
+ float:right
+}
+#sidebar-toggle.collapsed,
+#toc-toggle.collapsed {
+ background-position:bottom left
+}
+#sidebar-content > h2 {
+ display:none
+}
+#footerbar {
+ background:#222840;
+ color:#fff;
+ font-size: 0.9em;
+}
+#footerbar.fixed {
+ bottom:0;
+ left:0;
+ width:100%
+}
+#footerbar .footer-nav {
+ display:inline;
+ float:left
+}
+#footerbar .footer-main .footer-nav li {
+ float:left;
+ margin-right:1em
+}
+#footerbar .footer-main .footer-nav li a {
+ display:block;
+ padding:30px 0 10px 0;
+ line-height:20px;
+ height:20px;
+ color:#fff;
+ font-weight: 600;
+}
+#footerbar .footer-main .footer-nav li a:hover,#footerbar .footer-main .footer-nav li.current-menu-item a {
+ color:#eee
+}
+#footerbar .footer-main .footer-nav .sub-menu {
+ margin-left:0;
+ margin-bottom:0
+}
+#footerbar .footer-main .footer-nav .sub-menu li {
+ float:none;
+ width: 100%;
+}
+#footerbar .footer-main .footer-nav .sub-menu ul {
+ padding:1px 1em;
+ font-size:0.786em;
+ line-height:8px;
+ float:none;
+ color:#5d5b59;
+ margin-bottom:0
+}
+#footerbar .footer-main .footer-nav .sub-menu li a {
+ padding:2px 0;
+ font-size:1em;
+ float:none;
+ color:#cecfd5;
+ font-weight: 400;
+}
+#footerbar .footer-main .footer-nav .sub-menu li a:hover,#footerbar .footer-main .footer-nav .sub-menu li.current-menu-item a {
+ color:#eee
+}
+#footerbar .theqtcompany {
+ background:url("theqtcompany.png") no-repeat;
+ background-size:100%;
+ width:215px;
+ height:68px;
+ display:inline;
+ float:right;
+ margin:29px 0 28px 30px
+}
+#footerbar .footer-social {
+ display:inline;
+ float:right;
+ width:164px
+}
+#footerbar .footer-main .footer-social>div {
+ margin-left:0.1em;
+ margin-bottom:10px
+}
+#footerbar .disclaimer {
+ font-size:0.786em;
+ line-height:2.73;
+ color:#868584;
+ padding-top:20px;
+ padding-bottom:0.5%
+}
+#footerbar .disclaimer a {
+ color:#bdbebf
+}
+#footerbar .disclaimer a:hover {
+ color:#d6d6d6
+}
+#footerbar .disclaimer ul li {
+ float:left;
+ vertical-align:middle;
+ margin-left:1.18em
+}
+#footerbar .disclaimer ul li:first-child {
+ margin-left:0
+}
+#footerbar .disclaimer ul.lang-selector a {
+ color:#506a34;
+ color:rgba(128,195,66,0.3)
+}
+#footerbar .disclaimer ul.lang-selector a:hover {
+ color:#80c342;
+ color:rgba(128,195,66,0.7)
+}
+#menu-footer-menu, #menu-footer-menu ul {
+ margin-left:0;
+ margin-bottom:0
+}
+@font-face {
+ font-family: 'Titillium Web';
+ font-style: normal;
+ font-weight: 400;
+ src: url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-regular.eot");
+ /* IE9 Compat Modes */
+ src: local("Titillium Web"), local("TitilliumWeb-Regular"), url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-regular.eot?#iefix") format("embedded-opentype"), url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-regular.woff2") format("woff2"), url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-regular.woff") format("woff"), url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-regular.ttf") format("truetype"), url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-regular.svg#TitilliumWeb") format("svg");
+ /* Legacy iOS */
+}
+/* titillium-web-italic - latin_latin-ext */
+@font-face {
+ font-family: 'Titillium Web';
+ font-style: italic;
+ font-weight: 400;
+ src: url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-italic.eot");
+ /* IE9 Compat Modes */
+ src: local("Titillium WebItalic"), local("TitilliumWeb-Italic"), url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-italic.eot?#iefix") format("embedded-opentype"), url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-italic.woff2") format("woff2"), url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-italic.woff") format("woff"), url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-italic.ttf") format("truetype"), url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-italic.svg#TitilliumWeb") format("svg");
+ /* Legacy iOS */
+}
+/* titillium-web-600 - latin_latin-ext */
+@font-face {
+ font-family: 'Titillium Web';
+ font-style: normal;
+ font-weight: 600;
+ src: url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-600.eot");
+ /* IE9 Compat Modes */
+ src: local("Titillium WebSemiBold"), local("TitilliumWeb-SemiBold"), url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-600.eot?#iefix") format("embedded-opentype"), url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-600.woff2") format("woff2"), url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-600.woff") format("woff"), url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-600.ttf") format("truetype"), url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-600.svg#TitilliumWeb") format("svg");
+ /* Legacy iOS */
+}
+@font-face {
+ font-family:'Droid Sans Mono';
+ font-style:normal;
+ font-weight:400;
+ src:local("Droid Sans Mono"),local("DroidSansMono"),url(//fonts.gstatic.com/s/droidsansmono/v7/ns-m2xQYezAtqh7ai59hJUYuTAAIFFn5GTWtryCmBQ4.woff) format("woff")
+}
+@font-face {
+ font-family:'Qt Icons';
+ src:url("../style/icomoon.eot?-tgjuoj");
+ src:url("../style/icomoon.eot?#iefix-tgjuoj") format("embedded-opentype"),url("../style/icomoon.woff?-tgjuoj") format("woff"),url("../style/icomoon.ttf?-tgjuoj") format("truetype"),url("../style/icomoon.svg?-tgjuoj#icomoon") format("svg");
+ font-weight:normal;
+ font-style:normal
+}
+@font-face {
+ font-family:'social-icons';
+ src:url("../style/social-icons.eot?54625607");
+ src:url("../style/social-icons.eot?54625607#iefix") format("embedded-opentype"),
+ url("../style/social-icons.woff?54625607") format("woff");
+ font-weight:normal;
+ font-style:normal
+}
+.clearfix:before,.clearfix:after {
+ content:" ";
+ display:table
+}
+.clearfix:after {
+ clear:both
+}
+.clearfix {
+ *zoom:1
+}
+.clearfix .right {
+ float:right
+}
+html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video {
+ margin:0;
+ padding:0;
+ border:0;
+ font-size:100%
+ line-height: 1.4;
+}
+html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,caption,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video {
+ vertical-align:baseline
+}
+h1,h2,h3,h4,h5,h6 {
+ font-weight:300
+}
+.body h2,.body h3,.body h4,.body h5,.body h6 {
+ margin:1.5em 0 0.75em
+}
+.body h1 {
+ margin-bottom:0.75em;
+ font-size:2.25em;
+}
+.body h3.fn,.body h3.flags {
+ color:#26282a;
+ font-size:1.46em;
+ padding:15px 0 15px 0;
+ border-bottom:2px #eee solid;
+ word-wrap:break-word
+}
+.body .fngroup {
+ border-bottom:2px #eee solid;
+ padding-bottom:15px;
+ margin-bottom:1.5em
+}
+.body .fngroup h3.fngroupitem {
+ margin:0;
+ padding-bottom:0;
+ border:none
+}
+.body h3.fn .name,
+.body h3 span.type,
+.qmlname span.name {
+ font-weight: 400
+}
+.qmlname {
+ font-size:1.46em
+}
+.qmlproto table {
+ border:none;
+ border-bottom:2px #eee solid
+}
+.qmlproto table p {
+ max-width:100%
+}
+.qmlproto table tr {
+ background-color:#fff
+}
+.qmlname td, .qmlname th {
+ border:none;
+ text-align:left;
+ padding:5px 0 0 0
+}
+.qmlreadonly,.qmldefault {
+ padding:0 5px 0 5px;
+ font-size:0.75em;
+ background-color:#eee;
+ float:right
+}
+.qmlreadonly {
+ color:#414141
+}
+.qmldefault {
+ color:#D14141
+}
+.rightAlign {
+ padding:3px 5px 3px 10px;
+ text-align:right
+}
+.centerAlign.functionIndex {
+ text-align:center;
+ font-size:150%;
+ margin-bottom: 1em
+}
+article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section {
+ display:block
+}
+body {
+ line-height:1;
+ font-family:'Titillium Web', Arial, Helvetica, sans-serif;
+ font-weight:400;
+ transition-duration:1s;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ font-size: 16px;
+ background-color:#f3f3f4;
+ color:#404244;
+}
+ol,ul {
+ list-style-type: square;
+ color: #17a81a;
+}
+.body ol,.body ul {
+ margin-top:0.75em;
+ margin-left:20px
+}
+.bodywrapper ol>li {
+ list-style-type:decimal;
+ margin-left:15px
+}
+.bodywrapper ol.a >li {
+ list-style-type:lower-alpha;
+}
+.bodywrapper ol.A >li {
+ list-style-type:upper-alpha;
+}
+.bodywrapper ol.i >li {
+ list-style-type:lower-roman;
+}
+.bodywrapper ol.I >li {
+ list-style-type:upper-roman;
+}
+.body li p {
+ margin-top:1em
+}
+blockquote,q {
+ quotes:none;
+ border-left:10px solid #ddd;
+ padding-left:10px
+}
+blockquote:before,blockquote:after,q:before,q:after {
+ content:'';
+ content:none;
+ width:100%
+}
+table {
+ border-collapse:collapse;
+ border-spacing:0;
+ margin-bottom:5px;
+ width:100%
+}
+a {
+ color:#17a81a;
+ text-decoration:none;
+ transition-duration:0.3s
+}
+a:hover {
+ color:#17a81a
+}
+.main,#footerbar>div {
+ max-width:1280px;
+ width:95%;
+ margin:0 auto
+}
+.main {
+ margin-top:80px
+}
+@media (max-width: 1120px) {
+ .main,.navbar-header,#footerbar>div {
+ width: 100%;
+ margin: 0;
+ }
+ .main .main-rounded {
+ padding: 0 15px;
+ }
+}
+.main_index {
+ background-color:#fff
+}
+.sectionlist {
+ margin-bottom:2em
+}
+[class*="col-"] {
+ letter-spacing:normal
+}
+.landing,.main_index .row {
+ letter-spacing:-0.31em
+}
+.main_index .row>div {
+ letter-spacing:normal
+}
+.col-1,.body {
+ display:inline-block;
+ background-color:#fff;
+ padding: 25px 35px 20px 30px;
+ -webkit-box-sizing:border-box;
+ -moz-box-sizing:border-box;
+ -ms-box-sizing:border-box;
+ box-sizing:border-box;
+}
+.col-1 h2 {
+ font-size:1.8em;
+ font-weight:300;
+ line-height:1.1;
+ margin-bottom:0.83em;
+ margin-top:1em
+}
+.icons1of3 img {
+ display:inline-block;
+ float:left;
+ margin-right:0.75em;
+ margin-top:-5px;
+ width:2.75em
+}
+div.multi-column {
+ position:relative
+}
+div.multi-column div {
+ display:-moz-inline-box;
+ display:inline-block;
+ vertical-align:top;
+ margin-top:1em;
+ margin-right:2em;
+ width:16em
+}
+.sidebar {
+ display:block;
+ position:relative;
+ position:sticky;
+ float:left;
+ -webkit-box-sizing:border-box;
+ -moz-box-sizing:border-box;
+ -ms-box-sizing:border-box;
+ box-sizing:border-box;
+ width:20%;
+ padding-right:20px
+}
+.sidebar li {
+ text-overflow:ellipsis;
+ overflow:hidden
+}
+.toc,.sectionlist {
+ padding:25px;
+ background-color:#fff;
+ margin-bottom:1.25em
+}
+.sidebar .sectionlist p {
+ margin-bottom:0
+}
+.sectionlist.promo {
+ padding:0;
+ background-color:#f3f3f4
+}
+.sidebar-content:empty {
+ display:none;
+ visibility:hidden
+}
+.col-2 h2,.toc h3,.sidebar-content h2,
+.sidebar-content h3,.sectionlist h2,
+.sphinxsidebar {
+ position: -webkit-sticky;
+ position: sticky;
+ top: 64px;
+ overflow: scroll;
+ overflow-x: hidden;
+ overflow-y: hidden;
+}
+.sphinxsidebar h3 {
+ font-weight: bold;
+ margin-bottom:1em;
+}
+.toc h3 a {
+ color:#404244
+}
+.title {
+ font-size:2.25em;
+ font-weight:300;
+ letter-spacing:-1px;
+ line-height:1.15em;
+ margin-bottom:0.5em;
+ word-wrap:break-word
+}
+.navigationbar,col-1 h2 {
+ font-size:0.85em
+}
+.navigationbar h1 {
+ font-size:2.5em;
+ margin-bottom:0.85em;
+ margin-top:0.85em
+}
+.navigationbar li {
+ display:inline-block;
+ margin-right:5px;
+ position:relative;
+ padding-right:10px;
+ color:#585a5c
+}
+.navigationbar ul:last-of-type li a {
+ color:#404244
+}
+.sectionlist li, .sphinxsidebar li {
+ padding-bottom: 10px;
+ line-height: 1.75em;
+}
+.col-1 ul {
+ margin-bottom:1.56em
+}
+.bodywrapper li {
+ margin-top:0.5em;
+ line-height:1.25em
+}
+.bodywrapper li.level2 {
+ margin-left:10px;
+ margin-top:0.4em;
+ font-size:0.9375em;
+}
+.bodywrapper p,
+.bodywrapper dd {
+ line-height:1.25em;
+ margin:1em 0 1em;
+ color:#404244
+}
+.bodywrapper b {
+ font-weight:600
+}
+.body ul,.body ol {
+ /* margin-bottom:1.5em */
+}
+.bodywrapper ul ul {
+ margin-top:0.5em
+}
+.bodywrapper .naviNextPrevious {
+ margin-top:25px;
+ max-width:100%
+}
+.naviNextPrevious.headerNavi,
+p.naviNextPrevious + p {
+ display:none
+}
+.nextPage {
+ float:right
+}
+.prevPage:before {
+ content:"< "
+}
+.nextPage:after {
+ content:" >"
+}
+.navigationbar li a {
+ color:#404244
+}
+.navigationbar li:after {
+ color:#404244;
+ content:"›";
+ display:inline-block;
+ font-size:1.5em;
+ line-height:1;
+ position:absolute;
+ right:-2px;
+ top:-4px
+}
+.sub-navigation {
+ margin-top:10px
+}
+.navigationbar li:last-child:after,.sub-navigation li:after {
+ content:none
+}
+.navigationbar {
+ margin-bottom:10px;
+ line-height:1em
+}
+#buildversion {
+ margin-bottom:10px;
+ font-style:italic;
+ font-size:small;
+ float:right
+}
+.copy-notice {
+ width:75%;
+ font-size:0.75em;
+ margin:20px 35px 0 10px;
+ line-height:1.75em;
+ float:right;
+ color:#585a5c
+}
+.copy-notice.index {
+ margin-top:10px;
+ float:none
+}
+li a.active {
+ color:#585a5c
+}
+.flowList {
+ padding:25px
+}
+.flowListDiv dl {
+ -webkit-column-count:1;
+ -moz-column-count:1;
+ column-count:1
+}
+.flowList dd {
+ display:inline-block;
+ margin-left:10px;
+ width:90%;
+ line-height:1.15em;
+ overflow-x:hidden;
+ text-overflow:ellipsis
+}
+.alphaChar {
+ font-size:2em;
+ position:absolute
+}
+.flowList.odd {
+ background-color:#f9f9f9
+}
+.body ul>li,.doc-column ul>li {
+ list-style-image:url("list_arrow.png");
+ margin-left:15px;
+ color:#404244;
+ margin-top:0.65em;
+ line-height:1em
+}
+.bodywrapper table p {
+ margin:0px;
+ padding:0px
+}
+.bodywrapper table p {
+ margin:0px;
+ padding:0px;
+ min-height:1.25em
+}
+.bodywrapper .qmldoc {
+ margin-top:0.75em
+}
+.body h2 {
+ margin-top: 1.5em;
+ font-size:1.75em
+}
+.body h3 {
+ font-size:1.35em
+}
+.body h4 {
+ font-size:1.15em
+}
+.body p img {
+ margin-top:0.75em;
+ max-width:100%
+}
+.body .border img {
+ box-shadow:3px 3px 8px 3px rgba(200,200,200,0.5)
+}
+.body .border .player {
+ box-shadow:3px 3px 8px 3px rgba(200,200,200,0.5)
+}
+.body p.figCaption {
+ transform:translateY(-30px);
+ color:#606366;
+ font-size:95%;
+ margin-left:3px;
+ font-style:italic
+}
+.body table {
+ width:initial;
+ vertical-align:initial
+}
+table .odd {
+ background-color:#f9f9f9
+}
+table thead {
+ text-align:left;
+ padding-left:20px
+}
+table,table td,table th {
+ border:1px solid #eee
+}
+table td,table th {
+ padding:5px 20px;
+ line-height:1.3
+}
+.body .fixed table td {
+ min-width:50%;
+ width:50%
+}
+table.alignedsummary,table.propsummary {
+ width:initial
+}
+table.valuelist td.tblval {
+ font-size:0.75em
+}
+div.main_index .row {
+ border-bottom:10px solid #f3f3f4
+}
+div.main_index .row {
+ position:relative
+}
+div.main_index .row>div {
+ display:inline-block;
+ width:50%;
+ vertical-align:top;
+ padding:2em 3em;
+ -webkit-box-sizing:border-box;
+ -moz-box-sizing:border-box;
+ -ms-box-sizing:border-box;
+ box-sizing:border-box
+}
+div.main_index h2 {
+ font-size:2.1875em;
+ margin-bottom:1em
+}
+#search_bar {
+ width:40%;
+ float:right
+}
+div.main_index .row:after {
+ content:"";
+ position:absolute;
+ top:0;
+ right:50%;
+ height:100%;
+ width:10px;
+ background-color:#f3f3f4
+}
+div.table {
+ overflow-x:auto
+}
+.body tr > td > pre {
+ font-size:0.75em
+}
+p.qt_commercial {
+ border:3px solid #5caa15;
+ margin:0 auto;
+ padding:15px;
+ width:28%;
+ text-align:center;
+ clear:both
+}
+h1.qt_commercial {
+ padding:20px;
+ background-color:#5caa15;
+ display:inline;
+ float:right;
+ font-size:1.25em;
+ line-height:1.25em;
+ height:1.25em;
+ color:#fff
+}
+div.qt_commercial {
+ border-top:5px solid #5caa15;
+ margin-bottom:50px
+}
+div.pre {
+ position:relative;
+ height:auto
+}
+pre, .LegaleseLeft {
+ background-color:#222840;
+ color:#fff;
+ display:block;
+ font-family:"Droid Sans Mono";
+ line-height:1.5;
+ overflow-x:auto;
+ margin-bottom:25px;
+ padding:25px;
+ margin-top:0.75em;
+ font-size: .8em;
+}
+.bodywrapper .LegaleseLeft p {
+ color:#fff;
+ white-space: pre-wrap
+}
+pre .str,code .str {
+ color:#aaaaaa
+}
+pre .kwd,code .kwd {
+ color:#ffff55
+}
+pre .com,code .com {
+ color:#55ffff
+}
+pre .typ,code .typ {
+ color:#4f9d08
+}
+pre a .typ,code a .typ {
+ color:#21be2b
+}
+pre .lit,code .lit {
+ color:#ff55ff
+}
+pre .pun,code .pun {
+ color:#fff
+}
+pre .pln,code .pln {
+ color:#fff
+}
+@media print {
+ pre {
+ background-color:#eee !important
+ }
+ pre .str,code .str {
+ color:#060
+ }
+ pre .kwd,code .kwd{
+ color:#006;
+ font-weight:bold
+ }
+ pre .com,code .com {
+ color:#600
+ }
+ pre .typ,code .typ {
+ color:#404;
+ font-weight:bold
+ }
+ pre .lit,code .lit {
+ color:#044
+ }
+ pre .pun,code .pun {
+ color:#440
+ }
+ pre .pln,code .pln {
+ color:#000
+ }
+}
+pre.wrap {
+ white-space:pre-wrap
+}
+pre span.wrap {
+ display:none;
+ background:url("wrap.png") no-repeat;
+ right:0;
+ top:2px;
+ position:absolute;
+ width:20px;
+ height:14px;
+ margin:4px;
+ opacity:0.65
+}
+
+span.pre {
+ color: #09102d;
+}
+
+span.wrap:hover {
+ opacity:1
+}
+span.wrap:active {
+ opacity:0.75
+}
+.copy_text {
+ background-color:#46a2da;
+ color:#fff;
+ border:2px solid #46a2da;
+ padding:10px 16px;
+ margin-left:-10px;
+ margin-top:-50px;
+ position:absolute;
+ opacity:0;
+ cursor:pointer;
+ float:right
+}
+.copy_text:hover {
+ background-color:#fff;
+ color:#46a2da
+}
+code,.codelike {
+ font-family:"Droid Sans Mono"
+}
+#detailed-description .function dt > code,
+#detailed-description .function dt > em {
+ font-weight:bold
+}
+h3.fn code {
+ font-size:0.75em;
+ float:right;
+ background-color:#eee;
+ padding:3px;
+ margin: 3px 0 0 20px
+}
+pre:hover>.copy_text {
+ display:inline-block;
+ opacity:1;
+ transition:0.5s ease
+}
+#main_title_bar {
+ background:url("pyside-logo.png") no-repeat;
+ background-size:100%;
+ width:366px;
+ height:86px;
+ margin:15px 0 15px 0
+}
+#main_title_bar h1 {
+ visibility:hidden
+}
+#main_title_bar .search_bar {
+ letter-spacing:normal;
+ width:50%;
+ display:inline-block;
+ -webkit-box-sizing:border-box;
+ -moz-box-sizing:border-box;
+ -ms-box-sizing:border-box;
+ box-sizing:border-box;
+ vertical-align:middle
+}
+#main_title_bar h1 {
+ letter-spacing:normal;
+ display:inline-block;
+ -webkit-box-sizing:border-box;
+ -moz-box-sizing:border-box;
+ -ms-box-sizing:border-box;
+ box-sizing:border-box;
+ vertical-align:middle
+}
+#main_title_bar .search_bar * {
+ letter-spacing:normal;
+ padding:0;
+ margin:0;
+ border:none
+}
+#sidebar-toggle,#toc-toggle {
+ display:none
+}
+@media (max-width: 980px) {
+ body {
+ font-size:calc-em(14px)
+ }
+ #main_title_bar>h1,#main_title_bar .search_bar {
+ width:100%
+ }
+ #main_title_bar .search_bar {
+ margin-bottom:15px
+ }
+ .main {
+ margin-top:0px
+ }
+ .main_index .row {
+ border:none !important
+ }
+ .title {
+ font-size:1.5em;
+ font-weight:400;
+ word-wrap:break-word
+ }
+ .col-1,.body,.naviNextPrevious,.sidebar {
+ padding:10px
+ }
+ .sidebar {
+ position:relative;
+ padding-top:0
+ }
+ .search .sidebar {
+ display:none;
+ visibility:hidden
+ }
+ .col-2 h2,.toc h3,.sidebar-content h2,.sidebar-content h3,.sectionlist h2 {
+ text-align:center;
+ margin-bottom:5px
+ }
+ div.main_index .row:after {
+ content:none
+ }
+ div.main_index .row>div {
+ display:block !important;
+ width:100%;
+ padding:15px;
+ margin:0
+ }
+ .body,.sidebar,.col-1 {
+ width:100%
+ }
+ .sidebar-content,.col-2,.toc {
+ background-color:#fff;
+ margin-bottom:1em;
+ padding:20px
+ }
+ #sidebar-toggle,#toc-toggle {
+ display:block
+ }
+ #sidebar-toggle.collapsed + h2 {
+ display:block
+ }
+ .bodywrapper p {
+ margin-bottom:1em;
+ max-width:100%
+ }
+ table td,table th {
+ padding:5px 5px
+ }
+ .sectionlist {
+ padding:0
+ }
+ .sidebar > .sectionlist {
+ padding:20px
+ }
+ .sectionlist.promo {
+ max-width:46%;
+ margin:0 auto 1em auto;
+ float:left;
+ padding:0 2%
+ }
+ .sidebar .sidebar-content {
+ clear:both
+ }
+ .copy-notice {
+ float:none;
+ width:initial
+ }
+}
+[id]:target > *:first-child,
+dt[id]:target {
+ -webkit-animation:highlighter 3s;
+ animation:highlighter 3s
+}
+@-webkit-keyframes highlighter {
+ 25% {
+ background-color:#d1e8f6;
+ color:#444
+ }
+ 75% {
+ background-color:#d1e8f6;
+ color:#444
+ }
+}
+@keyframes highlighter {
+ 25% {
+ background-color:#d1e8f6;
+ color:#444
+ }
+ 75% {
+ background-color:#d1e8f6;
+ color:#444
+ }
+}
+@-webkit-keyframes copypaste {
+ 25% {
+ opacity:1
+ }
+ 100% {
+ border-radius:10px;
+ margin-top:-50px;
+ opacity:1
+ }
+}
+@keyframes copypaste {
+ 25% {
+ opacity:1
+ }
+ 100% {
+ border-radius:10px;
+ margin-top:-50px;
+ opacity:1
+ }
+}
+#footer {
+ clear:both
+}
+.footer-social i {
+ font-family: "social-icons";
+ font-style: normal;
+ font-size:150%;
+ margin: .55em;
+ color: #cecfd5
+}
+.footer-social i:hover {
+ color: #eee
+}
+.footer-social .icon-twitter:before {
+ content: '\f099'
+}
+.footer-social .icon-facebook:before {
+ content: '\f09a'
+}
+.footer-social .icon-youtube:before {
+ content: '\f16a'
+}
+.menuextraslanguages {
+ display:none;
+ visibility:hidden
+}
+form.gsc-search-box {
+ font-size: 25px !important;
+ margin-top: 0 !important;
+ margin-right: 0 !important;
+ margin-bottom: 4px !important;
+ margin-left: 0 !important;
+ width: 102.5% !important;
+}
+table.gsc-search-box {
+ border-style: none !important;
+ border-width: 0 !important;
+ border-spacing: 0 0 !important;
+ width: 100% !important;
+ margin-bottom: 2px !important;
+}
+
+table.gsc-search-box td {
+ vertical-align: middle !important;
+}
+
+table.gsc-search-box td.gsc-input {
+ padding-right: 0px !important;
+}
+table.gsc-search-box td.gsc-input input {
+ background-position: 10px center !important;
+}
+
+td.gsc-search-button {
+ width: 1% !important;
+}
+
+td.gsc-clear-button {
+ width: 14px !important;
+ visibility:hidden !important;
+ display:none !important;
+}
+table.gsc-branding td,
+table.gsc-branding {
+ margin: 0 0 0 0 !important;
+ padding: 0 0 0 0 !important;
+ border: none !important;
+}
+
+table.gsc-branding {
+ border-style: none !important;
+ border-width: 0 !important;
+ border-spacing: 0 0 !important;
+ width: 100% !important;
+}
+
+.gsc-branding-text {
+ color: #676767 !important;
+}
+
+td.gsc-branding-text {
+ vertical-align: top !important;
+}
+td.gsc-branding-text div.gsc-branding-text {
+ padding-bottom: 2px !important;
+ text-align: right !important;
+ font-size: 11px !important;
+ margin-right: 2px !important;
+}
+
+td.gsc-branding-img {
+ width: 65px !important;
+ vertical-align: bottom !important;
+}
+
+img.gsc-branding-img {
+ padding-top: 1px !important;
+ margin: 0 0 0 0 !important;
+ padding-right: 0 !important;
+ padding-left: 0 !important;
+ padding-bottom: 0 !important;
+ border: none !important;
+ display: inline !important;
+}
+
+input.gsc-search-button {
+ background-color: white !important;
+ height: 35px !important;
+ width: 25px !important;
+ color: transparent !important;
+ background-image: url("doc_search.png") !important;
+ background-size: 25px auto;
+ background-position: 0px 5px;
+ background-repeat: no-repeat;
+ margin-left: -43px !important;
+ overflow: hidden;
+ min-width: 20px !important;
+}
+
+input.gsc-search-button:hover {
+ cursor: pointer;
+}
+
+input.gsc-search-button:focus {
+ outline: none;
+ box-shadow: none;
+}
+
+.gsc-search-box-tools .gsc-clear-button {
+ display: none !important;
+ visibility: none !important;
+}
+
+.gsc-overflow-hidden {
+ overflow: hidden !important;
+}
+
+input.gsc-input {
+ background-color: #fff !important;
+ border: 1px solid #d6d6d6 !important;
+ box-sizing: border-box !important;
+ -moz-box-sizing: border-box !important;
+ color: #868482 !important;
+ outline: 0 none !important;
+ padding: 9px 10px 10px !important;
+ transition: color 0.5s ease 0s, box-shadow 0.5s ease 0s, background-color 0.5s ease 0s !important;
+}
+
+input {
+ font-family: 'Titillium Web', Arial, Helvetica, sans-serif !important;
+ line-height: 1.5 !important;
+ font-weight: 300 !important;
+ vertical-align:middle
+}
+
+input:focus {
+ border-color: #46a2da;
+ box-shadow: 0 0 5px #46a2da;
+ color: #000;
+}
+
+.animation {
+ width: 100%;
+ border-style: none;
+ border-width: 0
+}
+
+.player {
+ width: auto;
+ position: relative;
+ display: table;
+ margin-bottom:1.5em;
+}
+
+.playcontrol {
+ display: none;
+ background: url("play_icon.svg") no-repeat center,
+ linear-gradient(
+ rgba(0,0,0,0.15), rgba(0,0,0,0.15)
+ );
+ background-size: 25%;
+ width: 100%;
+ height: 100%;
+ position: absolute;
+ left: 0%;
+ right: 0%;
+ top: 0%;
+ bottom: 0%;
+ margin: auto
+}
+
+/* expand/collapse code sections */
+pre input {
+ display:none;
+ visibility:hidden
+}
+pre label {
+ display:block;
+ margin:-3px 3px 0 -16px;
+ text-align:center;
+ color:#21be2b;
+ float:left;
+}
+pre label:hover {
+ color:#fff
+}
+pre label::before {
+ font-weight:600;
+ font-size:16px;
+ content:"+";
+ display:inline-block;
+ width:16px;
+ height:16px
+}
+#ec_expand {
+ height:16px;
+ overflow:hidden;
+ transition:height 0.35s;
+}
+#ec_expand::before {
+ content:"...*/";
+ color:#aaa;
+ background-color:#3a4055;
+ z-index:99 !important;
+ right:25px;
+ position:absolute
+}
+#ec_toggle:checked ~ #ec_expand {
+ height:initial
+}
+#ec_toggle:checked ~ #ec_expand::before {
+ content:""
+}
+#ec_toggle:checked ~ label::before {
+ content:"-"
+}
+
+/* permalinks */
+h1:hover > .headerlink,
+h2:hover > .plink,
+h2:hover > .headerlink,
+h3:hover > .plink,
+h3:hover > .headerlink,
+h4:hover > .plink,
+h4:hover > .headerlink,
+h5:hover > .plink,
+h5:hover > .headerlink {
+ opacity:1
+}
+a.plink, a.headerlink {
+ opacity: 0;
+ padding-left: 8px;
+ font-size: 0.8em;
+ font-weight: 600;
+ transition: opacity 180ms ease-in-out
+}
+a.plink::before {
+ content:'\00B6'
+}
+
+table.special {
+ border: 3px;
+ padding: 0px;
+ border-collapse: separate;
+ border-spacing: 20px;
+ line-height: 1.5em;
+}
+
+.special p {
+ text-align: center;
+ color: #3a4055;
+}
+
+.special a {
+ display: block;
+ border-bottom: 0;
+ text-decoration: none;
+}
+
+.special a:hover {
+ border-bottom: 0;
+ text-decoration: none;
+}
+
+.special strong {
+ color: #17a81a;
+ font-size: 110%;
+ font-weight: normal;
+}
+
+table.special th,
+table.special td {
+ border: 1px solid #888;
+ padding-top: 14px;
+ padding-bottom: 14px;
+ padding-left: 6px;
+ padding-right: 5px;
+ border-radius: 5px;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -khtml-border-radius: 5px;
+}
+
+.special td:hover {
+ padding-top: 2px;
+ padding-bottom: 2px;
+ border-bottom: 4px solid #41cd52;
+}
diff --git a/sources/pyside6/doc/_themes/pysidedocs/static/pysidelogo.png b/sources/pyside6/doc/_themes/pysidedocs/static/pysidelogo.png
new file mode 100644
index 000000000..3a2f2bd17
--- /dev/null
+++ b/sources/pyside6/doc/_themes/pysidedocs/static/pysidelogo.png
Binary files differ
diff --git a/sources/pyside6/doc/_themes/pysidedocs/static/relbar_bg.png b/sources/pyside6/doc/_themes/pysidedocs/static/relbar_bg.png
new file mode 100644
index 000000000..4036733a7
--- /dev/null
+++ b/sources/pyside6/doc/_themes/pysidedocs/static/relbar_bg.png
Binary files differ
diff --git a/sources/pyside6/doc/_themes/pysidedocs/theme.conf b/sources/pyside6/doc/_themes/pysidedocs/theme.conf
new file mode 100644
index 000000000..01a4dd4a1
--- /dev/null
+++ b/sources/pyside6/doc/_themes/pysidedocs/theme.conf
@@ -0,0 +1,7 @@
+[theme]
+inherit = default
+stylesheet = pyside.css
+pygments_style = none
+
+[options]
+nosidebar = false
diff --git a/sources/pyside6/doc/_themes/pysidedocs_qthelp/domainindex.html b/sources/pyside6/doc/_themes/pysidedocs_qthelp/domainindex.html
new file mode 100644
index 000000000..c136cdd1c
--- /dev/null
+++ b/sources/pyside6/doc/_themes/pysidedocs_qthelp/domainindex.html
@@ -0,0 +1,57 @@
+{#
+ basic/domainindex.html
+ ~~~~~~~~~~~~~~~~~~~~~~
+
+ Template for domain indices (module index, ...).
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+#}
+{% extends "layout.html" %}
+{% set title = indextitle %}
+{% block extrahead %}
+{{ super() }}
+{% if not embedded and collapse_index %}
+ <script type="text/javascript">
+ DOCUMENTATION_OPTIONS.COLLAPSE_INDEX = true;
+ </script>
+{% endif %}
+{% endblock %}
+{% block body %}
+<div class="section">
+ {%- set curr_group = 0 %}
+
+ <h1>{{ indextitle }}</h1>
+
+ <div class="modindex-jumpbox">
+ {%- for (letter, entries) in content %}
+ <a href="#cap-{{ letter }}"><strong>{{ letter }}</strong></a>
+ {%- if not loop.last %} | {% endif %}
+ {%- endfor %}
+ </div>
+
+ <table class="indextable modindextable" cellspacing="0" cellpadding="2">
+ {%- for letter, entries in content %}
+ <tr class="pcap"><td></td><td>&nbsp;</td><td></td></tr>
+ <tr class="cap"><td></td><td><a name="cap-{{ letter }}">
+ <strong>{{ letter }}</strong></a></td><td></td></tr>
+ {%- for (name, grouptype, page, anchor, extra, qualifier, description)
+ in entries %}
+ {%- if grouptype == 1 %}{% set curr_group = curr_group + 1 %}{% endif %}
+ <tr{% if grouptype == 2 %} class="cg-{{ curr_group }}"{% endif %}>
+ <td>{% if grouptype == 1 -%}
+ <img src="{{ pathto('_static/minus.png', 1) }}" id="toggle-{{ curr_group }}"
+ class="toggler" style="display: none" alt="-" />
+ {%- endif %}</td>
+ <td>{% if grouptype == 2 %}&nbsp;&nbsp;&nbsp;{% endif %}
+ {% if page %}<a href="{{ pathto(page) }}#{{ anchor }}">{% endif -%}
+ <tt class="xref">{{ name|e }}</tt>
+ {%- if page %}</a>{% endif %}
+ {%- if extra %} <em>({{ extra|e }})</em>{% endif -%}
+ </td><td>{% if qualifier %}<strong>{{ qualifier|e }}:</strong>{% endif %}
+ <em>{{ description|e }}</em></td></tr>
+ {%- endfor %}
+ {%- endfor %}
+ </table>
+</div>
+{% endblock %}
diff --git a/sources/pyside6/doc/_themes/pysidedocs_qthelp/static/fakebar.png b/sources/pyside6/doc/_themes/pysidedocs_qthelp/static/fakebar.png
new file mode 100644
index 000000000..b45830e00
--- /dev/null
+++ b/sources/pyside6/doc/_themes/pysidedocs_qthelp/static/fakebar.png
Binary files differ
diff --git a/sources/pyside6/doc/_themes/pysidedocs_qthelp/static/logo_python.jpg b/sources/pyside6/doc/_themes/pysidedocs_qthelp/static/logo_python.jpg
new file mode 100644
index 000000000..cd474efba
--- /dev/null
+++ b/sources/pyside6/doc/_themes/pysidedocs_qthelp/static/logo_python.jpg
Binary files differ
diff --git a/sources/pyside6/doc/_themes/pysidedocs_qthelp/static/logo_qt.png b/sources/pyside6/doc/_themes/pysidedocs_qthelp/static/logo_qt.png
new file mode 100644
index 000000000..3bc03b7c7
--- /dev/null
+++ b/sources/pyside6/doc/_themes/pysidedocs_qthelp/static/logo_qt.png
Binary files differ
diff --git a/sources/pyside6/doc/_themes/pysidedocs_qthelp/static/minus.png b/sources/pyside6/doc/_themes/pysidedocs_qthelp/static/minus.png
new file mode 100644
index 000000000..da1c5620d
--- /dev/null
+++ b/sources/pyside6/doc/_themes/pysidedocs_qthelp/static/minus.png
Binary files differ
diff --git a/sources/pyside6/doc/_themes/pysidedocs_qthelp/static/plus.png b/sources/pyside6/doc/_themes/pysidedocs_qthelp/static/plus.png
new file mode 100644
index 000000000..b3cb37425
--- /dev/null
+++ b/sources/pyside6/doc/_themes/pysidedocs_qthelp/static/plus.png
Binary files differ
diff --git a/sources/pyside6/doc/_themes/pysidedocs_qthelp/static/pyside.css b/sources/pyside6/doc/_themes/pysidedocs_qthelp/static/pyside.css
new file mode 100644
index 000000000..aee5e4420
--- /dev/null
+++ b/sources/pyside6/doc/_themes/pysidedocs_qthelp/static/pyside.css
@@ -0,0 +1,1943 @@
+@import url('cookie-confirm.css') screen;
+
+/* -- admonitions -- */
+
+div.admonition {
+ margin: 1.5em 0 1.5em;
+ padding: 0;
+}
+
+div.admonition dt {
+ font-weight: bold;
+}
+
+div.admonition dl {
+ margin-bottom: 0;
+}
+
+p.admonition-title {
+ margin: 0px 10px 5px 0px;
+ font-weight: bold;
+}
+
+div.admonition code {
+ font-family: inherit;
+}
+
+p.admonition-title + p {
+ padding-left: 1em;
+}
+
+div.admonition a:after {
+ content: ', ';
+}
+
+div.admonition a:last-child:after {
+ content: '';
+}
+
+.body {
+ width: 100%
+}
+.bodywrapper .admonition p.admonition-title {
+ margin-bottom:5px
+}
+
+.bodywrapper .admonition p {
+ margin:0
+}
+
+div.body p.centered {
+ text-align: center;
+ margin-top: 25px;
+}
+
+div.warning, div.seealso, div.note {
+ padding: 6px 0px 6px 10px;
+ border: none;
+}
+
+div.warning {
+ background-color: #ffe4e4;
+}
+
+div.seealso {
+ background-color: #fff2d6;
+}
+
+div.note {
+ background-color: #f3f3f4;
+}
+
+table.docutils {
+ margin-right: auto;
+ margin-bottom: 10px;
+ border: none;
+ width: initial;
+}
+
+table.docutils.colwidths-given td {
+ float: none;
+}
+
+table.docutils th,
+table.docutils td {
+ padding-left:0;
+ border: none;
+}
+
+table.docutils td ul {
+ margin:0
+}
+
+table.docutils td ul > li {
+ margin: 0 0 0.5em;
+}
+h2 em {
+ float: right;
+ font-size: 10px;
+ position: relative;
+ top: -20px;
+}
+
+.document {
+ padding-bottom: 20px;
+}
+
+.documentwrapper {
+ margin-left: 20px;
+}
+
+.body blockquote {
+ border: none;
+ padding-left: 0;
+ margin-bottom: 1.5em;
+}
+
+.sphinxsidebar {
+ float: left;
+ width: 186px;
+ padding: 25px;
+ text-align: left;
+ background-color: #fff;
+}
+
+.sphinxsidebar ul {
+ padding: 0px;
+ margin: 0px;
+ list-style-position: inside;
+}
+
+.sphinxsidebar > ul {
+ padding: 0px;
+ margin: 0px;
+}
+
+.sphinxsidebar ul li li {
+ margin-left: 10px;
+ padding: 0px;
+ font-size: 0.95em;
+}
+
+.sphinxsidebar ul a,
+.sphinxsidebar p.topless a {
+ word-break: break-word;
+}
+
+.sphinxsidebar h3, .sphinxsidebar h3 a {
+ color: #333;
+}
+
+.sphinxsidebar p.topless {
+ margin: 1em 0 1em;
+}
+
+.pysidetoc ul {
+ list-style: none;
+ padding: 0px;
+ margin: 0px;
+}
+
+.pysidetoc em {
+ font-style: normal;
+}
+
+.pysidetoc strong {
+ display: block;
+ padding: 5px;
+ margin: 0 10px 10px 0;
+ border: none;
+ background-color: #e2e2e2;
+}
+
+.section .docutils.container td {
+ float:left;
+}
+
+.hide {
+ display: none;
+}
+
+/* copy-notice */
+.document + p {
+ margin-left: 255px;
+ width: 70%;
+ font-size: 0.75em;
+ margin: 0 35px 15px 280px;
+}
+
+#searchbox {
+ border-top: 1px solid #989898;
+ padding-top: 10px;
+ margin-left: -10px;
+ margin-right: -10px;
+ padding-left: 10px;
+ padding-right: 10px;
+}
+
+#search_button {
+ border: 1px solid #3A393A;
+ background-color: #3A393A;
+ color: white;
+ cursor: pointer;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -khtml-border-radius: 5px;
+
+}
+
+form {
+ margin: 0px;
+ padding: 0px;
+}
+
+#searchbox h3 {
+ padding: 10px 0 0 0;
+ margin-bottom: 5px;
+}
+
+/* search field */
+form #q {
+ width: 136px;
+ /* height: 22px; */
+ /* border: none; */
+ margin: 0px;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -khtml-border-radius: 5px;
+ margin-top: 2px;
+ padding: 4px;
+ line-height: 22px;
+}
+
+#search-results h2 {
+ display: none;
+}
+
+#search-results h2 {
+ display: none;
+}
+
+#search-results ul.search {
+ margin: 0px;
+ padding: 0px;
+}
+
+ul.search div.context {
+ padding-left: 40px;
+}
+
+#installation td {
+ text-align: center;
+ font-weight: bold;
+}
+
+em {
+ color: inherit;
+ font-style:italic;
+}
+
+/******** REL bar *********/
+
+.related {
+ display: inline;
+}
+
+.related h3 {
+ display: none;
+}
+
+.align-center {
+ text-align: center;
+}
+
+.contentstable {
+ width: 100%;
+}
+
+.contentstable td {
+ padding-left: 30px;
+ vertical-align: top;
+}
+
+p.biglink a {
+ font-size: 20px;
+}
+
+dt:target, .highlight {
+ background-color: #fbe54e;
+}
+
+p.highlight-link {
+ margin-top: 10px;
+ font-size: 0.8em;
+}
+
+#synopsis table, table.field-list {
+ margin: 1em 0 1em 0;
+}
+
+table.field-list tr {
+ text-align: left;
+}
+
+tt.descname {
+ font-size: 120%;
+ font-weight: bold;
+}
+
+#functions ul, #virtual-functions ul, #slots ul, #signals ul, #static-functions ul {
+ margin: 0;
+ padding: 6px;
+ border: 1px solid #ddd;
+ border-radius: 0;
+ background-color: #e2e2e2;
+}
+
+#functions p, #virtual-functions p, #slots p, #signals p, #static-functions p {
+ margin: 0;
+ padding: 0;
+}
+
+#functions li, #virtual-functions li, #slots li, #signals li, #static-functions li {
+ list-style: none;
+ margin: 5px;
+ padding: 0;
+ font-size: 90%;
+}
+
+#synopsis span.pre {
+ color: #009491;
+ font-weight: bolder;
+}
+
+#detailed-description .class dt,
+#detailed-description .method dt,
+#detailed-description .staticmethod dt,
+#detailed-description .attribute dt {
+ margin: 0px;
+ margin-bottom: 10px;
+ padding: 10px;
+ font-weight: bold;
+ background-color: #e2e2e2;
+ border: none;
+ border-radius: 0;
+}
+
+#detailed-description dd > blockquote,
+#detailed-description dd > .field-list {
+ font-family: monospace;
+ font-size: small;
+ border-left: 10px solid #e2e2e2;
+ padding-left: 10px;
+ margin-bottom: 1.5em;
+}
+
+#detailed-description dd > blockquote blockquote {
+ border: none;
+ padding: 0;
+}
+
+#detailed-description .class .field-odd,
+#detailed-description .method .field-odd,
+#detailed-description .staticmethod .field-odd,
+#detailed-description .attribute .field-odd {
+ margin: 0;
+ padding: 1px 0 0 0;
+ background-color: #ffffff;
+
+}
+
+#detailed-description .class .field-even,
+#detailed-description .method .field-even,
+#detailed-description .staticmethod .field-even,
+#detailed-description .attribute .field-even {
+ margin: 0;
+ padding: 1px 0 0 0;
+ background-color: #ffffff;
+}
+
+#detailed-description .class .field-odd li,
+#detailed-description .method .field-odd li,
+#detailed-description .staticmethod .field-odd li,
+#detailed-description .attribute .field-odd li {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+
+}
+
+#detailed-description .class .field-even li,
+#detailed-description .method .field-even li,
+#detailed-description .staticmethod .field-even li,
+#detailed-description .attribute .field-even li {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+}
+
+#detailed-description .class .field-odd p,
+#detailed-description .method .field-odd p,
+#detailed-description .staticmethod .field-odd p,
+#detailed-description .attribute .field-odd p{
+ margin: 0;
+ margin-left: 20px;
+
+}
+
+#detailed-description .class .field-even p,
+#detailed-description .method .field-even p,
+#detailed-description .staticmethod .field-even p,
+#detailed-description .attribute .field-even p{
+ margin: 0;
+ margin-left: 20px;
+}
+
+#detailed-description .class .field-odd p:last-child,
+#detailed-description .method .field-odd p:last-child,
+#detailed-description .staticmethod .field-odd p:last-child,
+#detailed-description .attribute .field-odd p:last-child {
+ margin-bottom: 10px;
+
+}
+
+#detailed-description .class .field-even p:last-child,
+#detailed-description .method .field-even p:last-child,
+#detailed-description .staticmethod .field-even p:last-child,
+#detailed-description .attribute .field-even p:last-child{
+ margin-bottom: 10px;
+}
+
+.document dl.attribute,
+.document dl.class,
+.document dl.method,
+.document dl.staticmethod {
+ margin-top: 2em;
+}
+
+.document dl.attribute dd,
+.document dl.class dd,
+.document dl.method dd,
+.document dl.staticmethod dd {
+ padding-left: 1em;
+}
+
+#detailed-description .attribute td:nth-child(1) {
+ font-family: monospace;
+}
+
+/* Qt theme */
+#navbar {
+ position:fixed;
+ top:0;
+ left:0;
+ z-index:100;
+ background:#fff;
+ width:100%
+}
+#navbar .container, .fixed .container {
+ max-width:1280px;
+ margin:0 auto;
+ padding:0 3.9%; /* 0? */
+ position:relative;
+ overflow:visible
+}
+#navbar .navbar-header {
+ position:relative
+}
+#menuextras li a:hover span {
+ color: #41cd52;
+}
+/* new header */
+#mm-wrap, #mm-wrap #mm-helper,
+#mm-wrap #mm-helper li.mm-item,
+#mm-wrap #mm-helper a.mm-link {
+ -moz-transition: none;
+ -o-transition: none;
+ -webkit-transition: none;
+ transition: none;
+ -webkit-border-radius: 0 0 0 0;
+ -moz-border-radius: 0 0 0 0;
+ -ms-border-radius: 0 0 0 0;
+ -o-border-radius: 0 0 0 0;
+ border-radius: 0 0 0 0;
+ -webkit-box-shadow: none;
+ -moz-box-shadow: none;
+ -ms-box-shadow: none;
+ -o-box-shadow: none;
+ box-shadow: none;
+ background: none;
+ border: 0;
+ bottom: auto;
+ box-sizing: border-box;
+ clip: auto;
+ color: #090e21;
+ display: block;
+ float: none;
+ font-family: inherit;
+ font-size: 14px;
+ height: auto;
+ left: auto;
+ line-height: 1.7;
+ list-style-type: none;
+ margin: 0;
+ min-height: 0;
+ opacity: 1;
+ outline: none;
+ overflow: visible;
+ padding: 0;
+ position: relative;
+ right: auto;
+ text-align: left;
+ text-decoration: none;
+ text-transform: none;
+ top: auto;
+ vertical-align: baseline;
+ visibility: inherit;
+ width: auto;
+}
+#mm-wrap #mm-helper {
+ visibility:visible;
+ text-align:right;
+ padding:0 0px 0 0px
+}
+#navbar #mm-wrap #mm-helper li.mm-item {
+ border-right:solid #f3f3f4 1px;
+ padding-right:30px;
+ padding-left:30px
+}
+#navbar #mm-wrap #mm-helper li.mm-item > a:hover {
+ opacity: .5
+}
+#mm-wrap #mm-helper > li.mm-item {
+ margin:0 0 0 0;
+ display:inline-block;
+ height:auto;
+ vertical-align:middle
+}
+#navbar #mm-wrap #mm-helper li.mm-item:nth-child(3) {
+ border-right:0
+}
+#mm-wrap #mm-helper a.mm-link {
+ cursor: pointer
+}
+@media (max-width: 1279px) {
+ #navbar {
+ padding:0;
+ position:relative;
+ }
+ #navbar .container {
+ max-width:100%
+ }
+ .container {
+ padding:0 2%
+ }
+}
+#navbar .navbar-oneQt {
+ display:inline;
+ float:left;
+ width:31px;
+ color:#41cd52
+}
+#navbar .navbar-oneQt:before {
+ content:attr(data-icon);
+ position:absolute;
+ top:14px;
+ left:0;
+ color:#41cd52;
+ font-family:'Qt Icons';
+ line-height:1;
+ font-size:40px;
+ transition:all 0.3s ease-in-out;
+}
+#mm-wrap {
+ clear:both;
+ background:rgba(255, 255, 255, 0.1);
+ -webkit-border-radius:0px 0px 0px 0px;
+ -moz-border-radius:0px 0px 0px 0px;
+ -ms-border-radius:0px 0px 0px 0px;
+ -o-border-radius:0px 0px 0px 0px;
+ border-radius:0px 0px 0px 0px
+}
+#mm-wrap #mm-helper li.mm-item:last-child a {
+ background:transparent url("icon_avatar.png") 50% 50% no-repeat !important;
+ background-size:24px !important;
+ width:24px !important;
+ height:24px !important;
+}
+#navbar #mm-wrap #mm-helper li.mm-item > a {
+ opacity:1;
+ -webkit-transition:all 0.3s ease-in-out;
+ -moz-transition:all 0.3s ease-in-out;
+ -ms-transition:all 0.3s ease-in-out;
+ -o-transition:all 0.3s ease-in-out;
+ transition:all 0.3s ease-in-out;
+}
+#mm-wrap #mm-helper > li.mm-item > a.mm-link {
+ border-top:0px solid #fff;
+ border-left:0px solid #fff;
+ border-right:0px solid #fff;
+ border-bottom:0px solid #fff;
+ outline:none;
+ text-decoration:none;
+ padding:0 0 0 0;
+ line-height:70px;
+ font-weight:normal;
+ height:70px;
+ vertical-align:baseline;
+ text-align:left;
+ width:auto;
+ display:block;
+ color:#090e21;
+ text-transform:none;
+ text-decoration:none;
+ background:rgba(0, 0, 0, 0);
+ -webkit-border-radius:0px 0px 0px 0px;
+ -moz-border-radius:0px 0px 0px 0px;
+ -ms-border-radius:0px 0px 0px 0px;
+ -o-border-radius:0px 0px 0px 0px;
+ border-radius:0px 0px 0px 0px;
+ font-family:inherit;
+ font-size:14px;
+}
+/* end new header */
+@media (min-width: 1320px) {
+ .body .flowListDiv dl.flowList {
+ -webkit-column-count:3;
+ -moz-column-count:3;
+ column-count:3
+ }
+}
+@media (min-width: 1120px) {
+ #navbar.fixed {
+ -moz-box-shadow:0px 0px 8px rgba(0,0,0,0.23);
+ -webkit-box-shadow:0px 0px 8px rgba(0,0,0,0.23);
+ box-shadow:0px 0px 8px rgba(0,0,0,0.23)
+ }
+ #navbar.fixed #mm-wrap #mm-helper > li.mm-item > a.mm-link {
+ height:50px;
+ line-height:50px
+ }
+ #navbar.fixed .navbar-oneQt:before {
+ font-size:35px;
+ top:7px
+ }
+
+ .flowListDiv dl.flowList {
+ -webkit-column-count:2;
+ -moz-column-count:2;
+ column-count:2
+ }
+}
+@media (max-width: 1120px) {
+ #navbar {
+ padding:0;
+ position:relative
+ }
+ #navbar .navbar-oneQt:before {
+ left:10px
+ }
+ #navbar .container {
+ max-width:100%;
+ padding:0
+ }
+ #footerbar .container {
+ padding:0
+ }
+ body .main {
+ margin-top:0px
+ }
+ #footerbar .footer-main .footer-nav {
+ padding:3.9% 0 3.9% 3%;
+ border-bottom:1px solid #413d3b;
+ float:none;
+ display:block;
+ width:auto
+ }
+ #footerbar .footer-main .theqtcompany {
+ clear:both;
+ float:left;
+ margin:30px 0 8px 3%
+ }
+ #footerbar .footer-main .footer-social {
+ float:left;
+ padding:50px 0px 0px 3%
+ }
+ #footerbar #menu-footer-submenu {
+ clear:both;
+ float:none;
+ display:block;
+ padding:0px 0px 3.9% 3%
+ }
+ ul#menu-footer-submenu {
+ margin-left: 0
+ }
+}
+.cookies_yum {
+ background-color:#cecfd5;
+ display:none;
+ width:100%
+}
+.cookies_yum img {
+ width:25px;
+ top:6px;
+ display:inline-block;
+ position:absolute;
+ left:13px
+}
+.cookies_yum div {
+ margin:0 auto;
+ max-width:1280px;
+ min-height:30px;
+ padding:6px 0px 6px 0px;
+ position:relative
+}
+.cookies_yum p {
+ color:#09102b;
+ margin:0px;
+ font-size:0.79em;
+ display:inline-block;
+ line-height:1.2;
+ padding:0 30px 0 50px
+}
+.cookies_yum p a {
+ white-space:nowrap
+}
+.cookies_yum a:hover {
+ color:#46a2da
+}
+.cookies_yum .close {
+ width:15px;
+ height:15px;
+ background-image:url("cookiebar-x.png");
+ background-size:15px 30px;
+ background-position:top left;
+ cursor:pointer;
+ top:13px;
+ right:13px;
+ position:absolute;
+ transition:none
+}
+.cookies_yum .close:hover {
+ background-position:bottom left
+}
+#sidebar-toggle,#toc-toggle {
+ width:24px;
+ height:14px;
+ background-size:24px 28px;
+ cursor:pointer;
+ background-image:url("list_expand.png");
+ float:right
+}
+#sidebar-toggle.collapsed,
+#toc-toggle.collapsed {
+ background-position:bottom left
+}
+#sidebar-content > h2 {
+ display:none
+}
+#footerbar {
+ background:#222840;
+ color:#fff;
+ font-size: 0.9em;
+}
+#footerbar.fixed {
+ bottom:0;
+ left:0;
+ width:100%
+}
+#footerbar .footer-nav {
+ display:inline;
+ float:left
+}
+#footerbar .footer-main .footer-nav li {
+ float:left;
+ margin-right:1em
+}
+#footerbar .footer-main .footer-nav li a {
+ display:block;
+ padding:30px 0 10px 0;
+ line-height:20px;
+ height:20px;
+ color:#fff;
+ font-weight: 600;
+}
+#footerbar .footer-main .footer-nav li a:hover,#footerbar .footer-main .footer-nav li.current-menu-item a {
+ color:#eee
+}
+#footerbar .footer-main .footer-nav .sub-menu {
+ margin-left:0;
+ margin-bottom:0
+}
+#footerbar .footer-main .footer-nav .sub-menu li {
+ float:none;
+ width: 100%;
+}
+#footerbar .footer-main .footer-nav .sub-menu ul {
+ padding:1px 1em;
+ font-size:0.786em;
+ line-height:8px;
+ float:none;
+ color:#5d5b59;
+ margin-bottom:0
+}
+#footerbar .footer-main .footer-nav .sub-menu li a {
+ padding:2px 0;
+ font-size:1em;
+ float:none;
+ color:#cecfd5;
+ font-weight: 400;
+}
+#footerbar .footer-main .footer-nav .sub-menu li a:hover,#footerbar .footer-main .footer-nav .sub-menu li.current-menu-item a {
+ color:#eee
+}
+#footerbar .theqtcompany {
+ background:url("theqtcompany.png") no-repeat;
+ background-size:100%;
+ width:215px;
+ height:68px;
+ display:inline;
+ float:right;
+ margin:29px 0 28px 30px
+}
+#footerbar .footer-social {
+ display:inline;
+ float:right;
+ width:164px
+}
+#footerbar .footer-main .footer-social>div {
+ margin-left:0.1em;
+ margin-bottom:10px
+}
+#footerbar .disclaimer {
+ font-size:0.786em;
+ line-height:2.73;
+ color:#868584;
+ padding-top:20px;
+ padding-bottom:0.5%
+}
+#footerbar .disclaimer a {
+ color:#bdbebf
+}
+#footerbar .disclaimer a:hover {
+ color:#d6d6d6
+}
+#footerbar .disclaimer ul li {
+ float:left;
+ vertical-align:middle;
+ margin-left:1.18em
+}
+#footerbar .disclaimer ul li:first-child {
+ margin-left:0
+}
+#footerbar .disclaimer ul.lang-selector a {
+ color:#506a34;
+ color:rgba(128,195,66,0.3)
+}
+#footerbar .disclaimer ul.lang-selector a:hover {
+ color:#80c342;
+ color:rgba(128,195,66,0.7)
+}
+#menu-footer-menu, #menu-footer-menu ul {
+ margin-left:0;
+ margin-bottom:0
+}
+@font-face {
+ font-family: 'Titillium Web';
+ font-style: normal;
+ font-weight: 400;
+ src: url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-regular.eot");
+ /* IE9 Compat Modes */
+ src: local("Titillium Web"), local("TitilliumWeb-Regular"), url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-regular.eot?#iefix") format("embedded-opentype"), url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-regular.woff2") format("woff2"), url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-regular.woff") format("woff"), url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-regular.ttf") format("truetype"), url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-regular.svg#TitilliumWeb") format("svg");
+ /* Legacy iOS */
+}
+/* titillium-web-italic - latin_latin-ext */
+@font-face {
+ font-family: 'Titillium Web';
+ font-style: italic;
+ font-weight: 400;
+ src: url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-italic.eot");
+ /* IE9 Compat Modes */
+ src: local("Titillium WebItalic"), local("TitilliumWeb-Italic"), url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-italic.eot?#iefix") format("embedded-opentype"), url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-italic.woff2") format("woff2"), url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-italic.woff") format("woff"), url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-italic.ttf") format("truetype"), url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-italic.svg#TitilliumWeb") format("svg");
+ /* Legacy iOS */
+}
+/* titillium-web-600 - latin_latin-ext */
+@font-face {
+ font-family: 'Titillium Web';
+ font-style: normal;
+ font-weight: 600;
+ src: url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-600.eot");
+ /* IE9 Compat Modes */
+ src: local("Titillium WebSemiBold"), local("TitilliumWeb-SemiBold"), url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-600.eot?#iefix") format("embedded-opentype"), url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-600.woff2") format("woff2"), url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-600.woff") format("woff"), url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-600.ttf") format("truetype"), url("//d33sqmjvzgs8hq.cloudfront.net/wp-content/themes/oneqt/assets/fonts/titillium-web-v4-latin_latin-ext-600.svg#TitilliumWeb") format("svg");
+ /* Legacy iOS */
+}
+@font-face {
+ font-family:monospace;
+ font-style:normal;
+ font-weight:400;
+ src:local("Droid Sans Mono"),local("DroidSansMono"),url(//fonts.gstatic.com/s/droidsansmono/v7/ns-m2xQYezAtqh7ai59hJUYuTAAIFFn5GTWtryCmBQ4.woff) format("woff")
+}
+@font-face {
+ font-family:'Qt Icons';
+ src:url("../style/icomoon.eot?-tgjuoj");
+ src:url("../style/icomoon.eot?#iefix-tgjuoj") format("embedded-opentype"),url("../style/icomoon.woff?-tgjuoj") format("woff"),url("../style/icomoon.ttf?-tgjuoj") format("truetype"),url("../style/icomoon.svg?-tgjuoj#icomoon") format("svg");
+ font-weight:normal;
+ font-style:normal
+}
+@font-face {
+ font-family:'social-icons';
+ src:url("../style/social-icons.eot?54625607");
+ src:url("../style/social-icons.eot?54625607#iefix") format("embedded-opentype"),
+ url("../style/social-icons.woff?54625607") format("woff");
+ font-weight:normal;
+ font-style:normal
+}
+.clearfix:before,.clearfix:after {
+ content:" ";
+ display:table
+}
+.clearfix:after {
+ clear:both
+}
+.clearfix {
+ *zoom:1
+}
+.clearfix .right {
+ float:right
+}
+html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video {
+ margin:0;
+ padding:0;
+ border:0;
+ font-size:100%;
+ line-height: 1.4;
+}
+html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,caption,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video {
+ vertical-align:baseline
+}
+h1,h2,h3,h4,h5,h6 {
+ font-weight:300
+}
+.body h2,.body h3,.body h4,.body h5,.body h6 {
+ margin:1.5em 0 0.75em
+}
+.body h1 {
+ margin-bottom:0.75em;
+ font-size:2.25em;
+}
+.body h3.fn,.body h3.flags {
+ color:#26282a;
+ font-size:1.46em;
+ padding:15px 0 15px 0;
+ border-bottom:2px #eee solid;
+ word-wrap:break-word
+}
+.body .fngroup {
+ border-bottom:2px #eee solid;
+ padding-bottom:15px;
+ margin-bottom:1.5em
+}
+.body .fngroup h3.fngroupitem {
+ margin:0;
+ padding-bottom:0;
+ border:none
+}
+.body h3.fn .name,
+.body h3 span.type,
+.qmlname span.name {
+ font-weight: 400
+}
+.qmlname {
+ font-size:1.46em
+}
+.qmlproto table {
+ border:none;
+ border-bottom:2px #eee solid
+}
+.qmlproto table p {
+ max-width:100%
+}
+.qmlproto table tr {
+ background-color:#fff
+}
+.qmlname td, .qmlname th {
+ border:none;
+ text-align:left;
+ padding:5px 0 0 0
+}
+.qmlreadonly,.qmldefault {
+ padding:0 5px 0 5px;
+ font-size:0.75em;
+ background-color:#eee;
+ float:right
+}
+.qmlreadonly {
+ color:#414141
+}
+.qmldefault {
+ color:#D14141
+}
+.rightAlign {
+ padding:3px 5px 3px 10px;
+ text-align:right
+}
+.centerAlign.functionIndex {
+ text-align:center;
+ font-size:150%;
+ margin-bottom: 1em
+}
+article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section {
+ display:block
+}
+body {
+ line-height:1.25em;
+ font-family: Arial, Helvitica;
+ font-weight:400;
+ transition-duration:1s;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ font-size: 16px;
+ background-color:#f3f3f4;
+ color:#404244;
+}
+ol,ul {
+ list-style-type: square;
+ #color: #17a81a;
+}
+.body ol,.body ul {
+ margin-top:0.75em;
+ margin-left:20px
+}
+.bodywrapper ol>li {
+ list-style-type:decimal;
+ margin-left:15px
+}
+.bodywrapper ol.a >li {
+ list-style-type:lower-alpha;
+}
+.bodywrapper ol.A >li {
+ list-style-type:upper-alpha;
+}
+.bodywrapper ol.i >li {
+ list-style-type:lower-roman;
+}
+.bodywrapper ol.I >li {
+ list-style-type:upper-roman;
+}
+.body li p {
+ margin-top:1em
+}
+blockquote,q {
+ quotes:none;
+ border-left:10px solid #ddd;
+ padding-left:10px
+}
+blockquote:before,blockquote:after,q:before,q:after {
+ content:'';
+ content:none;
+ width:100%
+}
+table {
+ border-collapse:collapse;
+ border-spacing:0;
+ margin-bottom:5px;
+ width:100%
+}
+a {
+ color:#17a81a;
+ text-decoration:none;
+ transition-duration:0.3s
+}
+a:hover {
+ color:#17a81a
+}
+.main,#footerbar>div {
+ max-width:1280px;
+ width:95%;
+ margin:0 auto
+}
+.main {
+ margin-top:80px
+}
+@media (max-width: 1120px) {
+ .main,.navbar-header,#footerbar>div {
+ width: 100%;
+ margin: 0;
+ }
+ .main .main-rounded {
+ padding: 0 15px;
+ }
+}
+.main_index {
+ background-color:#fff
+}
+.sectionlist {
+ margin-bottom:2em
+}
+[class*="col-"] {
+ letter-spacing:normal
+}
+.landing,.main_index .row {
+ letter-spacing:-0.31em
+}
+.main_index .row>div {
+ letter-spacing:normal
+}
+.col-1,.body {
+ display:inline-block;
+ background-color:#fff;
+ padding: 25px 35px 20px 30px;
+ -webkit-box-sizing:border-box;
+ -moz-box-sizing:border-box;
+ -ms-box-sizing:border-box;
+ box-sizing:border-box;
+}
+.col-1 h2 {
+ font-size:1.8em;
+ font-weight:300;
+ line-height:1.1;
+ margin-bottom:0.83em;
+ margin-top:1em
+}
+.icons1of3 img {
+ display:inline-block;
+ float:left;
+ margin-right:0.75em;
+ margin-top:-5px;
+ width:2.75em
+}
+div.multi-column {
+ position:relative
+}
+div.multi-column div {
+ display:-moz-inline-box;
+ display:inline-block;
+ vertical-align:top;
+ margin-top:1em;
+ margin-right:2em;
+ width:16em
+}
+.sidebar {
+ display:block;
+ position:relative;
+ position:sticky;
+ float:left;
+ -webkit-box-sizing:border-box;
+ -moz-box-sizing:border-box;
+ -ms-box-sizing:border-box;
+ box-sizing:border-box;
+ width:20%;
+ padding-right:20px
+}
+.sidebar li {
+ text-overflow:ellipsis;
+ overflow:hidden
+}
+.toc,.sectionlist {
+ padding:25px;
+ background-color:#fff;
+ margin-bottom:1.25em
+}
+.sidebar .sectionlist p {
+ margin-bottom:0
+}
+.sectionlist.promo {
+ padding:0;
+ background-color:#f3f3f4
+}
+.sidebar-content:empty {
+ display:none;
+ visibility:hidden
+}
+.col-2 h2,.toc h3,.sidebar-content h2,
+.sidebar-content h3,.sectionlist h2,
+.sphinxsidebar {
+ position: fixed;
+ overflow: scroll;
+ overflow-x: hidden;
+ overflow-y: hidden;
+}
+.sphinxsidebar h3 {
+ font-weight: bold;
+ margin-bottom:1em;
+}
+.toc h3 a {
+ color:#404244
+}
+.title {
+ font-size:2.25em;
+ font-weight:300;
+ letter-spacing:-1px;
+ line-height:1.15em;
+ margin-bottom:0.5em;
+ word-wrap:break-word
+}
+.navigationbar,col-1 h2 {
+ font-size:0.85em
+}
+.navigationbar h1 {
+ font-size:2.5em;
+ margin-bottom:0.85em;
+ margin-top:0.85em
+}
+.navigationbar li {
+ display:inline-block;
+ margin-right:5px;
+ position:relative;
+ padding-right:10px;
+ color:#585a5c
+}
+.navigationbar ul:last-of-type li a {
+ color:#404244
+}
+.sectionlist li, .sphinxsidebar li {
+ padding-bottom: 10px;
+ line-height: 1.75em;
+}
+.col-1 ul {
+ margin-bottom:1.56em
+}
+.bodywrapper li {
+ margin-top:0.5em;
+ line-height:1.25em
+}
+.bodywrapper li.level2 {
+ margin-left:10px;
+ margin-top:0.4em;
+ font-size:0.9375em;
+}
+.bodywrapper p,
+.bodywrapper dd {
+ line-height:1.25em;
+ margin:1em 0 1em;
+ color:#404244
+}
+.bodywrapper b {
+ font-weight:600
+}
+.body ul,.body ol {
+ /* margin-bottom:1.5em */
+}
+.bodywrapper ul ul {
+ margin-top:0.5em
+}
+.bodywrapper .naviNextPrevious {
+ margin-top:25px;
+ max-width:100%
+}
+.naviNextPrevious.headerNavi,
+p.naviNextPrevious + p {
+ display:none
+}
+.nextPage {
+ float:right
+}
+.prevPage:before {
+ content:"< "
+}
+.nextPage:after {
+ content:" >"
+}
+.navigationbar li a {
+ color:#404244
+}
+.navigationbar li:after {
+ color:#404244;
+ content:"›";
+ display:inline-block;
+ font-size:1.5em;
+ line-height:1;
+ position:absolute;
+ right:-2px;
+ top:-4px
+}
+.sub-navigation {
+ margin-top:10px
+}
+.navigationbar li:last-child:after,.sub-navigation li:after {
+ content:none
+}
+.navigationbar {
+ margin-bottom:10px;
+ line-height:1em
+}
+#buildversion {
+ margin-bottom:10px;
+ font-style:italic;
+ font-size:small;
+ float:right
+}
+.copy-notice {
+ width:75%;
+ font-size:0.75em;
+ margin:20px 35px 0 10px;
+ line-height:1.75em;
+ float:right;
+ color:#585a5c
+}
+.copy-notice.index {
+ margin-top:10px;
+ float:none
+}
+li a.active {
+ color:#585a5c
+}
+.flowList {
+ padding:25px
+}
+.flowListDiv dl {
+ -webkit-column-count:1;
+ -moz-column-count:1;
+ column-count:1
+}
+.flowList dd {
+ display:inline-block;
+ margin-left:10px;
+ width:90%;
+ line-height:1.15em;
+ overflow-x:hidden;
+ text-overflow:ellipsis
+}
+.alphaChar {
+ font-size:2em;
+ position:absolute
+}
+.flowList.odd {
+ background-color:#f9f9f9
+}
+.body ul>li,.doc-column ul>li {
+ list-style-image:url("list_arrow.png");
+ margin-left:15px;
+ color:#404244;
+ margin-top:0.65em;
+ line-height:1em
+}
+.bodywrapper table p {
+ margin:0px;
+ padding:0px
+}
+.bodywrapper table p {
+ margin:0px;
+ padding:0px;
+ min-height:1.25em
+}
+.bodywrapper .qmldoc {
+ margin-top:0.75em
+}
+.body h2 {
+ margin-top: 1.5em;
+ font-size:1.75em
+}
+.body h3 {
+ font-size:1.35em
+}
+.body h4 {
+ font-size:1.15em
+}
+.body p img {
+ margin-top:0.75em;
+ max-width:100%
+}
+.body .border img {
+ box-shadow:3px 3px 8px 3px rgba(200,200,200,0.5)
+}
+.body .border .player {
+ box-shadow:3px 3px 8px 3px rgba(200,200,200,0.5)
+}
+.body p.figCaption {
+ transform:translateY(-30px);
+ color:#606366;
+ font-size:95%;
+ margin-left:3px;
+ font-style:italic
+}
+.body table {
+ width:initial;
+ vertical-align:initial
+}
+table .odd {
+ background-color:#f9f9f9
+}
+table thead {
+ text-align:left;
+ padding-left:20px
+}
+table,table td,table th {
+ border:1px solid #eee
+}
+table td,table th {
+ padding:5px 20px;
+ line-height:1.3
+}
+.body .fixed table td {
+ min-width:50%;
+ width:50%
+}
+table.alignedsummary,table.propsummary {
+ width:initial
+}
+table.valuelist td.tblval {
+ font-size:0.75em
+}
+div.main_index .row {
+ border-bottom:10px solid #f3f3f4
+}
+div.main_index .row {
+ position:relative
+}
+div.main_index .row>div {
+ display:inline-block;
+ width:50%;
+ vertical-align:top;
+ padding:2em 3em;
+ -webkit-box-sizing:border-box;
+ -moz-box-sizing:border-box;
+ -ms-box-sizing:border-box;
+ box-sizing:border-box
+}
+div.main_index h2 {
+ font-size:2.1875em;
+ margin-bottom:1em
+}
+#search_bar {
+ width:40%;
+ float:right
+}
+div.main_index .row:after {
+ content:"";
+ position:absolute;
+ top:0;
+ right:50%;
+ height:100%;
+ width:10px;
+ background-color:#f3f3f4
+}
+div.table {
+ overflow-x:auto
+}
+.body tr > td > pre {
+ font-size:0.75em
+}
+p.qt_commercial {
+ border:3px solid #5caa15;
+ margin:0 auto;
+ padding:15px;
+ width:28%;
+ text-align:center;
+ clear:both
+}
+h1.qt_commercial {
+ padding:20px;
+ background-color:#5caa15;
+ display:inline;
+ float:right;
+ font-size:1.25em;
+ line-height:1.25em;
+ height:1.25em;
+ color:#fff
+}
+div.qt_commercial {
+ border-top:5px solid #5caa15;
+ margin-bottom:50px
+}
+div.pre {
+ position:relative;
+ height:auto
+}
+pre, .LegaleseLeft {
+ background-color:#222840;
+ color:#fff;
+ display:block;
+ font-family:monospace;
+ line-height:1.5;
+ overflow-x:auto;
+ margin-bottom:25px;
+ padding:25px;
+ margin-top:0.75em;
+ font-size: .8em;
+}
+.bodywrapper .LegaleseLeft p {
+ color:#fff;
+ white-space: pre-wrap
+}
+pre .str,code .str {
+ color:#aaaaaa
+}
+pre .kwd,code .kwd {
+ color:#ffff55
+}
+pre .com,code .com {
+ color:#55ffff
+}
+pre .typ,code .typ {
+ color:#4f9d08
+}
+pre a .typ,code a .typ {
+ color:#21be2b
+}
+pre .lit,code .lit {
+ color:#ff55ff
+}
+pre .pun,code .pun {
+ color:#fff
+}
+pre .pln,code .pln {
+ color:#fff
+}
+@media print {
+ pre {
+ background-color:#eee !important
+ }
+ pre .str,code .str {
+ color:#060
+ }
+ pre .kwd,code .kwd{
+ color:#006;
+ font-weight:bold
+ }
+ pre .com,code .com {
+ color:#600
+ }
+ pre .typ,code .typ {
+ color:#404;
+ font-weight:bold
+ }
+ pre .lit,code .lit {
+ color:#044
+ }
+ pre .pun,code .pun {
+ color:#440
+ }
+ pre .pln,code .pln {
+ color:#000
+ }
+}
+pre.wrap {
+ white-space:pre-wrap
+}
+pre span.wrap {
+ display:none;
+ background:url("wrap.png") no-repeat;
+ right:0;
+ top:2px;
+ position:absolute;
+ width:20px;
+ height:14px;
+ margin:4px;
+ opacity:0.65
+}
+
+span.pre {
+ color: #09102d;
+}
+
+span.wrap:hover {
+ opacity:1
+}
+span.wrap:active {
+ opacity:0.75
+}
+.copy_text {
+ background-color:#46a2da;
+ color:#fff;
+ border:2px solid #46a2da;
+ padding:10px 16px;
+ margin-left:-10px;
+ margin-top:-50px;
+ position:absolute;
+ opacity:0;
+ cursor:pointer;
+ float:right
+}
+.copy_text:hover {
+ background-color:#fff;
+ color:#46a2da
+}
+code,.codelike {
+ font-family:monospace;
+}
+#detailed-description .function dt > code,
+#detailed-description .function dt > em {
+ font-weight:bold
+}
+h3.fn code {
+ font-size:0.75em;
+ float:right;
+ background-color:#eee;
+ padding:3px;
+ margin: 3px 0 0 20px
+}
+pre:hover>.copy_text {
+ display:inline-block;
+ opacity:1;
+ transition:0.5s ease
+}
+#main_title_bar {
+ background:url("pyside-logo.png") no-repeat;
+ background-size:100%;
+ width:366px;
+ height:86px;
+ margin:15px 0 15px 0
+}
+#main_title_bar h1 {
+ visibility:hidden
+}
+#main_title_bar .search_bar {
+ letter-spacing:normal;
+ width:50%;
+ display:inline-block;
+ -webkit-box-sizing:border-box;
+ -moz-box-sizing:border-box;
+ -ms-box-sizing:border-box;
+ box-sizing:border-box;
+ vertical-align:middle
+}
+#main_title_bar h1 {
+ letter-spacing:normal;
+ display:inline-block;
+ -webkit-box-sizing:border-box;
+ -moz-box-sizing:border-box;
+ -ms-box-sizing:border-box;
+ box-sizing:border-box;
+ vertical-align:middle
+}
+#main_title_bar .search_bar * {
+ letter-spacing:normal;
+ padding:0;
+ margin:0;
+ border:none
+}
+#sidebar-toggle,#toc-toggle {
+ display:none
+}
+@media (max-width: 980px) {
+ body {
+ font-size:calc-em(14px)
+ }
+ #main_title_bar>h1,#main_title_bar .search_bar {
+ width:100%
+ }
+ #main_title_bar .search_bar {
+ margin-bottom:15px
+ }
+ .main {
+ margin-top:0px
+ }
+ .main_index .row {
+ border:none !important
+ }
+ .title {
+ font-size:1.5em;
+ font-weight:400;
+ word-wrap:break-word
+ }
+ .col-1,.body,.naviNextPrevious,.sidebar {
+ padding:10px
+ }
+ .sidebar {
+ position:relative;
+ padding-top:0
+ }
+ .search .sidebar {
+ display:none;
+ visibility:hidden
+ }
+ .col-2 h2,.toc h3,.sidebar-content h2,.sidebar-content h3,.sectionlist h2 {
+ text-align:center;
+ margin-bottom:5px
+ }
+ div.main_index .row:after {
+ content:none
+ }
+ div.main_index .row>div {
+ display:block !important;
+ width:100%;
+ padding:15px;
+ margin:0
+ }
+ .body,.sidebar,.col-1 {
+ width:100%
+ }
+ .sidebar-content,.col-2,.toc {
+ background-color:#fff;
+ margin-bottom:1em;
+ padding:20px
+ }
+ #sidebar-toggle,#toc-toggle {
+ display:block
+ }
+ #sidebar-toggle.collapsed + h2 {
+ display:block
+ }
+ .bodywrapper p {
+ margin-bottom:1em;
+ max-width:100%
+ }
+ table td,table th {
+ padding:5px 5px
+ }
+ .sectionlist {
+ padding:0
+ }
+ .sidebar > .sectionlist {
+ padding:20px
+ }
+ .sectionlist.promo {
+ max-width:46%;
+ margin:0 auto 1em auto;
+ float:left;
+ padding:0 2%
+ }
+ .sidebar .sidebar-content {
+ clear:both
+ }
+ .copy-notice {
+ float:none;
+ width:initial
+ }
+}
+[id]:target > *:first-child,
+dt[id]:target {
+ -webkit-animation:highlighter 3s;
+ animation:highlighter 3s
+}
+@-webkit-keyframes highlighter {
+ 25% {
+ background-color:#d1e8f6;
+ color:#444
+ }
+ 75% {
+ background-color:#d1e8f6;
+ color:#444
+ }
+}
+@keyframes highlighter {
+ 25% {
+ background-color:#d1e8f6;
+ color:#444
+ }
+ 75% {
+ background-color:#d1e8f6;
+ color:#444
+ }
+}
+@-webkit-keyframes copypaste {
+ 25% {
+ opacity:1
+ }
+ 100% {
+ border-radius:10px;
+ margin-top:-50px;
+ opacity:1
+ }
+}
+@keyframes copypaste {
+ 25% {
+ opacity:1
+ }
+ 100% {
+ border-radius:10px;
+ margin-top:-50px;
+ opacity:1
+ }
+}
+#footer {
+ clear:both
+}
+.footer-social i {
+ font-family: "social-icons";
+ font-style: normal;
+ font-size:150%;
+ margin: .55em;
+ color: #cecfd5
+}
+.footer-social i:hover {
+ color: #eee
+}
+.footer-social .icon-twitter:before {
+ content: '\f099'
+}
+.footer-social .icon-facebook:before {
+ content: '\f09a'
+}
+.footer-social .icon-youtube:before {
+ content: '\f16a'
+}
+.menuextraslanguages {
+ display:none;
+ visibility:hidden
+}
+
+input:focus {
+ border-color: #46a2da;
+ box-shadow: 0 0 5px #46a2da;
+ color: #000;
+}
+
+.animation {
+ width: 100%;
+ border-style: none;
+ border-width: 0
+}
+
+.player {
+ width: auto;
+ position: relative;
+ display: table;
+ margin-bottom:1.5em;
+}
+
+.playcontrol {
+ display: none;
+ background: url("play_icon.svg") no-repeat center,
+ linear-gradient(
+ rgba(0,0,0,0.15), rgba(0,0,0,0.15)
+ );
+ background-size: 25%;
+ width: 100%;
+ height: 100%;
+ position: absolute;
+ left: 0%;
+ right: 0%;
+ top: 0%;
+ bottom: 0%;
+ margin: auto
+}
+
+/* expand/collapse code sections */
+pre input {
+ display:none;
+ visibility:hidden
+}
+pre label {
+ display:block;
+ margin:-3px 3px 0 -16px;
+ text-align:center;
+ color:#21be2b;
+ float:left;
+}
+pre label:hover {
+ color:#fff
+}
+pre label::before {
+ font-weight:600;
+ font-size:16px;
+ content:"+";
+ display:inline-block;
+ width:16px;
+ height:16px
+}
+#ec_expand {
+ height:16px;
+ overflow:hidden;
+ transition:height 0.35s;
+}
+#ec_expand::before {
+ content:"...*/";
+ color:#aaa;
+ background-color:#3a4055;
+ z-index:99 !important;
+ right:25px;
+ position:absolute
+}
+#ec_toggle:checked ~ #ec_expand {
+ height:initial
+}
+#ec_toggle:checked ~ #ec_expand::before {
+ content:""
+}
+#ec_toggle:checked ~ label::before {
+ content:"-"
+}
+
+/* permalinks */
+h1:hover > .headerlink,
+h2:hover > .plink,
+h2:hover > .headerlink,
+h3:hover > .plink,
+h3:hover > .headerlink,
+h4:hover > .plink,
+h4:hover > .headerlink,
+h5:hover > .plink,
+h5:hover > .headerlink {
+ opacity:1
+}
+a.plink, a.headerlink {
+ opacity: 0;
+ padding-left: 8px;
+ font-size: 0.8em;
+ font-weight: 600;
+ transition: opacity 180ms ease-in-out
+}
+a.plink::before {
+ content:'\00B6'
+}
+
+table.special {
+ border: 3px;
+ padding: 0px;
+ border-collapse: separate;
+ border-spacing: 20px;
+ line-height: 1.5em;
+}
+
+.special p {
+ text-align: center;
+ color: #3a4055;
+}
+
+.special a {
+ display: block;
+ border-bottom: 0;
+ text-decoration: none;
+}
+
+.special a:hover {
+ border-bottom: 0;
+ text-decoration: none;
+}
+
+.special strong {
+ color: #17a81a;
+ font-size: 110%;
+ font-weight: normal;
+}
+
+table.special th,
+table.special td {
+ border: 1px solid #888;
+ padding-top: 14px;
+ padding-bottom: 14px;
+ padding-left: 6px;
+ padding-right: 5px;
+ border-radius: 5px;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -khtml-border-radius: 5px;
+}
+
+.special td:hover {
+ padding-top: 2px;
+ padding-bottom: 2px;
+ border-bottom: 4px solid #41cd52;
+}
diff --git a/sources/pyside6/doc/_themes/pysidedocs_qthelp/static/pysidelogo.png b/sources/pyside6/doc/_themes/pysidedocs_qthelp/static/pysidelogo.png
new file mode 100644
index 000000000..3a2f2bd17
--- /dev/null
+++ b/sources/pyside6/doc/_themes/pysidedocs_qthelp/static/pysidelogo.png
Binary files differ
diff --git a/sources/pyside6/doc/_themes/pysidedocs_qthelp/static/relbar_bg.png b/sources/pyside6/doc/_themes/pysidedocs_qthelp/static/relbar_bg.png
new file mode 100644
index 000000000..4036733a7
--- /dev/null
+++ b/sources/pyside6/doc/_themes/pysidedocs_qthelp/static/relbar_bg.png
Binary files differ
diff --git a/sources/pyside6/doc/_themes/pysidedocs_qthelp/theme.conf b/sources/pyside6/doc/_themes/pysidedocs_qthelp/theme.conf
new file mode 100644
index 000000000..4384b459c
--- /dev/null
+++ b/sources/pyside6/doc/_themes/pysidedocs_qthelp/theme.conf
@@ -0,0 +1,7 @@
+[theme]
+inherit = default
+stylesheet = pyside.css
+pygments_style = none
+
+[options]
+nosidebar = true
diff --git a/sources/pyside6/doc/additionaldocs.lst b/sources/pyside6/doc/additionaldocs.lst
new file mode 100644
index 000000000..e6ffe7e5d
--- /dev/null
+++ b/sources/pyside6/doc/additionaldocs.lst
@@ -0,0 +1,597 @@
+#############################################################################
+##
+## Copyright (C) 2018 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of Qt for Python.
+##
+## $QT_BEGIN_LICENSE:LGPL$
+## 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.
+##
+## GNU Lesser General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU Lesser
+## General Public License version 3 as published by the Free Software
+## Foundation and appearing in the file LICENSE.LGPL3 included in the
+## packaging of this file. Please review the following information to
+## ensure the GNU Lesser General Public License version 3 requirements
+## will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+##
+## GNU General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU
+## General Public License version 2.0 or (at your option) the GNU General
+## Public license version 3 or any later version approved by the KDE Free
+## Qt Foundation. The licenses are as published by the Free Software
+## Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+## included in the packaging of this file. Please review the following
+## information to ensure the GNU General Public License requirements will
+## be met: https://www.gnu.org/licenses/gpl-2.0.html and
+## https://www.gnu.org/licenses/gpl-3.0.html.
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+# This is a list of additional documentation files created by the below script
+# and some hand-editing.
+# for F in *.webxml
+# do
+# echo "$F" | egrep '(-index)|(-module)|(-qmlmodule)\.webxml$' > /dev/null
+# if [ $? -ne 0 ]
+# then
+# if fgrep '<para>' "$F" > /dev/null # Exclude reference only
+# then
+# egrep "(<class )|(<namespace )" $F > /dev/null || echo $F
+# fi
+# fi
+# done
+# A line enclosed in [] denotes a (relative) target directory
+[pyside-examples]
+all-pyside-examples.webxml
+pysideexamples-widgets-dialogs-classwizard-classwizard-pyproject.webxml
+pysideexamples-widgets-dialogs-classwizard-classwizard-py.webxml
+pysideexamples-widgets-dialogs-classwizard-classwizard-qrc.webxml
+pysideexamples-widgets-dialogs-classwizard-classwizard-rc-py.webxml
+pysideexamples-widgets-dialogs-classwizard-example.webxml
+pysideexamples-widgets-itemviews-stardelegate-example.webxml
+pysideexamples-widgets-itemviews-stardelegate-stardelegate-pyproject.webxml
+pysideexamples-widgets-itemviews-stardelegate-stardelegate-py.webxml
+pysideexamples-widgets-itemviews-stardelegate-stareditor-py.webxml
+pysideexamples-widgets-itemviews-stardelegate-starrating-py.webxml
+
+[overviews]
+animation-overview.webxml
+animation.webxml
+application-windows.webxml
+audiooverview.webxml
+bearer-management.webxml
+cameraoverview.webxml
+# changes.webxml
+codec-big5.webxml
+codec-big5hkscs.webxml
+codec-eucjp.webxml
+codec-euckr.webxml
+codec-gbk.webxml
+codec-sjis.webxml
+codec-tscii.webxml
+codecs-jis.webxml
+compatmap.webxml
+# containers.webxml
+coordsys.webxml
+creating-a-sensor-plugin.webxml
+custom-types.webxml
+datastreamformat.webxml
+datavisualization-examples.webxml
+determining-the-default-sensor-for-a-type.webxml
+dialogs.webxml
+dnd.webxml
+dynamic-sensor-backend-registration.webxml
+events.webxml
+eventsandfilters.webxml
+examples-desktop.webxml
+examples-dialogs.webxml
+examples-graphicsview.webxml
+examples-itemviews.webxml
+examples-mainwindow.webxml
+examples-network.webxml
+examples-painting.webxml
+examples-qthelp.webxml
+examples-qtuitools.webxml
+examples-richtext.webxml
+examples-widgets-opengl.webxml
+examples-widgets.webxml
+focus.webxml
+gallery.webxml
+genericbackend.webxml
+gestures-overview.webxml
+graphicsview.webxml
+guibooks.webxml
+helpsystem.webxml
+implicit-sharing.webxml
+io-functions.webxml
+io.webxml
+json.webxml
+layout.webxml
+location-cpp-qml.webxml
+location-maps-cpp.webxml
+location-maps-qml.webxml
+location-places-backend.webxml
+location-places-cpp.webxml
+location-places-qml.webxml
+location-plugin-esri.webxml
+location-plugin-here.webxml
+location-plugin-itemsoverlay.webxml
+location-plugin-mapbox.webxml
+location-plugin-mapboxgl.webxml
+location-plugin-osm.webxml
+location-positioning-cpp.webxml
+location-positioning-qml.webxml
+mainwindow.webxml
+metaobjects.webxml
+model-view-programming.webxml
+modelview.webxml
+multimedia-examples.webxml
+multimediabackend.webxml
+multimediaoverview.webxml
+object.webxml
+objecttrees.webxml
+painting.webxml
+paintsystem-devices.webxml
+paintsystem-drawing.webxml
+paintsystem-images.webxml
+paintsystem.webxml
+pdf-licensing.webxml
+plugins.webxml
+positioning-cpp-qml.webxml
+properties.webxml
+qfloat16.webxml
+qml-advtutorial.webxml
+qml-dynamicview-tutorial.webxml
+qml-location5-maps.webxml
+qml-multimedia.webxml
+qml-qtlocation5-maps.webxml
+qml-tutorial.webxml
+qml-tutorial1.webxml
+qml-tutorial2.webxml
+qml-tutorial3.webxml
+qmlexampletoggleswitch.webxml
+qt3d-advancedcustommaterial-example.webxml
+qt3d-audio-visualizer-qml-example.webxml
+qt3d-basicshapes-cpp-example.webxml
+qt3d-cpp.webxml
+qt3d-examples.webxml
+qt3d-multiviewport-example.webxml
+qt3d-overview.webxml
+qt3d-pbr-materials-example.webxml
+qt3d-planets-qml-example.webxml
+qt3d-qml.webxml
+qt3d-scene2d-example.webxml
+qt3d-scene3d-example.webxml
+qt3d-shadow-map-qml-example.webxml
+qt3d-simple-cpp-example.webxml
+qt3d-simple-qml-example.webxml
+qt3d-simplecustommaterial-example.webxml
+qt3d-wave-example.webxml
+qt3d-widgets-scene3d-example.webxml
+qt3d-wireframe-example.webxml
+qt3drender-framegraph.webxml
+qt3drender-geometry.webxml
+qt3drender-protips.webxml
+qtalgorithms.webxml
+qtconcurrent-imagescaling-example.webxml
+qtconcurrent-map-example.webxml
+qtconcurrent-progressdialog-example.webxml
+qtconcurrent-runfunction-example.webxml
+qtconcurrent-wordcount-example.webxml
+qtconcurrentfilter.webxml
+qtconcurrentmap.webxml
+qtconcurrentrun.webxml
+qtcore-ipc-localfortuneclient-example.webxml
+qtcore-ipc-localfortuneserver-example.webxml
+qtcore-ipc-sharedmemory-example.webxml
+qtcore-mimetypes-mimetypebrowser-example.webxml
+qtcore-serialization-savegame-example.webxml
+qtcore-threads-mandelbrot-example.webxml
+qtcore-threads-queuedcustomtype-example.webxml
+qtcore-threads-semaphores-example.webxml
+qtcore-threads-waitconditions-example.webxml
+qtcore-tools-contiguouscache-example.webxml
+qtcore-tools-customtype-example.webxml
+qtdatavisualization-audiolevels-example.webxml
+qtdatavisualization-bars-example.webxml
+qtdatavisualization-custominput-example.webxml
+qtdatavisualization-customitems-example.webxml
+qtdatavisualization-customproxy-example.webxml
+qtdatavisualization-data-handling.webxml
+qtdatavisualization-draggableaxes-example.webxml
+qtdatavisualization-interacting-with-data.webxml
+qtdatavisualization-itemmodel-example.webxml
+qtdatavisualization-known-issues.webxml
+qtdatavisualization-overview.webxml
+qtdatavisualization-qmlaxisdrag-example.webxml
+qtdatavisualization-qmlaxisformatter-example.webxml
+qtdatavisualization-qmlbars-example.webxml
+qtdatavisualization-qmlcustominput-example.webxml
+qtdatavisualization-qmllegend-example.webxml
+qtdatavisualization-qmlmultigraph-example.webxml
+qtdatavisualization-qmloscilloscope-example.webxml
+qtdatavisualization-qmlscatter-example.webxml
+qtdatavisualization-qmlspectrogram-example.webxml
+qtdatavisualization-qmlsurface-example.webxml
+qtdatavisualization-qmlsurfacelayers-example.webxml
+qtdatavisualization-rotations-example.webxml
+qtdatavisualization-scatter-example.webxml
+qtdatavisualization-surface-example.webxml
+qtdatavisualization-texturesurface-example.webxml
+qtdatavisualization-volumetric-example.webxml
+qtest-overview.webxml
+qtest-tutorial.webxml
+qtglobal.webxml
+qtgui-analogclock-example.webxml
+qtgui-hellovulkancubes-example.webxml
+qtgui-hellovulkantexture-example.webxml
+qtgui-hellovulkantriangle-example.webxml
+qtgui-hellovulkanwidget-example.webxml
+qtgui-hellovulkanwindow-example.webxml
+qtgui-openglwindow-example.webxml
+qtgui-rasterwindow-example.webxml
+qthelp-framework.webxml
+qthelpproject.webxml
+qtlocation-changes.webxml
+qtlocation-cpp.webxml
+qtlocation-examples.webxml
+qtlocation-geoservices.webxml
+qtlocation-mapviewer-example.webxml
+qtlocation-minimal-map-example.webxml
+qtlocation-places-example.webxml
+qtlocation-places-list-example.webxml
+qtlocation-places-map-example.webxml
+qtlocation-planespotter-example.webxml
+qtmath.webxml
+qtmultimedia-ios.webxml
+qtmultimedia-multimedia-audiodevices-example.webxml
+qtmultimedia-multimedia-audioengine-example.webxml
+qtmultimedia-multimedia-audioinput-example.webxml
+qtmultimedia-multimedia-audiooutput-example.webxml
+qtmultimedia-multimedia-audiorecorder-example.webxml
+qtmultimedia-multimedia-declarative-camera-example.webxml
+qtmultimedia-multimedia-declarative-radio-example.webxml
+qtmultimedia-multimedia-spectrum-example.webxml
+qtmultimedia-multimedia-video-qmlvideo-example.webxml
+qtmultimedia-multimedia-video-qmlvideofx-example.webxml
+qtmultimedia-multimediawidgets-camera-example.webxml
+qtmultimedia-multimediawidgets-player-example.webxml
+qtmultimedia-multimediawidgets-videographicsitem-example.webxml
+qtmultimedia-multimediawidgets-videowidget-example.webxml
+qtmultimedia-windows.webxml
+qtnetwork-blockingfortuneclient-example.webxml
+qtnetwork-broadcastreceiver-example.webxml
+qtnetwork-broadcastsender-example.webxml
+qtnetwork-download-example.webxml
+qtnetwork-downloadmanager-example.webxml
+qtnetwork-fortuneclient-example.webxml
+qtnetwork-fortuneserver-example.webxml
+qtnetwork-googlesuggest-example.webxml
+qtnetwork-http-example.webxml
+qtnetwork-loopback-example.webxml
+qtnetwork-multicastreceiver-example.webxml
+qtnetwork-multicastsender-example.webxml
+qtnetwork-network-chat-example.webxml
+qtnetwork-programming.webxml
+qtnetwork-securesocketclient-example.webxml
+qtnetwork-threadedfortuneserver-example.webxml
+qtnetwork-torrent-example.webxml
+qtopengl-2dpainting-example.webxml
+qtopengl-cube-example.webxml
+qtopengl-hellogl2-example.webxml
+qtpositioning-examples.webxml
+qtpositioning-geoflickr-example.webxml
+qtpositioning-logfilepositionsource-example.webxml
+qtpositioning-plugins.webxml
+qtpositioning-satelliteinfo-example.webxml
+qtpositioning-weatherinfo-example.webxml
+qtquick-animation-example.webxml
+qtquick-bestpractices.webxml
+qtquick-canvas-example.webxml
+qtquick-codesamples.webxml
+qtquick-convenience-topic.webxml
+qtquick-cppextensionpoints.webxml
+qtquick-customitems-dialcontrol-example.webxml
+qtquick-customitems-flipable-example.webxml
+qtquick-customitems-painteditem-example.webxml
+qtquick-customitems-scrollbar-example.webxml
+qtquick-customitems-tabwidget-example.webxml
+qtquick-demos-calqlatr-example.webxml
+qtquick-demos-clocks-example.webxml
+qtquick-demos-maroon-example.webxml
+qtquick-demos-photosurface-example.webxml
+qtquick-demos-photoviewer-example.webxml
+qtquick-demos-rssnews-example.webxml
+qtquick-demos-samegame-example.webxml
+qtquick-demos-stocqt-example.webxml
+qtquick-demos-tweetsearch-example.webxml
+qtquick-draganddrop-example.webxml
+qtquick-effects-particles.webxml
+qtquick-effects-sprites.webxml
+qtquick-effects-topic.webxml
+qtquick-effects-transformations.webxml
+qtquick-externaldraganddrop-example.webxml
+qtquick-imageelements-example.webxml
+qtquick-imageprovider-example.webxml
+qtquick-imageresponseprovider-example.webxml
+qtquick-input-focus.webxml
+qtquick-input-mouseevents.webxml
+qtquick-input-textinput.webxml
+qtquick-input-topic.webxml
+qtquick-keyinteraction-example.webxml
+qtquick-layouts-example.webxml
+qtquick-localstorage-example.webxml
+qtquick-modelviewsdata-cppmodels.webxml
+qtquick-modelviewsdata-modelview.webxml
+qtquick-modelviewsdata-topic.webxml
+qtquick-mousearea-example.webxml
+qtquick-particles-affectors-example.webxml
+qtquick-particles-customparticle-example.webxml
+qtquick-particles-emitters-example.webxml
+qtquick-particles-imageparticle-example.webxml
+qtquick-particles-performance.webxml
+qtquick-particles-system-example.webxml
+qtquick-positioners-example.webxml
+qtquick-positioning-anchors.webxml
+qtquick-positioning-layouts.webxml
+qtquick-positioning-righttoleft.webxml
+qtquick-positioning-topic.webxml
+qtquick-quick-accessibility-example.webxml
+qtquick-righttoleft-example.webxml
+qtquick-scenegraph-customgeometry-example.webxml
+qtquick-scenegraph-materials.webxml
+qtquick-scenegraph-nodes.webxml
+qtquick-scenegraph-openglunderqml-example.webxml
+qtquick-scenegraph-simplematerial-example.webxml
+qtquick-shadereffects-example.webxml
+qtquick-shapes-example.webxml
+qtquick-statesanimations-animations.webxml
+qtquick-statesanimations-behaviors.webxml
+qtquick-statesanimations-states.webxml
+qtquick-statesanimations-topic.webxml
+qtquick-text-example.webxml
+qtquick-text-validator.webxml
+qtquick-threading-example.webxml
+qtquick-threading-threadedlistmodel-example.webxml
+qtquick-tools-and-utilities.webxml
+qtquick-touchinteraction-example.webxml
+qtquick-tutorials-dynamicview-dynamicview1-example.webxml
+qtquick-tutorials-dynamicview-dynamicview2-example.webxml
+qtquick-tutorials-dynamicview-dynamicview3-example.webxml
+qtquick-tutorials-dynamicview-dynamicview4-example.webxml
+qtquick-tutorials-samegame-samegame1-example.webxml
+qtquick-tutorials-samegame-samegame2-example.webxml
+qtquick-tutorials-samegame-samegame3-example.webxml
+qtquick-tutorials-samegame-samegame4-example.webxml
+qtquick-views-example.webxml
+qtquick-visualcanvas-adaptations-d3d12.webxml
+qtquick-visualcanvas-adaptations-openvg.webxml
+qtquick-visualcanvas-adaptations-software.webxml
+qtquick-visualcanvas-adaptations.webxml
+qtquick-visualcanvas-coordinates.webxml
+qtquick-visualcanvas-scenegraph-renderer.webxml
+qtquick-visualcanvas-scenegraph.webxml
+qtquick-visualcanvas-topic.webxml
+qtquick-visualcanvas-visualparent.webxml
+qtquick-visualtypes-topic.webxml
+qtquick-window-example.webxml
+qtquicklayouts-overview.webxml
+qtsensorgestures-cpp.webxml
+qtsensors-accelbubble-example.webxml
+qtsensors-cpp.webxml
+qtsensors-examples.webxml
+qtsensors-grue-example.webxml
+qtsensors-maze-example.webxml
+qtsensors-porting.webxml
+qtsensors-qmlqtsensors-example.webxml
+qtsensors-qmlsensorgestures-example.webxml
+qtsensors-sensor-explorer-example.webxml
+qtsensors-sensorgestures-example.webxml
+qtsensors-shakeit-example.webxml
+qtsql-books-example.webxml
+qtsql-cachedtable-example.webxml
+qtsql-drilldown-example.webxml
+qtsql-masterdetail-example.webxml
+qtsql-sqlwidgetmapper-example.webxml
+qtsvg-richtext-textobject-example.webxml
+qtsvg-svggenerator-example.webxml
+qtsvg-svgviewer-example.webxml
+qttestlib-tutorial1-example.webxml
+qttestlib-tutorial2-example.webxml
+qttestlib-tutorial3-example.webxml
+qttestlib-tutorial4-example.webxml
+qttestlib-tutorial5-example.webxml
+qttestlib-tutorial6.webxml
+qtuitools-multipleinheritance-example.webxml
+qtuitools-textfinder-example.webxml
+qtwidgets-animation-easing-example.webxml
+qtwidgets-animation-moveblocks-example.webxml
+qtwidgets-animation-stickman-example.webxml
+qtwidgets-animation-sub-attaq-example.webxml
+qtwidgets-desktop-screenshot-example.webxml
+qtwidgets-desktop-systray-example.webxml
+qtwidgets-dialogs-classwizard-example.webxml
+qtwidgets-dialogs-extension-example.webxml
+qtwidgets-dialogs-findfiles-example.webxml
+qtwidgets-dialogs-licensewizard-example.webxml
+qtwidgets-dialogs-tabdialog-example.webxml
+qtwidgets-dialogs-trivialwizard-example.webxml
+qtwidgets-draganddrop-draggableicons-example.webxml
+qtwidgets-draganddrop-dropsite-example.webxml
+qtwidgets-draganddrop-fridgemagnets-example.webxml
+qtwidgets-draganddrop-puzzle-example.webxml
+qtwidgets-effects-blurpicker-example.webxml
+qtwidgets-effects-fademessage-example.webxml
+qtwidgets-gestures-imagegestures-example.webxml
+qtwidgets-graphicsview-anchorlayout-example.webxml
+qtwidgets-graphicsview-basicgraphicslayouts-example.webxml
+qtwidgets-graphicsview-boxes-example.webxml
+qtwidgets-graphicsview-chip-example.webxml
+qtwidgets-graphicsview-collidingmice-example.webxml
+qtwidgets-graphicsview-diagramscene-example.webxml
+qtwidgets-graphicsview-dragdroprobot-example.webxml
+qtwidgets-graphicsview-elasticnodes-example.webxml
+qtwidgets-graphicsview-embeddeddialogs-example.webxml
+qtwidgets-graphicsview-flowlayout-example.webxml
+qtwidgets-graphicsview-padnavigator-example.webxml
+qtwidgets-graphicsview-simpleanchorlayout-example.webxml
+qtwidgets-graphicsview-weatheranchorlayout-example.webxml
+qtwidgets-itemviews-addressbook-example.webxml
+qtwidgets-itemviews-chart-example.webxml
+qtwidgets-itemviews-coloreditorfactory-example.webxml
+qtwidgets-itemviews-combowidgetmapper-example.webxml
+qtwidgets-itemviews-customsortfiltermodel-example.webxml
+qtwidgets-itemviews-dirview-example.webxml
+qtwidgets-itemviews-editabletreemodel-example.webxml
+qtwidgets-itemviews-fetchmore-example.webxml
+qtwidgets-itemviews-frozencolumn-example.webxml
+qtwidgets-itemviews-pixelator-example.webxml
+qtwidgets-itemviews-puzzle-example.webxml
+qtwidgets-itemviews-simpledommodel-example.webxml
+qtwidgets-itemviews-simpletreemodel-example.webxml
+qtwidgets-itemviews-simplewidgetmapper-example.webxml
+qtwidgets-itemviews-spinboxdelegate-example.webxml
+qtwidgets-itemviews-stardelegate-example.webxml
+qtwidgets-layouts-basiclayouts-example.webxml
+qtwidgets-layouts-borderlayout-example.webxml
+qtwidgets-layouts-dynamiclayouts-example.webxml
+qtwidgets-layouts-flowlayout-example.webxml
+qtwidgets-mainwindows-application-example.webxml
+qtwidgets-mainwindows-dockwidgets-example.webxml
+qtwidgets-mainwindows-menus-example.webxml
+qtwidgets-painting-affine-example.webxml
+qtwidgets-painting-basicdrawing-example.webxml
+qtwidgets-painting-composition-example.webxml
+qtwidgets-painting-concentriccircles-example.webxml
+qtwidgets-painting-deform-example.webxml
+qtwidgets-painting-fontsampler-example.webxml
+qtwidgets-painting-gradients-example.webxml
+qtwidgets-painting-imagecomposition-example.webxml
+qtwidgets-painting-painterpaths-example.webxml
+qtwidgets-painting-pathstroke-example.webxml
+qtwidgets-painting-transformations-example.webxml
+qtwidgets-richtext-calendar-example.webxml
+qtwidgets-richtext-orderform-example.webxml
+qtwidgets-richtext-syntaxhighlighter-example.webxml
+qtwidgets-statemachine-eventtransitions-example.webxml
+qtwidgets-statemachine-factorial-example.webxml
+qtwidgets-statemachine-pingpong-example.webxml
+qtwidgets-statemachine-rogue-example.webxml
+qtwidgets-statemachine-trafficlight-example.webxml
+qtwidgets-statemachine-twowaybutton-example.webxml
+qtwidgets-tools-codecs-example.webxml
+qtwidgets-tools-completer-example.webxml
+qtwidgets-tools-customcompleter-example.webxml
+qtwidgets-tools-echoplugin-example.webxml
+qtwidgets-tools-plugandpaint-app-example.webxml
+qtwidgets-tools-plugandpaint-plugins-basictools-example.webxml
+qtwidgets-tools-plugandpaint-plugins-extrafilters-example.webxml
+qtwidgets-tools-regularexpression-example.webxml
+qtwidgets-tools-styleplugin-example.webxml
+qtwidgets-tools-treemodelcompleter-example.webxml
+qtwidgets-tools-undo-example.webxml
+qtwidgets-tools-undoframework-example.webxml
+qtwidgets-tutorials-addressbook-part1-example.webxml
+qtwidgets-tutorials-addressbook-part2-example.webxml
+qtwidgets-tutorials-addressbook-part3-example.webxml
+qtwidgets-tutorials-addressbook-part4-example.webxml
+qtwidgets-tutorials-addressbook-part5-example.webxml
+qtwidgets-tutorials-addressbook-part6-example.webxml
+qtwidgets-tutorials-addressbook-part7-example.webxml
+qtwidgets-tutorials-notepad-example.webxml
+qtwidgets-tutorials-widgets-childwidget-example.webxml
+qtwidgets-tutorials-widgets-nestedlayouts-example.webxml
+qtwidgets-tutorials-widgets-toplevel-example.webxml
+qtwidgets-tutorials-widgets-windowlayout-example.webxml
+qtwidgets-widgets-analogclock-example.webxml
+qtwidgets-widgets-calculator-example.webxml
+qtwidgets-widgets-calendarwidget-example.webxml
+qtwidgets-widgets-charactermap-example.webxml
+qtwidgets-widgets-codeeditor-example.webxml
+qtwidgets-widgets-digitalclock-example.webxml
+qtwidgets-widgets-elidedlabel-example.webxml
+qtwidgets-widgets-groupbox-example.webxml
+qtwidgets-widgets-icons-example.webxml
+qtwidgets-widgets-imageviewer-example.webxml
+qtwidgets-widgets-lineedits-example.webxml
+qtwidgets-widgets-mousebuttons-example.webxml
+qtwidgets-widgets-movie-example.webxml
+qtwidgets-widgets-scribble-example.webxml
+qtwidgets-widgets-shapedclock-example.webxml
+qtwidgets-widgets-sliders-example.webxml
+qtwidgets-widgets-spinboxes-example.webxml
+qtwidgets-widgets-styles-example.webxml
+qtwidgets-widgets-stylesheet-example.webxml
+qtwidgets-widgets-tablet-example.webxml
+qtwidgets-widgets-tetrix-example.webxml
+qtwidgets-widgets-tooltips-example.webxml
+qtwidgets-widgets-wiggly-example.webxml
+qtwidgets-widgets-windowflags-example.webxml
+qtxml-dombookmarks-example.webxml
+qtxml-saxbookmarks-example.webxml
+qtxml-streambookmarks-example.webxml
+qtxml-xmlstreamlint-example.webxml
+qtxmlpatterns-filetree-example.webxml
+qtxmlpatterns-recipes-example.webxml
+qtxmlpatterns-schema-example.webxml
+qtxmlpatterns-xquery-example.webxml
+qwidget-styling.webxml
+radiooverview.webxml
+resources.webxml
+richtext-advanced-processing.webxml
+richtext-common-tasks.webxml
+richtext-cursor.webxml
+richtext-html-subset.webxml
+richtext-layouts.webxml
+richtext-structure.webxml
+richtext.webxml
+senorfwbackend.webxml
+sensorgesture-emulator-topics.webxml
+sensorgesture-plugins-topics.webxml
+sensors-backend-topics.webxml
+shared.webxml
+signalsandslots.webxml
+sql-connecting.webxml
+sql-driver.webxml
+sql-forms.webxml
+sql-model.webxml
+sql-presenting.webxml
+sql-programming.webxml
+sql-sqlstatements.webxml
+sql-types.webxml
+ssl.webxml
+statemachine-api.webxml
+statemachine.webxml
+style-reference.webxml
+stylesheet-customizing.webxml
+stylesheet-designer.webxml
+stylesheet-examples.webxml
+stylesheet-reference.webxml
+stylesheet-syntax.webxml
+stylesheet.webxml
+svgrendering.webxml
+textedit-example.webxml
+timers.webxml
+tutorials-addressbook.webxml
+videooverview.webxml
+widget-classes.webxml
+widgets-tutorial.webxml
+xml-dom-tml.webxml
+xml-namespaces.webxml
+xml-processing.webxml
+xml-sax.webxml
+xml-streaming.webxml
+xml-tools.webxml
+xmlpattern-examples.webxml
+xmlprocessing.webxml
+xquery-introduction.webxml
diff --git a/sources/pyside6/doc/api.rst b/sources/pyside6/doc/api.rst
new file mode 100644
index 000000000..a246dd52c
--- /dev/null
+++ b/sources/pyside6/doc/api.rst
@@ -0,0 +1,90 @@
+.. _pyside-api:
+
+|project| Modules
+=================
+
+Basic modules
+-------------
+
+These are the main modules that help you build a Widget-based UI.
+
++---------------------------------------+--------------------------------------------------------+
+| :mod:`Qt Core <PySide6.QtCore>` | Provides core non-GUI functionality, like signal and |
+| | slots, properties, base classes of item models, |
+| | serialization, and more. |
++---------------------------------------+--------------------------------------------------------+
+| :mod:`Qt GUI <PySide6.QtGui>` | Extends QtCore with GUI functionality: Events, windows |
+| | and screens, OpenGL and raster-based 2D painting, as |
+| | well as images. |
++---------------------------------------+--------------------------------------------------------+
+| :mod:`Qt Widgets <PySide6.QtWidgets>` | Provides ready to use Widgets for your application, |
+| | including graphical elements for your UI. |
++---------------------------------------+--------------------------------------------------------+
+
+QML and Qt Quick
+----------------
+
+Use these modules to interact with the `QML Language <https://doc.qt.io/qt-5.qmlapplications>`,
+from Python.
+
++-------------------------------------------------+----------------------------------------------+
+| :mod:`Qt QML <PySide6.QtQml>` | The base Python API to interact with the |
+| | module. |
++-------------------------------------------------+----------------------------------------------+
+| :mod:`Qt Quick <PySide6.QtQuick>` | Provides classes to embed Qt Quick in Qt |
+| | applications. |
++-------------------------------------------------+----------------------------------------------+
+| :mod:`Qt QuickWidgets <PySide6.QtQuickWidgets>` | Provides the QQuickWidget class to embed Qt |
+| | Quick in widget-based applications. |
++-------------------------------------------------+----------------------------------------------+
+
+Data visualization
+------------------
+
+Charts, diagrams, animations: these modules provide classes to help you include these elements in
+your UI.
+
++------------------------------------------------------------+-----------------------------------+
+| :mod:`Qt Charts <PySide6.QtCharts>` | Provides a set of easy to use |
+| | chart components. |
++------------------------------------------------------------+-----------------------------------+
+| :mod:`Qt DataVisualization <PySide6.QtDataVisualization>` | Provides a way to visualize data |
+| | in 3D as bar, scatter, or surface |
+| | graphs. |
++------------------------------------------------------------+-----------------------------------+
+
+Multimedia
+-----------
+
+Audio, video, and hardware interaction: use these modules for multimedia solutions.
+
++------------------------------------------------------------+-----------------------------------+
+| :mod:`Qt Multimedia <PySide6.QtMultimedia>` | Provides low-level multimedia |
+| | functionality. |
++------------------------------------------------------------+-----------------------------------+
+| :mod:`Qt MultimediaWidgets <PySide6.QtMultimediaWidgets>` | Provides the widget-based |
+| | multimedia API. |
++------------------------------------------------------------+-----------------------------------+
+
+WebEngine
+---------
+
+If your project is based on a browser or the features around Web-based applications, use these
+modules to interact with them.
+
++---------------------------------------------------------+--------------------------------------+
+| :mod:`Qt WebEngineWidgets <PySide6.QtWebEngineWidgets>` | Provides widgets to handle Web |
+| | content. |
++---------------------------------------------------------+--------------------------------------+
+| :mod:`Qt WebChannel <PySide6.QtWebChannel>` | Enables peer-to-peer communication |
+| | between a server and a client |
+| | (HTML/JavaScript or QML application).|
++---------------------------------------------------------+--------------------------------------+
+
+All the modules
+---------------
+
+There are many other modules currently supported by |pymodname|, here you can find a complete list
+of them.
+
+ :doc:`Check all the modules <modules>`
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/accessibilityslidersnippet.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/accessibilityslidersnippet.cpp
new file mode 100644
index 000000000..6c479cd3f
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/accessibilityslidersnippet.cpp
@@ -0,0 +1,271 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+
+//! [0]
+QAccessibleSlider::QAccessibleSlider(QWidget *w)
+: QAccessibleAbstractSlider(w)
+{
+ Q_ASSERT(slider());
+ addControllingSignal(QLatin1String("valueChanged(int)"));
+}
+//! [0]
+
+QSlider *QAccessibleSlider::slider() const
+{
+ return qobject_cast<QSlider*>(object());
+}
+
+//! [1]
+QRect QAccessibleSlider::rect(int child) const
+{
+//! [1]
+ QRect rect;
+ if (!slider()->isVisible())
+ return rect;
+ const QStyleOptionSlider option = qt_qsliderStyleOption(slider());
+ QRect srect = slider()->style()->subControlRect(QStyle::CC_Slider, &option,
+ QStyle::SC_SliderHandle, slider());
+
+//! [2]
+ switch (child) {
+ case PageLeft:
+ if (slider()->orientation() == Qt::Vertical)
+ rect = QRect(0, 0, slider()->width(), srect.y());
+ else
+ rect = QRect(0, 0, srect.x(), slider()->height());
+ break;
+ case Position:
+ rect = srect;
+ break;
+ case PageRight:
+ if (slider()->orientation() == Qt::Vertical)
+ rect = QRect(0, srect.y() + srect.height(), slider()->width(), slider()->height()- srect.y() - srect.height());
+ else
+ rect = QRect(srect.x() + srect.width(), 0, slider()->width() - srect.x() - srect.width(), slider()->height());
+ break;
+ default:
+ return QAccessibleAbstractSlider::rect(child);
+ }
+//! [2] //! [3]
+
+ QPoint tp = slider()->mapToGlobal(QPoint(0,0));
+ return QRect(tp.x() + rect.x(), tp.y() + rect.y(), rect.width(), rect.height());
+}
+//! [3]
+
+int QAccessibleSlider::childCount() const
+{
+ if (!slider()->isVisible())
+ return 0;
+ return PageRight;
+}
+
+//! [4]
+QString QAccessibleSlider::text(Text t, int child) const
+{
+ if (!slider()->isVisible())
+ return QString();
+ switch (t) {
+ case Value:
+ if (!child || child == 2)
+ return QString::number(slider()->value());
+ return QString();
+ case Name:
+ switch (child) {
+ case PageLeft:
+ return slider()->orientation() == Qt::Horizontal ?
+ QSlider::tr("Page left") : QSlider::tr("Page up");
+ case Position:
+ return QSlider::tr("Position");
+ case PageRight:
+ return slider()->orientation() == Qt::Horizontal ?
+ QSlider::tr("Page right") : QSlider::tr("Page down");
+ }
+ break;
+ default:
+ break;
+ }
+ return QAccessibleAbstractSlider::text(t, child);
+}
+//! [4]
+
+//! [5]
+QAccessible::Role QAccessibleSlider::role(int child) const
+{
+ switch (child) {
+ case PageLeft:
+ case PageRight:
+ return PushButton;
+ case Position:
+ return Indicator;
+ default:
+ return Slider;
+ }
+}
+//! [5]
+
+//! [6]
+QAccessible::State QAccessibleSlider::state(int child) const
+{
+ const State parentState = QAccessibleAbstractSlider::state(0);
+//! [6]
+
+ if (child == 0)
+ return parentState;
+
+ // Inherit the Invisible state from parent.
+ State state = parentState & QAccessible::Invisible;
+
+ // Disable left/right if we are at the minimum/maximum.
+ const QSlider * const slider = QAccessibleSlider::slider();
+//! [7]
+ switch (child) {
+ case PageLeft:
+ if (slider->value() <= slider->minimum())
+ state |= Unavailable;
+ break;
+ case PageRight:
+ if (slider->value() >= slider->maximum())
+ state |= Unavailable;
+ break;
+ case Position:
+ default:
+ break;
+ }
+
+ return state;
+}
+//! [7]
+
+int QAccessibleSlider::defaultAction(int child) const
+{
+ switch (child) {
+ case SliderSelf:
+ return SetFocus;
+ case PageLeft:
+ return Press;
+ case PageRight:
+ return Press;
+ }
+
+ return 0;
+}
+
+// Name, Description, Value, Help, Accelerator
+static const char * const actionTexts[][5] =
+{
+ {"Press", "Decreases the value of the slider", "", "", "Ctrl+L"},
+ {"Press", "Increaces the value of the slider", "", "", "Ctrl+R"}
+};
+
+QString QAccessibleSlider::actionText(int action, Text text, int child) const
+{
+ if (action != Press || child < 1 || child > 2)
+ return QAccessibleAbstractSlider::actionText(action, text, child);
+
+ return actionTexts[child - 1][t];
+}
+
+bool QAccessibleSlider::doAction(int action, int child)
+{
+ if (action != Press || child < 1 || child > 2)
+ return false;
+
+ if (child == PageLeft)
+ slider()->setValue(slider()->value() - slider()->pageStep());
+ else
+ slider()->setValue(slider()->value() + slider()->pageStep());
+}
+
+QAccessibleAbstractSlider::QAccessibleAbstractSlider(QWidget *w, Role r)
+ : QAccessibleWidgetEx(w, r)
+{
+ Q_ASSERT(qobject_cast<QAbstractSlider *>(w));
+}
+
+QVariant QAccessibleAbstractSlider::invokeMethodEx(Method method, int child, const QVariantList &params)
+{
+ switch (method) {
+ case ListSupportedMethods: {
+ QSet<QAccessible::Method> set;
+ set << ListSupportedMethods;
+ return qVariantFromValue(set | qvariant_cast<QSet<QAccessible::Method> >(
+ QAccessibleWidgetEx::invokeMethodEx(method, child, params)));
+ }
+ default:
+ return QAccessibleWidgetEx::invokeMethodEx(method, child, params);
+ }
+}
+
+QVariant QAccessibleAbstractSlider::currentValue()
+{
+ return abstractSlider()->value();
+}
+
+void QAccessibleAbstractSlider::setCurrentValue(const QVariant &value)
+{
+ abstractSlider()->setValue(value.toInt());
+}
+
+QVariant QAccessibleAbstractSlider::maximumValue()
+{
+ return abstractSlider()->maximum();
+}
+
+QVariant QAccessibleAbstractSlider::minimumValue()
+{
+ return abstractSlider()->minimum();
+}
+
+QAbstractSlider *QAccessibleAbstractSlider::abstractSlider() const
+{
+ return static_cast<QAbstractSlider *>(object());
+}
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/alphachannel.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/alphachannel.cpp
new file mode 100644
index 000000000..78c2c54db
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/alphachannel.cpp
@@ -0,0 +1,64 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+//! [0]
+ pixmap = QPixmap(100, 100)
+ pixmap.fill(Qt.transparent)
+
+ gradient = QRadialGradient(50, 50, 50, 50, 50)
+ gradient.setColorAt(0, QColor.fromRgbF(1, 0, 0, 1))
+ gradient.setColorAt(1, QColor.fromRgbF(0, 0, 0, 0))
+ painter = QPainter(pixmap)
+ painter.fillRect(0, 0, 100, 100, gradient)
+
+ channelImage = pixmap.alphaChannel()
+ update()
+//! [0]
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/audio/main.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/audio/main.cpp
new file mode 100644
index 000000000..09d1aa420
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/audio/main.cpp
@@ -0,0 +1,104 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+class Window2 (QWidget):
+//![0]
+ @Slot(QAudio.State)
+ def stateChanged(self, newState):
+ if newState == QAudio.StopState:
+ if self.input.error() != QAudio.NoError:
+ # Error handling
+//![0]
+
+class Window (QWidget):
+ def __init__(self):
+ QWidget.__init__(self)
+ self.output = QAudioOutput()
+ self.output.stateChanged[QAudio.State].connect(self.stateChanged)
+
+ def setupFormat(self):
+//![1]
+ format = QAudioFormat()
+ format.setFrequency(44100)
+//![1]
+ format.setChannels(2)
+ format.setSampleSize(16)
+ format.setCodec("audio/pcm")
+ format.setByteOrder(QAudioFormat.LittleEndian)
+//![2]
+ format.setSampleType(QAudioFormat.SignedInt)
+
+ info = QAudioDeviceInfo(QAudioDeviceInfo.defaultOutputDevice())
+
+ if not info.isFormatSupported(format):
+ format = info.nearestFormat(format)
+//![2]
+
+//![3]
+ @Slot(QAudio.State)
+ def stateChanged(self, newState):
+ if newState == QAudio.StopState:
+ if self.output.error() != QAudio.NoError:
+ # Perform error handling
+ else:
+ # Normal stop
+//![3]
+
+ # Handle
+ elif newState == QAudio.ActiveState:
+ # Handle active state...
+
+app = QApplication(sys.argv)
+
+window = Window()
+window.show()
+sys.exit(app.exec_())
+
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/brushstyles/qt-logo.png b/sources/pyside6/doc/codesnippets/doc/src/snippets/brushstyles/qt-logo.png
new file mode 100644
index 000000000..d609c1e1e
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/brushstyles/qt-logo.png
Binary files differ
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/brushstyles/renderarea.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/brushstyles/renderarea.h
new file mode 100644
index 000000000..82356e2dd
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/brushstyles/renderarea.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 RENDERAREA_H
+#define RENDERAREA_H
+
+#include <QWidget>
+
+class RenderArea : public QWidget
+{
+ Q_OBJECT
+
+public:
+ RenderArea(QBrush *brush, QWidget *parent = 0);
+ QSize minimumSizeHint() const;
+
+protected:
+ void paintEvent(QPaintEvent *event);
+
+private:
+ QBrush *currentBrush;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/brushstyles/stylewidget.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/brushstyles/stylewidget.h
new file mode 100644
index 000000000..57223cbb4
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/brushstyles/stylewidget.h
@@ -0,0 +1,108 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 STYLEWIDGET_H
+#define STYLEWIDGET_H
+
+#include <QWidget>
+#include <QPainterPath>
+#include "renderarea.h"
+
+class QLabel;
+
+class StyleWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ StyleWidget(QWidget *parent = 0);
+
+private:
+ RenderArea *solid;
+ RenderArea *dense1;
+ RenderArea *dense2;
+ RenderArea *dense3;
+ RenderArea *dense4;
+ RenderArea *dense5;
+ RenderArea *dense6;
+ RenderArea *dense7;
+ RenderArea *no;
+ RenderArea *hor;
+ RenderArea *ver;
+ RenderArea *cross;
+ RenderArea *bdiag;
+ RenderArea *fdiag;
+ RenderArea *diagCross;
+ RenderArea *linear;
+ RenderArea *radial;
+ RenderArea *conical;
+ RenderArea *texture;
+
+ QLabel *solidLabel;
+ QLabel *dense1Label;
+ QLabel *dense2Label;
+ QLabel *dense3Label;
+ QLabel *dense4Label;
+ QLabel *dense5Label;
+ QLabel *dense6Label;
+ QLabel *dense7Label;
+ QLabel *noLabel;
+ QLabel *horLabel;
+ QLabel *verLabel;
+ QLabel *crossLabel;
+ QLabel *bdiagLabel;
+ QLabel *fdiagLabel;
+ QLabel *diagCrossLabel;
+ QLabel *linearLabel;
+ QLabel *radialLabel;
+ QLabel *conicalLabel;
+ QLabel *textureLabel;
+};
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/clipboard/clipwindow.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/clipboard/clipwindow.h
new file mode 100644
index 000000000..a06b59b20
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/clipboard/clipwindow.h
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 CLIPWINDOW_H
+#define CLIPWINDOW_H
+
+#include <QMainWindow>
+
+class QClipboard;
+class QComboBox;
+class QLabel;
+class QListWidget;
+class QMimeData;
+class QWidget;
+
+class ClipWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ ClipWindow(QWidget *parent = 0);
+
+public slots:
+ void updateClipboard();
+ void updateData(const QString &format);
+
+private:
+ int currentItem;
+ QClipboard *clipboard;
+ QComboBox *mimeTypeCombo;
+ QLabel *dataInfoLabel;
+ QListWidget *previousItems;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/clipboard/clipwindow.py b/sources/pyside6/doc/codesnippets/doc/src/snippets/clipboard/clipwindow.py
new file mode 100644
index 000000000..e5e156e69
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/clipboard/clipwindow.py
@@ -0,0 +1,105 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+form PySide6.QtGui import *
+
+
+def __init__(self, parent):
+ QMainWindow.__init__(self, parent)
+ clipboard = QApplication.clipboard()
+
+ centralWidget = QWidget(self)
+ currentItem = QWidget(centralWidget)
+ mimeTypeLabel = QLabel(tr("MIME types:"), currentItem)
+ mimeTypeCombo = QComboBox(currentItem)
+ dataLabel = QLabel(tr("Data:"), currentItem)
+ dataInfoLabel = QLabel("", currentItem)
+
+ previousItems = QListWidget(centralWidget)
+
+//! [0]
+ clipboard.dataChanged.connect(self.updateClipboard)
+//! [0]
+ mimeTypeCombo.activated[str].connect(self.updateData)
+
+ currentLayout = QVBoxLayout(currentItem)
+ currentLayout.addWidget(mimeTypeLabel)
+ currentLayout.addWidget(mimeTypeCombo)
+ currentLayout.addWidget(dataLabel)
+ currentLayout.addWidget(dataInfoLabel)
+ currentLayout.addStretch(1)
+
+ mainLayout = QHBoxLayout(centralWidget)
+ mainLayout.addWidget(currentItem, 1)
+ mainLayout.addWidget(previousItems)
+
+ setCentralWidget(centralWidget)
+ setWindowTitle(tr("Clipboard"))
+
+//! [1]
+def updateClipboard(self):
+ formats = clipboard.mimeData().formats()
+ data = clipboard.mimeData().data(format)
+//! [1]
+
+ mimeTypeCombo.clear()
+ mimeTypeCombo.insertStringList(formats)
+
+ size = clipboard.mimeData().data(formats[0]).size()
+ Item = QListWidgetItem(previousItems)
+ Item.setText(tr("%1 (%2 bytes)").arg(formats[0]).arg(size))
+
+ updateData(formats[0])
+//! [2]
+//! [2]
+
+def updateData(self, format)
+ data = clipboard.mimeData().data(format)
+ dataInfoLabel.setText(tr("%1 bytes").arg(data.size()))
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qnamespace.qdoc b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qnamespace.qdoc
new file mode 100644
index 000000000..b63810f97
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qnamespace.qdoc
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+QObject::connect: Cannot queue arguments of type 'MyType'
+//! [0]
+
+
+//! [1]
+# An important event
+ImportantEventPriority = Qt.HighEventPriority
+# A more important event
+MoreImportantEventPriority = ImportantEventPriority + 1
+# A critical event
+CriticalEventPriority = 100 * MoreImportantEventPriority
+# Not that important
+StatusEventPriority = Qt.LowEventPriority
+# These are less important than Status events
+IdleProcessingDoneEventPriority = StatusEventPriority - 1
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtcore.py b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtcore.py
new file mode 100644
index 000000000..a9c70fa93
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtcore.py
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+import PySide6.QtCore
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtnetwork.py b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtnetwork.py
new file mode 100644
index 000000000..d49a623b2
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtnetwork.py
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [1]
+import PySide6.QtNetwork
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtopengl.py b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtopengl.py
new file mode 100644
index 000000000..37fba2534
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtopengl.py
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+import PySide6.QtOpenGL
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtprintsupport.py b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtprintsupport.py
new file mode 100644
index 000000000..4426e7628
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtprintsupport.py
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 20188888888 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [1]
+import PySide6.QtPrintSupport
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtqml.py b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtqml.py
new file mode 100644
index 000000000..0216cab3d
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtqml.py
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+import PySide6.QtQml
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtquick.py b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtquick.py
new file mode 100644
index 000000000..42801d9d9
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtquick.py
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+import PySide6.QtQuick
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtsql.py b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtsql.py
new file mode 100644
index 000000000..6ffc52b57
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtsql.py
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+//! [0]
+import PySide6.QtSql
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qttest.py b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qttest.py
new file mode 100644
index 000000000..b6efed395
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qttest.py
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+import PySide6.QtTest
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtwidgets.py b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtwidgets.py
new file mode 100644
index 000000000..c4e161e73
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtwidgets.py
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [1]
+import PySide6.QtWidgets
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtxml.py b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtxml.py
new file mode 100644
index 000000000..e2ebf0d74
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtxml.py
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+import PySide6.QtXml
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src.gui.text.qtextdocumentwriter.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src.gui.text.qtextdocumentwriter.cpp
new file mode 100644
index 000000000..bfe7b30e3
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src.gui.text.qtextdocumentwriter.cpp
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+ writer = QTextDocumentWriter()
+ writer.setFormat("odf") # same as writer.setFormat("ODF");
+//! [0]
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src.qdbus.qdbuspendingcall.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src.qdbus.qdbuspendingcall.cpp
new file mode 100644
index 000000000..549d7a6f8
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src.qdbus.qdbuspendingcall.cpp
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+{
+//! [0]
+ QDBusPendingCall async = iface->asyncCall("RemoteMethod", value1, value2);
+ QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(async, this);
+
+ QObject::connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)),
+ this, SLOT(callFinishedSlot(QDBusPendingCallWatcher*)));
+//! [0]
+
+}
+
+//! [1]
+void MyClass::callFinishedSlot(QDBusPendingCallWatcher *call)
+{
+ QDBusPendingReply<QString, QByteArray> reply = *call;
+ if (reply.isError()) {
+ showError();
+ } else {
+ QString text = reply.argumentAt<0>();
+ QByteArray data = reply.argumentAt<1>();
+ showReply(text, data);
+ }
+}
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src.qdbus.qdbuspendingreply.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src.qdbus.qdbuspendingreply.cpp
new file mode 100644
index 000000000..5029d3aca
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src.qdbus.qdbuspendingreply.cpp
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+{
+//! [0]
+ QDBusPendingReply<QString> reply = interface->asyncCall("RemoteMethod");
+ reply.waitForFinished();
+ if (reply.isError())
+ // call failed. Show an error condition.
+ showError(reply.error());
+ else
+ // use the returned value
+ useValue(reply.value());
+//! [0]
+
+//! [2]
+ QDBusPendingReply<bool, QString> reply = interface->asyncCall("RemoteMethod");
+ reply.waitForFinished();
+ if (!reply.isError()) {
+ if (reply.argumentAt<0>())
+ showSuccess(reply.argumentAt<1>());
+ else
+ showFailure(reply.argumentAt<1>());
+ }
+//! [2]
+}
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src.scripttools.qscriptenginedebugger.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src.scripttools.qscriptenginedebugger.cpp
new file mode 100644
index 000000000..53c4a9efe
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src.scripttools.qscriptenginedebugger.cpp
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+ engine = QScriptEngine()
+ debugger = QScriptEngineDebugger()
+ debugger.attachTo(engine)
+//! [0]
+
+//! [1]
+ engine.evaluate("debugger")
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_codecs_qtextcodec.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_codecs_qtextcodec.cpp
new file mode 100644
index 000000000..7cbfc4e30
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_codecs_qtextcodec.cpp
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+encodedString = QByteArray("...")
+codec = QTextCodec.codecForName("KOI8-R")
+string = codec.toUnicode(encodedString)
+//! [0]
+
+
+//! [1]
+string = u"..."
+codec = QTextCodec.codecForName("KOI8-R")
+encodedString = codec.fromUnicode(string)
+//! [1]
+
+
+//! [2]
+codec = QTextCodec.codecForName("Shift-JIS")
+decoder = codec.makeDecoder()
+
+string = u''
+while new_data_available():
+ chunk = get_new_data()
+ string += decoder.toUnicode(chunk)
+
+//! [2]
+
+
+//! [3]
+def main():
+ app = QApplication([])
+ QTextCodec.setCodecForTr(QTextCodec.codecForName("eucKR"))
+ ...
+//! [3]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_codecs_qtextcodecplugin.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_codecs_qtextcodecplugin.cpp
new file mode 100644
index 000000000..3538b6574
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_codecs_qtextcodecplugin.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+
+def names(self):
+ return list = ["IBM01140", "hp15-tw"]
+
+def createForName(name):
+ if (name == "IBM01140"):
+ return Ibm01140Codec()
+ else if (name == "hp15-tw"):
+ return Hp15TwCodec()
+ return None
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qfuture.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qfuture.cpp
new file mode 100644
index 000000000..7dcc7052d
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qfuture.cpp
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+QFuture<QString> future = ...;
+
+QFuture<QString>::const_iterator i;
+for (i = future.constBegin(); i != future.constEnd(); ++i)
+ cout << *i << endl;
+//! [0]
+
+
+//! [1]
+QFuture<QString> future;
+...
+QFutureIterator<QString> i(future);
+while (i.hasNext())
+ qDebug() << i.next();
+//! [1]
+
+
+//! [2]
+QFutureIterator<QString> i(future);
+i.toBack();
+while (i.hasPrevious())
+ qDebug() << i.previous();
+//! [2]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qfuturesynchronizer.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qfuturesynchronizer.cpp
new file mode 100644
index 000000000..014c5b167
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qfuturesynchronizer.cpp
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+void someFunction()
+{
+ QFutureSynchronizer<void> synchronizer;
+
+ ...
+
+ synchronizer.addFuture(QtConcurrent::run(anotherFunction));
+ synchronizer.addFuture(QtConcurrent::map(list, mapFunction));
+
+ return; // QFutureSynchronizer waits for all futures to finish
+}
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qfuturewatcher.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qfuturewatcher.cpp
new file mode 100644
index 000000000..9c536b822
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qfuturewatcher.cpp
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+// Instantiate the objects and connect to the finished signal.
+MyClass myObject;
+QFutureWatcher<int> watcher;
+connect(&watcher, SIGNAL(finished()), &myObject, SLOT(handleFinished()));
+
+// Start the computation.
+QFuture<int> future = QtConcurrent::run(...);
+watcher.setFuture(future);
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentexception.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentexception.cpp
new file mode 100644
index 000000000..da4254a76
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentexception.cpp
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+
+class MyException : public QtConcurrent::Exception
+{
+public:
+ void raise() const { throw *this; }
+ Exception *clone() const { return new MyException(*this); }
+};
+
+//! [0]
+
+
+//! [1]
+
+try {
+ QtConcurrent::blockingMap(list, throwFunction); // throwFunction throws MyException
+} catch (MyException &e) {
+ // handle exception
+}
+
+//! [1]
+
+
+//! [2]
+
+void MyException::raise() const { throw *this; }
+
+//! [2]
+
+
+//! [3]
+
+MyException *MyException::clone() const { return new MyException(*this); }
+
+//! [3]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentfilter.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentfilter.cpp
new file mode 100644
index 000000000..a0f6778b6
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentfilter.cpp
@@ -0,0 +1,181 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+bool function(const T &t);
+//! [0]
+
+
+//! [1]
+bool allLowerCase(const QString &string)
+{
+ return string.lowered() == string;
+}
+
+QStringList strings = ...;
+QFuture<QString> lowerCaseStrings = QtConcurrent::filtered(strings, allLowerCase);
+//! [1]
+
+
+//! [2]
+QStringList strings = ...;
+QFuture<void> future = QtConcurrent::filter(strings, allLowerCase);
+//! [2]
+
+
+//! [3]
+V function(T &result, const U &intermediate)
+//! [3]
+
+
+//! [4]
+void addToDictionary(QSet<QString> &dictionary, const QString &string)
+{
+ dictionary.insert(string);
+}
+
+QStringList strings = ...;
+QFuture<QSet<QString> > dictionary = QtConcurrent::filteredReduced(strings, allLowerCase, addToDictionary);
+//! [4]
+
+
+//! [5]
+QStringList strings = ...;
+QFuture<QString> lowerCaseStrings = QtConcurrent::filtered(strings.constBegin(), strings.constEnd(), allLowerCase);
+
+// filter in-place only works on non-const iterators
+QFuture<void> future = QtConcurrent::filter(strings.begin(), strings.end(), allLowerCase);
+
+QFuture<QSet<QString> > dictionary = QtConcurrent::filteredReduced(strings.constBegin(), strings.constEnd(), allLowerCase, addToDictionary);
+//! [5]
+
+
+//! [6]
+QStringList strings = ...;
+
+// each call blocks until the entire operation is finished
+QStringList lowerCaseStrings = QtConcurrent::blockingFiltered(strings, allLowerCase);
+
+
+QtConcurrent::blockingFilter(strings, allLowerCase);
+
+QSet<QString> dictionary = QtConcurrent::blockingFilteredReduced(strings, allLowerCase, addToDictionary);
+//! [6]
+
+
+//! [7]
+// keep only images with an alpha channel
+QList<QImage> images = ...;
+QFuture<void> alphaImages = QtConcurrent::filter(strings, &QImage::hasAlphaChannel);
+
+// keep only gray scale images
+QList<QImage> images = ...;
+QFuture<QImage> grayscaleImages = QtConcurrent::filtered(images, &QImage::isGrayscale);
+
+// create a set of all printable characters
+QList<QChar> characters = ...;
+QFuture<QSet<QChar> > set = QtConcurrent::filteredReduced(characters, &QChar::isPrint, &QSet<QChar>::insert);
+//! [7]
+
+
+//! [8]
+// can mix normal functions and member functions with QtConcurrent::filteredReduced()
+
+// create a dictionary of all lower cased strings
+extern bool allLowerCase(const QString &string);
+QStringList strings = ...;
+QFuture<QSet<int> > averageWordLength = QtConcurrent::filteredReduced(strings, allLowerCase, QSet<QString>::insert);
+
+// create a collage of all gray scale images
+extern void addToCollage(QImage &collage, const QImage &grayscaleImage);
+QList<QImage> images = ...;
+QFuture<QImage> collage = QtConcurrent::filteredReduced(images, &QImage::isGrayscale, addToCollage);
+//! [8]
+
+
+//! [9]
+bool QString::contains(const QRegExp &regexp) const;
+//! [9]
+
+
+//! [10]
+boost::bind(&QString::contains, QRegExp("^\\S+$")); // matches strings without whitespace
+//! [10]
+
+
+//! [11]
+bool contains(const QString &string)
+//! [11]
+
+
+//! [12]
+QStringList strings = ...;
+boost::bind(static_cast<bool(QString::*)(const QRegExp&)>( &QString::contains ), QRegExp("..." ));
+//! [12]
+
+//! [13]
+struct StartsWith
+{
+ StartsWith(const QString &string)
+ : m_string(string) { }
+
+ typedef bool result_type;
+
+ bool operator()(const QString &testString)
+ {
+ return testString.startsWith(m_string);
+ }
+
+ QString m_string;
+};
+
+QList<QString> strings = ...;
+QFuture<QString> fooString = QtConcurrent::filtered(images, StartsWith(QLatin1String("Foo")));
+//! [13]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentmap.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentmap.cpp
new file mode 100644
index 000000000..e61b73613
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentmap.cpp
@@ -0,0 +1,194 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+U function(const T &t);
+//! [0]
+
+
+//! [1]
+QImage scaled(const QImage &image)
+{
+ return image.scaled(100, 100);
+}
+
+QList<QImage> images = ...;
+QFuture<QImage> thumbnails = QtConcurrent::mapped(images, scaled);
+//! [1]
+
+
+//! [2]
+U function(T &t);
+//! [2]
+
+
+//! [3]
+void scale(QImage &image)
+{
+ image = image.scaled(100, 100);
+}
+
+QList<QImage> images = ...;
+QFuture<void> future = QtConcurrent::map(images, scale);
+//! [3]
+
+
+//! [4]
+V function(T &result, const U &intermediate)
+//! [4]
+
+
+//! [5]
+void addToCollage(QImage &collage, const QImage &thumbnail)
+{
+ QPainter p(&collage);
+ static QPoint offset = QPoint(0, 0);
+ p.drawImage(offset, thumbnail);
+ offset += ...;
+}
+
+QList<QImage> images = ...;
+QFuture<QImage> collage = QtConcurrent::mappedReduced(images, scaled, addToCollage);
+//! [5]
+
+
+//! [6]
+QList<QImage> images = ...;
+
+QFuture<QImage> thumbnails = QtConcurrent::mapped(images.constBegin(), images.constEnd(), scaled);
+
+// map in-place only works on non-const iterators
+QFuture<void> future = QtConcurrent::map(images.begin(), images.end(), scale);
+
+QFuture<QImage> collage = QtConcurrent::mappedReduced(images.constBegin(), images.constEnd(), scaled, addToCollage);
+//! [6]
+
+
+//! [7]
+QList<QImage> images = ...;
+
+// each call blocks until the entire operation is finished
+QList<QImage> future = QtConcurrent::blockingMapped(images, scaled);
+
+QtConcurrent::blockingMap(images, scale);
+
+QImage collage = QtConcurrent::blockingMappedReduced(images, scaled, addToCollage);
+//! [7]
+
+
+//! [8]
+// squeeze all strings in a QStringList
+QStringList strings = ...;
+QFuture<void> squeezedStrings = QtConcurrent::map(strings, &QString::squeeze);
+
+// swap the rgb values of all pixels on a list of images
+QList<QImage> images = ...;
+QFuture<QImage> bgrImages = QtConcurrent::mapped(images, &QImage::rgbSwapped);
+
+// create a set of the lengths of all strings in a list
+QStringList strings = ...;
+QFuture<QSet<int> > wordLengths = QtConcurrent::mappedReduced(string, &QString::length, &QSet<int>::insert);
+//! [8]
+
+
+//! [9]
+// can mix normal functions and member functions with QtConcurrent::mappedReduced()
+
+// compute the average length of a list of strings
+extern void computeAverage(int &average, int length);
+QStringList strings = ...;
+QFuture<int> averageWordLength = QtConcurrent::mappedReduced(strings, &QString::length, computeAverage);
+
+// create a set of the color distribution of all images in a list
+extern int colorDistribution(const QImage &string);
+QList<QImage> images = ...;
+QFuture<QSet<int> > totalColorDistribution = QtConcurrent::mappedReduced(images, colorDistribution, QSet<int>::insert);
+//! [9]
+
+
+//! [10]
+QImage QImage::scaledToWidth(int width, Qt::TransformationMode) const;
+//! [10]
+
+
+//! [11]
+boost::bind(&QImage::scaledToWidth, 100, Qt::SmoothTransformation)
+//! [11]
+
+
+//! [12]
+QImage scaledToWith(const QImage &image)
+//! [12]
+
+
+//! [13]
+QList<QImage> images = ...;
+QFuture<QImage> thumbnails = QtConcurrent::mapped(images, boost::bind(&QImage::scaledToWidth, 100 Qt::SmoothTransformation));
+//! [13]
+
+//! [14]
+struct Scaled
+{
+ Scaled(int size)
+ : m_size(size) { }
+
+ typedef QImage result_type;
+
+ QImage operator()(const QImage &image)
+ {
+ return image.scaled(m_size, m_size);
+ }
+
+ int m_size;
+};
+
+QList<QImage> images = ...;
+QFuture<QImage> thumbnails = QtConcurrent::mapped(images, Scaled(100));
+//! [14]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentrun.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentrun.cpp
new file mode 100644
index 000000000..3c55ef77e
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentrun.cpp
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+extern void aFunction();
+QFuture<void> future = QtConcurrent::run(aFunction);
+//! [0]
+
+
+//! [1]
+extern void aFunctionWithArguments(int arg1, double arg2, const QString &string);
+
+int integer = ...;
+double floatingPoint = ...;
+QString string = ...;
+
+QFuture<void> future = QtConcurrent::run(aFunctionWithArguments, integer, floatingPoint, string);
+//! [1]
+
+
+//! [2]
+extern QString functionReturningAString();
+QFuture<QString> future = QtConcurrent::run(functionReturningAString);
+...
+QString result = future.result();
+//! [2]
+
+
+//! [3]
+extern QString someFunction(const QByteArray &input);
+
+QByteArray bytearray = ...;
+
+QFuture<QString> future = QtConcurrent::run(someFunction, bytearray);
+...
+QString result = future.result();
+//! [3]
+
+
+//! [4]
+// call 'QStringList QString::split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const' in a separate thread
+QString string = ...;
+QFuture<QStringList> future = QtConcurrent::run(string, &QString::split, QString(", "), QString::KeepEmptyParts, Qt::CaseSensitive);
+...
+QStringList result = future.result();
+//! [4]
+
+
+//! [5]
+// call 'void QImage::invertPixels(InvertMode mode)' in a separate thread
+QImage image = ...;
+QFuture<void> future = QtConcurrent::run(image, &QImage::invertPixels, QImage::InvertRgba);
+...
+future.waitForFinished();
+// At this point, the pixels in 'image' have been inverted
+//! [5]
+
+
+//! [6]
+void someFunction(int arg1, double arg2);
+QFuture<void> future = QtConcurrent::run(boost::bind(someFunction, 1, 2.0));
+...
+//! [6]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qthreadpool.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qthreadpool.cpp
new file mode 100644
index 000000000..f552f3429
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qthreadpool.cpp
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+class HelloWorldTask(QRunnable):
+ def run(self):
+ print "Hello world from thread", QThread.currentThread()
+
+hello = HelloWorldTask()
+# QThreadPool takes ownership and deletes 'hello' automatically
+QThreadPool.globalInstance().start(hello)
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qabstractfileengine.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qabstractfileengine.cpp
new file mode 100644
index 000000000..878259f62
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qabstractfileengine.cpp
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+class ZipEngineHandler(QAbstractFileEngineHandler):
+ def create(self, fileName):
+ # ZipEngineHandler returns a ZipEngine for all .zip files
+ if fileName.toLower().endsWith(".zip"):
+ return ZipEngine(fileName)
+ else
+ return None
+
+def main():
+ app = QApplication(sys.argv)
+
+ engine = ZipEngineHandler()
+
+ window = MainWindow()
+ window.show()
+
+ return app.exec()
+//! [0]
+
+
+//! [1]
+def create(fileName):
+ # ZipEngineHandler returns a ZipEngine for all .zip files
+ if fileName.lower().endswith(".zip"):
+ return ZipEngine(fileName)
+ else
+ return None
+//! [1]
+
+
+//! [2]
+# @arg filters QDir.Filters
+# @arg filterNames [str, ...]
+# @return QAbstractFileEngineIterator
+def beginEntryList(filters, filterNames):
+ return CustomFileEngineIterator(filters, filterNames)
+//! [2]
+
+
+//! [3]
+class CustomIterator(QAbstractFileEngineIterator):
+ def __init__(self, nameFilters, filters):
+ QAbstractFileEngineIterator.__init__(self, nameFilters, filters)
+
+ self.index = 0
+ # In a real iterator, these entries are fetched from the
+ # file system based on the value of path().
+ self.entries << "entry1" << "entry2" << "entry3"
+
+ def hasNext(self):
+ return self.index < self.entries.size() - 1
+
+ def next(self):
+ if not self.hasNext():
+ return None
+ index += 1
+ return currentFilePath()
+
+ def currentFileName(self):
+ return self.entries.at(index)
+//! [3]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qdatastream.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qdatastream.cpp
new file mode 100644
index 000000000..79e64d4a3
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qdatastream.cpp
@@ -0,0 +1,135 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+void wrapInFunction()
+{
+
+//! [0]
+file_ = QFile("file.dat")
+file_.open(QIODevice.WriteOnly)
+# we will serialize the data into the file
+out = QDataStream(file_)
+# serialize a string
+out.writeQString("the answer is")
+# serialize an integer
+out.writeInt32(42)
+//! [0]
+
+
+//! [1]
+file_ = QFile("file.dat")
+file_.open(QIODevice.ReadOnly)
+# read the data serialized from the file
+i = QDataStream(file_)
+string = ''
+a = 0
+# extract "the answer is" and 42
+string = i.readQString()
+a = i.readInt32()
+//! [1]
+
+
+//! [2]
+stream.setVersion(QDataStream.Qt_4_0)
+//! [2]
+
+
+//! [3]
+file_ = QFile("file.xxx")
+file_.open(QIODevice.WriteOnly)
+out = QDataStream(file_)
+
+# Write a header with a "magic number" and a version
+out.writeInt32(0xA0B0C0D0)
+out.writeInt32(123)
+
+out.setVersion(QDataStream.Qt_4_0)
+
+// Write the data
+out << lots_of_interesting_data
+//! [3]
+
+
+//! [4]
+file_ = QFile("file.xxx")
+file_.open(QIODevice.ReadOnly)
+i = QDataStream(file_)
+
+// Read and check the header
+magic = i.readInt32()
+if magic != 0xA0B0C0D0:
+ return XXX_BAD_FILE_FORMAT
+
+// Read the version
+version = i.readInt32()
+if version < 100:
+ return XXX_BAD_FILE_TOO_OLD
+if version > 123:
+ return XXX_BAD_FILE_TOO_NEW
+
+if version <= 110:
+ in_.setVersion(QDataStream.Qt_3_2)
+else:
+ in_.setVersion(QDataStream.Qt_4_0)
+
+// Read the data
+in_ >> lots_of_interesting_data
+if version >= 120:
+ in_ >> data_new_in_XXX_version_1_2
+in_ >> other_interesting_data
+//! [4]
+
+
+//! [5]
+out = QDataStream(file_)
+out.setVersion(QDataStream.Qt_4_0)
+//! [5]
+
+}
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qdir.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qdir.cpp
new file mode 100644
index 000000000..16f20c236
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qdir.cpp
@@ -0,0 +1,179 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+void wrapInFunction()
+{
+
+//! [0]
+QDir("/home/user/Documents")
+QDir("C:/Documents and Settings")
+//! [0]
+
+
+//! [1]
+QDir("images/landscape.png")
+//! [1]
+
+
+//! [2]
+QDir("Documents/Letters/Applications").dirName() # "Applications"
+QDir().dirName() # "."
+//! [2]
+
+
+//! [3]
+directory = QDir("Documents/Letters")
+path = directory.filePath("contents.txt")
+absolutePath = directory.absoluteFilePath("contents.txt")
+//! [3]
+
+
+//! [4]
+dir = QDir("example")
+if not dir.exists():
+ print "Cannot find the example directory"
+//! [4]
+
+
+//! [5]
+dir = QDir.root() # "/"
+if not dir.cd("tmp"): # "/tmp"
+ print "Cannot find the \"/tmp\" directory"
+else:
+ file = QFile(dir.filePath("ex1.txt")) # "/tmp/ex1.txt"
+ if !file.open(QIODevice.ReadWrite):
+ print "Cannot create the file %s" % (file.name())
+//! [5]
+
+
+//! [6]
+bin = "/local/bin" # where /local/bin is a symlink to /usr/bin
+binDir = QDir(bin)
+canonicalBin = binDir.canonicalPath()
+# canonicalBin now equals "/usr/bin"
+
+ls = "/local/bin/ls" # where ls is the executable "ls"
+lsDir = QDir(ls)
+canonicalLs = lsDir.canonicalPath()
+# canonicalLS now equals "/usr/bin/ls".
+//! [6]
+
+
+//! [7]
+dir = QDir("/home/bob")
+
+s = dir.relativeFilePath("images/file.jpg") # s is "images/file.jpg"
+s = dir.relativeFilePath("/home/mary/file.txt") # s is "../mary/file.txt"
+//! [7]
+
+
+//! [8]
+QDir.setSearchPaths("icons", [QDir.homePath() + "/images"])
+QDir.setSearchPaths("docs", [":/embeddedDocuments"])
+...
+pixmap = QPixmap("icons:undo.png") # will look for undo.png in QDir::homePath() + "/images"
+file = QFile("docs:design.odf") # will look in the :/embeddedDocuments resource path
+//! [8]
+
+
+//! [9]
+dir = QDir("/tmp/root_link")
+dir = dir.canonicalPath()
+if dir.isRoot():
+ print "It is a root link"
+//! [9]
+
+
+//! [10]
+# The current directory is "/usr/local"
+d1 = QDir("/usr/local/bin")
+d2 = QDir("bin")
+if d1 == d2:
+ print "They're the same"
+//! [10]
+
+
+//! [11]
+// The current directory is "/usr/local"
+d1 = QDir("/usr/local/bin")
+d1.setFilter(QDir.Executable)
+d2 = QDir("bin")
+if d1 != d2:
+ print "They differ"
+//! [11]
+
+
+//! [12]
+C:/Documents and Settings/Username
+//! [12]
+
+
+//! [13]
+Q_INIT_RESOURCE(myapp);
+//! [13]
+
+
+//! [14]
+def initMyResource():
+ Q_INIT_RESOURCE(myapp)
+
+class MyNamespace
+ ...
+
+ def myFunction(self):
+ initMyResource()
+//! [14]
+
+
+//! [15]
+Q_CLEANUP_RESOURCE(myapp);
+//! [15]
+
+}
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qdiriterator.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qdiriterator.cpp
new file mode 100644
index 000000000..be68a5dbb
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qdiriterator.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+it = QDirIterator("/etc", QDirIterator.Subdirectories)
+while it.hasNext():
+ print it.next()
+
+ # /etc/.
+ # /etc/..
+ # /etc/X11
+ # /etc/X11/fs
+ # ...
+
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qfile.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qfile.cpp
new file mode 100644
index 000000000..1e9d102c8
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qfile.cpp
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+file = QFile()
+QDir.setCurrent("/tmp")
+file.setFileName("readme.txt")
+QDir.setCurrent("/home")
+file.open(QIODevice.ReadOnly) # opens "/home/readme.txt" under Unix
+//! [0]
+
+
+//! [1]
+def myEncoderFunc(fileName):
+//! [1]
+
+
+//! [2]
+def myDecoderFunc(localFileName):
+//! [2]
+
+
+//! [3]
+
+def printError(msg):
+ file = QFile()
+ file.open(sys.stderr.fileno(), QIODevice.WriteOnly)
+ file.write(msg, size(msg)) # write to stderr
+ file.close()
+//! [3]
+
+
+//! [4]
+CONFIG += console
+//! [4]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qfileinfo.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qfileinfo.cpp
new file mode 100644
index 000000000..1027525db
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qfileinfo.cpp
@@ -0,0 +1,148 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//![newstuff]
+ fi = QFileInfo("c:/temp/foo") => fi.absoluteFilePath() => "C:/temp/foo"
+//![newstuff]
+
+//! [0]
+info1 = QFileInfo("/home/bob/bin/untabify")
+info1.isSymLink() # returns true
+info1.absoluteFilePath() # returns "/home/bob/bin/untabify"
+info1.size() # returns 56201
+info1.symLinkTarget() # returns "/opt/pretty++/bin/untabify"
+
+info2 = QFileInfo(info1.symLinkTarget())
+info1.isSymLink() # returns False
+info1.absoluteFilePath() # returns "/opt/pretty++/bin/untabify"
+info1.size() # returns 56201
+
+//! [0]
+
+
+//! [1]
+info1 = QFileInfo("C:\\Documents and Settings\\Bob\\untabify.lnk")
+info1.isSymLink() # returns True
+info1.absoluteFilePath() # returns "C:/Documents and Settings/Bob/untabify.lnk"
+info1.size() # returns 743
+info1.symLinkTarget() # returns "C:/Pretty++/untabify"
+
+info2 = QFileInfo(info1.symLinkTarget())
+info1.isSymLink() # returns False
+info1.absoluteFilePath() # returns "C:/Pretty++/untabify"
+info1.size() # returns 63942
+//! [1]
+
+
+//! [2]
+absolute = "/local/bin"
+relative = "local/bin"
+absFile = QFileInfo(absolute)
+relFile = QFileInfo(relative)
+
+QDir.setCurrent(QDir.rootPath())
+# absFile and relFile now point to the same file
+
+QDir.setCurrent("/tmp")
+# absFile now points to "/local/bin",
+# while relFile points to "/tmp/local/bin"
+//! [2]
+
+
+//! [3]
+fi = QFileInfo("/tmp/archive.tar.gz")
+name = fi.fileName() # name = "archive.tar.gz"
+//! [3]
+
+
+//! [4]
+fi = QFileInfo("/Applications/Safari.app")
+bundle = fi.bundleName() # name = "Safari"
+//! [4]
+
+
+//! [5]
+fi = QFileInfo("/tmp/archive.tar.gz")
+base = fi.baseName() # base = "archive"
+//! [5]
+
+
+//! [6]
+fi = QFileInfo("/tmp/archive.tar.gz")
+base = fi.completeBaseName() # base = "archive.tar"
+//! [6]
+
+
+//! [7]
+fi = QFileInfo("/tmp/archive.tar.gz")
+ext = fi.completeSuffix() # ext = "tar.gz"
+//! [7]
+
+
+//! [8]
+fi = QFileInfo("/tmp/archive.tar.gz")
+ext = fi.suffix(); # ext = "gz"
+//! [8]
+
+
+//! [9]
+info = QFileInfo(fileName)
+if info.isSymLink():
+ fileName = info.symLinkTarget()
+//! [9]
+
+
+//! [10]
+fi = QFileInfo("/tmp/archive.tar.gz")
+if fi.permission(QFile.WriteUser | QFile.ReadGroup):
+ print "I can change the file; my group can read the file"
+if fi.permission(QFile.WriteGroup | QFile.WriteOther):
+ print "The group or others can change the file"
+//! [10]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qiodevice.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qiodevice.cpp
new file mode 100644
index 000000000..d8f155c38
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qiodevice.cpp
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+gzip = QProcess()
+gzip.start("gzip", ["-c"])
+if not gzip.waitForStarted():
+ return False
+
+gzip.write("uncompressed data")
+
+compressed = QByteArray()
+while gzip.waitForReadyRead():
+ compressed += gzip.readAll()
+//! [0]
+
+
+//! [1]
+def bytesAvailable(self):
+ return buffer.size() + QIODevice.bytesAvailable()
+//! [1]
+
+
+//! [2]
+file = QFile("box.txt")
+if file.open(QFile.ReadOnly):
+ buf = file.readLine(1024)
+ if buf.size():
+ # the line is available in buf
+//! [2]
+
+
+//! [3]
+def canReadLine(self):
+ return buffer.contains('\n') or QIODevice.canReadLine()
+//! [3]
+
+
+//! [4]
+def isExeFile(file_):
+ buf = file_.peek(2)
+ if buf.size() == 2:
+ return buf[0] == 'M' and buf[1] == 'Z'
+ return False
+//! [4]
+
+
+//! [5]
+def isExeFile(file_):
+ return file_.peek(2) == "MZ"
+//! [5]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qprocess.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qprocess.cpp
new file mode 100644
index 000000000..a4b74ae97
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qprocess.cpp
@@ -0,0 +1,132 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+def wrapInFunction():
+
+//! [0]
+builder = QProcess()
+builder.setProcessChannelMode(QProcess.MergedChannels)
+builder.start("make", ["-j2"])
+
+import sys
+if not builder.waitForFinished():
+ sys.stderr.write("Make failed:" + builder.errorString())
+else
+ sys.stderr.write("Make output:" + builder.readAll())
+//! [0]
+
+
+//! [1]
+more = QProcess()
+more.start("more")
+more.write("Text to display")
+more.closeWriteChannel()
+#QProcess will emit readyRead() once "more" starts printing
+//! [1]
+
+
+//! [2]
+command1 | command2
+//! [2]
+
+
+//! [3]
+process1 = QProcess()
+process2 = QProcess()
+
+process1.setStandardOutputProcess(process2)
+
+process1.start("command1")
+process2.start("command2")
+//! [3]
+
+
+//! [4]
+class SandboxProcess(QProcess):
+ def setupChildProcess(self)
+ # Drop all privileges in the child process, and enter
+ # a chroot jail.
+ os.setgroups(0, 0)
+ os.chroot("/etc/safe")
+ os.chdir("/")
+ os.setgid(safeGid)
+ os.setuid(safeUid)
+ os.umask(0)
+
+//! [4]
+
+
+//! [5]
+process = QProcess()
+process.start("del /s *.txt")
+# same as process.start("del", ["/s", "*.txt"])
+...
+//! [5]
+
+
+//! [6]
+process = QProcess()
+process.start("dir \"My Documents\"")
+//! [6]
+
+
+//! [7]
+process = QProcess()
+process.start("dir \"\"\"My Documents\"\"\"")
+//! [7]
+
+
+//! [8]
+environment = QProcess.systemEnvironment()
+# environment = [PATH=/usr/bin:/usr/local/bin",
+# "USER=greg", "HOME=/home/greg"]
+//! [8]
+
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qsettings.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qsettings.cpp
new file mode 100644
index 000000000..11bb9af48
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qsettings.cpp
@@ -0,0 +1,327 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+settings = QSettings("MySoft", "Star Runner")
+color = QColor(settings.value("DataPump/bgcolor"))
+//! [0]
+
+
+//! [1]
+settings = QSettings("MySoft", "Star Runner")
+color = palette().background().color()
+settings.setValue("DataPump/bgcolor", color)
+//! [1]
+
+
+//! [2]
+settings = QSettings("/home/petra/misc/myapp.ini",
+ QSettings.IniFormat)
+//! [2]
+
+
+//! [3]
+settings = QSettings("/Users/petra/misc/myapp.plist",
+ QSettings.NativeFormat)
+//! [3]
+
+
+//! [4]
+settings = QSettings("HKEY_CURRENT_USER\\Software\\Microsoft\\Office",
+ QSettings.NativeFormat)
+//! [4]
+
+
+//! [5]
+settings.setValue("11.0/Outlook/Security/DontTrustInstalledFiles", 0)
+//! [5]
+
+
+//! [6]
+settings.setValue("HKEY_CURRENT_USER\\MySoft\\Star Runner\\Galaxy", "Milkyway")
+settings.setValue("HKEY_CURRENT_USER\\MySoft\\Star Runner\\Galaxy\\Sun", "OurStar")
+settings.value("HKEY_CURRENT_USER\\MySoft\\Star Runner\\Galaxy\\Default") # returns "Milkyway"
+//! [6]
+
+
+//! [7]
+ organizationName = "grenoullelogique.fr" if sys.platform.startswith('darwin') else "Grenoulle Logique"
+ settings = QSettings(organizationName, "Squash")
+//! [7]
+
+
+//! [8]
+pos = @Point(100 100)
+//! [8]
+
+
+//! [9]
+windir = C:\Windows
+//! [9]
+
+
+//! [10]
+settings = QSettings("Moose Tech", "Facturo-Pro")
+//! [10]
+
+
+//! [11]
+settings = QSettings("Moose Soft", "Facturo-Pro")
+//! [11]
+
+
+//! [12]
+QCoreApplication.setOrganizationName("Moose Soft")
+QCoreApplication.setApplicationName("Facturo-Pro")
+settings = QSettings()
+//! [12]
+
+
+//! [13]
+settings.beginGroup("mainwindow")
+settings.setValue("size", win.size())
+settings.setValue("fullScreen", win.isFullScreen())
+settings.endGroup()
+
+settings.beginGroup("outputpanel")
+settings.setValue("visible", panel.isVisible())
+settings.endGroup()
+//! [13]
+
+
+//! [14]
+settings.beginGroup("alpha")
+# settings.group() == "alpha"
+
+settings.beginGroup("beta")
+# settings.group() == "alpha/beta"
+
+settings.endGroup()
+# settings.group() == "alpha"
+
+settings.endGroup()
+# settings.group() == ""
+//! [14]
+
+
+//! [15]
+class Login:
+ userName = ''
+ password = ''
+
+ logins = []
+ ...
+
+ settings = QSettings()
+ size = settings.beginReadArray("logins")
+ for i in range(size):
+ settings.setArrayIndex(i)
+ login = Login()
+ login.userName = settings.value("userName")
+ login.password = settings.value("password")
+ logins.append(login)
+
+ settings.endArray()
+//! [15]
+
+
+//! [16]
+class Login:
+ userName = ''
+ password = ''
+
+ logins = []
+ ...
+
+ settings = QSettings()
+ settings.beginWriteArray("logins")
+ for i in range(logins.size()):
+ settings.setArrayIndex(i)
+ settings.setValue("userName", list.at(i).userName)
+ settings.setValue("password", list.at(i).password)
+
+ settings.endArray()
+//! [16]
+
+
+//! [17]
+settings = QSettings()
+settings.setValue("fridge/color", Qt.white)
+settings.setValue("fridge/size", QSize(32, 96))
+settings.setValue("sofa", True)
+settings.setValue("tv", False)
+
+keys = settings.allKeys();
+# keys: ["fridge/color", "fridge/size", "sofa", "tv"]
+//! [17]
+
+
+//! [18]
+settings.beginGroup("fridge")
+keys = settings.allKeys()
+# keys: ["color", "size"]
+//! [18]
+
+
+//! [19]
+settings = QSettings()
+settings.setValue("fridge/color", Qt.white)
+settings.setValue("fridge/size", QSize(32, 96))
+settings.setValue("sofa", True)
+settings.setValue("tv", False)
+
+keys = settings.childKeys()
+# keys: ["sofa", "tv"]
+//! [19]
+
+
+//! [20]
+settings.beginGroup("fridge")
+keys = settings.childKeys()
+# keys: ["color", "size"]
+//! [20]
+
+
+//! [21]
+settings = QSettings()
+settings.setValue("fridge/color", Qt.white)
+settings.setValue("fridge/size", QSize(32, 96));
+settings.setValue("sofa", True)
+settings.setValue("tv", False)
+
+groups = settings.childGroups()
+# group: ["fridge"]
+//! [21]
+
+
+//! [22]
+settings.beginGroup("fridge")
+groups = settings.childGroups()
+# groups: []
+//! [22]
+
+
+//! [23]
+settings = QSettings()
+settings.setValue("interval", 30)
+settings.value("interval") # returns 30
+
+settings.setValue("interval", 6.55)
+settings.value("interval") # returns 6.55
+//! [23]
+
+
+//! [24]
+settings = QSettings()
+settings.setValue("ape")
+settings.setValue("monkey", 1)
+settings.setValue("monkey/sea", 2)
+settings.setValue("monkey/doe", 4)
+
+settings.remove("monkey")
+keys = settings.allKeys()
+# keys: ["ape"]
+//! [24]
+
+
+//! [25]
+settings = QSettings()
+settings.setValue("ape")
+settings.setValue("monkey", 1)
+settings.setValue("monkey/sea", 2)
+settings.setValue("monkey/doe", 4)
+
+settings.beginGroup("monkey")
+settings.remove("")
+settings.endGroup()
+
+keys = settings.allKeys()
+# keys: ["ape"]
+//! [25]
+
+
+//! [26]
+settings = QSettings()
+settings.setValue("animal/snake", 58)
+settings.value("animal/snake", 1024) # returns 58
+settings.value("animal/zebra", 1024) # returns 1024
+settings.value("animal/zebra") # returns 0
+//! [26]
+
+
+//! [27]
+# @arg device QIODevice
+# @arg map QSettings.SettingsMap
+# @return bool
+def myReadFunc(device, map):
+//! [27]
+
+
+//! [28]
+# @arg device QIODevice
+# @arg map QSettings.SettingsMap
+# @return bool
+def myWriteFunc(device, map)
+//! [28]
+
+
+//! [29]
+# @arg device QIODevice
+# @arg map QSettings.SettingsMap
+# @return bool
+def readXmlFile(device, map):
+def writeXmlFile(device, map):
+
+def main():
+ XmlFormat = QSettings::registerFormat("xml", readXmlFile, writeXmlFile)
+ settings = QSettings(XmlFormat, QSettings.UserSettings,
+ "MySoft", "Star Runner")
+ ...
+//! [29]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qtemporaryfile.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qtemporaryfile.cpp
new file mode 100644
index 000000000..7244c22c8
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qtemporaryfile.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+{
+//! [0]
+ # Within a function/method...
+
+ file_ = QTemporaryFile()
+ if file_.open():
+ # file_.fileName() returns the unique file name
+
+ # The QTemporaryFile destructor removes the temporary file
+ # as it goes out of scope.
+//! [0]
+}
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qtextstream.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qtextstream.cpp
new file mode 100644
index 000000000..cf67a61fb
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qtextstream.cpp
@@ -0,0 +1,140 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+data = QFile("output.txt")
+if data.open(QFile.WriteOnly | QFile.Truncate):
+ out = QTextStream(&data)
+ out << "Result: " << qSetFieldWidth(10) << left << 3.14 << 2.7
+ # writes "Result: 3.14 2.7 "
+
+//! [0]
+
+
+//! [1]
+stream = QTextStream(sys.stdin.fileno())
+
+while(True):
+ line = stream.readLine()
+ if line.isNull():
+ break;
+//! [1]
+
+
+//! [2]
+in_ = QTextStream("0x50 0x20")
+firstNumber = 0
+secondNumber = 0
+
+in_ >> firstNumber # firstNumber == 80
+in_ >> dec >> secondNumber # secondNumber == 0
+
+ch = None
+in_ >> ch # ch == 'x'
+//! [2]
+
+
+//! [3]
+def main():
+ # read numeric arguments (123, 0x20, 4.5...)
+ for i in sys.argv():
+ number = None
+ QTextStream in_(i)
+ in_ >> number
+ ...
+//! [3]
+
+
+//! [4]
+str = QString()
+in_ = QTextStream(sys.stdin.fileno())
+in_ >> str
+//! [4]
+
+
+//! [5]
+s = QString()
+out = QTextStream(s)
+out.setFieldWidth(10)
+out.setFieldAlignment(QTextStream::AlignCenter)
+out.setPadChar('-')
+out << "Qt" << "rocks!"
+//! [5]
+
+
+//! [6]
+----Qt------rocks!--
+//! [6]
+
+
+//! [7]
+in_ = QTextStream(file)
+ch1 = QChar()
+ch2 = QChar()
+ch3 = QChar()
+in_ >> ch1 >> ch2 >> ch3;
+//! [7]
+
+
+//! [8]
+out = QTextStream(sys.stdout.fileno())
+out << "Qt rocks!" << endl
+//! [8]
+
+
+//! [9]
+stream << '\n' << flush
+//! [9]
+
+
+//! [10]
+out = QTextStream(file)
+out.setCodec("UTF-8")
+//! [10]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qurl.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qurl.cpp
new file mode 100644
index 000000000..d32a7b9c7
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qurl.cpp
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+url = QUrl("http://www.example.com/List of holidays.xml")
+# url.toEncoded() == "http://www.example.com/List%20of%20holidays.xml"
+//! [0]
+
+
+//! [1]
+url = QUrl.fromEncoded("http://qtsoftware.com/List%20of%20holidays.xml")
+//! [1]
+
+
+//! [2]
+def checkUrl(url):
+ if !url.isValid():
+ print "Invalid URL: %s" % url.toString()
+ return False
+
+ return True
+
+//! [2]
+
+
+//! [3]
+ftp = QFtp()
+ftp.connectToHost(url.host(), url.port(21))
+//! [3]
+
+
+//! [4]
+http://www.example.com/cgi-bin/drawgraph.cgi?type-pie/color-green
+//! [4]
+
+
+//! [5]
+baseUrl = QUrl("http://qtsoftware.com/support")
+relativeUrl = QUrl("../products/solutions")
+print baseUrl.resolved(relativeUrl).toString()
+# prints "http://qtsoftware.com/products/solutions"
+//! [5]
+
+
+//! [6]
+ba = QUrl.toPercentEncoding("{a fishy string?}", "{}", "s")
+print ba
+# prints "{a fi%73hy %73tring%3F}"
+//! [6]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qabstracteventdispatcher.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qabstracteventdispatcher.cpp
new file mode 100644
index 000000000..a531f22fc
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qabstracteventdispatcher.cpp
@@ -0,0 +1,3 @@
+//! [0]
+bool myEventFilter(void *message);
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp
new file mode 100644
index 000000000..f2a9e8222
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+beginInsertRows(parent, 2, 4)
+//! [0]
+
+
+//! [1]
+beginInsertRows(parent, 4, 5)
+//! [1]
+
+
+//! [2]
+beginRemoveRows(parent, 2, 3)
+//! [2]
+
+
+//! [3]
+beginInsertColumns(parent, 4, 6)
+//! [3]
+
+
+//! [4]
+beginInsertColumns(parent, 6, 8)
+//! [4]
+
+
+//! [5]
+beginRemoveColumns(parent, 4, 6)
+//! [5]
+
+
+//! [6]
+beginMoveRows(sourceParent, 2, 4, destinationParent, 2)
+//! [6]
+
+
+//! [7]
+beginMoveRows(sourceParent, 2, 4, destinationParent, 6)
+//! [7]
+
+
+//! [8]
+beginMoveRows(parent, 2, 2, parent, 0)
+//! [8]
+
+
+//! [9]
+beginMoveRows(parent, 2, 2, parent, 4)
+//! [9]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp
new file mode 100644
index 000000000..115c76671
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp
@@ -0,0 +1,128 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+event = QMouseEvent(QEvent.MouseButtonPress, pos, 0, 0, 0)
+QApplication.sendEvent(mainWindow, event)
+//! [0]
+
+
+//! [1]
+quitButton = QPushButton("Quit")
+quitButton.clicked.connect(app.quit)
+//! [1]
+
+
+//! [2]
+for path in app.libraryPaths():
+ do_something(path)
+//! [2]
+
+
+//! [3]
+myEventFilter(message, result)
+//! [3]
+
+
+//! [4]
+def cleanup_stuff():
+ # do the cleanup stuff
+
+def init_stuff():
+ qAddPostRoutine(cleanup_stuff)
+//! [4]
+
+
+//! [5]
+class MyPrivateInitStuff : public QObject
+{
+public:
+ static MyPrivateInitStuff *initStuff(QObject *parent)
+ {
+ if (!p)
+ p = new MyPrivateInitStuff(parent);
+ return p;
+ }
+
+ ~MyPrivateInitStuff()
+ {
+ // cleanup goes here
+ }
+
+private:
+ MyPrivateInitStuff(QObject *parent)
+ : QObject(parent)
+ {
+ // initialization goes here
+ }
+
+ MyPrivateInitStuff *p;
+};
+//! [5]
+
+
+//! [6]
+static inline QString tr(const char *sourceText,
+ const char *comment = 0);
+static inline QString trUtf8(const char *sourceText,
+ const char *comment = 0);
+//! [6]
+
+
+//! [7]
+class MyMfcView : public CView
+{
+ Q_DECLARE_TR_FUNCTIONS(MyMfcView)
+
+public:
+ MyMfcView();
+ ...
+};
+//! [7]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qmetaobject.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qmetaobject.cpp
new file mode 100644
index 000000000..79fe7f09f
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qmetaobject.cpp
@@ -0,0 +1,132 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+void wrapInFunction()
+{
+
+//! [0]
+class MyClass:
+
+ Q_CLASSINFO("author", "Sabrina Schweinsteiger")
+ Q_CLASSINFO("url", "http://doc.moosesoft.co.uk/1.0/")
+
+ ...
+//! [0]
+
+
+//! [1]
+normType = QMetaObject.normalizedType(" int const *")
+# normType is now "const int*"
+//! [1]
+
+
+//! [2]
+QMetaObject.invokeMethod(pushButton, "animateClick",
+ Qt.QueuedConnection)
+//! [2]
+
+
+//! [3]
+QMetaObject.invokeMethod: Unable to handle unregistered datatype 'MyType'
+//! [3]
+
+
+//! [4]
+retVal = QString()
+QMetaObject.invokeMethod(obj, "compute", Qt::DirectConnection,
+ Q_RETURN_ARG(QString, retVal),
+ Q_ARG(QString, "sqrt"),
+ Q_ARG(int, 42),
+ Q_ARG(double, 9.7));
+//! [4]
+
+
+//! [5]
+class MyClass:
+ Q_CLASSINFO("author", "Sabrina Schweinsteiger")
+ Q_CLASSINFO("url", "http://doc.moosesoft.co.uk/1.0/")
+//! [5]
+
+
+//! [propertyCount]
+metaObject = obj.metaObject()
+properties = [metaObject.property(i).name() for i in range(metaObject.propertyOffset(), metaObject.propertyCount())]
+//! [propertyCount]
+
+
+//! [methodCount]
+metaObject = obj.metaObject()
+methods = [metaObject.method(i).signature() for i in range(metaObject.methodOffset(), metaObject.methodCount())]
+//! [methodCount]
+
+//! [6]
+methodIndex = pushButton.metaObject().indexOfMethod("animateClick()")
+method = metaObject.method(methodIndex)
+method.invoke(pushButton, Qt.QueuedConnection)
+//! [6]
+
+//! [7]
+QMetaMethod.invoke: Unable to handle unregistered datatype 'MyType'
+//! [7]
+
+//! [8]
+retVal = QString()
+normalizedSignature = QMetaObject.normalizedSignature("compute(QString, int, double)")
+methodIndex = obj.metaObject().indexOfMethod(normalizedSignature)
+method = metaObject.method(methodIndex)
+method.invoke(obj,
+ Qt.DirectConnection,
+ Q_RETURN_ARG(QString, retVal),
+ Q_ARG(QString, "sqrt"),
+ Q_ARG(int, 42),
+ Q_ARG(double, 9.7));
+//! [8]
+
+}
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp
new file mode 100644
index 000000000..14f07a139
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp
@@ -0,0 +1,119 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+struct MyStruct
+{
+ int i;
+ ...
+};
+
+Q_DECLARE_METATYPE(MyStruct)
+//! [0]
+
+
+//! [1]
+namespace MyNamespace
+{
+ ...
+}
+
+Q_DECLARE_METATYPE(MyNamespace::MyStruct)
+//! [1]
+
+
+//! [2]
+MyStruct s;
+QVariant var;
+var.setValue(s); // copy s into the variant
+
+...
+
+// retrieve the value
+MyStruct s2 = var.value<MyStruct>();
+//! [2]
+
+
+//! [3]
+int id = QMetaType::type("MyClass");
+if (id == 0) {
+ void *myClassPtr = QMetaType::construct(id);
+ ...
+ QMetaType::destroy(id, myClassPtr);
+ myClassPtr = 0;
+}
+//! [3]
+
+
+//! [4]
+qRegisterMetaType<MyClass>("MyClass");
+//! [4]
+
+
+//! [5]
+qRegisterMetaTypeStreamOperators<MyClass>("MyClass");
+//! [5]
+
+
+//! [6]
+QDataStream &operator<<(QDataStream &out, const MyClass &myObj);
+QDataStream &operator>>(QDataStream &in, MyClass &myObj);
+//! [6]
+
+
+//! [7]
+int id = qRegisterMetaType<MyStruct>();
+//! [7]
+
+
+//! [8]
+int id = qMetaTypeId<QString>(); // id is now QMetaType::QString
+id = qMetaTypeId<MyStruct>(); // compile error if MyStruct not declared
+//! [8]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qmimedata.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qmimedata.cpp
new file mode 100644
index 000000000..46c7e31de
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qmimedata.cpp
@@ -0,0 +1,107 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+def dragEnterEvent(self, event):
+ if event.mimeData().hasUrls():
+ event.acceptProposedAction()
+
+def dropEvent(self, event):
+ if event->mimeData().hasUrls():
+ for url in event.mimeData().urls():
+ ...
+//! [0]
+
+
+//! [1]
+csvData = QByteArray(...)
+
+mimeData = QMimeData()
+mimeData.setData("text/csv", csvData)
+//! [1]
+
+
+//! [2]
+def dropEvent(self, event):
+ myData = event->mimeData()
+ if myData:
+ # access myData's data directly (not through QMimeData's API)
+}
+//! [2]
+
+
+//! [3]
+application/x-qt-windows-mime;value="<custom type>"
+//! [3]
+
+
+//! [4]
+application/x-qt-windows-mime;value="FileGroupDescriptor"
+application/x-qt-windows-mime;value="FileContents"
+//! [4]
+
+
+//! [5]
+if event.mimeData().hasImage():
+ image = QImage(event.mimeData().imageData())
+ ...
+//! [5]
+
+
+//! [6]
+mimeData.setImageData(QImage("beautifulfjord.png"))
+//! [6]
+
+
+//! [7]
+if event.mimeData().hasColor():
+ color = QColor(event.mimeData().colorData())
+ ...
+//! [7]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qobject.py b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qobject.py
new file mode 100644
index 000000000..7e50f6701
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qobject.py
@@ -0,0 +1,375 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the documentation of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+//! [0]
+lineEdit = qt_find_obj_child(myWidget, "QLineEdit", "my line edit")
+if lineEdit:
+ lineEdit.setText("Default")
+//! [0]
+
+
+//! [1]
+obj = QPushButton()
+obj.metaObject().className() # returns "QPushButton"
+
+QPushButton.staticMetaObject.className() # returns "QPushButton"
+//! [1]
+
+
+//! [2]
+QPushButton.staticMetaObject.className() # returns "QPushButton"
+
+obj = QPushButton()
+obj.metaObject().className() # returns "QPushButton"
+//! [2]
+
+
+//! [3]
+obj = QTimer() # QTimer inherits QObject
+
+timer = obj
+# timer == (QObject *)obj
+
+button = obj
+# button == 0
+//! [3]
+
+
+//! [4]
+timer = QTimer() # QTimer inherits QObject
+timer.inherits("QTimer") # returns true
+timer.inherits("QObject") # returns true
+timer.inherits("QAbstractButton") # returns false
+
+# QLayout inherits QObject and QLayoutItem
+layout = QLayout()
+layout.inherits("QObject") # returns true
+layout.inherits("QLayoutItem") # returns false
+//! [4]
+
+
+//! [5]
+print("MyClass.setPrecision(): ({}) invalid precision {}".format(qPrintable(objectName()),
+ newPrecision))
+//! [5]
+
+
+//! [6]
+class MainWindow(QMainWindow):
+ def __init__(self):
+ self.textEdit = QTextEdit()
+ setCentralWidget(self.textEdit)
+ textEdit.installEventFilter(self)
+
+ def eventFilter(self, obj, event):
+ if obj == textEdit:
+ if event.type() == QEvent.KeyPress:
+ keyEvent = event
+ print("Ate key press", keyEvent.key())
+ return true
+ else:
+ return false
+ else:
+ # pass the event on to the parent class
+ return QMainWindow.eventFilter(self, obj, event)
+//! [6]
+
+
+//! [7]
+myObject.moveToThread(QApplication.instance().thread())
+//! [7]
+
+
+//! [8]
+class MyObject(QObject):
+ def __init__(self, parent):
+ QObject.__init__(self, parent)
+
+ self.startTimer(50) # 50-millisecond timer
+ self.startTimer(1000) # 1-second timer
+ self.startTimer(60000) # 1-minute timer
+
+
+ def timerEvent(self, event):
+ print("Timer ID:", event.timerId())
+
+//! [8]
+
+
+//! [9]
+a_list = window().queryList("QAbstractButton")
+for obj in a_list:
+ obj.setEnabled(false)
+//! [9]
+
+
+//! [10]
+button = parentWidget.findChild(QPushButton, "button1")
+//! [10]
+
+
+//! [11]
+a_list = parentWidget.findChild(QListWidget)
+//! [11]
+
+
+//! [12]
+widgets = parentWidget.findChildren(QWidget, "widgetname")
+//! [12]
+
+
+//! [13]
+allPButtons = parentWidget.findChildren(QPushButton)
+//! [13]
+
+
+//! [14]
+monitoredObj.installEventFilter(filterObj)
+//! [14]
+
+
+//! [15]
+class KeyPressEater(QObject):
+ def eventFilter(self, obj, event):
+ if event.type() == QEvent.KeyPress:
+ print("Ate key press", event.key())
+ return True
+ else:
+ # standard event processing
+ return QObject.eventFilter(self, obj, event)
+//! [15]
+
+
+//! [16]
+keyPressEater = KeyPressEater(self)
+pushButton = QPushButton(self)
+listView = QListView(self)
+
+pushButton.installEventFilter(keyPressEater)
+listView.installEventFilter(keyPressEater)
+//! [16]
+
+
+//! [17]
+def __init__(self):
+ senderLabel = QLabel(self.tr("Name:"))
+ recipientLabel = QLabel(self.tr("Name:", "recipient"))
+ # ...
+//! [17]
+
+
+//! [18]
+n = messages.count();
+showMessage(self.tr("%n message(s) saved", "", n));
+//! [18]
+
+
+//! [19]
+if n == 1:
+ self.tr("%n message saved")
+else:
+ self.tr("%n messages saved")
+//! [19]
+
+
+//! [20]
+label.setText(self.tr("F\374r \310lise"))
+//! [20]
+
+
+//! [21]
+if receivers(SIGNAL('valueChanged()')) > 0:
+ data = get_the_value() # expensive operation
+ self.valueChanged(data)
+//! [21]
+
+
+//! [22]
+label = QLabel()
+scrollBar = QScrollBar()
+QObject.connect(scrollBar, SIGNAL('valueChanged(int)'),
+ label, SLOT('setNum(int)'));
+# or scrollBar.valueChanged.connect(label.setNum)
+//! [22]
+
+
+//! [23]
+// WRONG
+QObject.connect(scrollBar, SIGNAL('valueChanged(int value)'),
+ label, SLOT('setNum(int value)'));
+//! [23]
+
+
+//! [24]
+class MyWidget(QWidget):
+ def __init__(self):
+ myButton = QPushButton(self)
+ myButton.clicked.connect(self.buttonClicked)
+//! [24]
+
+
+//! [25]
+QObject.connect: Cannot queue arguments of type 'MyType'
+(Make sure 'MyType' is registered using qRegisterMetaType().)
+//! [25]
+
+
+//! [26]
+disconnect(myObject, 0, 0, 0)
+//! [26]
+
+
+//! [27]
+myObject.disconnect()
+//! [27]
+
+
+//! [28]
+disconnect(myObject, SIGNAL('mySignal()'), 0, 0)
+//! [28]
+
+
+//! [29]
+myObject.disconnect(SIGNAL('mySignal()'))
+//! [29]
+
+
+//! [30]
+disconnect(myObject, 0, myReceiver, 0)
+//! [30]
+
+
+//! [31]
+myObject.disconnect(myReceiver)
+//! [31]
+
+
+//! [32]
+if QLatin1String(signal) == SIGNAL('valueChanged()'):
+ # signal is valueChanged()
+//! [32]
+
+
+//! [33]
+def on_<object name>_<signal name>(<signal parameters>)
+//! [33]
+
+
+//! [34]
+def on_button1_clicked()
+//! [34]
+
+
+//! [35]
+class MyClass(QObject):
+ Q_CLASSINFO("Author", "Pierre Gendron")
+ Q_CLASSINFO("URL", "http://www.my-organization.qc.ca")
+
+//! [35]
+
+
+//! [36]
+Q_PROPERTY(type name
+ READ getFunction
+ [WRITE setFunction]
+ [RESET resetFunction]
+ [DESIGNABLE bool]
+ [SCRIPTABLE bool]
+ [STORED bool]
+ [USER bool])
+//! [36]
+
+
+//! [37]
+Q_PROPERTY(QString title READ title WRITE setTitle USER true)
+//! [37]
+
+
+//! [38]
+#this does not apply to Python
+class MyClass(QObject):
+
+ #Q_OBJECT, not needed
+ #Q_ENUMS(Priority), not supported
+
+ def __init__(self, parent=None):
+ pass
+
+ class Priority(Enum):
+ High = 1
+ Low = 2
+ VeryHigh = 3
+ VeryLow 4
+
+ def setPriority(self, priority):
+ pass
+
+ priority = Property(...)
+};
+//! [38]
+
+
+//! [39]
+#this does not apply to Python
+Q_FLAGS(Options Alignment)
+//! [39]
+
+
+//! [40]
+# This name refers to a host name.
+hostNameLabel.setText(self.tr("Name:"))
+
+# This text refers to a C++ code example.
+example = self.tr("Example")
+//! [40]
+
+//! [explicit tr context]
+text = QScrollBar.tr("Page up")
+//! [explicit tr context]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qsystemsemaphore.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qsystemsemaphore.cpp
new file mode 100644
index 000000000..2a9385269
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qsystemsemaphore.cpp
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+sem = QSystemSemaphore("market", 3, QSystemSemaphore.Create)
+# resources available == 3
+sem.acquire() # resources available == 2
+sem.acquire() # resources available == 1
+sem.acquire() # resources available == 0
+sem.release() # resources available == 1
+sem.release(2) # resources available == 3
+//! [0]
+
+
+//! [1]
+sem = QSystemSemaphore("market", 5, QSystemSemaphore.Create)
+sem.acquire(5) # acquire all 5 resources
+sem.release(5) # release the 5 resources
+//! [1]
+
+
+//! [2]
+sem.release(10) # "create" 10 new resources
+//! [2]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qtimer.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qtimer.cpp
new file mode 100644
index 000000000..7436ac5a8
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qtimer.cpp
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+from PySide6.QtCore import QApplication, QTimer
+
+def main():
+
+ app = QApplication([])
+ QTimer.singleShot(600000, app, SLOT('quit()'))
+ ...
+ return app.exec_()
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_plugin_qlibrary.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_plugin_qlibrary.cpp
new file mode 100644
index 000000000..310cf5df4
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_plugin_qlibrary.cpp
@@ -0,0 +1,94 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+QLibrary myLib("mylib");
+typedef void (*MyPrototype)();
+MyPrototype myFunction = (MyPrototype) myLib.resolve("mysymbol");
+if (myFunction)
+ myFunction();
+//! [0]
+
+
+//! [1]
+typedef void (*MyPrototype)();
+MyPrototype myFunction =
+ (MyPrototype) QLibrary::resolve("mylib", "mysymbol");
+if (myFunction)
+ myFunction();
+//! [1]
+
+
+//! [2]
+typedef int (*AvgFunction)(int, int);
+
+AvgFunction avg = (AvgFunction) library->resolve("avg");
+if (avg)
+ return avg(5, 8);
+else
+ return -1;
+//! [2]
+
+
+//! [3]
+extern "C" MY_EXPORT int avg(int a, int b)
+{
+ return (a + b) / 2;
+}
+//! [3]
+
+
+//! [4]
+#ifdef Q_WS_WIN
+#define MY_EXPORT __declspec(dllexport)
+#else
+#define MY_EXPORT
+#endif
+//! [4]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_plugin_quuid.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_plugin_quuid.cpp
new file mode 100644
index 000000000..90eafb980
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_plugin_quuid.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+# {67C8770B-44F1-410A-AB9A-F9B5446F13EE}
+IID_MyInterface = QUuid(0x67c8770b, 0x44f1, 0x410a, 0xab, 0x9a, 0xf9, 0xb5, 0x44, 0x6f, 0x13, 0xee)
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_statemachine_qstatemachine.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_statemachine_qstatemachine.cpp
new file mode 100644
index 000000000..6a78e19f1
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_statemachine_qstatemachine.cpp
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [simple state machine]
+button = QPushButton()
+
+machine = QStateMachine()
+s1 = QState()
+s1.assignProperty(button, "text", "Click me")
+
+s2 = QFinalState()
+s1.addTransition(button, SIGNAL('clicked()'), s2)
+
+machine.addState(s1)
+machine.addState(s2)
+machine.setInitialState(s1)
+machine.start()
+//! [simple state machine]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qatomic.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qatomic.cpp
new file mode 100644
index 000000000..7c999e55c
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qatomic.cpp
@@ -0,0 +1,108 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+MySharedType &MySharedType::operator=(const MySharedType &other)
+{
+ (void) other.data->atomicInt.ref();
+ if (!data->atomicInt.deref()) {
+ // The last reference has been released
+ delete d;
+ }
+ d = other.d;
+ return *this;
+}
+//! [0]
+
+
+//! [1]
+if (currentValue == expectedValue) {
+ currentValue = newValue;
+ return true;
+}
+return false;
+//! [1]
+
+
+//! [2]
+int originalValue = currentValue;
+currentValue = newValue;
+return originalValue;
+//! [2]
+
+
+//! [3]
+int originalValue = currentValue;
+currentValue += valueToAdd;
+return originalValue;
+//! [3]
+
+
+//! [4]
+if (currentValue == expectedValue) {
+ currentValue = newValue;
+ return true;
+}
+return false;
+//! [4]
+
+
+//! [5]
+T *originalValue = currentValue;
+currentValue = newValue;
+return originalValue;
+//! [5]
+
+
+//! [6]
+T *originalValue = currentValue;
+currentValue += valueToAdd;
+return originalValue;
+//! [6]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qmutex.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qmutex.cpp
new file mode 100644
index 000000000..e799cbb64
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qmutex.cpp
@@ -0,0 +1,165 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+number = 6
+
+def method1():
+ number *= 5
+ number /= 4
+
+def method2():
+ number *= 3
+ number /= 2
+//! [0]
+
+
+//! [1]
+# method1()
+number *= 5 # number is now 30
+number /= 4 # number is now 7
+
+# method2()
+number *= 3 # number is now 21
+number /= 2 # number is now 10
+//! [1]
+
+
+//! [2]
+# Thread 1 calls method1()
+number *= 5 # number is now 30
+
+# Thread 2 calls method2().
+#
+# Most likely Thread 1 has been put to sleep by the operating
+# system to allow Thread 2 to run.
+number *= 3 # number is now 90
+number /= 2 # number is now 45
+
+# Thread 1 finishes executing.
+number /= 4 # number is now 11, instead of 10
+//! [2]
+
+
+//! [3]
+mutex = QMutex()
+number = 6
+
+def method1():
+ mutex.lock()
+ number *= 5
+ number /= 4
+ mutex.unlock()
+
+def method2():
+ mutex.lock()
+ number *= 3
+ number /= 2
+ mutex.unlock()
+//! [3]
+
+
+//! [4]
+def complexFunction(flag):
+ mutex.lock()
+
+ retVal = 0
+
+ if flag == 0 or flag == 1:
+ mutex.unlock()
+ return moreComplexFunction(flag)
+ elif flag == 2:
+ status = anotherFunction()
+ if status < 0:
+ mutex.unlock()
+ return -2
+ retVal = status + flag
+ else:
+ if flag > 10:
+ mutex.unlock()
+ return -1
+
+ mutex.unlock()
+ return retVal
+//! [4]
+
+
+//! [5]
+def complexFunction(flag):
+ locker = QMutexLocker(mutex)
+
+ retVal = 0
+
+ if flag == 0 or flag == 1:
+ return moreComplexFunction(flag)
+ elif flag == 2:
+ status = anotherFunction()
+ if status < 0:
+ return -2
+ retVal = status + flag
+ else:
+ if flag > 10:
+ return -1
+
+ return retVal
+//! [5]
+
+
+//! [6]
+class SignalWaiter:
+ def __init__(mutex):
+ self.locker = mutex
+
+ def waitForSignal():
+ # ...
+ while not signalled:
+ waitCondition.wait(self.locker.mutex())
+ # ...
+//! [6]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qmutexpool.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qmutexpool.cpp
new file mode 100644
index 000000000..622cb18fd
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qmutexpool.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+class Number:
+ def __init__(n):
+ self.num = n
+//! [0]
+
+
+//! [1]
+def calcSquare(number):
+ locker = QMutexLocker(mutexpool.get(number))
+ number.num = number.num * number.num
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qreadwritelock.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qreadwritelock.cpp
new file mode 100644
index 000000000..d441042c8
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qreadwritelock.cpp
@@ -0,0 +1,111 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+lock = QReadWriteLock()
+
+class ReaderThread:
+ # ...
+ def run():
+ # ...
+ lock.lockForRead()
+ read_file()
+ lock.unlock()
+ # ...
+
+class WriterThread:
+ #...
+ def run():
+ # ...
+ lock.lockForWrite()
+ write_file()
+ lock.unlock()
+ # ...
+//! [0]
+
+
+//! [1]
+lock = QReadWriteLock()
+
+def readData():
+ locker = QReadLocker(lock)
+ # ...
+ return data
+//! [1]
+
+
+//! [2]
+lock = QReadWriteLock()
+
+def readData():
+ locker.lockForRead()
+ # ...
+ locker.unlock()
+ return data
+//! [2]
+
+
+//! [3]
+lock = QReadWriteLock()
+
+def writeData(data):
+ locker = QWriteLocker(lock)
+ # ...
+//! [3]
+
+
+//! [4]
+lock = QReadWriteLock()
+
+def writeData(data):
+ locker.lockForWrite()
+ # ...
+ locker.unlock()
+//! [4]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qsemaphore.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qsemaphore.cpp
new file mode 100644
index 000000000..086b105dd
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qsemaphore.cpp
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+sem = QSemaphore(5) # sem.available() == 5
+
+sem.acquire(3) # sem.available() == 2
+sem.acquire(2) # sem.available() == 0
+sem.release(5) # sem.available() == 5
+sem.release(5) # sem.available() == 10
+
+sem.tryAcquire(1) # sem.available() == 9, returns true
+sem.tryAcquire(250) # sem.available() == 9, returns false
+//! [0]
+
+
+//! [1]
+sem = QSemaphore(5) # a semaphore that guards 5 resources
+sem.acquire(5) # acquire all 5 resources
+sem.release(5) # release the 5 resources
+sem.release(10) # "create" 10 new resources
+//! [1]
+
+
+//! [2]
+sem = QSemaphore(5) # sem.available() == 5
+sem.tryAcquire(250) # sem.available() == 5, returns false
+sem.tryAcquire(3) # sem.available() == 2, returns true
+//! [2]
+
+
+//! [3]
+sem = QSemaphore(5) # sem.available() == 5
+sem.tryAcquire(250, 1000) # sem.available() == 5, waits 1000 milliseconds and returns false
+sem.tryAcquire(3, 30000) # sem.available() == 2, returns true without waiting
+//! [3]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qthread.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qthread.cpp
new file mode 100644
index 000000000..5470e8a6c
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qthread.cpp
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+class MyThread (QThread):
+ def run():
+ socket = QTcpSocket()
+ # connect QTcpSocket's signals somewhere meaningful
+ # ...
+ socket.connectToHost(hostName, portNumber)
+ self.exec_()
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qwaitcondition_unix.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qwaitcondition_unix.cpp
new file mode 100644
index 000000000..f652e5fcb
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qwaitcondition_unix.cpp
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+while True:
+ mutex.lock()
+ keyPressed.wait(mutex)
+ do_something()
+ mutex.unlock()
+//! [0]
+
+
+//! [1]
+while True:
+ getchar()
+ keyPressed.wakeAll()
+
+//! [1]
+
+
+//! [2]
+while True:
+ mutex.lock()
+ keyPressed.wait(&mutex)
+ count += 1
+ mutex.unlock()
+
+ do_something()
+
+ mutex.lock()
+ count -= 1
+ mutex.unlock()
+//! [2]
+
+
+//! [3]
+while True:
+ getchar()
+
+ mutex.lock()
+ # Sleep until there are no busy worker threads
+ while count > 0:
+ mutex.unlock()
+ sleep(1)
+ mutex.lock()
+ keyPressed.wakeAll()
+ mutex.unlock()
+//! [3]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qbitarray.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qbitarray.cpp
new file mode 100644
index 000000000..2edd35b0a
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qbitarray.cpp
@@ -0,0 +1,239 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+ba = QBitArray(200)
+//! [0]
+
+
+//! [1]
+ba = QBitArray()
+ba.resize(3)
+ba[0] = True
+ba[1] = False
+ba[2] = True
+//! [1]
+
+
+//! [2]
+ba = QBitArray(3)
+ba.setBit(0, True)
+ba.setBit(1, False)
+ba.setBit(2, True)
+//! [2]
+
+
+//! [3]
+x = QBitArray(5)
+x.setBit(3, True)
+# x: [ 0, 0, 0, 1, 0 ]
+
+y = QBitArray(5)
+y.setBit(4, True)
+# y: [ 0, 0, 0, 0, 1 ]
+
+x |= y
+# x: [ 0, 0, 0, 1, 1 ]
+//! [3]
+
+
+//! [4]
+QBitArray().isNull() # returns True
+QBitArray().isEmpty() # returns True
+
+QBitArray(0).isNull() # returns False
+QBitArray(0).isEmpty() # returns True
+
+QBitArray(3).isNull() # returns False
+QBitArray(3).isEmpty() # returns False
+//! [4]
+
+
+//! [5]
+QBitArray().isNull() # returns True
+QBitArray(0).isNull() # returns False
+QBitArray(3).isNull() # returns False
+//! [5]
+
+
+//! [6]
+ba = QBitArray(8)
+ba.fill(True)
+# ba: [ 1, 1, 1, 1, 1, 1, 1, 1 ]
+
+ba.fill(False, 2)
+# ba: [ 0, 0 ]
+//! [6]
+
+
+//! [7]
+a = QBitArray(3)
+a[0] = False
+a[1] = True
+a[2] = a[0] ^ a[1]
+//! [7]
+
+
+//! [8]
+a = QBitArray(3)
+b = QBitArray(2)
+a[0] = 1
+a[1] = 0
+a[2] = 1
+# a: [ 1, 0, 1 ]
+
+b[0] = 1
+b[1] = 0
+# b: [ 1, 1 ]
+
+a &= b
+# a: [ 1, 0, 0 ]
+//! [8]
+
+
+//! [9]
+a = QBitArray(3)
+b = QBitArray(2)
+a[0] = 1
+a[1] = 0
+a[2] = 1
+# a: [ 1, 0, 1 ]
+
+b[0] = 1
+b[1] = 0
+# b: [ 1, 1 ]
+
+a |= b
+# a: [ 1, 1, 1 ]
+//! [9]
+
+
+//! [10]
+a = QBitArray(3)
+b = QBitArray(2)
+a[0] = 1
+a[1] = 0
+a[2] = 1
+# a: [ 1, 0, 1 ]
+
+b[0] = 1
+b[1] = 0
+# b: [ 1, 1 ]
+
+a ^= b
+# a: [ 0, 1, 1 ]
+//! [10]
+
+
+//! [11]
+a = QBitArray(3)
+b = QBitArray()
+a[0] = 1
+a[1] = 0
+a[2] = 1
+# a: [ 1, 0, 1 ]
+
+b = ~a
+# b: [ 0, 1, 0 ]
+//! [11]
+
+
+//! [12]
+a = QBitArray(3)
+b = QBitArray(2)
+c = QBitArray()
+a[0] = 1
+a[1] = 0
+a[2] = 1
+# a: [ 1, 0, 1 ]
+
+b[0] = 1
+b[1] = 0
+# b: [ 1, 1 ]
+
+c = a & b
+# c: [ 1, 0, 0 ]
+//! [12]
+
+
+//! [13]
+a = QBitArray(3)
+QBitArray b(2)
+QBitArray c
+a[0] = 1
+a[1] = 0
+a[2] = 1
+# a: [ 1, 0, 1 ]
+
+b[0] = 1
+b[1] = 0
+# b: [ 1, 1 ]
+
+c = a | b
+# c: [ 1, 1, 1 ]
+//! [13]
+
+
+//! [14]
+a = QBitArray(3)
+b = QBitArray(2)
+c = QBitArray()
+a[0] = 1
+a[1] = 0
+a[2] = 1
+# a: [ 1, 0, 1 ]
+
+b[0] = 1
+b[1] = 0
+# b: [ 1, 1 ]
+
+c = a ^ b
+# c: [ 0, 1, 1 ]
+//! [14]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qbytearray.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qbytearray.cpp
new file mode 100644
index 000000000..bb0bc7de4
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qbytearray.cpp
@@ -0,0 +1,402 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+void wrapInFunction()
+{
+
+//! [0]
+ba = QByteArray("Hello")
+//! [0]
+
+
+//! [1]
+ba = QByteArray()
+ba.resize(5)
+ba[0] = 'H'
+ba[1] = 'e'
+ba[2] = 'l'
+ba[3] = 'l'
+ba[4] = 'o'
+//! [1]
+
+
+//! [2]
+for i in range(0, ba.size()):
+ if ba.at(i) >= 'a' and ba.at(i) <= 'f':
+ print "Found character in range [a-f]"
+//! [2]
+
+
+//! [3]
+x = QByteArray("and")
+x.prepend("rock ") # x == "rock and"
+x.append(" roll") # x == "rock and roll"
+x.replace(5, 3, "&") # x == "rock & roll"
+//! [3]
+
+
+//! [4]
+ba = QByteArray("We must be <b>bold</b>, very <b>bold</b>")
+j = 0
+while (j = ba.indexOf("<b>", j)) != -1:
+ print "Found <b> tag at index position %d" % j
+ ++j
+//! [4]
+
+
+//! [5]
+QByteArray().isNull() # returns true
+QByteArray().isEmpty() # returns true
+
+QByteArray("").isNull() # returns false
+QByteArray("").isEmpty() # returns true
+
+QByteArray("abc").isNull() # returns false
+QByteArray("abc").isEmpty() # returns false
+//! [5]
+
+
+//! [6]
+ba = QByteArray("Hello")
+n = ba.size() # n == 5
+ba.data()[0] # returns 'H'
+ba.data()[4] # returns 'o'
+//! [6]
+
+
+//! [7]
+QByteArray().isEmpty() # returns true
+QByteArray("").isEmpty() # returns true
+QByteArray("abc").isEmpty() # returns false
+//! [7]
+
+
+//! [8]
+ba = QByteArray("Hello world");
+print ba.data();
+//! [8]
+
+
+//! [9]
+ba = QByteArray()
+for i in range(0, 10):
+ ba[i] = 'A' + str(i)
+# ba == "ABCDEFGHIJ"
+//! [9]
+
+
+//! [10]
+ba = QByteArray("Stockholm")
+ba.truncate(5) # ba == "Stock"
+//! [10]
+
+
+//! [11]
+ba = QByteArray("STARTTLS\r\n")
+ba.chop(2) # ba == "STARTTLS"
+//! [11]
+
+
+//! [12]
+x = QByteArray("free")
+y = QByteArray("dom");
+x += y
+# x == "freedom"
+//! [12]
+
+
+//! [13]
+QByteArray().isNull() # returns true
+QByteArray("").isNull() # returns false
+QByteArray("abc").isNull() # returns false
+//! [13]
+
+
+//! [14]
+ba = QByteArray("Istambul")
+ba.fill('o')
+# ba == "oooooooo"
+
+ba.fill('X', 2)
+# ba == "XX"
+//! [14]
+
+
+//! [15]
+x = QByteArray("ship")
+y = QByteArray("air")
+x.prepend(y)
+# x == "airship"
+//! [15]
+
+
+//! [16]
+x = QByteArray("free")
+y = QByteArray("dom")
+x.append(y)
+# x == "freedom"
+//! [16]
+
+
+//! [17]
+ba = QByteArray("Meal")
+ba.insert(1, QByteArray("ontr"))
+# ba == "Montreal"
+//! [17]
+
+
+//! [18]
+ba = QByteArray("Montreal")
+ba.remove(1, 4)
+# ba == "Meal"
+//! [18]
+
+
+//! [19]
+x = QByteArray("Say yes!")
+y = QByteArray("no")
+x.replace(4, 3, y)
+# x == "Say no!"
+//! [19]
+
+
+//! [20]
+ba = QByteArray("colour behaviour flavour neighbour")
+ba.replace(QByteArray("ou"), QByteArray("o"))
+# ba == "color behavior flavor neighbor"
+//! [20]
+
+
+//! [21]
+x = QByteArray("sticky question")
+y = QByteArray("sti")
+x.indexOf(y) # returns 0
+x.indexOf(y, 1) # returns 10
+x.indexOf(y, 10) # returns 10
+x.indexOf(y, 11) # returns -1
+//! [21]
+
+
+//! [22]
+ba = QByteArray("ABCBA")
+ba.indexOf("B") # returns 1
+ba.indexOf("B", 1) # returns 1
+ba.indexOf("B", 2) # returns 3
+ba.indexOf("X") # returns -1
+//! [22]
+
+
+//! [23]
+x = QByteArray("crazy azimuths")
+y = QByteArray("azy")
+x.lastIndexOf(y) # returns 6
+x.lastIndexOf(y, 6) # returns 6
+x.lastIndexOf(y, 5) # returns 2
+x.lastIndexOf(y, 1) # returns -1
+//! [23]
+
+
+//! [24]
+ba = QByteArray("ABCBA")
+ba.lastIndexOf("B") # returns 3
+ba.lastIndexOf("B", 3) # returns 3
+ba.lastIndexOf("B", 2) # returns 1
+ba.lastIndexOf("X") # returns -1
+//! [24]
+
+
+//! [25]
+url = QByteArray("ftp://ftp.qt-project.org/")
+if url.startsWith("ftp:"):
+ ...
+//! [25]
+
+
+//! [26]
+url = QByteArray("http://qtsoftware.com/index.html")
+if url.endsWith(".html"):
+ ...
+//! [26]
+
+
+//! [27]
+x = QByteArray("Pineapple")
+y = x.left(4)
+# y == "Pine"
+//! [27]
+
+
+//! [28]
+x = QByteArray("Pineapple")
+y = x.right(5)
+# y == "apple"
+//! [28]
+
+
+//! [29]
+x = QByteArray("Five pineapples")
+y = x.mid(5, 4) # y == "pine"
+z = x.mid(5) # z == "pineapples"
+//! [29]
+
+
+//! [30]
+x = QByteArray("Qt by THE QT COMPANY")
+y = x.toLower()
+# y == "qt by the qt company"
+//! [30]
+
+
+//! [31]
+x = QByteArray("Qt by THE QT COMPANY")
+y = x.toUpper()
+# y == "QT BY THE QT COMPANY"
+//! [31]
+
+
+//! [32]
+ba = QByteArray(" lots\t of\nwhitespace\r\n ")
+ba = ba.simplified()
+# ba == "lots of whitespace";
+//! [32]
+
+
+//! [33]
+ba = QByteArray(" lots\t of\nwhitespace\r\n ");
+ba = ba.trimmed();
+# ba == "lots\t of\nwhitespace";
+//! [33]
+
+
+//! [34]
+x = QByteArray("apple")
+y = x.leftJustified(8, '.') # y == "apple..."
+//! [34]
+
+
+//! [35]
+x = QByteArray("apple")
+y = x.rightJustified(8, '.') # y == "...apple"
+//! [35]
+
+
+//! [36]
+string = QByteArray("FF")
+(hex, ok) = string.toInt(16) # hex == 255, ok == true
+(dec, ok) = string.toInt(10) # dec == 0, ok == false
+//! [36]
+
+
+//! [37]
+string = QByteArray("FF")
+(hex, ok) = str.toLong(16); # hex == 255, ok == true
+(dec, ok) = str.toLong(10); # dec == 0, ok == false
+//! [37]
+
+
+//! [38]
+string = QByteArray("1234.56")
+(a, ok) = string.toDouble() # a == 1234.56, ok == true
+//! [38]
+
+
+//! [39]
+text = QByteArray("Qt is great!")
+text.toBase64() # returns "UXQgaXMgZ3JlYXQh"
+//! [39]
+
+
+//! [40]
+ba = QByteArray()
+n = 63
+ba.setNum(n) # ba == "63"
+ba.setNum(n, 16) # ba == "3f"
+//! [40]
+
+
+//! [41]
+n = 63;
+QByteArray.number(n) # returns "63"
+QByteArray.number(n, 16) # returns "3f"
+QByteArray.number(n, 16).toUpper() # returns "3F"
+//! [41]
+
+
+//! [42]
+ba = QByteArray.number(12.3456, 'E', 3)
+# ba == 1.235E+01
+//! [42]
+
+
+//! [43]
+mydata = '\x00\x00\x03\x84\x78\x9c\x3b\x76'\
+ '\xec\x18\xc3\x31\x0a\xf1\xcc\x99'\
+ ...
+ '\x6d\x5b'
+
+data = QByteArray.fromRawData(mydata)
+in_ = QDataStream(data, QIODevice.ReadOnly)
+...
+//! [43]
+
+
+//! [44]
+text = QByteArray.fromBase64("UXQgaXMgZ3JlYXQh")
+text.data() # returns "Qt is great!"
+//! [44]
+
+
+//! [45]
+text = QByteArray.fromHex("517420697320677265617421")
+text.data() # returns "Qt is great!"
+//! [45]
+
+}
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qdatetime.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qdatetime.cpp
new file mode 100644
index 000000000..ea8c04453
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qdatetime.cpp
@@ -0,0 +1,156 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+d1 = QDate(1995, 5, 17) # May 17, 1995
+d2 = QDate(1995, 5, 20) # May 20, 1995
+d1.daysTo(d2) # returns 3
+d2.daysTo(d1) # returns -3
+//! [0]
+
+
+//! [1]
+date = QDate.fromString("1MM12car2003", "d'MM'MMcaryyyy")
+# date is 1 December 2003
+//! [1]
+
+
+//! [2]
+date = QDate.fromString("130", "Md") # invalid
+//! [2]
+
+
+//! [3]
+QDate.fromString("1.30", "M.d") # January 30 1900
+QDate.fromString("20000110", "yyyyMMdd") # January 10, 2000
+QDate.fromString("20000110", "yyyyMd") # January 10, 2000
+//! [3]
+
+
+//! [4]
+QDate.isValid(2002, 5, 17) # True
+QDate.isValid(2002, 2, 30) # False (Feb 30 does not exist)
+QDate.isValid(2004, 2, 29) # True (2004 is a leap year)
+QDate.isValid(2000, 2, 29) # True (2000 is a leap year)
+QDate.isValid(2006, 2, 29) # False (2006 is not a leap year)
+QDate.isValid(2100, 2, 29) # False (2100 is not a leap year)
+QDate.isValid(1202, 6, 6) # True (even though 1202 is pre-Gregorian)
+//! [4]
+
+
+//! [5]
+n = QTime(14, 0, 0) # n == 14:00:00
+t = QTime()
+t = n.addSecs(70) # t == 14:01:10
+t = n.addSecs(-70) # t == 13:58:50
+t = n.addSecs(10 * 60 * 60 + 5) # t == 00:00:05
+t = n.addSecs(-15 * 60 * 60) # t == 23:00:00
+//! [5]
+
+
+//! [6]
+time = QTime.fromString("1mm12car00", "m'mm'hcarss")
+# time is 12:01.00
+//! [6]
+
+
+//! [7]
+time = QTime.fromString("00:710", "hh:ms") # invalid
+//! [7]
+
+
+//! [8]
+time = QTime.fromString("1.30", "m.s")
+# time is 00:01:30.000
+//! [8]
+
+
+//! [9]
+QTime.isValid(21, 10, 30) # returns True
+QTime.isValid(22, 5, 62) # returns False
+//! [9]
+
+
+//! [10]
+t = QTime()
+t.start()
+some_lengthy_task()
+print ("Time elapsed: %d ms" % t.elapsed())
+//! [10]
+
+
+//! [11]
+now = QDateTime.currentDateTime()
+xmas(QDate(now.date().year(), 12, 25), QTime(0, 0))
+print("There are %d seconds to Christmas" % now.secsTo(xmas))
+//! [11]
+
+
+//! [12]
+time1 = QTime.fromString("131", "HHh")
+# time1 is 13:00:00
+time1 = QTime.fromString("1apA", "1amAM")
+# time1 is 01:00:00
+
+dateTime2 = QDateTime.fromString("M1d1y9800:01:02",
+ "'M'M'd'd'y'yyhh:mm:ss")
+# dateTime is 1 January 1998 00:01:02
+//! [12]
+
+
+//! [13]
+dateTime = QDateTime.fromString("130", "Mm") # invalid
+//! [13]
+
+
+//! [14]
+dateTime = QDateTime.fromString("1.30.1", "M.d.s")
+# dateTime is January 30 in 1900 at 00:00:01.
+//! [14]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qhash.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qhash.cpp
new file mode 100644
index 000000000..985c7daf1
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qhash.cpp
@@ -0,0 +1,309 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+QHash<QString, int> hash;
+//! [0]
+
+
+//! [1]
+hash["one"] = 1;
+hash["three"] = 3;
+hash["seven"] = 7;
+//! [1]
+
+
+//! [2]
+hash.insert("twelve", 12);
+//! [2]
+
+
+//! [3]
+int num1 = hash["thirteen"];
+int num2 = hash.value("thirteen");
+//! [3]
+
+
+//! [4]
+int timeout = 30;
+if (hash.contains("TIMEOUT"))
+ timeout = hash.value("TIMEOUT");
+//! [4]
+
+
+//! [5]
+int timeout = hash.value("TIMEOUT", 30);
+//! [5]
+
+
+//! [6]
+// WRONG
+QHash<int, QWidget *> hash;
+...
+for (int i = 0; i < 1000; ++i) {
+ if (hash[i] == okButton)
+ cout << "Found button at index " << i << endl;
+}
+//! [6]
+
+
+//! [7]
+QHashIterator<QString, int> i(hash);
+while (i.hasNext()) {
+ i.next();
+ cout << i.key() << ": " << i.value() << endl;
+}
+//! [7]
+
+
+//! [8]
+QHash<QString, int>::const_iterator i = hash.constBegin();
+while (i != hash.constEnd()) {
+ cout << i.key() << ": " << i.value() << endl;
+ ++i;
+}
+//! [8]
+
+
+//! [9]
+hash.insert("plenty", 100);
+hash.insert("plenty", 2000);
+// hash.value("plenty") == 2000
+//! [9]
+
+
+//! [10]
+QList<int> values = hash.values("plenty");
+for (int i = 0; i < values.size(); ++i)
+ cout << values.at(i) << endl;
+//! [10]
+
+
+//! [11]
+QHash<QString, int>::iterator i = hash.find("plenty");
+while (i != hash.end() && i.key() == "plenty") {
+ cout << i.value() << endl;
+ ++i;
+}
+//! [11]
+
+
+//! [12]
+QHash<QString, int> hash;
+...
+foreach (int value, hash)
+ cout << value << endl;
+//! [12]
+
+
+//! [13]
+#ifndef EMPLOYEE_H
+#define EMPLOYEE_H
+
+class Employee
+{
+public:
+ Employee() {}
+ Employee(const QString &name, const QDate &dateOfBirth);
+ ...
+
+private:
+ QString myName;
+ QDate myDateOfBirth;
+};
+
+inline bool operator==(const Employee &e1, const Employee &e2)
+{
+ return e1.name() == e2.name()
+ && e1.dateOfBirth() == e2.dateOfBirth();
+}
+
+inline uint qHash(const Employee &key)
+{
+ return qHash(key.name()) ^ key.dateOfBirth().day();
+}
+
+#endif // EMPLOYEE_H
+//! [13]
+
+
+//! [14]
+QHash<QString, int> hash;
+hash.reserve(20000);
+for (int i = 0; i < 20000; ++i)
+ hash.insert(keys[i], values[i]);
+//! [14]
+
+
+//! [15]
+QHash<QObject *, int> objectHash;
+...
+QHash<QObject *, int>::iterator i = objectHash.find(obj);
+while (i != objectHash.end() && i.key() == obj) {
+ if (i.value() == 0) {
+ i = objectHash.erase(i);
+ } else {
+ ++i;
+ }
+}
+//! [15]
+
+
+//! [16]
+QHash<QString, int> hash;
+...
+QHash<QString, int>::const_iterator i = hash.find("HDR");
+while (i != hash.end() && i.key() == "HDR") {
+ cout << i.value() << endl;
+ ++i;
+}
+//! [16]
+
+
+//! [17]
+QHash<QString, int> hash;
+hash.insert("January", 1);
+hash.insert("February", 2);
+...
+hash.insert("December", 12);
+
+QHash<QString, int>::iterator i;
+for (i = hash.begin(); i != hash.end(); ++i)
+ cout << i.key() << ": " << i.value() << endl;
+//! [17]
+
+
+//! [18]
+QHash<QString, int>::iterator i;
+for (i = hash.begin(); i != hash.end(); ++i)
+ i.value() += 2;
+//! [18]
+
+
+//! [19]
+QHash<QString, int>::iterator i = hash.begin();
+while (i != hash.end()) {
+ if (i.key().startsWith("_"))
+ i = hash.erase(i);
+ else
+ ++i;
+}
+//! [19]
+
+
+//! [20]
+QHash<QString, int>::iterator i = hash.begin();
+while (i != hash.end()) {
+ QHash<QString, int>::iterator prev = i;
+ ++i;
+ if (prev.key().startsWith("_"))
+ hash.erase(prev);
+}
+//! [20]
+
+
+//! [21]
+// WRONG
+while (i != hash.end()) {
+ if (i.key().startsWith("_"))
+ hash.erase(i);
+ ++i;
+}
+//! [21]
+
+
+//! [22]
+if (i.key() == "Hello")
+ i.value() = "Bonjour";
+//! [22]
+
+
+//! [23]
+QHash<QString, int> hash;
+hash.insert("January", 1);
+hash.insert("February", 2);
+...
+hash.insert("December", 12);
+
+QHash<QString, int>::const_iterator i;
+for (i = hash.constBegin(); i != hash.constEnd(); ++i)
+ cout << i.key() << ": " << i.value() << endl;
+//! [23]
+
+
+//! [24]
+QMultiHash<QString, int> hash1, hash2, hash3;
+
+hash1.insert("plenty", 100);
+hash1.insert("plenty", 2000);
+// hash1.size() == 2
+
+hash2.insert("plenty", 5000);
+// hash2.size() == 1
+
+hash3 = hash1 + hash2;
+// hash3.size() == 3
+//! [24]
+
+
+//! [25]
+QList<int> values = hash.values("plenty");
+for (int i = 0; i < values.size(); ++i)
+ cout << values.at(i) << endl;
+//! [25]
+
+
+//! [26]
+QMultiHash<QString, int>::iterator i = hash.find("plenty");
+while (i != hash.end() && i.key() == "plenty") {
+ cout << i.value() << endl;
+ ++i;
+}
+//! [26]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qlinkedlist.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qlinkedlist.cpp
new file mode 100644
index 000000000..947594ae5
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qlinkedlist.cpp
@@ -0,0 +1,214 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+QLinkedList<int> integerList;
+QLinkedList<QTime> timeList;
+//! [0]
+
+
+//! [1]
+QLinkedList<QString> list;
+list << "one" << "two" << "three";
+// list: ["one", "two", "three"]
+//! [1]
+
+
+//! [2]
+QLinkedList<QWidget *> list;
+...
+while (!list.isEmpty())
+ delete list.takeFirst();
+//! [2]
+
+
+//! [3]
+QLinkedList<QString> list;
+list.append("one");
+list.append("two");
+list.append("three");
+// list: ["one", "two", "three"]
+//! [3]
+
+
+//! [4]
+QLinkedList<QString> list;
+list.prepend("one");
+list.prepend("two");
+list.prepend("three");
+// list: ["three", "two", "one"]
+//! [4]
+
+
+//! [5]
+QList<QString> list;
+list << "sun" << "cloud" << "sun" << "rain";
+list.removeAll("sun");
+// list: ["cloud", "rain"]
+//! [5]
+
+
+//! [6]
+QList<QString> list;
+list << "sun" << "cloud" << "sun" << "rain";
+list.removeOne("sun");
+// list: ["cloud", "sun", "rain"]
+//! [6]
+
+
+//! [7]
+QLinkedList<QString> list;
+list.append("January");
+list.append("February");
+...
+list.append("December");
+
+QLinkedList<QString>::iterator i;
+for (i = list.begin(); i != list.end(); ++i)
+ cout << *i << endl;
+//! [7]
+
+
+//! [8]
+QLinkedList<QString> list;
+...
+QLinkedList<QString>::iterator it = qFind(list.begin(),
+ list.end(), "Joel");
+if (it != list.end())
+ cout << "Found Joel" << endl;
+//! [8]
+
+
+//! [9]
+QLinkedList<int>::iterator i;
+for (i = list.begin(); i != list.end(); ++i)
+ *i += 2;
+//! [9]
+
+
+//! [10]
+QLinkedList<QString> list;
+...
+QLinkedList<QString>::iterator i = list.begin();
+while (i != list.end()) {
+ if ((*i).startsWith("_"))
+ i = list.erase(i);
+ else
+ ++i;
+}
+//! [10]
+
+
+//! [11]
+QLinkedList<QString>::iterator i = list.begin();
+while (i != list.end()) {
+ QLinkedList<QString>::iterator previous = i;
+ ++i;
+ if ((*previous).startsWith("_"))
+ list.erase(previous);
+}
+//! [11]
+
+
+//! [12]
+// WRONG
+while (i != list.end()) {
+ if ((*i).startsWith("_"))
+ list.erase(i);
+ ++i;
+}
+//! [12]
+
+
+//! [13]
+if (*it == "Hello")
+ *it = "Bonjour";
+//! [13]
+
+
+//! [14]
+QLinkedList<QString> list;
+list.append("January");
+list.append("February");
+...
+list.append("December");
+
+QLinkedList<QString>::const_iterator i;
+for (i = list.constBegin(); i != list.constEnd(); ++i)
+ cout << *i << endl;
+//! [14]
+
+
+//! [15]
+QLinkedList<QString> list;
+...
+QLinkedList<QString>::iterator it = qFind(list.constBegin(),
+ list.constEnd(), "Joel");
+if (it != list.constEnd())
+ cout << "Found Joel" << endl;
+//! [15]
+
+
+//! [16]
+std::list<double> stdlist;
+list.push_back(1.2);
+list.push_back(0.5);
+list.push_back(3.14);
+
+QLinkedList<double> list = QLinkedList<double>::fromStdList(stdlist);
+//! [16]
+
+
+//! [17]
+QLinkedList<double> list;
+list << 1.2 << 0.5 << 3.14;
+
+std::list<double> stdlist = list.toStdList();
+//! [17]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qlistdata.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qlistdata.cpp
new file mode 100644
index 000000000..d90d932e9
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qlistdata.cpp
@@ -0,0 +1,277 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+QList<int> integerList;
+QList<QDate> dateList;
+//! [0]
+
+
+//! [1]
+QList<QString> list;
+list << "one" << "two" << "three";
+// list: ["one", "two", "three"]
+//! [1]
+
+
+//! [2]
+if (list[0] == "Bob")
+ list[0] = "Robert";
+//! [2]
+
+
+//! [3]
+for (int i = 0; i < list.size(); ++i) {
+ if (list.at(i) == "Jane")
+ cout << "Found Jane at position " << i << endl;
+}
+//! [3]
+
+
+//! [4]
+QList<QWidget *> list;
+...
+while (!list.isEmpty())
+ delete list.takeFirst();
+//! [4]
+
+
+//! [5]
+int i = list.indexOf("Jane");
+if (i != -1)
+ cout << "First occurrence of Jane is at position " << i << endl;
+//! [5]
+
+
+//! [6]
+QList<QString> list;
+list.append("one");
+list.append("two");
+list.append("three");
+// list: ["one", "two", "three"]
+//! [6]
+
+
+//! [7]
+QList<QString> list;
+list.prepend("one");
+list.prepend("two");
+list.prepend("three");
+// list: ["three", "two", "one"]
+//! [7]
+
+
+//! [8]
+QList<QString> list;
+list << "alpha" << "beta" << "delta";
+list.insert(2, "gamma");
+// list: ["alpha", "beta", "gamma", "delta"]
+//! [8]
+
+
+//! [9]
+QList<QString> list;
+list << "sun" << "cloud" << "sun" << "rain";
+list.removeAll("sun");
+// list: ["cloud", "rain"]
+//! [9]
+
+
+//! [10]
+QList<QString> list;
+list << "sun" << "cloud" << "sun" << "rain";
+list.removeOne("sun");
+// list: ["cloud", ,"sun", "rain"]
+//! [10]
+
+
+//! [11]
+QList<QString> list;
+list << "A" << "B" << "C" << "D" << "E" << "F";
+list.move(1, 4);
+// list: ["A", "C", "D", "E", "B", "F"]
+//! [11]
+
+
+//! [12]
+QList<QString> list;
+list << "A" << "B" << "C" << "D" << "E" << "F";
+list.swap(1, 4);
+// list: ["A", "E", "C", "D", "B", "F"]
+//! [12]
+
+
+//! [13]
+QList<QString> list;
+list << "A" << "B" << "C" << "B" << "A";
+list.indexOf("B"); // returns 1
+list.indexOf("B", 1); // returns 1
+list.indexOf("B", 2); // returns 3
+list.indexOf("X"); // returns -1
+//! [13]
+
+
+//! [14]
+QList<QString> list;
+list << "A" << "B" << "C" << "B" << "A";
+list.lastIndexOf("B"); // returns 3
+list.lastIndexOf("B", 3); // returns 3
+list.lastIndexOf("B", 2); // returns 1
+list.lastIndexOf("X"); // returns -1
+//! [14]
+
+
+//! [15]
+QList<QString> list;
+list.append("January");
+list.append("February");
+...
+list.append("December");
+
+QList<QString>::iterator i;
+for (i = list.begin(); i != list.end(); ++i)
+ cout << *i << endl;
+//! [15]
+
+
+//! [16]
+QList<int>::iterator i;
+for (i = list.begin(); i != list.end(); ++i)
+ *i += 2;
+//! [16]
+
+
+//! [17]
+QList<QWidget *> list;
+...
+qDeleteAll(list.begin(), list.end());
+//! [17]
+
+
+//! [18]
+if (*it == "Hello")
+ *it = "Bonjour";
+//! [18]
+
+
+//! [19]
+QList<QString> list;
+list.append("January");
+list.append("February");
+...
+list.append("December");
+
+QList<QString>::const_iterator i;
+for (i = list.constBegin(); i != list.constEnd(); ++i)
+ cout << *i << endl;
+//! [19]
+
+
+//! [20]
+QList<QWidget *> list;
+...
+qDeleteAll(list.constBegin(), list.constEnd());
+//! [20]
+
+
+//! [21]
+QVector<double> vect;
+vect << 20.0 << 30.0 << 40.0 << 50.0;
+
+QList<double> list = QVector<T>::fromVector(vect);
+// list: [20.0, 30.0, 40.0, 50.0]
+//! [21]
+
+
+//! [22]
+QStringList list;
+list << "Sven" << "Kim" << "Ola";
+
+QVector<QString> vect = list.toVector();
+// vect: ["Sven", "Kim", "Ola"]
+//! [22]
+
+
+//! [23]
+QSet<double> set;
+set << 20.0 << 30.0 << 40.0 << ... << 70.0;
+
+QList<double> list = QList<double>::fromSet(set);
+qSort(list);
+//! [23]
+
+
+//! [24]
+QStringList list;
+list << "Julia" << "Mike" << "Mike" << "Julia" << "Julia";
+
+QSet<QString> set = list.toSet();
+set.contains("Julia"); // returns true
+set.contains("Mike"); // returns true
+set.size(); // returns 2
+//! [24]
+
+
+//! [25]
+std::list<double> stdlist;
+list.push_back(1.2);
+list.push_back(0.5);
+list.push_back(3.14);
+
+QList<double> list = QList<double>::fromStdList(stdlist);
+//! [25]
+
+
+//! [26]
+QList<double> list;
+list << 1.2 << 0.5 << 3.14;
+
+std::list<double> stdlist = list.toStdList();
+//! [26]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qlocale.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qlocale.cpp
new file mode 100644
index 000000000..4be07da07
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qlocale.cpp
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+egyptian = QLocale(QLocale.Arabic, QLocale.Egypt)
+s1 = egyptian.toString(1.571429E+07, 'e')
+s2 = egyptian.toString(10)
+
+(d, ok) = egyptian.toDouble(s1)
+(i, ok) = egyptian.toInt(s2)
+//! [0]
+
+
+//! [1]
+QLocale.setDefault(QLocale(QLocale.Hebrew, QLocale.Israel))
+hebrew = QLocale() # Constructs a default QLocale
+s1 = hebrew.toString(15714.3, 'e')
+
+QLocale.setDefault(QLocale(QLocale.C))
+c = QLocale()
+(d, ok) = c.toDouble("1234,56") # ok == false
+(d, ok) = c.toDouble("1234.56") # ok == true, d == 1234.56
+
+QLocale.setDefault(QLocale(QLocale.German))
+german = QLocale()
+(d, ok) = german.toDouble("1234,56") # ok == true, d == 1234.56
+(d, ok) = german.toDouble("1234.56") # ok == true, d == 1234.56
+
+QLocale.setDefault(QLocale(QLocale.English, QLocale.UnitedStates))
+english = QLocale()
+string = '%s %s %10x' % (12345, english.toString(12345), 12345)
+# string == "12345 12,345 3039"
+//! [1]
+
+
+//! [2]
+korean = QLocale("ko")
+swiss = QLocale("de_CH")
+//! [2]
+
+
+//! [3]
+c = QLocale(QLocale.C)
+(d, ok) = c.toDouble( "1234.56" ) # ok == true, d == 1234.56
+(d, ok) = c.toDouble( "1,234.56" ) # ok == true, d == 1234.56
+(d, ok) = c.toDouble( "1234,56" ) # ok == false
+
+german = QLocale(QLocale.German)
+(d, ok) = german.toDouble( "1234,56" ) # ok == true, d == 1234.56
+(d, ok) = german.toDouble( "1.234,56" ) # ok == true, d == 1234.56
+(d, ok) = german.toDouble( "1234.56" ) # ok == false
+
+(d, ok) = german.toDouble( "1.234" ) # ok == true, d == 1234.0
+//! [3]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qmap.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qmap.cpp
new file mode 100644
index 000000000..5bd7dc621
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qmap.cpp
@@ -0,0 +1,323 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+QMap<QString, int> map;
+//! [0]
+
+
+//! [1]
+map["one"] = 1;
+map["three"] = 3;
+map["seven"] = 7;
+//! [1]
+
+
+//! [2]
+map.insert("twelve", 12);
+//! [2]
+
+
+//! [3]
+int num1 = map["thirteen"];
+int num2 = map.value("thirteen");
+//! [3]
+
+
+//! [4]
+int timeout = 30;
+if (map.contains("TIMEOUT"))
+ timeout = map.value("TIMEOUT");
+//! [4]
+
+
+//! [5]
+int timeout = map.value("TIMEOUT", 30);
+//! [5]
+
+
+//! [6]
+// WRONG
+QMap<int, QWidget *> map;
+...
+for (int i = 0; i < 1000; ++i) {
+ if (map[i] == okButton)
+ cout << "Found button at index " << i << endl;
+}
+//! [6]
+
+
+//! [7]
+QMapIterator<QString, int> i(map);
+while (i.hasNext()) {
+ i.next();
+ cout << i.key() << ": " << i.value() << endl;
+}
+//! [7]
+
+
+//! [8]
+QMap<QString, int>::const_iterator i = map.constBegin();
+while (i != map.constEnd()) {
+ cout << i.key() << ": " << i.value() << endl;
+ ++i;
+}
+//! [8]
+
+
+//! [9]
+map.insert("plenty", 100);
+map.insert("plenty", 2000);
+// map.value("plenty") == 2000
+//! [9]
+
+
+//! [10]
+QList<int> values = map.values("plenty");
+for (int i = 0; i < values.size(); ++i)
+ cout << values.at(i) << endl;
+//! [10]
+
+
+//! [11]
+QMap<QString, int>::iterator i = map.find("plenty");
+while (i != map.end() && i.key() == "plenty") {
+ cout << i.value() << endl;
+ ++i;
+}
+//! [11]
+
+
+//! [12]
+QMap<QString, int> map;
+...
+foreach (int value, map)
+ cout << value << endl;
+//! [12]
+
+
+//! [13]
+#ifndef EMPLOYEE_H
+#define EMPLOYEE_H
+
+class Employee
+{
+public:
+ Employee() {}
+ Employee(const QString &name, const QDate &dateOfBirth);
+ ...
+
+private:
+ QString myName;
+ QDate myDateOfBirth;
+};
+
+inline bool operator<(const Employee &e1, const Employee &e2)
+{
+ if (e1.name() != e2.name())
+ return e1.name() < e2.name();
+ return e1.dateOfBirth() < e2.dateOfBirth();
+}
+
+#endif // EMPLOYEE_H
+//! [13]
+
+
+//! [14]
+QMap<QString, int> map;
+...
+QMap<QString, int>::const_iterator i = map.find("HDR");
+while (i != map.end() && i.key() == "HDR") {
+ cout << i.value() << endl;
+ ++i;
+}
+//! [14]
+
+
+//! [15]
+QMap<int, QString> map;
+map.insert(1, "one");
+map.insert(5, "five");
+map.insert(10, "ten");
+
+map.lowerBound(0); // returns iterator to (1, "one")
+map.lowerBound(1); // returns iterator to (1, "one")
+map.lowerBound(2); // returns iterator to (5, "five")
+map.lowerBound(10); // returns iterator to (10, "ten")
+map.lowerBound(999); // returns end()
+//! [15]
+
+
+//! [16]
+QMap<QString, int> map;
+...
+QMap<QString, int>::const_iterator i = map.lowerBound("HDR");
+QMap<QString, int>::const_iterator upperBound = map.upperBound("HDR");
+while (i != upperBound) {
+ cout << i.value() << endl;
+ ++i;
+}
+//! [16]
+
+
+//! [17]
+QMap<int, QString> map;
+map.insert(1, "one");
+map.insert(5, "five");
+map.insert(10, "ten");
+
+map.upperBound(0); // returns iterator to (1, "one")
+map.upperBound(1); // returns iterator to (5, "five")
+map.upperBound(2); // returns iterator to (5, "five")
+map.upperBound(10); // returns end()
+map.upperBound(999); // returns end()
+//! [17]
+
+
+//! [18]
+QMap<QString, int> map;
+map.insert("January", 1);
+map.insert("February", 2);
+...
+map.insert("December", 12);
+
+QMap<QString, int>::iterator i;
+for (i = map.begin(); i != map.end(); ++i)
+ cout << i.key() << ": " << i.value() << endl;
+//! [18]
+
+
+//! [19]
+QMap<QString, int>::iterator i;
+for (i = map.begin(); i != map.end(); ++i)
+ i.value() += 2;
+//! [19]
+
+
+//! [20]
+QMap<QString, int>::iterator i = map.begin();
+while (i != map.end()) {
+ if (i.key().startsWith("_"))
+ i = map.erase(i);
+ else
+ ++i;
+}
+//! [20]
+
+
+//! [21]
+QMap<QString, int>::iterator i = map.begin();
+while (i != map.end()) {
+ QMap<QString, int>::iterator prev = i;
+ ++i;
+ if (prev.key().startsWith("_"))
+ map.erase(prev);
+}
+//! [21]
+
+
+//! [22]
+// WRONG
+while (i != map.end()) {
+ if (i.key().startsWith("_"))
+ map.erase(i);
+ ++i;
+}
+//! [22]
+
+
+//! [23]
+if (i.key() == "Hello")
+ i.value() = "Bonjour";
+//! [23]
+
+
+//! [24]
+QMap<QString, int> map;
+map.insert("January", 1);
+map.insert("February", 2);
+...
+map.insert("December", 12);
+
+QMap<QString, int>::const_iterator i;
+for (i = map.constBegin(); i != map.constEnd(); ++i)
+ cout << i.key() << ": " << i.value() << endl;
+//! [24]
+
+
+//! [25]
+QMultiMap<QString, int> map1, map2, map3;
+
+map1.insert("plenty", 100);
+map1.insert("plenty", 2000);
+// map1.size() == 2
+
+map2.insert("plenty", 5000);
+// map2.size() == 1
+
+map3 = map1 + map2;
+// map3.size() == 3
+//! [25]
+
+
+//! [26]
+QList<int> values = map.values("plenty");
+for (int i = 0; i < values.size(); ++i)
+ cout << values.at(i) << endl;
+//! [26]
+
+
+//! [27]
+QMultiMap<QString, int>::iterator i = map.find("plenty");
+while (i != map.end() && i.key() == "plenty") {
+ cout << i.value() << endl;
+ ++i;
+}
+//! [27]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qpoint.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qpoint.cpp
new file mode 100644
index 000000000..e6a5e0cac
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qpoint.cpp
@@ -0,0 +1,161 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+p = QPoint()
+
+p.setX(p.x() + 1)
+p += QPoint(1, 0)
+//! [0]
+
+
+//! [1]
+p = QPoint(1, 2)
+#p.rx()--; // p becomes (0, 2)
+//! [1]
+
+
+//! [2]
+p = QPoint(1, 2)
+#p.ry()++; // p becomes (1, 3)
+//! [2]
+
+
+//! [3]
+p = QPoint( 3, 7)
+q = QPoint(-1, 4)
+p += q # p becomes (2, 11)
+//! [3]
+
+
+//! [4]
+p = QPoint( 3, 7)
+q = QPoint(-1, 4)
+p -= q # p becomes (4, 3)
+//! [4]
+
+
+//! [5]
+p = QPoint(-1, 4)
+p *= 2.5 # p becomes (-3, 10)
+//! [5]
+
+
+//! [6]
+p = QPoint(-3, 10)
+p /= 2.5 # p becomes (-1, 4)
+//! [6]
+
+
+//! [7]
+
+class MyWidget(QWidget):
+
+ self.oldPosition = QPointer()
+
+ # event : QMouseEvent
+ def mouseMoveEvent(QMouseEvent event):
+ point = event.pos() - self.oldPosition
+ if (point.manhattanLength() > 3):
+ # the mouse has moved more than 3 pixels since the oldPosition
+ pass
+//! [7]
+
+
+//! [8]
+trueLength = sqrt(pow(x(), 2) + pow(y(), 2))
+//! [8]
+
+
+//! [9]
+p = QPointF()
+
+p.setX(p.x() + 1.0)
+p += QPointF(1.0, 0.0)
+#p.rx()++;
+//! [9]
+
+
+//! [10]
+ p = QPointF(1.1, 2.5)
+ #p.rx()--; // p becomes (0.1, 2.5)
+//! [10]
+
+
+//! [11]
+p = QPointF(1.1, 2.5)
+#p.ry()++; // p becomes (1.1, 3.5)
+//! [11]
+
+
+//! [12]
+p = QPointF( 3.1, 7.1)
+q = QPointF(-1.0, 4.1)
+p += q # p becomes (2.1, 11.2)
+//! [12]
+
+
+//! [13]
+p = QPointF( 3.1, 7.1)
+q = QPointF(-1.0, 4.1)
+p -= q # p becomes (4.1, 3.0)
+//! [13]
+
+
+//! [14]
+p = QPointF(-1.1, 4.1)
+p *= 2.5 # p becomes (-2.75, 10.25)
+//! [14]
+
+
+//! [15]
+p = QPointF(-2.75, 10.25)
+p /= 2.5 # p becomes (-1.1, 4.1)
+//! [15]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qqueue.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qqueue.cpp
new file mode 100644
index 000000000..a0ea40541
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qqueue.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+QQueue<int> queue;
+queue.enqueue(1);
+queue.enqueue(2);
+queue.enqueue(3);
+while (!queue.isEmpty())
+ cout << queue.dequeue() << endl;
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qrect.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qrect.cpp
new file mode 100644
index 000000000..a3882750b
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qrect.cpp
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+r1 = QRect(100, 200, 11, 16)
+r2 = QRect(QPoint(100, 200), QSize(11, 16))
+//! [0]
+
+
+//! [1]
+r1 = QRectF(100, 200, 11, 16)
+r2 = QRectF(QPoint(100, 200), QSize(11, 16))
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qregexp.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qregexp.cpp
new file mode 100644
index 000000000..d3f45bbea
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qregexp.cpp
@@ -0,0 +1,225 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+rx = QRegExp("(\\d+)")
+txt = "Offsets: 12 14 99 231 7"
+lst = []
+
+pos = rx.indexIn(txt, 0)
+
+while pos != -1:
+ lst.append(rx.cap(1))
+ pos += rx.matchedLength()
+ pos = rx.indexIn(txt, pos)
+
+# lst: ["12", "14", "99", "231", "7"]
+//! [0]
+
+
+//! [1]
+rx = QRegExp("*.txt")
+rx.setPatternSyntax(QRegExp.Wildcard)
+rx.exactMatch("README.txt") # returns True
+rx.exactMatch("welcome.txt.bak") # returns False
+//! [1]
+
+
+//! [2]
+rx = QRegExp("ro+m")
+rx.setMinimal(True)
+//! [2]
+
+
+//! [3]
+mark = QRegExp("\\b" # word boundary
+ "[Mm]ark" # the word we want to match
+ )
+//! [3]
+
+
+//! [4]
+rx = QRegExp("^\\d\\d?$") # match integers 0 to 99
+rx.indexIn("123") # returns -1 (no match)
+rx.indexIn("-6") # returns -1 (no match)
+rx.indexIn("6") # returns 0 (matched as position 0)
+//! [4]
+
+
+//! [5]
+rx = QRegExp("^\\S+$") # match strings without whitespace
+rx.indexIn("Hello world") # returns -1 (no match)
+rx.indexIn("This_is-OK") # returns 0 (matched at position 0)
+//! [5]
+
+
+//! [6]
+rx = QRegExp("\\b(mail|letter|correspondence)\\b")
+rx.indexIn("I sent you an email") # returns -1 (no match)
+rx.indexIn("Please write the letter") # returns 17
+//! [6]
+
+
+//! [7]
+captured = rx.cap(1) # captured == "letter"
+//! [7]
+
+
+//! [8]
+rx = QRegExp("&(?!amp;)") # match ampersands but not &amp;
+line1 = QString("This & that")
+line1.replace(rx, "&amp;") # line1 == "This &amp; that"
+line2 = QString("His &amp; hers & theirs")
+line2.replace(rx, "&amp;") # line2 == "His &amp; hers &amp; theirs"
+//! [8]
+
+
+//! [9]
+txt = QString("One Eric another Eirik, and an Ericsson. How many Eiriks, Eric?")
+rx = QRegExp("\\b(Eric|Eirik)\\b") # match Eric or Eirik
+pos = 0 # where we are in the string
+count = 0 # how many Eric and Eirik's we've counted
+
+while pos >= 0:
+ pos = rx.indexIn(txt, pos)
+ if pos >= 0:
+ pos += 1 # move along in str
+ count += 1 # count our Eric or Eirik
+//! [9]
+
+
+//! [10]
+txt = "The Qt Company Ltd\tqt.io\tFinland"
+rx.setPattern("^([^\t]+)\t([^\t]+)\t([^\t]+)$");
+if rx.indexIn(txt) != -1:
+ company = rx.cap(1)
+ web = rx.cap(2)
+ country = rx.cap(3)
+//! [10]
+
+
+//! [11]
+field = txt.split("\t")
+//! [11]
+
+
+//! [12]
+rx = QRegExp("*.html")
+rx.setPatternSyntax(QRegExp.Wildcard)
+rx.exactMatch("index.html") # returns True
+rx.exactMatch("default.htm") # returns False
+rx.exactMatch("readme.txt") # returns False
+//! [12]
+
+
+//! [13]
+txt = QString("offsets: 1.23 .50 71.00 6.00")
+rx = QRegExp("\\d*\\.\\d+") # primitive floating point matching
+count = 0
+pos = rx.indexIn(txt, 0)
+while pos != -1:
+ count += 1
+ pos += rx.matchedLength()
+ pos = rx.indexIn(txt, pos)
+
+# pos will be 9, 14, 18 and finally 24; count will end up as 4
+//! [13]
+
+
+//! [14]
+rx = QRegExp("(\\d+)(\\s*)(cm|inch(es)?)")
+pos = rx.indexIn("Length: 36 inches")
+lst = rx.capturedTexts()
+# lst is now ("36 inches", "36", " ", "inches", "es")
+//! [14]
+
+
+//! [15]
+rx = QRegExp("(\\d+)(?:\\s*)(cm|inch(?:es)?)")
+pos = rx.indexIn("Length: 36 inches")
+lst = rx.capturedTexts()
+# lst is now ("36 inches", "36", "inches")
+//! [15]
+
+
+//! [16]
+for a in rx.capturedTexts():
+ myProcessing(a)
+//! [16]
+
+
+//! [17]
+rxlen = QRegExp("(\\d+)(?:\\s*)(cm|inch)")
+pos = rxlen.indexIn("Length: 189cm")
+if pos > -1:
+ value = rxlen.cap(1) # "189"
+ unit = rxlen.cap(2) # "cm"
+//! [17]
+
+
+//! [18]
+rx = QRegExp("/([a-z]+)/([a-z]+)")
+rx.indexIn("Output /dev/null") # returns 7 (position of /dev/null)
+rx.pos(0) # returns 7 (position of /dev/null)
+rx.pos(1) # returns 8 (position of dev)
+rx.pos(2) # returns 12 (position of null)
+//! [18]
+
+
+//! [19]
+s1 = QRegExp.escape("bingo") # s1 == "bingo"
+s2 = QRegExp.escape("f(x)") # s2 == "f\\(x\\)"
+//! [19]
+
+
+//! [20]
+rx = QRegExp("(" + QRegExp.escape(name) + "|" + QRegExp.escape(alias) + ")")
+//! [20]
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qsize.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qsize.cpp
new file mode 100644
index 000000000..ef8b29776
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qsize.cpp
@@ -0,0 +1,146 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+t1 = QSize(10, 12)
+t1.scale(60, 60, Qt.IgnoreAspectRatio)
+# t1 is (60, 60)
+
+t2 = QSize(10, 12)
+t2.scale(60, 60, Qt.KeepAspectRatio)
+# t2 is (50, 60)
+
+t3 = QSize(10, 12)
+t3.scale(60, 60, Qt.KeepAspectRatioByExpanding)
+# t3 is (60, 72)
+//! [0]
+
+
+//! [1]
+size = QSize(100, 10)
+size.rwidth() += 20
+
+#size becomes (120,10)
+//! [1]
+
+
+//! [2]
+size = QSize(100, 10)
+size.rheight() += 5
+
+# size becomes (100,15)
+//! [2]
+
+
+//! [3]
+s = QSize( 3, 7)
+r = QSize(-1, 4)
+s += r
+
+# s becomes (2,11)
+//! [3]
+
+
+//! [4]
+s = QSize( 3, 7)
+r = QSize(-1, 4)
+s -= r
+
+# s becomes (4,3)
+//! [4]
+
+
+//! [5]
+t1 = QSizeF(10, 12)
+t1.scale(60, 60, Qt.IgnoreAspectRatio)
+# t1 is (60, 60)
+
+t2 = QSizeF(10, 12)
+t2.scale(60, 60, Qt.KeepAspectRatio)
+# t2 is (50, 60)
+
+t3 = QSizeF(10, 12)
+t3.scale(60, 60, Qt.KeepAspectRatioByExpanding)
+# t3 is (60, 72)
+//! [5]
+
+
+//! [6]
+size = QSizeF(100.3, 10)
+size.rwidth() += 20.5
+
+# size becomes (120.8,10)
+//! [6]
+
+
+//! [7]
+size = QSizeF(100, 10.2)
+size.rheight() += 5.5
+
+# size becomes (100,15.7)
+//! [7]
+
+
+//! [8]
+s = QSizeF( 3, 7)
+r = QSizeF(-1, 4)
+s += r
+
+# s becomes (2,11)
+//! [8]
+
+
+//! [9]
+s = QSizeF( 3, 7)
+r = QSizeF(-1, 4)
+s -= r
+
+# s becomes (4,3)
+//! [9]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qstring.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qstring.cpp
new file mode 100644
index 000000000..8225d16f2
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qstring.cpp
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+DEFINES += QT_NO_CAST_FROM_ASCII \
+ QT_NO_CAST_TO_ASCII
+//! [0]
+
+
+//! [1]
+url = QLatin1String("http://www.unicode.org/")
+//! [1]
+
+
+//! [2]
+d = 12.34;
+str = QString("delta: %1").arg(d, 0, 'E', 3)
+# str == "delta: 1.234E+01"
+//! [2]
+
+
+//! [3]
+if str == "auto" || str == "extern" || str == "static" || str == "register":
+ ...
+//! [3]
+
+
+//! [4]
+if str == QString("auto") ||
+ str == QString("extern") ||
+ str == QString("static") ||
+ str == QString("register"):
+ ...
+//! [4]
+
+
+//! [5]
+if str == QLatin1String("auto") ||
+ str == QLatin1String("extern") ||
+ str == QLatin1String("static") ||
+ str == QLatin1String("register"):
+ ...
+//! [5]
+
+
+//! [6]
+label = QLabel(QLatin1String("MOD"), self)
+//! [6]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qtimeline.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qtimeline.cpp
new file mode 100644
index 000000000..480731a18
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qtimeline.cpp
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+...
+progressBar = QProgressBar(self)
+progressBar.setRange(0, 100)
+
+# Construct a 1-second timeline with a frame range of 0 - 100
+timeLine = QTimeLine(1000, self)
+timeLine.setFrameRange(0, 100)
+timeLine.frameChanged[int].connect(progressBar.setValue)
+
+# Clicking the push button will start the progress bar animation
+pushButton = QPushButton(QObject.tr("Start animation"), self)
+pushButton.clicked.connect(timeLine.start)
+...
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qvector.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qvector.cpp
new file mode 100644
index 000000000..57ffcae01
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qvector.cpp
@@ -0,0 +1,193 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+QVector<int> integerVector;
+QVector<QString> stringVector;
+//! [0]
+
+
+//! [1]
+QVector<QString> vector(200);
+//! [1]
+
+
+//! [2]
+QVector<QString> vector(200, "Pass");
+//! [2]
+
+
+//! [3]
+if (vector[0] == "Liz")
+ vector[0] = "Elizabeth";
+//! [3]
+
+
+//! [4]
+for (int i = 0; i < vector.size(); ++i) {
+ if (vector.at(i) == "Alfonso")
+ cout << "Found Alfonso at position " << i << endl;
+}
+//! [4]
+
+
+//! [5]
+int i = vector.indexOf("Harumi");
+if (i != -1)
+ cout << "First occurrence of Harumi is at position " << i << endl;
+//! [5]
+
+
+//! [6]
+QVector<int> vector(10);
+int *data = vector.data();
+for (int i = 0; i < 10; ++i)
+ data[i] = 2 * i;
+//! [6]
+
+
+//! [7]
+QVector<QString> vector(0);
+vector.append("one");
+vector.append("two");
+vector.append("three");
+// vector: ["one", "two", "three"]
+//! [7]
+
+
+//! [8]
+QVector<QString> vector;
+vector.prepend("one");
+vector.prepend("two");
+vector.prepend("three");
+// vector: ["three", "two", "one"]
+//! [8]
+
+
+//! [9]
+QVector<QString> vector;
+vector << "alpha" << "beta" << "delta";
+vector.insert(2, "gamma");
+// vector: ["alpha", "beta", "gamma", "delta"]
+//! [9]
+
+
+//! [10]
+QVector<double> vector;
+vector << 2.718 << 1.442 << 0.4342;
+vector.insert(1, 3, 9.9);
+// vector: [2.718, 9.9, 9.9, 9.9, 1.442, 0.4342]
+//! [10]
+
+
+//! [11]
+QVector<QString> vector(3);
+vector.fill("Yes");
+// vector: ["Yes", "Yes", "Yes"]
+
+vector.fill("oh", 5);
+// vector: ["oh", "oh", "oh", "oh", "oh"]
+//! [11]
+
+
+//! [12]
+QVector<QString> vector;
+vector << "A" << "B" << "C" << "B" << "A";
+vector.indexOf("B"); // returns 1
+vector.indexOf("B", 1); // returns 1
+vector.indexOf("B", 2); // returns 3
+vector.indexOf("X"); // returns -1
+//! [12]
+
+
+//! [13]
+QList<QString> vector;
+vector << "A" << "B" << "C" << "B" << "A";
+vector.lastIndexOf("B"); // returns 3
+vector.lastIndexOf("B", 3); // returns 3
+vector.lastIndexOf("B", 2); // returns 1
+vector.lastIndexOf("X"); // returns -1
+//! [13]
+
+
+//! [14]
+QVector<double> vect;
+vect << "red" << "green" << "blue" << "black";
+
+QList<double> list = vect.toList();
+// list: ["red", "green", "blue", "black"]
+//! [14]
+
+
+//! [15]
+QStringList list;
+list << "Sven" << "Kim" << "Ola";
+
+QVector<QString> vect = QVector<QString>::fromList(list);
+// vect: ["Sven", "Kim", "Ola"]
+//! [15]
+
+
+//! [16]
+std::vector<double> stdvector;
+vector.push_back(1.2);
+vector.push_back(0.5);
+vector.push_back(3.14);
+
+QVector<double> vector = QVector<double>::fromStdVector(stdvector);
+//! [16]
+
+
+//! [17]
+QVector<double> vector;
+vector << 1.2 << 0.5 << 3.14;
+
+std::vector<double> stdvector = vector.toStdVector();
+//! [17]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_xml_qxmlstream.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_xml_qxmlstream.cpp
new file mode 100644
index 000000000..f03a90643
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_xml_qxmlstream.cpp
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+xml = QXmlStreamReader()
+...
+while not xml.atEnd():
+ xml.readNext();
+ ... # do processing
+
+if xml.hasError():
+ ... # do error handling
+
+//! [0]
+
+
+//! [1]
+writeStartElement(qualifiedName)
+writeCharacters(text)
+writeEndElement()
+//! [1]
+
+
+//! [2]
+writeStartElement(namespaceUri, name)
+writeCharacters(text)
+writeEndElement()
+//! [2]
+
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_accessible_qaccessible.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_accessible_qaccessible.cpp
new file mode 100644
index 000000000..9971983df
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_accessible_qaccessible.cpp
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+child = QAccessibleInterface()
+targetChild = object.navigate(Accessible.Child, 1, child)
+if child:
+ # ...
+ del child
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_dialogs_qabstractprintdialog.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_dialogs_qabstractprintdialog.cpp
new file mode 100644
index 000000000..db6a8a85c
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_dialogs_qabstractprintdialog.cpp
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+printDialog = QPrintDialog(printer, parent)
+if printDialog.exec_() == QDialog.Accepted:
+ # print ...
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp
new file mode 100644
index 000000000..dd5f81bd2
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp
@@ -0,0 +1,136 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+fileName = QFileDialog.getOpenFileName(self,
+ tr("Open Image"), "/home/jana", tr("Image Files (*.png *.jpg *.bmp)"))
+//! [0]
+
+
+//! [1]
+"Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)"
+//! [1]
+
+
+//! [2]
+dialog = QFileDialog(self)
+dialog.setFileMode(QFileDialog.AnyFile)
+//! [2]
+
+
+//! [3]
+dialog.setNameFilter(tr("Images (*.png *.xpm *.jpg)"))
+//! [3]
+
+
+//! [4]
+dialog.setViewMode(QFileDialog.Detail)
+//! [4]
+
+
+//! [5]
+if dialog.exec_():
+ fileNames = dialog.selectedFiles()
+//! [5]
+
+
+//! [6]
+dialog.setNameFilter("All C++ files (*.cpp *.cc *.C *.cxx *.c++)")
+dialog.setNameFilter("*.cpp *.cc *.C *.cxx *.c++")
+//! [6]
+
+
+//! [7]
+filters = QStringList()
+filters << "Image files (*.png *.xpm *.jpg)"
+ << "Text files (*.txt)"
+ << "Any files (*)"
+
+dialog = QFileDialog(this)
+dialog.setNameFilters(filters)
+dialog.exec_()
+//! [7]
+
+
+//! [8]
+fileName = QFileDialog.getOpenFileName(self, tr("Open File"),
+ "/home",
+ tr("Images (*.png *.xpm *.jpg)"))
+//! [8]
+
+
+//! [9]
+files = QFileDialog.getOpenFileNames(self,
+ "Select one or more files to open",
+ "/home",
+ "Images (*.png *.xpm *.jpg)")
+//! [9]
+
+
+//! [10]
+for it in list:
+ myProcessing(it)
+ it++
+//! [10]
+
+
+//! [11]
+fileName = QFileDialog.getSaveFileName(self, tr("Save F:xile"),
+ "/home/jana/untitled.png",
+ tr("Images (*.png *.xpm *.jpg)"))
+//! [11]
+
+
+//! [12]
+dir = QFileDialog.getExistingDirectory(self, tr("Open Directory"),
+ "/home",
+ QFileDialog.ShowDirsOnly
+ | QFileDialog.DontResolveSymlinks)
+//! [12]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_dialogs_qfontdialog.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_dialogs_qfontdialog.cpp
new file mode 100644
index 000000000..6c91d213f
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_dialogs_qfontdialog.cpp
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+
+(ok, font) = QFontDialog.getFont(QFont("Helvetica [Cronyx]", 10), self)
+if ok:
+ # the user clicked OK and font is set to the font the user selected
+else:
+ # the user canceled the dialog; font is set to the initial
+ # value, in this case Helvetica [Cronyx], 10
+//! [0]
+
+
+//! [1]
+myWidget.setFont(QFontDialog.getFont(0, myWidget.font()))
+//! [1]
+
+
+//! [2]
+(ok, font) = QFontDialog.getFont(QFont("Times", 12), self)
+if ok:
+ # font is set to the font the user selected
+else:
+ # the user canceled the dialog; font is set to the initial
+ # value, in this case Times, 12.
+//! [2]
+
+
+//! [3]
+myWidget.setFont(QFontDialog.getFont(0, myWidget.font()))
+//! [3]
+
+
+//! [4]
+
+(ok, font) = QFontDialog.getFont(self)
+if ok:
+ # font is set to the font the user selected
+else:
+ # the user canceled the dialog; font is set to the default
+ # application font, QApplication.font()
+//! [4]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_dialogs_qwizard.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_dialogs_qwizard.cpp
new file mode 100644
index 000000000..9db90a72c
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_dialogs_qwizard.cpp
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+def nextId(self):
+ id = self.currentId()
+ if id == Page_Intro:
+ if field("intro.evaluate").toBool():
+ return Page_Evaluate
+ else:
+ return Page_Register
+ elif id == Page_Evaluate:
+ return Page_Conclusion
+ elif id == Page_Register:
+ if field("register.upgradeKey").toString().isEmpty():
+ return Page_Details
+ else:
+ return Page_Conclusion
+ elif id == Page_Details:
+ return Page_Conclusion
+ else:
+ return -1
+//! [0]
+
+
+//! [1]
+class MyWizard(QWizard):
+ def __init__(self, parent):
+ QWizard.__ini__(self, parent)
+ ...
+ layout = [QWizard.Stretch, QWizard.BackButton, QWizard.CancelButton, QWizard.NextButton, QWizard.FinishButton]
+ setButtonLayout(layout);
+ ...
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_effects_qgraphicseffect.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_effects_qgraphicseffect.cpp
new file mode 100644
index 000000000..d4b47fa57
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_effects_qgraphicseffect.cpp
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+def draw(self, painter):
+ # Fully opaque draw directly without going through a pixmap.
+ if qFuzzyCompare(self.opacity, 1):
+ drawSource(painter)
+ return
+ # ...
+//! [0]
+
+//! [1]
+def draw(self, painter):
+ # ...
+ offset = QPoint()
+ if self.sourceIsPixmap():
+ # No point in drawing in device coordinates (pixmap will be scaled anyways).
+ pixmap = sourcePixmap(Qt.LogicalCoordinates, offset)
+ ...
+ painter.drawPixmap(offset, pixmap)
+ else:
+ # Draw pixmap in device coordinates to avoid pixmap scaling
+ pixmap = sourcePixmap(Qt.DeviceCoordinates, offset)
+ painter.setWorldTransform(QTransform())
+ # ...
+ painter.drawPixmap(offset, pixmap)
+ # ...
+//! [1]
+
+//! [2]
+# ...
+alphaGradient = QLinearGradient(rect.topLeft(), rect.bottomLeft())
+alphaGradient.setColorAt(0.0, Qt.transparent)
+alphaGradient.setColorAt(0.5, Qt.black)
+alphaGradient.setColorAt(1.0, Qt.transparent)
+effect = QGraphicsOpacityEffect()
+effect.setOpacityMask(alphaGradient)
+# ...
+//! [2]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsgridlayout.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsgridlayout.cpp
new file mode 100644
index 000000000..4d138db3c
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsgridlayout.cpp
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+scene = QGraphicsScene()
+textEdit = scene.addWidget(QTextEdit())
+pushButton = scene.addWidget(QPushButton())
+
+layout = QGraphicsGridLayout()
+layout.addItem(textEdit, 0, 0)
+layout.addItem(pushButton, 0, 1)
+
+form = QGraphicsWidget()
+form.setLayout(layout)
+scene.addItem(form)
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp
new file mode 100644
index 000000000..59f26c729
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp
@@ -0,0 +1,249 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+class SimpleItem(QGraphicsItem):
+
+ def boundingRect(self):
+ penWidth = 1.0
+ return QRectF(-10 - penWidth / 2, -10 - penWidth / 2,
+ 20 + penWidth, 20 + penWidth)
+
+ def paint(self, painter, option, widget):
+ painter.drawRoundedRect(-10, -10, 20, 20, 5, 5)
+//! [0]
+
+
+//! [1]
+class CustomItem(QGraphicsItem):
+ ...
+ self.Type = QGraphicsItem.UserType + 1
+
+ def type(self):
+ # Enable the use of qgraphicsitem_cast with this item.
+ return self.Type
+ ...
+
+//! [1]
+
+
+//! [2]
+item.setCursor(Qt.IBeamCursor)
+//! [2]
+
+
+//! [3]
+item.setCursor(Qt.IBeamCursor)
+//! [3]
+
+
+//! [4]
+rect = QGraphicsRectItem()
+rect.setPos(100, 100)
+
+rect.sceneTransform().map(QPointF(0, 0))
+# returns QPointF(100, 100)
+
+rect.sceneTransform().inverted().map(QPointF(100, 100))
+# returns QPointF(0, 0);
+//! [4]
+
+
+//! [5]
+rect = QGraphicsRectItem()
+rect.setPos(100, 100)
+
+rect.deviceTransform(view.viewportTransform()).map(QPointF(0, 0))
+# returns the item's (0, 0) point in view's viewport coordinates
+
+rect.deviceTransform(view.viewportTransform()).inverted().map(QPointF(100, 100))
+# returns view's viewport's (100, 100) coordinate in item coordinates
+//! [5]
+
+
+//! [6]
+# Rotate an item 45 degrees around (0, 0)
+item.rotate(45)
+
+# Rotate an item 45 degrees around (x, y)
+item.setTransform(QTransform().translate(x, y).rotate(45).translate(-x, -y))
+//! [6]
+
+
+//! [7]
+# Scale an item by 3x2 from its origin
+item.scale(3, 2)
+
+# Scale an item by 3x2 from (x, y)
+item.setTransform(QTransform().translate(x, y).scale(3, 2).translate(-x, -y))
+//! [7]
+
+
+//! [8]
+def boundingRect(self):
+ penWidth = 1.0
+ return QRectF(-radius - penWidth / 2, -radius - penWidth / 2,
+ diameter + penWidth, diameter + penWidth)
+//! [8]
+
+
+//! [9]
+def shape(self):
+ path = QPainterPath()
+ path.addEllipse(boundingRect())
+ return path
+//! [9]
+
+
+//! [10]
+def paint(self, painter, option, widget):
+ painter.drawRoundedRect(-10, -10, 20, 20, 5, 5)
+//! [10]
+
+
+//! [11]
+ObjectName = 0;
+
+item = scene.itemAt(100, 50)
+if len(item.data(ObjectName)) == 0:
+ if isinstance(ButtonItem, item):
+ item.setData(ObjectName, "Button")
+//! [11]
+
+
+//! [12]
+scene = QGraphicsScene()
+ellipse = scene.addEllipse(QRectF(-10, -10, 20, 20))
+line = scene.addLine(QLineF(-10, -10, 20, 20))
+
+line.installSceneEventFilter(ellipse)
+# line's events are filtered by ellipse's sceneEventFilter() function.
+
+ellipse.installSceneEventFilter(line)
+# ellipse's events are filtered by line's sceneEventFilter() function.
+//! [12]
+
+
+//! [13]
+def contextMenuEvent(self, event):
+ menu = QMenu()
+ removeAction = menu.addAction("Remove")
+ markAction = menu.addAction("Mark")
+ selectedAction = menu.exec(event.screenPos())
+ // ...
+//! [13]
+
+
+//! [14]
+def __init__(self):
+ self.setAcceptDrops(true)
+ ...
+
+def dragEnterEvent(self, event):
+ event.setAccepted(event.mimeData().hasFormat("text/plain"))
+//! [14]
+
+
+//! [15]
+def itemChange(self, change, value):
+ if change == ItemPositionChange && scene():
+ # value is the new position.
+ rect = scene().sceneRect()
+ if !rect.contains(value):
+ # Keep the item inside the scene rect.
+ value.setX(qMin(rect.right(), qMax(value.x(), rect.left())))
+ value.setY(qMin(rect.bottom(), qMax(value.y(), rect.top())))
+ return value
+ return QGraphicsItem.itemChange(self, change, value)
+//! [15]
+
+
+//! [16]
+def setRadius(self, newRadius):
+ if radius != newRadius:
+ prepareGeometryChange()
+ radius = newRadius
+//! [16]
+
+
+//! [17]
+# Group all selected items together
+group = scene.createItemGroup(scene.selecteditems())
+
+# Destroy the group, and delete the group item
+scene.destroyItemGroup(group)
+//! [17]
+
+
+//! [QGraphicsItem type]
+class CustomItem(QGraphicsItem):
+ ...
+ self.Type = QGraphicsItem.UserType + 1
+
+ def type(self):
+ # Enable the use of qgraphicsitem_cast with this item.
+ return self.Type
+ ...
+//! [QGraphicsItem type]
+
+//! [18]
+class QGraphicsPathItem (QAbstractGraphicsShapeItem):
+ Type = 2
+
+ def type(self):
+ return QGraphicsPathItem.Type
+# ...
+//! [18]
+
+//! [19]
+xform = item.deviceTransform(view.viewportTransform())
+deviceRect = xform.mapRect(rect).toAlignedRect()
+view.viewport().scroll(dx, dy, deviceRect)
+//! [19]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicslinearlayout.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicslinearlayout.cpp
new file mode 100644
index 000000000..8e7dcc432
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicslinearlayout.cpp
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+scene = QGraphicsScene()
+textEdit = scene.addWidget(QTextEdit())
+pushButton = scene.addWidget(QPushButton())
+
+layout = QGraphicsLinearLayout()
+layout.addItem(textEdit)
+layout.addItem(pushButton)
+
+form = QGraphicsWidget()
+form.setLayout(layout)
+scene.addItem(form)
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsproxywidget.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsproxywidget.cpp
new file mode 100644
index 000000000..d0d21a64d
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsproxywidget.cpp
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+import sys
+
+QApplication app(sys.argv)
+
+tabWidget = QTabWidget()
+
+scene = QGraphicsScene()
+proxy = scene.addWidget(tabWidget)
+
+view = QGraphicsView(scene)
+view.show()
+
+return app.exec_()
+//! [0]
+
+//! [1]
+groupBox = QGroupBox("Contact Details")
+numberLabel = QLabel("Telephone number")
+numberEdit = QLineEdit()
+
+layout = QFormLayout()
+layout.addRow(numberLabel, numberEdit)
+groupBox.setLayout(layout)
+
+scene = QGraphicsScene()
+proxy = scene.addWidget(groupBox)
+
+view = QGraphicsView(scene)
+view.show()
+//! [1]
+
+//! [2]
+scene = QGraphicsScene()
+
+edit = QLineEdit()
+proxy = scene.addWidget(edit)
+
+edit.isVisible() // returns true
+proxy.isVisible() // also returns true
+
+edit.hide()
+
+edit.isVisible() // returns false
+proxy.isVisible() // also returns false
+//! [2]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsscene.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsscene.cpp
new file mode 100644
index 000000000..1f1316bec
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsscene.cpp
@@ -0,0 +1,125 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+scene = QGraphicsScene()
+scene.addText("Hello, world!")
+
+view = QGraphicsView(&scene)
+view.show()
+//! [0]
+
+
+//! [1]
+scene = QGraphicsScene
+scene.addItem(...
+...
+printer = QPrinter(QPrinter.HighResolution)
+printer.setPaperSize(QPrinter.A4)
+
+painter = QPainter(printer)
+scene.render(&painter)
+//! [1]
+
+
+//! [2]
+segmentSize = sceneRect().size() / math.pow(2, depth - 1)
+//! [2]
+
+
+//! [3]
+scene = QGraphicsScene()
+view = QGraphicsView(scene)
+view.show()
+
+# a blue background
+scene.setBackgroundBrush(Qt.blue)
+
+# a gradient background
+gradient = QRadialGradient(0, 0, 10)
+gradient.setSpread(QGradient.RepeatSpread)
+scene.setBackgroundBrush(gradient)
+//! [3]
+
+
+//! [4]
+scene = QGraphicsScene()
+view = QGraphicsView(scene)
+view.show()
+
+# a white semi-transparent foreground
+scene.setForegroundBrush(QColor(255, 255, 255, 127))
+
+# a grid foreground
+scene.setForegroundBrush(QBrush(Qt.lightGray, Qt.CrossPattern))
+//! [4]
+
+
+//! [5]
+class TileScene (QGraphicsScene):
+ # ...
+ def rectForTile(x, y):
+ # Return the rectangle for the tile at position (x, y).
+ return QRectF(x * self.tileWidth, y * self.tileHeight, self.tileWidth, self.tileHeight)
+
+ def setTile(x, y, pixmap):
+ # Sets or replaces the tile at position (x, y) with pixmap.
+ if x >= 0 && x < self.numTilesH && y >= 0 && y < self.numTilesV:
+ self.tiles[y][x] = pixmap
+ invalidate(rectForTile(x, y), BackgroundLayer)
+
+ def drawBackground(painter, exposed):
+ # Draws all tiles that intersect the exposed area.
+ for y in range(0, self.numTilesV:
+ for x in range(0, self.numTilesH:
+ rect = rectForTile(x, y)
+ if exposed.intersects(rect):
+ painter.drawPixmap(rect.topLeft(), tiles[y][x])
+//! [5]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicssceneevent.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicssceneevent.cpp
new file mode 100644
index 000000000..afb5f9f3a
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicssceneevent.cpp
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+
+setDropAction(proposedAction())
+
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsview.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsview.cpp
new file mode 100644
index 000000000..d13cee846
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsview.cpp
@@ -0,0 +1,136 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+scene = QGraphicsScene()
+scene.addText("Hello, world!")
+
+view = QGraphicsView(scene)
+view.show()
+//! [0]
+
+
+//! [1]
+scene = QGraphicsScene()
+scene.addRect(QRectF(-10, -10, 20, 20))
+
+view = QGraphicsView(scene)
+view.setRenderHints(QPainter.Antialiasing | QPainter.SmoothPixmapTransform)
+view.show()
+//! [1]
+
+
+//! [2]
+view = QGraphicsView()
+view.setBackgroundBrush(QImage(":/images/backgroundtile.png"))
+view.setCacheMode(QGraphicsView.CacheBackground)
+//! [2]
+
+
+//! [3]
+scene = QGraphicsScene()
+scene.addText("GraphicsView rotated clockwise")
+
+view = QGraphicsView(scene)
+view.rotate(90) # the text is rendered with a 90 degree clockwise rotation
+view.show()
+//! [3]
+
+
+//! [4]
+scene = QGraphicsScene()
+scene.addItem(...
+...
+
+view = QGraphicsView(scene)
+view.show()
+...
+
+printer = QPrinter(QPrinter.HighResolution)
+printer.setPageSize(QPrinter.A4)
+painter = QPainter(printer)
+
+# print, fitting the viewport contents into a full page
+view.render(painter)
+
+# print the upper half of the viewport into the lower.
+# half of the page.
+viewport = view.viewport()->rect()
+view.render(painter,
+ QRectF(0, printer.height() / 2,
+ printer.width(), printer.height() / 2),
+ viewport.adjusted(0, 0, 0, -viewport.height() / 2))
+
+//! [4]
+
+
+//! [5]
+def mousePressEvent(self, event):
+ print "There are", items(event->pos()).size(), "items at position", mapToScene(event->pos())
+//! [5]
+
+
+//! [6]
+def mousePressEvent(self, event):
+ if (item = itemAt(event.pos()):
+ print "You clicked on item", item
+ else:
+ print "You didn't click on an item."
+//! [6]
+
+
+//! [7]
+scene = QGraphicsScene()
+scene.addText("GraphicsView rotated clockwise")
+
+view = QGraphicsView(scene)
+view.rotate(90) # the text is rendered with a 90 degree clockwise rotation
+view.show()
+//! [7]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicswidget.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicswidget.cpp
new file mode 100644
index 000000000..ffba7a181
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicswidget.cpp
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+class MyGroupBoxWidget (QStyleOptionGroupBox):
+ # ...
+ def initStyleOption(option):
+ QGraphicsWidget.initStyleOption(self, option)
+ if isinstance(option, QStyleOptionGroupBox):
+ # Add group box specific state.
+ box.flat = isFlat()
+ # ...
+//! [0]
+
+
+//! [1]
+setTabOrder(a, b) # a to b
+setTabOrder(b, c) # a to b to c
+setTabOrder(c, d) # a to b to c to d
+//! [1]
+
+
+//! [2]
+# WRONG
+setTabOrder(c, d) # c to d
+setTabOrder(a, b) # a to b AND c to d
+setTabOrder(b, c) # a to b to c, but not c to d
+//! [2]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qbitmap.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qbitmap.cpp
new file mode 100644
index 000000000..aab995f33
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qbitmap.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+uchar arrow_bits[] = { 0x3f, 0x1f, 0x0f, 0x1f, 0x3b, 0x71, 0xe0, 0xc0 };
+QBitmap bm(8, 8, arrow_bits, true);
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qicon.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qicon.cpp
new file mode 100644
index 000000000..d40f485a4
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qicon.cpp
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+button = QToolButton()
+button.setIcon(QIcon("open.xpm"))
+//! [0]
+
+
+//! [1]
+button.setIcon(QIcon())
+//! [1]
+
+
+//! [2]
+def drawIcon(self, painter, pos):
+ enabledStatus = QIcon.Normal
+ if not isEnabled():
+ enabledStatus = QIcon::Disabled
+
+ onOff = QIcon.On
+ if not isOn():
+ onOff = QIcon.Off
+
+ pixmap = self.icon.pixmap(QSize(22, 22), enabledStatus, onOff)
+ painter.drawPixmap(pos, pixmap)
+//! [2]
+
+//! [3]
+ undoicon = QIcon.fromTheme("edit-undo")
+//! [3]
+
+//! [4]
+ undoicon = QIcon.fromTheme("edit-undo", QIcon(":/undo.png"))
+//! [4]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qimage.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qimage.cpp
new file mode 100644
index 000000000..e100624d8
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qimage.cpp
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+image = QImage(3, 3, QImage.Format_RGB32)
+
+value = qRgb(189, 149, 39) # 0xffbd9527
+image.setPixel(1, 1, value)
+
+value = qRgb(122, 163, 39) # 0xff7aa327
+image.setPixel(0, 1, value)
+image.setPixel(1, 0, value)
+
+value = qRgb(237, 187, 51) # 0xffedba31
+image.setPixel(2, 1, value)
+//! [0]
+
+
+//! [1]
+image = QImage(3, 3, QImage.Format_Indexed8)
+value = qRgb(122, 163, 39) # 0xff7aa327
+image.setColor(0, value)
+
+value = qRgb(237, 187, 51) # 0xffedba31
+image.setColor(1, value)
+
+value = qRgb(189, 149, 39) # 0xffbd9527
+image.setColor(2, value)
+
+image.setPixel(0, 1, 0)
+image.setPixel(1, 0, 0)
+image.setPixel(1, 1, 2)
+image.setPixel(2, 1, 1)
+//! [1]
+
+
+//! [2]
+start_xpm = ["16 15 8 1", "a c #cec6bd", ....
+//! [2]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qimagereader.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qimagereader.cpp
new file mode 100644
index 000000000..2e36ba8b2
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qimagereader.cpp
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+reader = QImageReader()
+reader.setFormat("png") # same as reader.setFormat("PNG")
+//! [0]
+
+
+//! [1]
+reader = QImageReader("image.png")
+# reader.format() == "png"
+//! [1]
+
+
+//! [2]
+icon = QImage(64, 64, QImage.Format_RGB32)
+reader = QImageReader("icon_64x64.bmp")
+if reader.read(icon):
+ # Display icon
+//! [2]
+
+
+//! [3]
+reader = QImageReader(":/image.png")
+if reader.supportsOption(QImageIOHandler.Size):
+ print "Size:", str(reader.size())
+//! [3]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qimagewriter.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qimagewriter.cpp
new file mode 100644
index 000000000..b65681718
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qimagewriter.cpp
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+writer = QImageWriter()
+writer.setFormat("png") # same as writer.setFormat("PNG")
+//! [0]
+
+
+//! [1]
+image = QImage("some/image.jpeg")
+writer = QImageWriter("images/outimage.png", "png")
+writer.setText("Author", "John Smith")
+writer.write(image)
+//! [1]
+
+
+//! [2]
+writer = QImageWriter(fileName)
+if writer.supportsOption(QImageIOHandler.Description):
+ writer.setText("Author", "John Smith")
+//! [2]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qmovie.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qmovie.cpp
new file mode 100644
index 000000000..050213e80
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qmovie.cpp
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+label = QLabel()
+movie = QMovie("animations/fire.gif")
+
+label.setMovie(movie)
+movie.start()
+//! [0]
+
+
+//! [1]
+movie = QMovie("racecar.gif")
+movie.setSpeed(200) // 2x speed
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qpixmap.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qpixmap.cpp
new file mode 100644
index 000000000..76d359a84
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qpixmap.cpp
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+static const char * const start_xpm[]={
+ "16 15 8 1",
+ "a c #cec6bd",
+....
+//! [0]
+
+
+//! [1]
+myPixmap = QPixmap()
+myPixmap.setMask(myPixmap.createHeuristicMask())
+//! [1]
+
+//! [2]
+pixmap = QPixmap("background.png")
+exposed = QRegion()
+pixmap.scroll(10, 10, pixmap.rect(), exposed)
+//! [2]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qpixmapcache.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qpixmapcache.cpp
new file mode 100644
index 000000000..611203116
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qpixmapcache.cpp
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+pm = QPixmap()
+if not QPixmapCache.find("my_big_image", pm):
+ pm.load("bigimage.png")
+ QPixmapCache.insert("my_big_image", pm)
+painter.drawPixmap(0, 0, pm)
+//! [0]
+
+
+//! [1]
+pm = QPixmap()
+if not QPixmapCache.find("my_big_image", pm):
+ pm.load("bigimage.png")
+ QPixmapCache.insert("my_big_image", pm)
+painter.drawPixmap(0, 0, pm)
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qpixmapfilter.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qpixmapfilter.cpp
new file mode 100644
index 000000000..4fa6e7901
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qpixmapfilter.cpp
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+myFilter = QPixmapColorFilter()
+myFilter.setColor(QColor(128, 0, 0))
+myFilter.draw(painter, QPoint(0, 0), originalPixmap)
+//! [0]
+
+//! [1]
+myFilter = QPixmapConvolutionFilter()
+kernel = [
+ 0.0,-1.0, 0.0,
+ -1.0, 5.0,-1.0,
+ 0.0,-1.0, 0.0
+ ]
+myFilter.setConvolutionKernel(kernel, 3, 3)
+myFilter.sdraw(painter, QPoint(0, 0), originalPixmap)
+//! [1]
+
+//! [2]
+myFilter = QPixmapDropShadowFilter()
+myFilter.draw(painter, QPoint(0, 0), originalPixmap)
+//! [2]
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qabstractitemview.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qabstractitemview.cpp
new file mode 100644
index 000000000..0d89ff73b
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qabstractitemview.cpp
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+def resizeEvent(self, event):
+ horizontalScrollBar().setRange(0, realWidth - width())
+ ...
+//! [0]
+
+//! [1]
+setIndexWidget(index, QLineEdit())
+...
+setIndexWidget(index, QTextEdit())
+//! [1]
+
+//! [2]
+m = view->selectionModel()
+view->setModel(model())
+del m
+//! [2]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qdatawidgetmapper.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qdatawidgetmapper.cpp
new file mode 100644
index 000000000..54687e749
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qdatawidgetmapper.cpp
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+mapper = QDataWidgetMapper
+mapper.setModel(model)
+mapper.addMapping(mySpinBox, 0)
+mapper.addMapping(myLineEdit, 1)
+mapper.addMapping(myCountryChooser, 2)
+mapper.toFirst()
+//! [0]
+
+
+//! [1]
+mapper = QDataWidgetMapper()
+mapper.setModel(myModel)
+mapper.addMapping(nameLineEdit, 0)
+mapper.addMapping(ageSpinBox, 1)
+//! [1]
+
+
+//! [2]
+mapper = QDataWidgetMapper()
+connect(myTableView.selectionModel(), SIGNAL("currentRowChanged(QModelIndex,QModelIndex)"),
+ mapper, SLOT(setCurrentModelIndex(QModelIndex)))
+//! [2]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qitemeditorfactory.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qitemeditorfactory.cpp
new file mode 100644
index 000000000..44d0594e4
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qitemeditorfactory.cpp
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+Q_PROPERTY(QColor color READ color WRITE setColor USER true)
+//! [0]
+
+
+//! [1]
+QItemEditorCreator<MyEditor> *itemCreator =
+ new QItemEditorCreator<MyEditor>("myProperty");
+
+QItemEditorFactory *factory = new QItemEditorFactory;
+//! [1]
+
+
+//! [2]
+QItemEditorFactory *editorFactory = new QItemEditorFactory;
+QItemEditorCreatorBase *creator = new QStandardItemEditorCreator<MyFancyDateTimeEdit>();
+editorFactory->registerEditor(QVariant::DateType, creator);
+//! [2]
+
+
+//! [3]
+Q_PROPERTY(QColor color READ color WRITE setColor USER true)
+//! [3]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qitemselectionmodel.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qitemselectionmodel.cpp
new file mode 100644
index 000000000..62861d9d3
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qitemselectionmodel.cpp
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+selection = QItemSelection(topLeft, bottomRight)
+//! [0]
+
+
+//! [1]
+selection = QItemSelection()
+...
+selection.select(topLeft, bottomRight)
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qstandarditemmodel.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qstandarditemmodel.cpp
new file mode 100644
index 000000000..42a64fbab
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qstandarditemmodel.cpp
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+model = QStandardItemModel (4, 4)
+for row in range(4):
+ for column in range(4):
+ item = QStandardItem("row %d, column %d" % (row, column))
+ model.setItem(row, column, item)
+//! [0]
+
+
+//! [1]
+model = QStandardItemModel()
+parentItem = model.invisibleRootItem()
+for i in range(4):
+ item = QStandardItem("item %d" % i)
+ parentItem.appendRow(item)
+ parentItem = item
+//! [1]
+
+
+//! [2]
+treeView = QTreeView(self)
+treeView.setModel(myStandardItemModel)
+treeView.clicked[QModelIndex].connect(self.clicked)
+//! [2]
+
+
+//! [3]
+def clicked(self, index):
+ item = myStandardItemModel.itemFromIndex(index)
+ # Do stuff with the item ...
+//! [3]
+
+
+//! [4]
+treeView.scrollTo(item.index())
+//! [4]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qtablewidget.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qtablewidget.cpp
new file mode 100644
index 000000000..ca7c0dbfc
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qtablewidget.cpp
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+setCellWidget(index, QLineEdit())
+...
+setCellWidget(index, QTextEdit())
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qtreewidget.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qtreewidget.cpp
new file mode 100644
index 000000000..ecdb7941b
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qtreewidget.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+treeWidget = QTreeWidget()
+treeWidget.setColumnCount(1)
+items = []
+for i in range(10):
+ items.append(QTreeWidgetItem(None, QStringList(QString("item: %1").arg(i))))
+treeWidget.insertTopLevelItems(None, items)
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qaction.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qaction.cpp
new file mode 100644
index 000000000..31a83e215
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qaction.cpp
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+app = QApplication(argv)
+app.setAttribute(Qt.AA_DontShowIconsInMenus) # Icons are *no longer shown* in menus
+// ...
+myAction = QAction()
+// ...
+myAction.setIcon(SomeIcon)
+myAction.setIconVisibleInMenu(True) # Icon *will* be shown in menus for *this* action.
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qapplication.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qapplication.cpp
new file mode 100644
index 000000000..fe02c93e5
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qapplication.cpp
@@ -0,0 +1,167 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+def main():
+ useGUI = not '-no-gui' in sys.argv
+ app = QApplication(sys.argv) if useGUI else QCoreApplication(sys.argv)
+ ...
+ return app.exec_()
+//! [0]
+
+
+//! [1]
+QApplication.setStyle(QWindowsStyle())
+//! [1]
+
+
+//! [2]
+def main():
+ QApplication.setColorSpec(QApplication.ManyColor)
+ QApplication app(sys.argv)
+ ...
+ return app.exec_()
+
+//! [2]
+
+
+//! [3]
+class MyWidget (QWidget):
+ # ...
+ def sizeHint(self):
+ return QSize(80, 25).expandedTo(QApplication.globalStrut())
+//! [3]
+
+
+//! [4]
+def showAllHiddenTopLevelWidgets():
+ for widget in QApplication.topLevelWidgets():
+ if widget.isHidden():
+ widget.show()
+//! [4]
+
+
+//! [5]
+def updateAllWidgets():
+ for widget in QApplication.allWidgets()
+ widget.update()
+//! [5]
+
+
+//! [6]
+if __name__ == '__main__':
+ QApplication.setDesktopSettingsAware(False)
+ app = QApplication(sys.argv)
+ # ...
+ return app.exec_()
+//! [6]
+
+
+//! [7]
+if (startPos - currentPos).manhattanLength() >= QApplication.startDragDistance():
+ startTheDrag()
+//! [7]
+
+
+//! [8]
+class MyApplication (QApplication):
+# ...
+ def commitData(QSessionManager& manager)
+ if manager.allowsInteraction():
+ ret = QMessageBox.warning(
+ mainWindow,
+ QObject.tr("My Application"),
+ QObject.tr("Save changes to document?"),
+ QMessageBox.Save | QMessageBox.Discard | QMessageBox.Cancel)
+
+ if ret == QMessageBox.Save:
+ manager.release()
+ if not saveDocument():
+ manager.cancel()
+ elif ret == QMessageBox.Discard:
+ pass
+ else:
+ manager.cancel()
+ else:
+ # we did not get permission to interact, then
+ # do something reasonable instead
+ pass
+//! [8]
+
+
+//! [9]
+appname -session id
+//! [9]
+
+
+//! [10]
+for command in mySession.restartCommand():
+ do_something(command)
+//! [10]
+
+
+//! [11]
+for command in mySession.discardCommand():
+ do_something(command)
+//! [11]
+
+
+//! [12]
+widget = qApp.widgetAt(x, y)
+if widget:
+ widget = widget.window()
+//! [12]
+
+
+//! [13]
+widget = qApp.widgetAt(point)
+if widget:
+ widget = widget.window()
+//! [13]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qapplication_x11.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qapplication_x11.cpp
new file mode 100644
index 000000000..5c90b998f
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qapplication_x11.cpp
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
+calculateHugeMandelbrot() # lunch time...
+QApplication.restoreOverrideCursor()
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qclipboard.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qclipboard.cpp
new file mode 100644
index 000000000..014835171
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qclipboard.cpp
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+clipboard = QGuiApplication.clipboard()
+originalText = clipboard.text()
+...
+clipboard.setText(newText)
+//! [0]
+
+
+//! [1]
+data = QMimeData()
+data.setImageData(image)
+clipboard.setMimeData(data, mode)
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qevent.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qevent.cpp
new file mode 100644
index 000000000..38d18d030
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qevent.cpp
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+def wheelEvent(self, event):
+ numDegrees = event.delta() / 8
+ numSteps = numDegrees / 15
+
+ if event->orientation() == Qt.Horizontal:
+ scrollHorizontally(numSteps)
+ else:
+ scrollVertically(numSteps)
+ event.accept()
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qformlayout.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qformlayout.cpp
new file mode 100644
index 000000000..1b3e58080
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qformlayout.cpp
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+formLayout = QFormLayout()
+formLayout.addRow(self.tr("&Name:"), nameLineEdit)
+formLayout.addRow(self.tr("&Email:"), emailLineEdit)
+formLayout.addRow(self.tr("&Age:"), ageSpinBox)
+setLayout(formLayout)
+//! [0]
+
+
+//! [1]
+nameLabel = QLabel(self.tr("&Name:"))
+nameLabel.setBuddy(nameLineEdit)
+
+emailLabel = QLabel(self.tr("&Name:"))
+emailLabel.setBuddy(emailLineEdit)
+
+ageLabel = QLabel(self.tr("&Name:"))
+ageLabel.setBuddy(ageSpinBox)
+
+gridLayout = QGridLayout()
+gridLayout.addWidget(nameLabel, 0, 0)
+gridLayout.addWidget(nameLineEdit, 0, 1)
+gridLayout.addWidget(emailLabel, 1, 0)
+gridLayout.addWidget(emailLineEdit, 1, 1)
+gridLayout.addWidget(ageLabel, 2, 0)
+gridLayout.addWidget(ageSpinBox, 2, 1)
+setLayout(gridLayout)
+//! [1]
+
+
+//! [2]
+formLayout.trowWrapPolicy(QFormLayout.DontWrapRows)
+formLayout.setFieldGrowthPolicy(QFormLayout.FieldsStayAtSizeHint)
+formLayout.setFormAlignment(Qt.AlignHCenter | Qt.AlignTop)
+formLayout.setLabelAlignment(Qt.AlignLeft)
+//! [2]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qkeysequence.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qkeysequence.cpp
new file mode 100644
index 000000000..25d5ee290
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qkeysequence.cpp
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+QKeySequence(QKeySequence.Print)
+QKeySequence(tr("Ctrl+P"))
+QKeySequence(tr("Ctrl+p"))
+QKeySequence(Qt.CTRL + Qt.Key_P)
+//! [0]
+
+
+//! [1]
+QKeySequence(tr("Ctrl+X, Ctrl+C"))
+QKeySequence(Qt.CTRL + Qt.Key_X, Qt.CTRL + Qt.Key_C)
+//! [1]
+
+
+//! [2]
+file = QMenu(self)
+file.addAction(tr("&Open..."), self, SLOT("open()"),
+ QKeySequence(tr("Ctrl+O", "File|Open")))
+//! [2]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qlayout.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qlayout.cpp
new file mode 100644
index 000000000..867e73b5e
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qlayout.cpp
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+
+def paintLayout(self, painter, item):
+ layout = item.layout()
+
+ if layout:
+ for layout_item in layout:
+ self.paintLayout(painter, layout_item)
+
+ painter.drawRect(item.geometry())
+
+def paintEvent(self, event):
+ painter = QPainter(self)
+ if self.layout():
+ self.paintLayout(painter, self.layout())
+
+//! [0]
+
+
+//! [1]
+child = layout.takeAt(0)
+while child:
+ ...
+ del child
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qlayoutitem.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qlayoutitem.cpp
new file mode 100644
index 000000000..8749f530b
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qlayoutitem.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+def heightForWidth(self, w):
+ if cache_dirty or cached_width != w:
+ h = calculateHeightForWidth(w)
+ self.cached_hfw = h
+ return h
+ return cached_hfw
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qshortcut.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qshortcut.cpp
new file mode 100644
index 000000000..baaf60571
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qshortcut.cpp
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+shortcut = QShortcut(QKeySequence(self.tr("Ctrl+O", "File|Open")),
+ parent)
+//! [0]
+
+
+//! [1]
+setKey(0) # no signal emitted
+setKey(QKeySequence()) # no signal emitted
+setKey(0x3b1) # Greek letter alpha
+setKey(Qt.Key_D) # 'd', e.g. to delete
+setKey('q') # 'q', e.g. to quit
+setKey(Qt.CTRL + Qt.Key_P) # Ctrl+P, e.g. to print document
+setKey("Ctrl+P") # Ctrl+P, e.g. to print document
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qshortcutmap.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qshortcutmap.cpp
new file mode 100644
index 000000000..48f63f6e9
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qshortcutmap.cpp
@@ -0,0 +1,3 @@
+//! [0]
+key = QKeySequence()
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qsound.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qsound.cpp
new file mode 100644
index 000000000..6ad7ef4f8
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qsound.cpp
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+QSound.play("mysounds/bells.wav")
+//! [0]
+
+
+//! [1]
+bells = QSound("mysounds/bells.wav")
+bells.play()
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qwidget.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qwidget.cpp
new file mode 100644
index 000000000..efa0f0589
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qwidget.cpp
@@ -0,0 +1,150 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+w.setWindowState(w.windowState() ^ Qt.WindowFullScreen)
+//! [0]
+
+
+//! [1]
+w.setWindowState(w.windowState() & ~Qt.WindowMinimized | Qt.WindowActive)
+//! [1]
+
+
+//! [2]
+width = widget.baseSize().width() + i * widget.sizeIncrement().width()
+height = widget.baseSize().height() + j * widget.sizeIncrement().height()
+//! [2]
+
+
+//! [3]
+aWidget.window().setWindowTitle("New Window Title")
+//! [3]
+
+
+//! [4]
+font = QFont("Helvetica", 12, QFont.Bold)
+widget.setFont(font)
+//! [4]
+
+
+//! [5]
+font = QFont()
+font.setBold(false)
+widget.setFont(font)
+//! [5]
+
+
+//! [6]
+widget.setCursor(Qt.IBeamCursor)
+//! [6]
+
+
+//! [7]
+pixmap = QPixmap(widget.size())
+widget.render(&pixmap)
+//! [7]
+
+
+//! [8]
+painter = QPainter(self)
+...
+painter.end()
+myWidget.render(self)
+//! [8]
+
+
+//! [9]
+widget.setTabOrder(a, b) # a to b
+widget.setTabOrder(b, c) # a to b to c
+widge.tsetTabOrder(c, d) # a to b to c to d
+//! [9]
+
+
+//! [10]
+# WRONG
+widget.setTabOrder(c, d) # c to d
+widget.setTabOrder(a, b) # a to b AND c to d
+widget.setTabOrder(b, c) # a to b to c, but not c to d
+//! [10]
+
+
+//! [11]
+class MyWidget(QWidget):
+
+ self.settings = None
+
+ def closeEvent(event):
+ # event is a QCloseEvent
+ self.settings = QSettings("MyCompany", "MyApp")
+ self.settings.setValue("geometry", self.saveGeometry())
+ QWidget.closeEvent(self, event)
+//! [11]
+
+
+//! [12]
+settings = QSettings("MyCompany", "MyApp")
+myWidget.restoreGeometry(settings.value("myWidget/geometry").toByteArray())
+//! [12]
+
+
+//! [13]
+widget.setUpdatesEnabled(False)
+widget.bigVisualChanges()
+widget.setUpdatesEnabled(True)
+//! [13]
+
+
+//! [14]
+...
+extern void qt_x11_set_global_double_buffer(bool);
+qt_x11_set_global_double_buffer(false);
+...
+//! [14]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qbrush.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qbrush.cpp
new file mode 100644
index 000000000..55fa8a784
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qbrush.cpp
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+painter = QPainter(self)
+
+painter.setBrush(Qt.cyan)
+painter.setPen(Qt.darkCyan)
+painter.drawRect(0, 0, 100,100)
+
+painter.setBrush(Qt.NoBrush)
+painter.setPen(Qt.darkGreen)
+painter.drawRect(40, 40, 100, 100)
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qcolor.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qcolor.cpp
new file mode 100644
index 000000000..cac026aa1
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qcolor.cpp
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+# Specify semi-transparent red
+painter.setBrush(QColor(255, 0, 0, 127))
+painter.drawRect(0, 0, self.width()/2, self.height())
+
+# Specify semi-transparent blue
+painter.setBrush(QColor(0, 0, 255, 127))
+painter.drawRect(0, 0, self.width(), self.height()/2)
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qdrawutil.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qdrawutil.cpp
new file mode 100644
index 000000000..1f76792e4
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qdrawutil.cpp
@@ -0,0 +1,108 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+frame = QFrame()
+frame.setFrameStyle(QFrame.HLine | QFrame.Sunken)
+//! [0]
+
+
+//! [1]
+frame = QFrame()
+frame.setFrameStyle(QFrame.Box | QFrame.Raised)
+//! [1]
+
+
+//! [2]
+frame = QFrame()
+frame.setFrameStyle( QFrame.Panel | QFrame.Sunken)
+//! [2]
+
+
+//! [3]
+frame = QFrame()
+frame.setFrameStyle(QFrame.WinPanel | QFrame.Raised)
+//! [3]
+
+
+//! [4]
+frame = QFrame()
+frame.setFrameStyle(QFrame.Box | QFrame.Plain)
+//! [4]
+
+
+//! [5]
+frame = QFrame()
+frame.setFrameStyle(QFrame.HLine | QFrame.Sunken)
+//! [5]
+
+
+//! [6]
+frame = QFrame()
+frame.setFrameStyle(QFrame.Box | QFrame.Raised)
+//! [6]
+
+
+//! [7]
+frame = QFrame()
+frame.setFrameStyle( QFrame.Panel | QFrame.Sunken)
+//! [7]
+
+
+//! [8]
+frame = QFrame()
+frame.setFrameStyle(QFrame.WinPanel | QFrame.Raised)
+//! [8]
+
+
+//! [9]
+frame = QFrame()
+frame.setFrameStyle(QFrame.Box | QFrame.Plain)
+//! [9]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qmatrix.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qmatrix.cpp
new file mode 100644
index 000000000..73ce084f7
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qmatrix.cpp
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+x' = m11*x + m21*y + dx
+y' = m22*y + m12*x + dy
+//! [0]
+
+
+//! [1]
+x' = m11*x + m21*y + dx
+y' = m22*y + m12*x + dy
+//! [1]
+
+
+//! [2]
+x' = m11*x + m21*y + dx
+y' = m22*y + m12*x + dy
+//! [2]
+
+
+//! [3]
+x' = m11*x + m21*y + dx
+y' = m22*y + m12*x + dy
+//! [3]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qpainter.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qpainter.cpp
new file mode 100644
index 000000000..e295f6638
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qpainter.cpp
@@ -0,0 +1,261 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+def paintEvent(self, paintEvent):
+ painter = QPainter(self)
+ painter.setPen(Qt.blue)
+ painter.setFont(QFont("Arial", 30))
+ painter.drawText(rect(), Qt.AlignCenter, "Qt")
+//! [0]
+
+
+//! [1]
+def paintEvent(self, paintEvent):
+ p = QPainter()
+ p.begin(self)
+ p.drawLine(...) # drawing code
+ p.end()
+//! [1]
+
+
+//! [2]
+self paintEvent(self, paintEvent):
+ p = QPainter(self)
+ p.drawLine(...) # drawing code
+
+//! [2]
+
+
+//! [3]
+painter.begin(0) # impossible - paint device cannot be 0
+
+image = QPixmap(0, 0)
+painter.begin(&image) # impossible - image.isNull() == true
+
+painter.begin(myWidget)
+painter2.begin(myWidget) # impossible - only one painter at a time
+//! [3]
+
+
+//! [4]
+def rotate(self, angle):
+ matrix = QMatrix()
+ matrix.rotate(angle)
+ setWorldMatrix(matrix, true)
+//! [4]
+
+
+//! [5]
+path = QPainterPath()
+path.moveTo(20, 80)
+path.lineTo(20, 30)
+path.cubicTo(80, 0, 50, 50, 80, 80)
+
+painter = QPainter(self)
+painter.drawPath(path)
+//! [5]
+
+
+//! [6]
+line = QLineF(10.0, 80.0, 90.0, 20.0)
+
+painter = QPainter(self)
+painter.drawLine(line)
+//! [6]
+
+
+//! [7]
+rectangle = QRectF(10.0, 20.0, 80.0, 60.0)
+
+painter = QPainter(self)
+painter.drawRect(rectangle)
+//! [7]
+
+
+//! [8]
+rectangle = QRectF(10.0, 20.0, 80.0, 60.0)
+
+painter = QPainter(self)
+painter.drawRoundedRect(rectangle, 20.0, 15.0)
+//! [8]
+
+
+//! [9]
+rectangle = QRectF(10.0, 20.0, 80.0, 60.0)
+
+painter = QPainter(self)
+painter.drawEllipse(rectangle)
+//! [9]
+
+
+//! [10]
+rectangle = QRectF(10.0, 20.0, 80.0, 60.0)
+startAngle = 30 * 16
+spanAngle = 120 * 16
+
+painter = QPainter(self)
+painter.drawArc(rectangle, startAngle, spanAngle)
+//! [10]
+
+
+//! [11]
+rectangle = QRectF(10.0, 20.0, 80.0, 60.0)
+startAngle = 30 * 16
+spanAngle = 120 * 16
+
+painter = QPainter(self)
+painter.drawPie(rectangle, startAngle, spanAngle)
+//! [11]
+
+
+//! [12]
+rectangle = QRectF(10.0, 20.0, 80.0, 60.0)
+startAngle = 30 * 16
+spanAngle = 120 * 16
+
+painter = QPainter(self)
+painter.drawChord(rect, startAngle, spanAngle)
+//! [12]
+
+
+//! [13]
+points = [
+ QPointF(10.0, 80.0),
+ QPointF(20.0, 10.0),
+ QPointF(80.0, 30.0),
+]
+
+painter = QPainter(self)
+painter.drawPolyline(points, 3)
+//! [13]
+
+
+//! [14]
+points = [
+ QPointF(10.0, 80.0),
+ QPointF(20.0, 10.0),
+ QPointF(80.0, 30.0),
+ QPointF(90.0, 70.0)
+]
+
+painter = QPainter(self)
+painter.drawPolygon(points, 4)
+//! [14]
+
+
+//! [15]
+points = [
+ QPointF(10.0, 80.0),
+ QPointF(20.0, 10.0),
+ QPointF(80.0, 30.0),
+ QPointF(90.0, 70.0)
+]
+
+painter = QPainter(self)
+painter.drawConvexPolygon(points, 4)
+//! [15]
+
+
+//! [16]
+target = QRectF(10.0, 20.0, 80.0, 60.0)
+source = QRectF(0.0, 0.0, 70.0, 40.0)
+pixmap = QPixmap(":myPixmap.png")
+
+painter = QPainter(self)
+painter.drawPixmap(target, image, source)
+//! [16]
+
+
+//! [17]
+painter = QPainter(self)
+painter.drawText(rect, Qt.AlignCenter, tr("Qt\nProject"))
+//! [17]
+
+
+//! [18]
+picture = QPicture()
+point = QPointF(10.0, 20.0)
+picture.load("drawing.pic")
+
+painter = QPainter(self)
+painter.drawPicture(0, 0, picture)
+//! [18]
+
+
+//! [19]
+fillRect(rectangle, background())
+//! [19]
+
+
+//! [20]
+target = QRectF(10.0, 20.0, 80.0, 60.0)
+source = QRectF(0.0, 0.0, 70.0, 40.0)
+image = QImage(":/images/myImage.png")
+
+painter = QPainter(self)
+painter.drawImage(target, image, source)
+//! [20]
+
+//! [21]
+painter = QPainter(self)
+painter.fillRect(0, 0, 128, 128, Qt.green)
+painter.beginNativePainting()
+
+glEnable(GL_SCISSOR_TEST)
+glScissor(0, 0, 64, 64)
+
+glClearColor(1, 0, 0, 1)
+glClear(GL_COLOR_BUFFER_BIT)
+
+glDisable(GL_SCISSOR_TEST)
+
+painter.endNativePainting()
+//! [21]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qpainterpath.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qpainterpath.cpp
new file mode 100644
index 000000000..cbf1aab54
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qpainterpath.cpp
@@ -0,0 +1,160 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+path = QPainterPath()
+path.addRect(20, 20, 60, 60)
+
+path.moveTo(0, 0)
+path.cubicTo(99, 0, 50, 50, 99, 99)
+path.cubicTo(0, 99, 50, 50, 0, 0)
+
+QPainter painter(self)
+painter.fillRect(0, 0, 100, 100, Qt.white)
+painter.setPen(QPen(QColor(79, 106, 25), 1, Qt.SolidLine,
+ Qt.FlatCap, Qt.MiterJoin))
+painter.setBrush(QColor(122, 163, 39))
+
+painter.drawPath(path)
+//! [0]
+
+
+//! [1]
+myGradient = QLinearGradient()
+myPen = QPen()
+
+myPath = QPainterPath()
+myPath.cubicTo(c1, c2, endPoint)
+
+painter = QPainter(self)
+painter.setBrush(myGradient)
+painter.setPen(myPen)
+painter.drawPath(myPath)
+//! [1]
+
+
+//! [2]
+myGradient = QLinearGradient()
+myPen = QPen()
+
+startPoint = QPointF()
+center = QPointF()
+
+myPath = QPainterPath()
+myPath.moveTo(center)
+myPath.arcTo(boundingRect, startAngle,
+ sweepLength)
+
+painter = QPainter(self)
+painter.setBrush(myGradient)
+painter.setPen(myPen)
+painter.drawPath(myPath)
+//! [2]
+
+
+//! [3]
+myGradient = QLinearGradient()
+myPen = QPen()
+myRectangle = QRectF()
+
+myPath = QPainterPath()
+myPath.addRect(myRectangle)
+
+painter = QPainter(self)
+painter.setBrush(myGradient)
+painter.setPen(myPen)
+painter.drawPath(myPath)
+//! [3]
+
+
+//! [4]
+myGradient = QLinearGradient()
+myPen = QPen()
+myPolygon = QPolygonF()
+
+myPath = QPainterPath()
+myPath.addPolygon(myPolygon)
+
+QPainter painter(self)
+painter.setBrush(myGradient)
+painter.setPen(myPen)
+painter.drawPath(myPath)
+//! [4]
+
+
+//! [5]
+myGradient = QLinearGradient()
+myPen = QPen()
+boundingRectangle = QRectF()
+
+myPath = QPainterPath()
+myPath.addEllipse(boundingRectangle)
+
+QPainter painter(self)
+painter.setBrush(myGradient)
+painter.setPen(myPen)
+painter.drawPath(myPath)
+//! [5]
+
+
+//! [6]
+myGradient = QLinearGradient()
+myPen = QPen()
+myFont = QFont()
+QPointF baseline(x, y)
+
+myPath = QPainterPath()
+myPath.addText(baseline, myFont, tr("Qt"))
+
+painter QPainter(self)
+painter.setBrush(myGradient)
+painter.setPen(myPen)
+painter.drawPath(myPath)
+//! [6]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qpen.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qpen.cpp
new file mode 100644
index 000000000..871935c49
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qpen.cpp
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+painter = QPainter(self)
+pen = QPen(Qt.green, 3, Qt.DashDotLine, Qt.RoundCap, Qt.RoundJoin)
+painter.setPen(pen)
+//! [0]
+
+
+//! [1]
+painter = QPainter(self)
+pen = QPen() # creates a default pen
+
+pen.setStyle(Qt.DashDotLine)
+pen.setWidth(3)
+pen.setBrush(Qt.green)
+pen.setCapStyle(Qt.RoundCap)
+pen.setJoinStyle(Qt.RoundJoin)
+
+painter.setPen(pen)
+//! [1]
+
+
+//! [2]
+pen = QPen()
+space = 4;
+dashes = [1, space, 3, space, 9, space, 27, space, 9, space]
+pen.setDashPattern(dashes)
+//! [2]
+
+
+//! [3]
+pen = QPen()
+space = 4;
+dashes = [1, space, 3, space, 9, space, 27, space, 9, space]
+pen.setDashPattern(dashes)
+//! [3]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qregion.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qregion.cpp
new file mode 100644
index 000000000..08e9c22be
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qregion.cpp
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+class MyWidget (QWidget):
+ # ...
+ def paintEvent(self):
+ r1 = QRegion(QRect(100, 100, 200, 80), QRegion.Ellipse) # r1: elliptic region
+ )
+ r2 = QRect(100, 120, 90, 30) # r2: rectangular region
+ r3 = r1.intersected(r2) # r3: intersection
+
+ painter = QPainter(self)
+ painter.setClipRegion(r3)
+ ... # paint clipped graphics
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qregion_unix.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qregion_unix.cpp
new file mode 100644
index 000000000..b347fb392
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qregion_unix.cpp
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+r1 = QRegion(10, 10, 20, 20)
+r1.isNull() // false
+r1.isEmpty() // false
+
+r2 = QRegion(40, 40, 20, 20)
+r3 = QRegion()
+r3.isNull() // true
+r3.isEmpty() // true
+
+r3 = r1.intersected(r2) // r3: intersection of r1 and r2
+r3.isNull() // false
+r3.isEmpty() // true
+
+r3 = r1.united(r2) // r3: union of r1 and r2
+r3.isNull() // false
+r3.isEmpty() // false
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qtransform.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qtransform.cpp
new file mode 100644
index 000000000..71ff40645
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qtransform.cpp
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+x' = m11*x + m21*y + dx
+y' = m22*y + m12*x + dy
+if is not affine:
+ w' = m13*x + m23*y + m33
+ x' /= w'
+ y' /= w'
+//! [0]
+
+
+//! [1]
+x' = m11*x + m21*y + dx
+y' = m22*y + m12*x + dy
+if is not affine:
+ w' = m13*x + m23*y + m33
+ x' /= w'
+ y' /= w'
+//! [1]
+
+
+//! [2]
+x' = m11*x + m21*y + dx
+y' = m22*y + m12*x + dy
+if is not affine:
+ w' = m13*x + m23*y + m33
+ x' /= w'
+ y' /= w'
+//! [2]
+
+
+//! [3]
+x' = m11*x + m21*y + dx
+y' = m22*y + m12*x + dy
+if is not affine:
+ w' = m13*x + m23*y + m33
+ x' /= w'
+ y' /= w'
+//! [3]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_styles_qstyle.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_styles_qstyle.cpp
new file mode 100644
index 000000000..be555b41a
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_styles_qstyle.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+python myapplication.py -style windows
+//! [0]
+
+
+//! [1]
+python myapplication.py -style custom
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_styles_qstyleoption.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_styles_qstyleoption.cpp
new file mode 100644
index 000000000..c46066a34
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_styles_qstyleoption.cpp
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+def styleHint(self, stylehint, opt, widget, returnData):
+ if stylehint == SH_RubberBand_Mask:
+ if isinstance(QStyleHintReturnMask, hint):
+ ...
+ ...
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_text_qfont.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_text_qfont.cpp
new file mode 100644
index 000000000..43537f9d3
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_text_qfont.cpp
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+serifFont = QFont("Times", 10, QFont.Bold)
+sansFont = QFont("Helvetica [Cronyx]", 12)
+//! [0]
+
+
+//! [1]
+f = QFont("Helvetica")
+//! [1]
+
+
+//! [2]
+f = QFont("Helvetica [Cronyx]")
+//! [2]
+
+
+//! [3]
+info = QFontInfo(f1)
+family = info.family()
+//! [3]
+
+
+//! [4]
+fm = QFontMetrics(f1)
+textWidthInPixels = fm.width("How many pixels wide is this text?")
+textHeightInPixels = fm.height()
+//! [4]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_text_qfontmetrics.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_text_qfontmetrics.cpp
new file mode 100644
index 000000000..a184a0072
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_text_qfontmetrics.cpp
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+font = QFont("times", 24)
+fm = QFontMetrics(font)
+pixelsWide = fm.width("What's the width of this text?")
+pixelsHigh = fm.height()
+//! [0]
+
+
+//! [1]
+font = QFont("times", 24)
+fm = QFontMetricsF(font)
+pixelsWide = fm.width("What's the width of this text?")
+pixelsHigh = fm.height()
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_text_qsyntaxhighlighter.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_text_qsyntaxhighlighter.cpp
new file mode 100644
index 000000000..2188be0a8
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_text_qsyntaxhighlighter.cpp
@@ -0,0 +1,124 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+editor = QTextEdit()
+highlighter = MyHighlighter(editor.document())
+//! [0]
+
+
+//! [1]
+class MyHighlighter(QSyntaxHighlighter):
+ def highlightBlock(self, text):
+ myClassFormat = QTextCharFormat()
+ myClassFormat.setFontWeight(QFont.Bold)
+ myClassFormat.setForeground(Qt.darkMagenta)
+ pattern = QString("\\bMy[A-Za-z]+\\b")
+
+ expression = QRegExp(pattern)
+ index = text.indexOf(expression)
+ while index >= 0:
+ length = expression.matchedLength()
+ setFormat(index, length, myClassFormat)
+ index = text.indexOf(expression, index + length)
+//! [1]
+
+
+//! [2]
+multiLineCommentFormat = QTextCharFormat()
+multiLineCommentFormat.setForeground(Qt.red)
+
+startExpression = QRegExp("/\\*")
+endExpression = QRegExp("\\*/")
+
+setCurrentBlockState(0)
+
+startIndex = 0
+if previousBlockState() != 1:
+ startIndex = text.indexOf(startExpression)
+
+while startIndex >= 0:
+ endIndex = text.indexOf(endExpression, startIndex)
+ if endIndex == -1:
+ setCurrentBlockState(1)
+ commentLength = text.length() - startIndex
+ else:
+ commentLength = endIndex - startIndex
+ + endExpression.matchedLength()
+
+ setFormat(startIndex, commentLength, multiLineCommentFormat)
+ startIndex = text.indexOf(startExpression,
+ startIndex + commentLength)
+//! [2]
+
+
+//! [3]
+class MyHighlighter(QSyntaxHighlighter):
+ def highlightBlock(self, text):
+ myClassFormat = QTextCharFormat()
+ myClassFormat.setFontWeight(QFont.Bold)
+ myClassFormat.setForeground(Qt.darkMagenta)
+ pattern = QString("\\bMy[A-Za-z]+\\b")
+
+ expression = QRegExp(pattern)
+ index = text.indexOf(expression)
+ while index >= 0:
+ length = expression.matchedLength()
+ setFormat(index, length, myClassFormat)
+ index = text.indexOf(expression, index + length)
+//! [3]
+
+
+//! [4]
+class BlockData(QTextBlockUserData):
+ def __init__(self):
+ # ...
+ self.parentheses = []
+//! [4]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_text_qtextcursor.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_text_qtextcursor.cpp
new file mode 100644
index 000000000..12189bf2a
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_text_qtextcursor.cpp
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+cursor.clearSelection()
+cursor.movePosition(QTextCursor.NextWord, QTextCursor.KeepAnchor)
+cursor.insertText("Hello World")
+//! [0]
+
+
+//! [1]
+img = ... # A QImage
+textDocument.addResource(QTextDocument.ImageResource, QUrl("myimage"), img)
+cursor.insertImage("myimage")
+//! [1]
+
+
+//! [2]
+cursor = QTextCursor(textDocument)
+cursor.beginEditBlock()
+cursor.insertText("Hello")
+cursor.insertText("World")
+cursor.endEditBlock()
+
+textDocument.undo()
+//! [2]
+
+
+//! [3]
+cursor = QTextCursor(textDocument)
+cursor.beginEditBlock()
+cursor.insertText("Hello")
+cursor.insertText("World")
+cursor.endEditBlock()
+
+...
+
+cursor.joinPreviousEditBlock()
+cursor.insertText("Hey")
+cursor.endEditBlock()
+
+textDocument.undo()
+//! [3]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_text_qtextlayout.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_text_qtextlayout.cpp
new file mode 100644
index 000000000..33cde13e7
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_text_qtextlayout.cpp
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+leading = fontMetrics.leading()
+height = 0
+widthUsed = 0
+textLayout.beginLayout()
+while True:
+ line = textLayout.createLine()
+ if not line.isValid():
+ break
+
+ line.setLineWidth(lineWidth)
+ height += leading
+ line.setPosition(QPointF(0, height))
+ height += line.height()
+ widthUsed = qMax(widthUsed, line.naturalTextWidth())
+textLayout.endLayout()
+//! [0]
+
+
+//! [1]
+painter = QPainter(self)
+textLayout.draw(painter, QPoint(0, 0))
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_util_qcompleter.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_util_qcompleter.cpp
new file mode 100644
index 000000000..a9ba16a65
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_util_qcompleter.cpp
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+wordList = ["alpha", "omega", "omicron", "zeta"]
+
+lineEdit = QLineEdit(self)
+
+completer = QCompleter(wordList, self)
+completer.setCaseSensitivity(Qt.CaseInsensitive)
+lineEdit.setCompleter(completer)
+//! [0]
+
+
+//! [1]
+completer = QCompleter(self)
+completer.setModel(QDirModel(completer))
+lineEdit.setCompleter(completer)
+//! [1]
+
+
+//! [2]
+i = 0
+while completer.setCurrentRow(i):
+ print "%s is match number %d" % (completer.currentCompletion(), i)
+ i += 1
+//! [2]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_util_qdesktopservices.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_util_qdesktopservices.cpp
new file mode 100644
index 000000000..f79f1ed24
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_util_qdesktopservices.cpp
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+def showHelp(url):
+ # ...
+ pass
+
+QDesktopServices.setUrlHandler("help", showHelp);
+//! [0]
+
+//! [1]
+mailto:user@foo.com?subject=Test&body=Just a test
+//! [1]
+
+//! [2]
+QDesktopServices.openUrl(QUrl("file:///C:/Documents and Settings/All Users/Desktop", QUrl.TolerantMode))
+//! [2]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_util_qundostack.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_util_qundostack.cpp
new file mode 100644
index 000000000..9875747e7
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_util_qundostack.cpp
@@ -0,0 +1,120 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+class AppendText(QUndoCommand):
+ self.m_document = ''
+ self.m_text = ''
+
+ def AppendText(self, doc, text):
+ self.m_document = doc
+ self.m_text = text
+ self.setText("append text")
+
+ def undo(self):
+ self.m_document.chop(self.m_text.length())
+
+ def redo(self):
+ self.m_document->append(self.m_text)
+//! [0]
+
+
+//! [1]
+command1 = MyCommand()
+stack.push(command1)
+command2 = MyCommand()
+stack.push(command2)
+
+stack.undo()
+
+command3 = MyCommand()
+stack.push(command3) # command2 gets deleted
+//! [1]
+
+
+//! [2]
+insertRed = QUndoCommand() # an empty command
+insertRed.setText("insert red text")
+
+InsertText(document, idx, text, insertRed) # becomes child of insertRed
+SetColor(document, idx, text.length(), Qt.red, insertRed)
+
+stack.push(insertRed)
+//! [2]
+
+
+//! [3]
+class AppendText(QUndoCommand):
+ ...
+ def mergeWith(self, other):
+ if other.id() != self.id(): # make sure other is also an AppendText command
+ return False
+ m_text += other.m_text
+ return True
+//! [3]
+
+
+//! [4]
+stack.beginMacro("insert red text")
+stack.push(InsertText(document, idx, text))
+stack.push(SetColor(document, idx, text.length(), Qt.red))
+stack.endMacro() # indexChanged() is emitted
+//! [4]
+
+
+//! [5]
+insertRed = QUndoCommand() # an empty command
+insertRed.setText("insert red text")
+
+InsertText(document, idx, text, insertRed) # becomes child of insertRed
+SetColor(document, idx, text.length(), Qt.red, insertRed)
+
+stack.push(insertRed)
+//! [5]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_util_qvalidator.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_util_qvalidator.cpp
new file mode 100644
index 000000000..df55131b3
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_util_qvalidator.cpp
@@ -0,0 +1,155 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+validator = QIntValidator(100, 999, self)
+edit = QLineEdit(self)
+
+# the edit lineedit will only accept integers between 100 and 999
+edit.setValidator(validator)
+//! [0]
+
+
+//! [1]
+pos = 0
+v = QIntValidator(100, 900, self)
+
+str = "1"
+v.validate(str, pos) # returns Intermediate
+str = "012"
+v.validate(str, pos) # returns Intermediate
+
+str = "123"
+v.validate(str, pos) # returns Acceptable
+str = "678"
+v.validate(str, pos) # returns Acceptable
+
+str = "999"
+v.validate(str, pos) # returns Intermediate
+
+str = "1234"
+v.validate(str, pos) # returns Invalid
+str = "-123"
+v.validate(str, pos) # returns Invalid
+str = "abc"
+v.validate(str, pos) # returns Invalid
+str = "12cm"
+v.validate(str, pos) # returns Invalid
+//! [1]
+
+
+//! [2]
+pos = 0
+
+s = "abc"
+v.validate(s, pos) # returns Invalid
+
+s = "5"
+v.validate(s, pos) # returns Intermediate
+
+s = "50"
+v.validate(s, pos) # returns Acceptable
+//! [2]
+
+
+//! [3]
+# regexp: optional '-' followed by between 1 and 3 digits
+rx = QRegExp("-?\\d{1,3}")
+validator = QRegExpValidator(rx, self)
+
+edit = QLineEdit(self)
+edit.setValidator(validator)
+//! [3]
+
+
+//! [4]
+# integers 1 to 9999
+rx = QRegExp("[1-9]\\d{0,3}")
+# the validator treats the regexp as "^[1-9]\\d{0,3}$"
+v = QRegExpValidator(rx, 0)
+pos = 0
+
+s = "0"
+v.validate(s, pos) # returns Invalid
+s = "12345"
+v.validate(s, pos) # returns Invalid
+s = "1"
+v.validate(s, pos) # returns Acceptable
+
+rx.setPattern("\\S+") # one or more non-whitespace characters
+v.setRegExp(rx)
+s = "myfile.txt"
+v.validate(s, pos) # Returns Acceptable
+s = "my file.txt"
+v.validate(s, pos) # Returns Invalid
+
+# A, B or C followed by exactly five digits followed by W, X, Y or Z
+rx.setPattern("[A-C]\\d{5}[W-Z]")
+v.setRegExp(rx)
+s = "a12345Z"
+v.validate(s, pos) # Returns Invalid
+s = "A12345Z"
+v.validate(s, pos) # Returns Acceptable
+s = "B12"
+v.validate(s, pos) # Returns Intermediate
+
+# match most 'readme' files
+rx.setPattern("read\\S?me(\.(txt|asc|1st))?")
+rx.setCaseSensitive(false)
+v.setRegExp(rx)
+s = "readme"
+v.validate(s, pos) # Returns Acceptable
+s = "README.1ST"
+v.validate(s, pos) # Returns Acceptable
+s = "read me.txt"
+v.validate(s, pos) # Returns Invalid
+s = "readm"
+v.validate(s, pos) # Returns Intermediate
+//! [4]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qabstractbutton.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qabstractbutton.cpp
new file mode 100644
index 000000000..c4219b3d7
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qabstractbutton.cpp
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+button = QPushButton(QObject.tr("Ro&ck && Roll"), self)
+//! [0]
+
+
+//! [1]
+button.setIcon(QIcon(":/images/print.png"))
+button.setShortcut(tr("Alt+F7"))
+//! [1]
+
+
+//! [2]
+class MyWidget (QWidget):
+ #...
+ def reactToToggle(checked):
+ if checked:
+ // Examine the button states.
+ ...
+//! [2]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qabstractspinbox.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qabstractspinbox.cpp
new file mode 100644
index 000000000..c8d60d015
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qabstractspinbox.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+spinBox = QSpinBox(self)
+spinBox.setRange(0, 100)
+spinBox.setWrapping(True)
+spinBox.setValue(100)
+spinBox.stepBy(1)
+// value is 0
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qcalendarwidget.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qcalendarwidget.cpp
new file mode 100644
index 000000000..9d83f0bc1
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qcalendarwidget.cpp
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+calendar.setGridVisible(True)
+//! [0]
+
+
+//! [1]
+calendar.setGridVisible(True)
+calendar.setMinimumDate(QDate(2006, 6, 19))
+//! [1]
+
+
+//! [2]
+calendar.setGridVisible(True)
+calendar.setMaximumDate(QDate(2006, 7, 3))
+//! [2]
+
+
+//! [3]
+
+calendar.setDateRange(min, max)
+//! [3]
+
+
+//! [4]
+
+calendar.setMinimumDate(min)
+calendar.setMaximumDate(max)
+//! [4]
+
+
+//! [5]
+calendar.setGridVisible(True)
+//! [5]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qcheckbox.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qcheckbox.cpp
new file mode 100644
index 000000000..c8aa50aa2
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qcheckbox.cpp
@@ -0,0 +1,3 @@
+//! [0]
+checkbox = QCheckBox("C&ase sensitive", self)
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qdatetimeedit.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qdatetimeedit.cpp
new file mode 100644
index 000000000..1dd6947c4
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qdatetimeedit.cpp
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+dateEdit = QDateTimeEdit(QDate.currentDate())
+dateEdit.setMinimumDate(QDate.currentDate().addDays(-365))
+dateEdit.setMaximumDate(QDate.currentDate().addDays(365))
+dateEdit.setDisplayFormat("yyyy.MM.dd")
+//! [0]
+
+
+//! [1]
+setDateTimeRange(min, max)
+//! [1]
+
+
+//! [2]
+setMinimumDateTime(min)
+setMaximumDateTime(max)
+//! [2]
+
+
+//! [3]
+setDateRange(min, max)
+//! [3]
+
+
+//! [4]
+setMinimumDate(min)
+setMaximumDate(max)
+//! [4]
+
+
+//! [5]
+setTimeRange(min, max)
+//! [5]
+
+
+//! [6]
+setMinimumTime(min)
+setMaximumTime(max)
+//! [6]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qdockwidget.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qdockwidget.cpp
new file mode 100644
index 000000000..c9da19b47
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qdockwidget.cpp
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+dockWidget = parentWidget()
+if dockWidget.features() & QDockWidget.DockWidgetVerticalTitleBar:
+ # I need to be vertical
+else:
+ # I need to be horizontal
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qframe.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qframe.cpp
new file mode 100644
index 000000000..a41f1c478
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qframe.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+label = QLabel()
+label.setFrameStyle(QFrame.Panel | QFrame.Raised)
+label.setLineWidth(2)
+
+pbar = QProgressBar()
+label.setFrameStyle(QFrame.NoFrame)
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qgroupbox.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qgroupbox.cpp
new file mode 100644
index 000000000..d236d91dd
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qgroupbox.cpp
@@ -0,0 +1,3 @@
+//! [0]
+g.setTitle("&User information")
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qlabel.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qlabel.cpp
new file mode 100644
index 000000000..4a73a181d
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qlabel.cpp
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+label = QLabel(self)
+label.setFrameStyle(QFrame.Panel | QFrame.Sunken)
+label.setText("first line\nsecond line")
+label.setAlignment(Qt.AlignBottom | Qt.AlignRight)
+//! [0]
+
+
+//! [1]
+phoneEdit = QLineEdit(self)
+phoneLabel = QLabel("&Phone:", self)
+phoneLabel.setBuddy(phoneEdit)
+//! [1]
+
+
+//! [2]
+nameEd = QLineEdit(self)
+nameLb = QLabel("&Name:", self)
+nameLb.setBuddy(nameEd)
+phoneEd = QLineEdit(self)
+phoneLb = QLabel("&Phone:", self)
+phoneLb.setBuddy(phoneEd)
+# (layout setup not shown)
+//! [2]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qlineedit.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qlineedit.cpp
new file mode 100644
index 000000000..bf093ba50
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qlineedit.cpp
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+def contextMenuEvent(event):
+ menu = createStandardContextMenu()
+ menu.addAction(QObject.tr("My Menu Item"))
+ #...
+ menu.exec_(event.globalPos())
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qmainwindow.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qmainwindow.cpp
new file mode 100644
index 000000000..a5104708d
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qmainwindow.cpp
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+def closeEvent(self, event):
+ settings = QSettings("MyCompany", "MyApp")
+ settings.setValue("geometry", self.saveGeometry())
+ settings.setValue("windowState", self.saveState())
+ QMainWindow.closeEvent(self, event)
+//! [0]
+
+
+//! [1]
+def readSettings(self):
+ settings = QSettings("MyCompany", "MyApp")
+ restoreGeometry(settings.value("myWidget/geometry"))
+ restoreState(settings.value("myWidget/windowState"))
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qmenu.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qmenu.cpp
new file mode 100644
index 000000000..6bf1bf8f2
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qmenu.cpp
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+exec_(QCursor.pos())
+//! [0]
+
+
+//! [1]
+exec_(somewidget.mapToGlobal(QPoint(0,0)))
+//! [1]
+
+
+//! [2]
+exec_(e.globalPos())
+//! [2]
+
+
+//! [3]
+exec_(QCursor.pos())
+//! [3]
+
+
+//! [4]
+exec_(somewidget.mapToGlobal(QPoint(0, 0)))
+//! [4]
+
+
+//! [5]
+exec_(e.globalPos())
+//! [5]
+
+
+//! [6]
+menu = QMenu()
+at = actions[0] // Assumes actions is not empty
+for a in actions:
+ menu.addAction(a)
+menu.exec_(pos, at)
+//! [6]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qmenubar.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qmenubar.cpp
new file mode 100644
index 000000000..fa5bb3b11
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qmenubar.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+menubar.addMenu(fileMenu)
+//! [0]
+
+
+//! [1]
+menuBar = QMenuBar()
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qplaintextedit.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qplaintextedit.cpp
new file mode 100644
index 000000000..674f78662
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qplaintextedit.cpp
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+class MyQPlainTextEdit(QPlainTextEdit):
+ def contextMenuEvent(self, event):
+ menu = createStandardContextMenu()
+ menu.addAction(tr("My Menu Item"))
+ # ...
+ menu.exec_(event.globalPos())
+ del menu
+//! [0]
+
+
+//! [1]
+edit.textCursor().insertText(text)
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qpushbutton.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qpushbutton.cpp
new file mode 100644
index 000000000..74b4cf884
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qpushbutton.cpp
@@ -0,0 +1,3 @@
+//! [0]
+button = QPushButton("&Download", self)
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qradiobutton.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qradiobutton.cpp
new file mode 100644
index 000000000..dbee86850
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qradiobutton.cpp
@@ -0,0 +1,3 @@
+//! [0]
+button = QRadioButton("Search from the &cursor", self)
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qrubberband.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qrubberband.cpp
new file mode 100644
index 000000000..61f784a3a
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qrubberband.cpp
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+class Widget:
+ def mousePressEvent(self, event):
+ origin = event.pos()
+ if not self.rubberBand:
+ self.rubberBand = QRubberBand(QRubberBand.Rectangle, self)
+ rubberBand.setGeometry(QRect(origin, QSize()))
+ rubberBand.show()
+
+ def mouseMoveEvent(self, event):
+ rubberBand.setGeometry(QRect(origin, event.pos()).normalized())
+
+ def mouseReleaseEvent(self, event):
+ rubberBand.hide()
+ # determine selection, for example using QRect.intersects()
+ # and QRect.contains().
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qscrollarea.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qscrollarea.cpp
new file mode 100644
index 000000000..7172efd56
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qscrollarea.cpp
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+imageLabel = QLabel()
+image = QImage("happyguy.png")
+imageLabel.setPixmap(QPixmap.fromImage(image))
+
+scrollArea = QScrollArea()
+scrollArea.setBackgroundRole(QPalette.Dark)
+scrollArea.setWidget(imageLabel)
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qspinbox.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qspinbox.cpp
new file mode 100644
index 000000000..77273e260
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qspinbox.cpp
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+sb.setPrefix("$")
+//! [0]
+
+
+//! [1]
+sb.setSuffix(" km")
+//! [1]
+
+
+//! [2]
+setRange(minimum, maximum)
+//! [2]
+
+
+//! [3]
+setMinimum(minimum)
+setMaximum(maximum)
+//! [3]
+
+
+//! [4]
+spinbox.setPrefix("$")
+//! [4]
+
+
+//! [5]
+spinbox.setSuffix(" km")
+//! [5]
+
+
+//! [6]
+setRange(minimum, maximum)
+//! [6]
+
+
+//! [7]
+setMinimum(minimum)
+setMaximum(maximum)
+//! [7]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qsplashscreen.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qsplashscreen.cpp
new file mode 100644
index 000000000..2bddb83a9
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qsplashscreen.cpp
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+pixmap = QPixmap(":/splash.png")
+splash = QSplashScreen(pixmap)
+splash.show()
+
+... # Loading some items
+splash.showMessage("Loaded modules")
+
+qApp.processEvents()
+
+... # Establishing connections
+splash.showMessage("Established connections")
+
+qApp.processEvents()
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qsplitter.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qsplitter.cpp
new file mode 100644
index 000000000..c5dfcd859
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qsplitter.cpp
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+widget = splitter.widget(index)
+policy = widget.sizePolicy()
+policy.setHorizontalStretch(stretch)
+policy.setVerticalStretch(stretch)
+widget.setSizePolicy(policy)
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qstatusbar.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qstatusbar.cpp
new file mode 100644
index 000000000..8b972b6f2
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qstatusbar.cpp
@@ -0,0 +1,3 @@
+//! [0]
+statusBar().addWidget(MyReadWriteIndication())
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qtextbrowser.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qtextbrowser.cpp
new file mode 100644
index 000000000..e35b40c38
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qtextbrowser.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+backaction.setToolTip(browser.historyTitle(-1))
+forwardaction.setToolTip(browser.historyTitle(+1))
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qtextedit.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qtextedit.cpp
new file mode 100644
index 000000000..fad9f6be1
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qtextedit.cpp
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+class MyTextEdit(QTextEdit):
+ def contextMenuEvent(self, event):
+ menu = createStandardContextMenu()
+ menu.addAction(tr("My Menu Item"))
+ #...
+ menu.exec_(event->globalPos())
+ del menu
+//! [0]
+
+
+//! [1]
+edit.textCursor().insertText(text)
+//! [1]
+
+
+//! [2]
+edit.textCursor().insertHtml(fragment)
+//! [2]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qworkspace.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qworkspace.cpp
new file mode 100644
index 000000000..1c7773310
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qworkspace.cpp
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+class MainWindow(...):
+ def __init__(self):
+ self.workspace = QWorkspace()
+ self.setCentralWidget(workspace)
+ ...
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_access_qftp.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_access_qftp.cpp
new file mode 100644
index 000000000..d0426fd89
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_access_qftp.cpp
@@ -0,0 +1,109 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+ftp = QFtp(parent)
+ftp.connectToHost("ftp.qt-project.org")
+ftp.login()
+//! [0]
+
+
+//! [1]
+ftp.connectToHost("ftp.qt-project.org") # id == 1
+ftp.login() # id == 2
+ftp.cd("qt") # id == 3
+ftp.get("INSTALL") # id == 4
+ftp.close() # id == 5
+//! [1]
+
+
+//! [2]
+start(1)
+stateChanged(HostLookup)
+stateChanged(Connecting)
+stateChanged(Connected)
+finished(1, false)
+
+start(2)
+stateChanged(LoggedIn)
+finished(2, false)
+
+start(3)
+finished(3, false)
+
+start(4)
+dataTransferProgress(0, 3798)
+dataTransferProgress(2896, 3798)
+readyRead()
+dataTransferProgress(3798, 3798)
+readyRead()
+finished(4, false)
+
+start(5)
+stateChanged(Closing)
+stateChanged(Unconnected)
+finished(5, false)
+
+done(false)
+//! [2]
+
+
+//! [3]
+start(1)
+stateChanged(HostLookup)
+stateChanged(Connecting)
+stateChanged(Connected)
+finished(1, false)
+
+start(2)
+finished(2, true)
+
+done(true)
+//! [3]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_access_qhttp.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_access_qhttp.cpp
new file mode 100644
index 000000000..333ea2bdd
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_access_qhttp.cpp
@@ -0,0 +1,132 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+content-type: text/html
+//! [0]
+
+
+//! [1]
+header.setValue("content-type", "text/html")
+contentType = header.value("content-type")
+//! [1]
+
+
+//! [2]
+header = QHttpRequestHeader("GET", QUrl.toPercentEncoding("/index.html"))
+header.setValue("Host", "qtsoftware.com")
+http.setHost("qtsoftware.com")
+http.request(header)
+//! [2]
+
+
+//! [3]
+http.setHost("qtsoftware.com") # id == 1
+http.get(QUrl.toPercentEncoding("/index.html")) # id == 2
+//! [3]
+
+
+//! [4]
+requestStarted(1)
+requestFinished(1, False)
+
+requestStarted(2)
+stateChanged(Connecting)
+stateChanged(Sending)
+dataSendProgress(77, 77)
+stateChanged(Reading)
+responseHeaderReceived(responseheader)
+dataReadProgress(5388, 0)
+readyRead(responseheader)
+dataReadProgress(18300, 0)
+readyRead(responseheader)
+stateChanged(Connected)
+requestFinished(2, False)
+
+done(False)
+
+stateChanged(Closing)
+stateChanged(Unconnected)
+//! [4]
+
+
+//! [5]
+http.setHost("www.foo.bar") # id == 1
+http.get("/index.html") # id == 2
+http.post("register.html", data) # id == 3
+//! [5]
+
+
+//! [6]
+requestStarted(1)
+requestFinished(1, False)
+
+requestStarted(2)
+stateChanged(HostLookup)
+requestFinished(2, True)
+
+done(True)
+
+stateChanged(Unconnected)
+//! [6]
+
+
+//! [7]
+def getTicks(self):
+ http = QHttp(self)
+ self.connect(http, SIGNAL('done(bool)'), self, SLOT('showPage()'))
+ http.setProxy("proxy.example.com", 3128)
+ http.setHost("ticker.example.com")
+ http.get("/ticks.asp")
+
+def showPage(self):
+ self.display(http.readAll())
+
+//! [7]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_access_qnetworkaccessmanager.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_access_qnetworkaccessmanager.cpp
new file mode 100644
index 000000000..478472530
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_access_qnetworkaccessmanager.cpp
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+manager = QNetworkAccessManager(self)
+manager.finished[QNetworkReply].connect(self.replyFinished)
+
+manager.get(QNetworkRequest(QUrl("http://qt-project.org")))
+//! [0]
+
+
+//! [1]
+request = QNetworkRequest()
+request.setUrl(QUrl("http://qt-project.org"))
+request.setRawHeader("User-Agent", "MyOwnBrowser 1.0")
+
+reply = manager.get(request)
+reply.readyRead.connect(self.slotReadyRead)
+reply.error[QNetworkReply.NetworkError].connect(self..slotError)
+reply.sslErrors.connect(self.slotSslErrors)
+//! [1]
+
+//! [2]
+manager = QNetworkConfigurationManager()
+networkAccessManager.setConfiguration(manager.defaultConfiguration())
+//! [2]
+
+//! [3]
+networkAccessManager.setConfiguration(QNetworkConfiguration())
+//! [3]
+
+//! [4]
+networkAccessManager.setNetworkAccessible(QNetworkAccessManager.NotAccessible)
+//! [4]
+
+//! [5]
+networkAccessManager.setNetworkAccessible(QNetworkAccessManager.Accessible)
+//! [5]
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_access_qnetworkdiskcache.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_access_qnetworkdiskcache.cpp
new file mode 100644
index 000000000..c8c81ad95
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_access_qnetworkdiskcache.cpp
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+manager = QNetworkAccessManager(self)
+diskCache = QNetworkDiskCache(self)
+diskCache.setCacheDirectory("cacheDir")
+manager.setCache(diskCache)
+//! [0]
+
+//! [1]
+# do a normal request (preferred from network, as this is the default)
+request = QNetworkRequest(QUrl("http://qt-project.org"))
+manager.get(request)
+
+# do a request preferred from cache
+request2 = QNetworkRequest(QUrl("http://qt-project.org"))
+request2.setAttribute(QNetworkRequest.CacheLoadControlAttribute, QNetworkRequest.PreferCache)
+manager.get(request2)
+//! [1]
+
+//! [2]
+@Slot(QNetworkReply)
+def replyFinished(reply):
+ fromCache = reply.attribute(QNetworkRequest.SourceIsFromCacheAttribute)
+ print("page from cache? %d" % fromCache)
+//! [2]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_access_qnetworkrequest.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_access_qnetworkrequest.cpp
new file mode 100644
index 000000000..9156597b1
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_access_qnetworkrequest.cpp
@@ -0,0 +1,3 @@
+//! [0]
+request.setRawHeader("Last-Modified", "Sun, 06 Nov 1994 08:49:37 GMT")
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_bearer_qnetworkconfigmanager.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_bearer_qnetworkconfigmanager.cpp
new file mode 100644
index 000000000..d30aca2ab
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_bearer_qnetworkconfigmanager.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+mgr = QNetworkConfigurationManager()
+activeConfigs = mgr.allConfigurations(QNetworkConfiguration.Active)
+if activeConfigs:
+ assert(mgr.isOnline())
+else:
+ assert(not mgr.isOnline())
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_kernel_qhostaddress.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_kernel_qhostaddress.cpp
new file mode 100644
index 000000000..e45b6d57a
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_kernel_qhostaddress.cpp
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+addr = hostAddr.toIPv6Address()
+# addr contains 16 unsigned characters
+
+for i in range(0, 16):
+ # process addr[i]
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_kernel_qhostinfo.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_kernel_qhostinfo.cpp
new file mode 100644
index 000000000..b1430a499
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_kernel_qhostinfo.cpp
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+# To find the IP address of qt-project.org
+QHostInfo.lookupHost("qt-project.org", self, SLOT("printResults(QHostInfo)"))
+
+# To find the host name for 4.2.2.1
+QHostInfo.lookupHost("4.2.2.1", self, SLOT("printResults(QHostInfo)"))
+//! [0]
+
+
+//! [1]
+info = QHostInfo.fromName("qt-project.org")
+//! [1]
+
+
+//! [2]
+QHostInfo.lookupHost("www.kde.org", self.lookedUp)
+//! [2]
+
+
+//! [3]
+def lookedUp(host):
+ if host.error() != QHostInfo.NoError:
+ print "Lookup failed: %s" % host.errorString()
+ return
+
+ for address in host.addresses():
+ print "Found address: %s" % address.toString()
+//! [3]
+
+
+//! [4]
+QHostInfo.lookupHost("4.2.2.1", self.lookedUp)
+//! [4]
+
+
+//! [5]
+info = QHostInfo()
+...
+if not info.addresses().isEmpty():
+ address = info.addresses().first()
+ # use the first IP address
+//! [5]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_kernel_qnetworkproxy.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_kernel_qnetworkproxy.cpp
new file mode 100644
index 000000000..29c6a8efd
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_kernel_qnetworkproxy.cpp
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+proxy = QNetworkProxy()
+proxy.setType(QNetworkProxy.Socks5Proxy)
+proxy.setHostName("proxy.example.com")
+proxy.setPort(1080)
+proxy.setUser("username")
+proxy.setPassword("password")
+QNetworkProxy.setApplicationProxy(proxy)
+//! [0]
+
+
+//! [1]
+serverSocket.setProxy(QNetworkProxy.NoProxy)
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_socket_qabstractsocket.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_socket_qabstractsocket.cpp
new file mode 100644
index 000000000..ea70b1fcf
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_socket_qabstractsocket.cpp
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+socket.connectToHost("imap", 143)
+if socket.waitForConnected(1000):
+ print "Connected!"
+//! [0]
+
+
+//! [1]
+socket.disconnectFromHost()
+ if socket.state() == QAbstractSocket.UnconnectedState or \
+ socket.waitForDisconnected(1000):
+ print "Disconnected!"
+//! [1]
+
+
+//! [2]
+class SocketClass(...):
+ def readyReadSlot(self):
+ # This slot is connected to QAbstractSocket::readyRead()
+ while not socket.atEnd():
+ data = socket.read(100)
+ ...
+//! [2]
+
+
+//! [3]
+socket.setProxy(QNetworkProxy.NoProxy)
+//! [3]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_socket_qlocalsocket_unix.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_socket_qlocalsocket_unix.cpp
new file mode 100644
index 000000000..1687fe69b
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_socket_qlocalsocket_unix.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+socket.connectToServer("market")
+if (socket.waitForConnected(1000))
+ print("Connected!")
+//! [0]
+
+
+//! [1]
+socket.disconnectFromServer()
+if (socket.waitForDisconnected(1000))
+ print("Disconnected!")
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_socket_qnativesocketengine.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_socket_qnativesocketengine.cpp
new file mode 100644
index 000000000..9fda752ef
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_socket_qnativesocketengine.cpp
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+socketLayer = QNativeSocketEngine()
+socketLayer.initialize(QAbstractSocket.TcpSocket, QAbstractSocket.IPv4Protocol)
+socketLayer.connectToHost(QHostAddress.LocalHost, 22)
+# returns False
+
+socketLayer.waitForWrite()
+socketLayer.connectToHost(QHostAddress.LocalHost, 22)
+# returns True
+//! [0]
+
+
+//! [1]
+socketLayer = QNativeSocketEngine()
+socketLayer.bind(QHostAddress.Any, 4000)
+socketLayer.listen()
+if socketLayer.waitForRead():
+ clientSocket = socketLayer.accept()
+ # a client is connected
+
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_socket_qtcpserver.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_socket_qtcpserver.cpp
new file mode 100644
index 000000000..b685462bc
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_socket_qtcpserver.cpp
@@ -0,0 +1,3 @@
+//! [0]
+server.setProxy(QNetworkProxy.NoProxy)
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_socket_qudpsocket.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_socket_qudpsocket.cpp
new file mode 100644
index 000000000..cbeb0be68
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_socket_qudpsocket.cpp
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+def initSocket(self):
+ udpSocket = QUdpSocket(self)
+ udpSocket.bind(QHostAddress.LocalHost, 7755)
+
+ self.connect(udpSocket, SIGNAL('readyRead()'),
+ self, SLOT('readPendingDatagrams()'))
+
+def readPendingDatagrams(self):
+ while udpSocket.hasPendingDatagrams():
+ datagram = QByteArray()
+ datagram.resize(udpSocket.pendingDatagramSize())
+
+ (sender, senderPort) = udpSocket.readDatagram(datagram.data(), datagram.size())
+
+ processTheDatagram(datagram)
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_ssl_qsslcertificate.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_ssl_qsslcertificate.cpp
new file mode 100644
index 000000000..d13d4dd3c
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_ssl_qsslcertificate.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+for cert in QSslCertificate.fromPath('C:/ssl/certificate.*.pem', QSsL.Pem, QRegExp.Wildcard):
+ print cert.issuerInfo(QSslCertificate.Organization)
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_ssl_qsslconfiguration.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_ssl_qsslconfiguration.cpp
new file mode 100644
index 000000000..1ba2170d1
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_ssl_qsslconfiguration.cpp
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+config = sslSocket.sslConfiguration()
+config.setProtocol(QSsl.TlsV1)
+sslSocket.setSslConfiguration(config)
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_ssl_qsslsocket.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_ssl_qsslsocket.cpp
new file mode 100644
index 000000000..d822b80c5
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_ssl_qsslsocket.cpp
@@ -0,0 +1,100 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+socket = QSslSocket(self)
+QObject.connect(socket, SIGNAL("encrypted()"), self, SLOT("ready()"))
+
+socket.connectToHostEncrypted("imap.example.com", 993)
+//! [0]
+
+
+//! [1]
+def incomingConnection(socketDescriptor):
+ serverSocket = QSslSocket()
+ if serverSocket.setSocketDescriptor(socketDescriptor):
+ QObject.connect(serverSocket, SIGNAL("encrypted()"), self, SLOT("ready()"))
+ serverSocket.startServerEncryption()
+//! [1]
+
+
+//! [2]
+socket = QSslSocket()
+socket.connectToHostEncrypted("http.example.com", 443)
+if not socket.waitForEncrypted():
+ print socket.errorString()
+ return false
+
+socket.write("GET / HTTP/1.0\r\n\r\n")
+while socket.waitForReadyRead():
+ print socket.readAll().data()
+//! [2]
+
+
+//! [3]
+socket = QSslSocket()
+QObject.connect(socket, SIGNAL("encrypted()"), receiver, SLOT("socketEncrypted()"))
+
+socket.connectToHostEncrypted("imap", 993)
+socket.write("1 CAPABILITY\r\n")
+//! [3]
+
+
+//! [4]
+socket = QSslSocket()
+socket.setCiphers("DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:AES256-SHA")
+//! [4]
+
+
+//! [5]
+socket.connectToHostEncrypted("imap", 993)
+if socket.waitForEncrypted(1000):
+ print "Encrypted!"
+//! [5]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_opengl_qgl.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_opengl_qgl.cpp
new file mode 100644
index 000000000..264cf0888
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_opengl_qgl.cpp
@@ -0,0 +1,168 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+fmt = QGLFormat()
+fmt.setAlpha(True)
+fmt.setStereo(True)
+QGLFormat.setDefaultFormat(fmt)
+//! [0]
+
+
+//! [1]
+fmt = QGLFormat()
+fmt.setDoubleBuffer(False) # single buffer
+fmt.setDirectRendering(False) # software rendering
+myWidget = MyGLWidget(fmt, ...)
+//! [1]
+
+
+//! [2]
+fmt = QGLFormat()
+fmt.setOverlay(True)
+fmt.setStereo(True)
+myWidget = MyGLWidget(fmt, ...)
+if !myWidget.format().stereo():
+ # ok, goggles off
+ if !myWidget.format().hasOverlay():
+ print "Cool hardware required"
+//! [2]
+
+
+//! [3]
+# The rendering in MyGLWidget depends on using
+# stencil buffer and alpha channel
+
+class MyGLWidget(QGLWidget):
+ def __init__(self, parent):
+ QGLWidget.__init__(self, QGLFormat(QGL.StencilBuffer | QGL.AlphaChannel), parent)
+
+ if !format().stencil():
+ print "Could not get stencil buffer results will be suboptimal"
+ if !format().alpha():
+ print "Could not get alpha channel results will be suboptimal"
+ ...
+//! [3]
+
+
+//! [4]
+a = QApplication([])
+f = QGLFormat()
+f.setDoubleBuffer(False)
+QGLFormat.setDefaultFormat(f)
+//! [4]
+
+
+//! [5]
+f = QGLFormat.defaultOverlayFormat()
+f.setDoubleBuffer(True)
+QGLFormat.setDefaultOverlayFormat(f)
+//! [5]
+
+
+//! [6]
+# ...continued from above
+myWidget = MyGLWidget(QGLFormat(QGL.HasOverlay), ...)
+if myWidget.format().hasOverlay():
+ # Yes, we got an overlay, let's check _its_ format:
+ olContext = myWidget.overlayContext()
+ if olContext.format().doubleBuffer():
+ # yes, we got a double buffered overlay
+ else:
+ # no, only single buffered overlays are available
+//! [6]
+
+
+//! [7]
+cx = QGLContext()
+# ...
+f = QGLFormat()
+f.setStereo(True)
+cx.setFormat(f)
+if !cx.create():
+ exit() # no OpenGL support, or cannot render on the specified paintdevice
+if !cx.format().stereo():
+ exit() # could not create stereo context
+//! [7]
+
+
+//! [8]
+class MyGLDrawer(QGLWidget):
+
+ def __init__(self, parent):
+ QGLWidget.__init__(self, parent)
+ pass
+
+ def initializeGL(self):
+ # Set up the rendering context, define display lists etc.:
+ ...
+ glClearColor(0.0, 0.0, 0.0, 0.0)
+ glEnable(GL_DEPTH_TEST)
+ ...
+
+ def resizeGL(self, w, h):
+ # setup viewport, projection etc.:
+ glViewport(0, 0, w, h)
+ ...
+ glFrustum(...)
+ ...
+
+ def paintGL(self):
+ # draw the scene:
+ ...
+ glRotatef(...)
+ glMaterialfv(...)
+ glBegin(GL_QUADS)
+ glVertex3f(...)
+ glVertex3f(...)
+ ...
+ glEnd()
+ ...
+//! [8]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_opengl_qglcolormap.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_opengl_qglcolormap.cpp
new file mode 100644
index 000000000..c95874e22
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_opengl_qglcolormap.cpp
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+import sys
+
+from PySide6.QtGui import QApplication, qRgb
+from PySide6.QtOpenGL import QGLColormap
+
+def main(argv):
+ app = QApplication(argv)
+
+ widget = MySuperGLWidget() # a QGLWidget in color-index mode
+ colormap = QGLColormap()
+
+ # This will fill the colormap with colors ranging from
+ # black to white.
+ for i in range(0, colormap.size()):
+ colormap.setEntry(i, qRgb(i, i, i))
+
+ widget.setColormap(colormap)
+ widget.show()
+ return app.exec_()
+
+if __name__ == "__main__":
+ main(sys.argv)
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_opengl_qglpixelbuffer.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_opengl_qglpixelbuffer.cpp
new file mode 100644
index 000000000..fd8c50499
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_opengl_qglpixelbuffer.cpp
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+pbuffer QGLPixelBuffer(...)
+...
+pbuffer.makeCurrent()
+dynamicTexture = pbuffer.generateDynamicTexture()
+pbuffer.bindToDynamicTexture(dynamicTexture)
+...
+pbuffer.releaseFromDynamicTexture()
+//! [0]
+
+
+//! [1]
+pbuffer QGLPixelBuffer(...)
+...
+pbuffer.makeCurrent()
+dynamicTexture = pbuffer.generateDynamicTexture()
+...
+pbuffer.updateDynamicTexture(dynamicTexture)
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_opengl_qglshaderprogram.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_opengl_qglshaderprogram.cpp
new file mode 100644
index 000000000..102867f43
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_opengl_qglshaderprogram.cpp
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+shader = QGLShader(QGLShader.Vertex)
+shader.compileSourceCode(code)
+
+program = QGLShaderProgram(context)
+program.addShader(shader)
+program.link()
+
+program.bind()
+//! [0]
+
+//! [1]
+program.addShaderFromSourceCode(QGLShader.Vertex,
+ "attribute highp vec4 vertex\n" \
+ "attribute mediump mat4 matrix\n" \
+ "void main(void)\n" \
+ "{\n" \
+ " gl_Position = matrix * vertex\n" \
+ "}")
+program.addShaderFromSourceCode(QGLShader.Fragment,
+ "uniform mediump vec4 color\n" \
+ "void main(void)\n" \
+ "{\n" \
+ " gl_FragColor = color\n" \
+ "}")
+program.link()
+program.bind()
+
+vertexLocation = program.attributeLocation("vertex")
+matrixLocation = program.attributeLocation("matrix")
+colorLocation = program.uniformLocation("color")
+//! [1]
+
+//! [2]
+triangleVertices = (
+ 60.0f, 10.0f, 0.0f,
+ 110.0f, 110.0f, 0.0f,
+ 10.0f, 110.0f, 0.0f)
+
+color = QColor(0, 255, 0, 255)
+
+pmvMatrix = QMatrix4x4()
+pmvMatrix.ortho(self.rect())
+
+program.enableAttributeArray(vertexLocation)
+program.setAttributeArray(vertexLocation, triangleVertices, 3)
+program.setUniformValue(matrixLocation, pmvMatrix)
+program.setUniformValue(colorLocation, color)
+
+glDrawArrays(GL_TRIANGLES, 0, 3)
+
+program.disableAttributeArray(vertexLocation)
+//! [2]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_qtestlib_qtestcase.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_qtestlib_qtestcase.cpp
new file mode 100644
index 000000000..8ff2a6ee4
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_qtestlib_qtestcase.cpp
@@ -0,0 +1,237 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+QVERIFY(1 + 1 == 2)
+//! [0]
+
+
+//! [1]
+QVERIFY2(1 + 1 == 2, "A breach in basic arithmetic occured.")
+//! [1]
+
+
+//! [2]
+QCOMPARE(QString("hello").toUpper(), QString("HELLO"))
+//! [2]
+
+
+//! [3]
+void TestQString.toInt_data()
+{
+ QTest.addColumn<QString>("aString")
+ QTest.addColumn<int>("expected")
+
+ QTest.newRow("positive value") << "42" << 42
+ QTest.newRow("negative value") << "-42" << -42
+ QTest.newRow("zero") << "0" << 0
+}
+//! [3]
+
+
+//! [4]
+void TestQString.toInt()
+{
+ QFETCH(QString, aString)
+ QFETCH(int, expected)
+
+ QCOMPARE(aString.toInt(), expected)
+}
+//! [4]
+
+
+//! [5]
+if (sizeof(int) != 4)
+ QFAIL("This test has not been ported to this platform yet.")
+//! [5]
+
+
+//! [6]
+QFETCH(QString, myString)
+QCOMPARE(QString("hello").toUpper(), myString)
+//! [6]
+
+
+//! [7]
+QTEST(QString("hello").toUpper(), "myString")
+//! [7]
+
+
+//! [8]
+if (!QSqlDatabase.drivers().contains("SQLITE"))
+ QSKIP("This test requires the SQLITE database driver", SkipAll)
+//! [8]
+
+
+//! [9]
+QEXPECT_FAIL("", "Will fix in the next release", Continue)
+QCOMPARE(i, 42)
+QCOMPARE(j, 43)
+//! [9]
+
+
+//! [10]
+QEXPECT_FAIL("data27", "Oh my, this is soooo broken", Abort)
+QCOMPARE(i, 42)
+//! [10]
+
+
+//! [11]
+class TestQString: public QObject { ... }
+QTEST_MAIN(TestQString)
+//! [11]
+
+
+//! [12]
+#ifdef Q_WS_X11
+ QTEST_MAIN(MyX11Test)
+#else
+ // do nothing on non-X11 platforms
+ QTEST_NOOP_MAIN
+#endif
+//! [12]
+
+
+//! [13]
+QTest.keyClick(myWidget, 'a')
+//! [13]
+
+
+//! [14]
+QTest.keyClick(myWidget, Qt.Key_Escape)
+
+QTest.keyClick(myWidget, Qt.Key_Escape, Qt.ShiftModifier, 200)
+//! [14]
+
+
+//! [15]
+QTest.keyClicks(myWidget, "hello world")
+//! [15]
+
+
+//! [16]
+namespace QTest {
+ template<>
+ char *toString(const MyPoint &point)
+ {
+ QByteArray ba = "MyPoint("
+ ba += QByteArray.number(point.x()) + ", " + QByteArray.number(point.y())
+ ba += ")"
+ return qstrdup(ba.data())
+ }
+}
+//! [16]
+
+
+//! [17]
+int i = 0
+while (myNetworkServerNotResponding() && i++ < 50)
+ QTest.qWait(250)
+//! [17]
+
+
+//! [18]
+MyFirstTestObject test1
+QTest.qExec(&test1)
+
+MySecondTestObject test2
+QTest.qExec(&test2)
+//! [18]
+
+
+//! [19]
+QDir dir
+
+QTest.ignoreMessage(QtWarningMsg, "QDir.mkdir: Empty or null file name(s)")
+dir.mkdir("")
+//! [19]
+
+
+//! [20]
+void myTestFunction_data()
+{
+ QTest.addColumn<QString>("aString")
+ QTest.newRow("just hello") << QString("hello")
+ QTest.newRow("a null string") << QString()
+}
+//! [20]
+
+
+//! [21]
+void myTestFunction_data() {
+ QTest.addColumn<int>("intval")
+ QTest.addColumn<QString>("str")
+ QTest.addColumn<double>("dbl")
+
+ QTest.newRow("row1") << 1 << "hello" << 1.5
+}
+//! [21]
+
+
+//! [22]
+void MyTestClass.cleanup()
+{
+ if (qstrcmp(currentTestFunction(), "myDatabaseTest") == 0) {
+ // clean up all database connections
+ closeAllDatabases()
+ }
+}
+//! [22]
+
+
+//! [23]
+QTest.qSleep(250)
+//! [23]
+
+//! [24]
+widget = QWidget()
+widget.show()
+QTest.qWaitForWindowShown(widget)
+//! [24]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptable.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptable.cpp
new file mode 100644
index 000000000..ac181e70c
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptable.cpp
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+class MyScriptableObject(QObject, QScriptable):
+...
+ def doSomething(self):
+ ...
+ def doSomethingElse(self):
+ ...
+//! [0]
+
+
+//! [1]
+
+def doSomething(self):
+ self.context().throwError('Threw an error from a slot')
+
+def doSomethingElse(self):
+ return self.thisObject()
+
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptclass.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptclass.cpp
new file mode 100644
index 000000000..94601aa9b
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptclass.cpp
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+if extension == Callable:
+ context = argument
+ engine = context.engine()
+ sum = 0
+ for i in range(0, context.argumentCount()):
+ sum += context.argument(i).toNumber()
+ return sum
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptcontext.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptcontext.cpp
new file mode 100644
index 000000000..632283d82
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptcontext.cpp
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+foo(20.5, "hello", Object())
+//! [0]
+
+
+//! [1]
+def Person_prototype_fullName(context, engine):
+ self = context.selfObject()
+ result = self.property("firstName").toString()
+ result += QLatin1String(" ")
+ result += self.property("lastName").toString()
+ return result
+//! [1]
+
+
+//! [2]
+def myInclude(ctx, eng):
+ fileName = ctx.argument(0).toString()
+ contents = readTheFile(fileName)
+ ctx.setActivationObject(ctx.parentContext().activationObject())
+ ctx.setThisObject(ctx.parentContext().selfObject())
+ return eng.evaluate(contents, fileName)
+//! [2]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptengine.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptengine.cpp
new file mode 100644
index 000000000..4005e2c2b
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptengine.cpp
@@ -0,0 +1,320 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+myEngine = QScriptEngine()
+three = myEngine.evaluate("1 + 2")
+//! [0]
+
+
+//! [1]
+fun = myEngine.evaluate("function(a, b) { return a + b }");
+args = QScriptValueList()
+args << 1 << 2
+threeAgain = fun.call(QScriptValue(), args)
+//! [1]
+
+
+//! [2]
+fileName = "helloworld.qs"
+scriptFile = QFile(fileName)
+if !scriptFile.open(QIODevice.ReadOnly):
+ # handle error
+stream = QTextStream(scriptFile)
+contents = stream.readAll()
+scriptFile.close()
+myEngine.evaluate(contents, fileName)
+//! [2]
+
+
+//! [3]
+myEngine.globalObject().setProperty("myNumber", 123)
+...
+myNumberPlusOne = myEngine.evaluate("myNumber + 1")
+//! [3]
+
+
+//! [4]
+result = myEngine.evaluate(...)
+if myEngine.hasUncaughtException():
+ line = myEngine.uncaughtExceptionLineNumber()
+ print "uncaught exception at line", line, ":", result.toString()
+//! [4]
+
+
+//! [5]
+button = QPushButton()
+QScriptValue scriptButton = myEngine.QObject(button)
+myEngine.globalObject().setProperty("button", scriptButton)
+
+myEngine.evaluate("button.checkable = True")
+
+print scriptButton.property("checkable").toBoolean()
+scriptButton.property("show").call() # call the show() slot
+//! [5]
+
+
+//! [6]
+def myAdd(context, engine):
+ a = context.argument(0)
+ b = context.argument(1)
+ return a.toNumber() + b.toNumber()
+//! [6]
+
+
+//! [7]
+fun = myEngine.Function(myAdd)
+myEngine.globalObject().setProperty("myAdd", fun)
+//! [7]
+
+
+//! [8]
+result = myEngine.evaluate("myAdd(myNumber, 1)")
+//! [8]
+
+
+//! [9]
+def Foo(context, engine):
+ if context.calledAsConstructor():
+ # initialize the object
+ context.selfObject().setProperty("bar", ...)
+ # ...
+ # return a non-object value to indicate that the
+ # selfObject() should be the result of the " Foo()" expression
+ return engine.undefinedValue()
+ else:
+ # not called as " Foo()", just "Foo()"
+ # create our own object and return that one
+ object = engine.Object()
+ object.setPrototype(context.callee().property("prototype"))
+ object.setProperty("baz", ...)
+ return object
+...
+
+fooProto = engine.Object()
+fooProto.setProperty("whatever", ...)
+engine.globalObject().setProperty("Foo", engine->Function(Foo, fooProto))
+//! [9]
+
+
+//! [10]
+class Bar:
+ ...
+
+def constructBar(context, engine):
+ bar = Bar()
+ # initialize from arguments in context, if desired
+ ...
+ return engine.toScriptValue(bar)
+
+class BarPrototype(QObject, QScriptable):
+# provide the scriptable interface of self type using slots and properties
+...
+
+...
+
+# create and register the Bar prototype and constructor in the engine
+barPrototypeObject = BarPrototype(...)
+barProto = engine.QObject(barPrototypeObject)
+engine.setDefaultPrototype(qMetaTypeId(Bar), barProto)
+barCtor = engine.Function(constructBar, barProto)
+engine.globalObject().setProperty("Bar", barCtor)
+//! [10]
+
+
+//! [11]
+def getSetFoo(context,engine):
+ callee = context.callee()
+ if context.argumentCount() == 1: # writing?
+ callee.setProperty("value", context.argument(0))
+ return callee.property("value")
+}
+
+....
+
+object = engine.Object()
+object.setProperty("foo", engine.Function(getSetFoo),
+ QScriptValue.PropertyGetter | QScriptValue::PropertySetter)
+//! [11]
+
+
+//! [12]
+object = engine.Object()
+object.setProperty("foo", engine.Function(getFoo), QScriptValue.PropertyGetter)
+object.setProperty("foo", engine.Function(setFoo), QScriptValue.PropertySetter)
+//! [12]
+
+
+//! [13]
+Q_SCRIPT_DECLARE_QMETAOBJECT(QLineEdit, QWidget*)
+
+...
+
+lineEditClass = engine.scriptValueFromQMetaObject(QLineEdit)
+engine.globalObject().setProperty("QLineEdit", lineEditClass)
+//! [13]
+
+
+//! [14]
+if hello && world:
+ print("hello world")
+//! [14]
+
+
+//! [15]
+if hello &&
+//! [15]
+
+
+//! [16]
+0 = 0
+//! [16]
+
+
+//! [17]
+./test.js
+//! [17]
+
+
+//! [18]
+foo["bar"]
+//! [18]
+
+
+//! [19]
+engine = QScriptEngine()
+context = engine.pushContext()
+context.activationObject().setProperty("myArg", 123)
+engine.evaluate("var tmp = myArg + 42")
+...
+engine.popContext()
+//! [19]
+
+
+//! [20]
+class MyStruct:
+ x = 0
+ y = 0
+//! [20]
+
+
+//! [21]
+Q_DECLARE_METATYPE(MyStruct)
+//! [21]
+
+
+//! [22]
+def toScriptValue(engine, s):
+ obj = engine.Object()
+ obj.setProperty("x", s.x)
+ obj.setProperty("y", s.y)
+ return obj
+
+def fromScriptValue(obj, s):
+ s.x = obj.property("x").toInt32()
+ s.y = obj.property("y").toInt32()
+//! [22]
+
+
+//! [23]
+qScriptRegisterMetaType(engine, toScriptValue, fromScriptValue)
+//! [23]
+
+
+//! [24]
+s = context.argument(0)
+...
+s2 = MyStruct()
+s2.x = s.x + 10
+s2.y = s.y + 20
+v = engine.toScriptValue(s2)
+//! [24]
+
+
+//! [25]
+def createMyStruct(cx, engine):
+ s = MyStruct()
+ s.x = 123
+ s.y = 456
+ return engine.toScriptValue(s)
+...
+
+ctor = engine.Function(createMyStruct)
+engine.globalObject().setProperty("MyStruct", ctor)
+//! [25]
+
+
+//! [26]
+Q_DECLARE_METATYPE(QVector<int>)
+
+...
+
+qScriptRegisterSequenceMetaType<QVector<int> >(engine)
+...
+v = engine.evaluate("[5, 1, 3, 2]")
+v.sort()
+a = engine.toScriptValue(v)
+print a.toString() # outputs "[1, 2, 3, 5]"
+//! [26]
+
+//! [27]
+def mySpecialQObjectConstructor(context, engine):
+ parent = context.argument(0).toQObject()
+ object = QObject(parent)
+ return engine.QObject(object, QScriptEngine.ScriptOwnership)
+
+...
+
+ctor = engine.Function(mySpecialQObjectConstructor)
+metaObject = engine.QMetaObject(QObject.staticMetaObject, ctor)
+engine.globalObject().setProperty("QObject", metaObject)
+
+result = engine.evaluate(" QObject()")
+//! [27]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptengineagent.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptengineagent.cpp
new file mode 100644
index 000000000..91541f539
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptengineagent.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+var a = Math.random() + 2;
+//! [0]
+
+
+//! [1]
+function cube(a) {
+ return a * a * a;
+}
+
+var a = cube(3);
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptvalue.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptvalue.cpp
new file mode 100644
index 000000000..18109bd83
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptvalue.cpp
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+myEngine = QScriptEngine()
+myObject = myEngine.newObject()
+myOtherObject = myEngine.newObject()
+myObject.setProperty("myChild", myOtherObject)
+myObject.setProperty("name", "John Doe")
+//! [0]
+
+
+//! [1]
+val = QScriptValue(myEngine, 123)
+myObject.setProperty("myReadOnlyProperty", val, QScriptValue.ReadOnly)
+//! [1]
+
+
+//! [2]
+engine = QScriptEngine()
+engine.evaluate("function fullName() { return this.firstName + ' ' + this.lastName; }")
+engine.evaluate("somePerson = { firstName: 'John', lastName: 'Doe' }")
+
+global_ = engine.globalObject()
+fullName = global_.property("fullName")
+who = global_.property("somePerson")
+print fullName.call(who).toString() # "John Doe"
+
+engine.evaluate("function cube(x) { return x * x * x; }")
+QScriptValue cube = global_.property("cube")
+args = QScriptValueList()
+args << 3
+print cube.call(QScriptValue(), args).toNumber() # 27
+//! [2]
+
+
+//! [3]
+
+def myNativeFunction(context, engine):
+ otherFunction = ...
+
+ return otherFunction.call(context.thisObject(), context.argumentsObject())
+
+//! [3]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptvalueiterator.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptvalueiterator.cpp
new file mode 100644
index 000000000..f9401488e
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptvalueiterator.cpp
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+object = QScriptValue()
+...
+it = QScriptValueIterator(object)
+while it.hasNext():
+ it.next()
+ print "%s:%s" % (it.name(), it.value().toString())
+//! [0]
+
+
+//! [1]
+QScriptValue obj = ... // the object to iterate over
+while obj.isObject():
+ it = QScriptValueIterator(obj)
+ while it.hasNext():
+ it.next()
+ print it.name()
+ obj = obj.prototype()
+//! [1]
+
+
+//! [2]
+while it.hasNext():
+ it.next()
+ if it.flags() & QScriptValue::SkipInEnumeration:
+ continue
+ print "found enumerated property: %s" % it.name()
+//! [2]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqldriver.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqldriver.cpp
new file mode 100644
index 000000000..cedc675ff
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqldriver.cpp
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+db = QSqlDatabase.addDatabase("SQLITE3")
+v = QVariant(db.driver().handle())
+if v.isValid() && v.typeName() == "sqlite3*":
+ # v.data() returns a pointer to the handle
+ sqlite3 *handle = *static_cast<sqlite3 **>(v.data())
+ if handle != 0: # check that it is not NULL
+ doSomething()
+//! [0]
+
+
+//! [1]
+# Impossible to translate to python
+if (v.typeName() == "PGconn*") {
+ PGconn *handle = *static_cast<PGconn **>(v.data())
+ if (handle != 0) ...
+}
+
+if (v.typeName() == "MYSQL*") {
+ MYSQL *handle = *static_cast<MYSQL **>(v.data())
+ if (handle != 0) ...
+}
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqlerror.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqlerror.cpp
new file mode 100644
index 000000000..ea0c8709a
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqlerror.cpp
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+model = QSqlQueryModel()
+model.setQuery("select * from myTable")
+if model.lastError().isValid():
+ print model.lastError()
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqlindex.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqlindex.cpp
new file mode 100644
index 000000000..3af6ef49d
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqlindex.cpp
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+strlist = myIndex.toStringList()
+for i in strlist:
+ myProcessing(i)
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqlquery.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqlquery.cpp
new file mode 100644
index 000000000..8e323680b
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqlquery.cpp
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+SELECT forename, surname FROM people
+//! [0]
+
+
+//! [1]
+q = QSqlQuery("select * from employees")
+rec = q.record()
+
+print "Number of columns: %d" % rec.count()
+
+nameCol = rec.indexOf("name") # index of the field "name"
+while q.next():
+ print q.value(nameCol) # output all names
+//! [1]
+
+
+//! [2]
+q = QSqlQuery()
+q.prepare("insert into myTable values (?, ?)")
+
+ints = [1, 2, 3, 4]
+q.addBindValue(ints)
+
+names = ["Harald", "Boris", "Trond", ""]
+q.addBindValue(names)
+
+if not q.execBatch():
+ print q.lastError()
+//! [2]
+
+
+//! [3]
+1 Harald
+2 Boris
+3 Trond
+4 NULL
+//! [3]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqlresult.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqlresult.cpp
new file mode 100644
index 000000000..3ba3277d0
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqlresult.cpp
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+q = QSqlQuery()
+q.prepare("insert into test (i1, i2, s) values (?, ?, ?)")
+
+col1 = [1, 3]
+col2 = [2, 4]
+col3 = ["hello", "world"]
+
+q.bindValue(0, col1)
+q.bindValue(1, col2)
+q.bindValue(2, col3)
+
+if not q.execBatch():
+ print q.lastError()
+//! [0]
+
+
+//! [1]
+query = QSqlQuery ...
+v = query.result().handle()
+if v.isValid() and (v.typeName() == "sqlite3_stmt*"):
+ # v.data() returns a pointer to the handle
+ handle = v.data()
+ if handle != 0: # check that it is not NULL
+ ...
+//! [1]
+
+
+//! [2]
+if v.typeName() == "PGresult*":
+ handle = v.data()
+ if handle != 0 ...
+
+if v.typeName() == "MYSQL_STMT*":
+ handle = v.data()
+ if handle != 0 ...
+}
+//! [2]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_models_qsqlquerymodel.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_models_qsqlquerymodel.cpp
new file mode 100644
index 000000000..fc5c398ad
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_models_qsqlquerymodel.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+while myModel.canFetchMore():
+ myModel.fetchMore()
+//! [0]
+
+
+//! [1]
+model = QSqlQueryModel()
+model.setQuery("select * from MyTable")
+if model.lastError().isValid():
+ print model.lastError()
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xml_dom_qdom.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xml_dom_qdom.cpp
new file mode 100644
index 000000000..6396cbcdc
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xml_dom_qdom.cpp
@@ -0,0 +1,230 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+doc = QDomDocument()
+impl = QDomImplementation()
+
+# This will create the element, but the resulting XML document will
+# be invalid, because '~' is not a valid character in a tag name.
+impl.setInvalidDataPolicy(QDomImplementation.AcceptInvalidData)
+elt1 = doc.createElement("foo~bar")
+
+# This will create an element with the tag name "foobar".
+impl.setInvalidDataPolicy(QDomImplementation.DropInvalidData)
+elt2 = doc.createElement("foo~bar")
+
+# This will create a null element.
+impl.setInvalidDataPolicy(QDomImplementation::ReturnNullNode)
+elt3 = doc.createElement("foo~bar")
+//! [0]
+
+
+//! [1]
+d = QDomDocument()
+d.setContent(someXML)
+n = d.firstChild()
+while !n.isNull():
+ if n.isElement():
+ e = n.toElement()
+ print "Element name: %s" % e.tagName()
+ break
+ n = n.nextSibling()
+//! [1]
+
+
+//! [2]
+QDomDocument document
+QDomElement element1 = document.documentElement()
+QDomElement element2 = element1
+//! [2]
+
+
+//! [3]
+QDomElement element3 = document.createElement("MyElement")
+QDomElement element4 = document.createElement("MyElement")
+//! [3]
+
+
+//! [4]
+<body>
+<h1>Heading</h1>
+<p>Hello <b>you</b></p>
+</body>
+//! [4]
+
+
+//! [5]
+<h1>Heading</h1>
+<p>The text...</p>
+<h2>Next heading</h2>
+//! [5]
+
+
+//! [6]
+<h1>Heading</h1>
+<p>The text...</p>
+<h2>Next heading</h2>
+//! [6]
+
+
+//! [7]
+<link href="http://qt-project.org" color="red" />
+//! [7]
+
+
+//! [8]
+e = # some QDomElement...
+#...
+a = e.attributeNode("href")
+print a.value() # prints "http://qt-project.org.com"
+a.setValue("http://qt-project.org/doc") # change the node's attribute
+a2 = e.attributeNode("href")
+print a2.value() # prints "http://qt-project.org/doc"
+//! [8]
+
+
+//! [9]
+e = # some QDomElement...
+#...
+s = e.text()
+//! [9]
+
+
+//! [10]
+text = QString()
+element = doc.documentElement()
+
+n = element.firstChild()
+while True:
+ if not n.isNull()
+ break
+ t = n.toText()
+ if !t.isNull():
+ text += t.data()
+
+ n = n.nextSibling()
+//! [10]
+
+
+//! [11]
+doc = # some QDomDocument ...
+root = doc.firstChildElement("database")
+elt = root.firstChildElement("entry")
+while True:
+ if not elt.isNull():
+ break
+ # ...
+ elt = elt.nextSiblingElement("entry")
+//! [11]
+
+
+//! [12]
+<img src="myimg.png">
+//! [12]
+
+
+//! [13]
+<h1>Hello <b>Qt</b> <![CDATA[<xml is cool>]]></h1>
+//! [13]
+
+
+//! [14]
+Hello Qt <xml is cool>
+//! [14]
+
+
+//! [15]
+<!-- this is a comment -->
+//! [15]
+
+
+//! [16]
+doc = QDomDocument("mydocument")
+file = QFile("mydocument.xml")
+if not file.open(QIODevice::ReadOnly):
+ return
+if not doc.setContent(&file):
+ file.close()
+ return
+file.close()
+
+# print out the element names of all elements that are direct children
+# of the outermost element.
+docElem = doc.documentElement()
+
+n = docElem.firstChild()
+while not n.isNull():
+ e = n.toElement() # try to convert the node to an element.
+ if not e.isNull():
+ print e.tagName() # the node really is an element.
+ n = n.nextSibling()
+}
+
+# Here we append a new element to the end of the document
+elem = doc.createElement("img")
+elem.setAttribute("src", "myimage.png")
+docElem.appendChild(elem)
+//! [16]
+
+
+//! [17]
+doc = QDomDocument("MyML")
+root = doc.createElement("MyML")
+doc.appendChild(root)
+
+tag = doc.createElement("Greeting")
+root.appendChild(tag)
+
+t = doc.createTextNode("Hello World")
+tag.appendChild(t)
+
+xml = doc.toString()
+//! [17]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xml_sax_qxml.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xml_sax_qxml.cpp
new file mode 100644
index 000000000..9df91ab39
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xml_sax_qxml.cpp
@@ -0,0 +1,3 @@
+//! [0]
+xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", True)
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qabstracturiresolver.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qabstracturiresolver.cpp
new file mode 100644
index 000000000..990a84968
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qabstracturiresolver.cpp
@@ -0,0 +1,3 @@
+//! [0]
+return baseURI.resolved(relative);
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qabstractxmlforwarditerator.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qabstractxmlforwarditerator.cpp
new file mode 100644
index 000000000..f31ea3f5c
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qabstractxmlforwarditerator.cpp
@@ -0,0 +1,3 @@
+//! [0]
+OutputType inputToOutputItem(const InputType &inputType) const;
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qabstractxmlnodemodel.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qabstractxmlnodemodel.cpp
new file mode 100644
index 000000000..0ba6de235
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qabstractxmlnodemodel.cpp
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+myInstance = QXmlNodeModelIndex();
+//! [0]
+
+//! [1]
+QFile queryFile(argv[1]);
+QFile chemistryData(argv[2]);
+QString moleculeName = argv[3];
+
+QXmlQuery query;
+query.setQuery(&queryFile, QUrl::fromLocalFile(queryFile.fileName()));
+
+ChemistryNodeModel myNodeModel(query.namePool(), chemistryData);
+QXmlNodeModelIndex startNode = myNodeModel.nodeFor(moleculeName);
+query.bindVariable("queryRoot", startNode);
+
+QFile out;
+out.open(stdout, QIODevice::WriteOnly);
+
+QXmlSerializer serializer(query, &out);
+query.evaluateTo(&serializer);
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qabstractxmlreceiver.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qabstractxmlreceiver.cpp
new file mode 100644
index 000000000..32397e331
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qabstractxmlreceiver.cpp
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+QXmlQuery query;
+query.setQuery("doc('index.html')/html/body/p[1]");
+
+QXmlSerializer serializer(query, myOutputDevice);
+query.evaluateTo(&serializer);
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qsimplexmlnodemodel.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qsimplexmlnodemodel.cpp
new file mode 100644
index 000000000..80147c840
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qsimplexmlnodemodel.cpp
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+QXmlNodeModelIndex MyTreeModel::nextFromSimpleAxis(SimpleAxis axis, const QXmlNodeModelIndex &ni) const
+{
+ // Convert the QXmlNodeModelIndex to a value that is specific to what we represent.
+ const MyValue value = toMyValue(ni);
+
+ switch(axis)
+ {
+ case Parent:
+ return toNodeIndex(value.parent());
+ case FirstChild:
+ case PreviousSibling:
+ case NextSibling:
+ // and so on
+ ;
+ }
+ return QXmlNodeModelIndex();
+}
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlformatter.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlformatter.cpp
new file mode 100644
index 000000000..3695d41d1
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlformatter.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+QXmlQuery query;
+query.setQuery("doc('index.html')/html/body/p[1]");
+
+QXmlFormatter formatter(query, myOutputDevice);
+formatter.setIndentationDepth(2);
+query.evaluateTo(&formatter);
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlname.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlname.cpp
new file mode 100644
index 000000000..033757068
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlname.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+// Fills the bits from begin to end with 1s and leaves the rest as 0.
+
+template<typename IntegralT>
+inline IntegralT bitmask(IntegralT begin, IntegralT end)
+{
+ IntegralT filled_bits = (1 << (end - begin + 1)) - 1;
+ return filled_bits << begin;
+}
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlquery.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlquery.cpp
new file mode 100644
index 000000000..a5a2706a7
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlquery.cpp
@@ -0,0 +1,202 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+ QXmlNamePool namePool(query.namePool());
+ query.bindVariable(QXmlName(namePool, localName), value);
+//! [0]
+
+
+{
+//! [1]
+ QByteArray myDocument;
+ QBuffer buffer(&myDocument); // This is a QIODevice.
+ buffer.open(QIODevice::ReadOnly);
+ QXmlQuery query;
+ query.bindVariable("myDocument", &buffer);
+ query.setQuery("doc($myDocument)");
+//! [1]
+}
+
+
+{
+ QIODevice *device = 0;
+//! [2]
+ QXmlNamePool namePool(query.namePool());
+ query.bindVariable(QXmlName(namePool, localName), device);
+//! [2]
+
+}
+
+{
+ QIODevice *myOutputDevice = 0;
+//! [3]
+ QFile xq("myquery.xq");
+
+ QXmlQuery query;
+ query.setQuery(&xq, QUrl::fromLocalFile(xq.fileName()));
+
+ QXmlSerializer serializer(query, myOutputDevice);
+ query.evaluateTo(&serializer);
+//! [3]
+}
+
+{
+ QIODevice *myOutputDevice = 0;
+//! [4]
+ QFile xq("myquery.xq");
+ QString fileName("the filename");
+ QString publisherName("the publisher");
+ qlonglong year = 1234;
+
+ QXmlQuery query;
+
+ query.bindVariable("file", QVariant(fileName));
+ query.bindVariable("publisher", QVariant(publisherName));
+ query.bindVariable("year", QVariant(year));
+
+ query.setQuery(&xq, QUrl::fromLocalFile(xq.fileName()));
+
+ QXmlSerializer serializer(query, myOutputDevice);
+ query.evaluateTo(&serializer);
+//! [4]
+}
+
+{
+//! [5]
+ QFile xq("myquery.xq");
+ QString fileName("the filename");
+ QString publisherName("the publisher");
+ qlonglong year = 1234;
+
+ QXmlQuery query;
+
+ query.bindVariable("file", QVariant(fileName));
+ query.bindVariable("publisher", QVariant(publisherName));
+ query.bindVariable("year", QVariant(year));
+
+ query.setQuery(&xq, QUrl::fromLocalFile(xq.fileName()));
+
+ QXmlResultItems result;
+ query.evaluateTo(&result);
+ QXmlItem item(result.next());
+ while (!item.isNull()) {
+ if (item.isAtomicValue()) {
+ QVariant v = item.toAtomicValue();
+ switch (v.type()) {
+ case QVariant::LongLong:
+ // xs:integer
+ break;
+ case QVariant::String:
+ // xs:string
+ break;
+ default:
+ // error
+ break;
+ }
+ }
+ else if (item.isNode()) {
+ QXmlNodeModelIndex i = item.toNodeModelIndex();
+ // process node
+ }
+ item = result.next();
+ }
+//! [5]
+}
+
+{
+//! [6]
+ QFile xq("myquery.xq");
+
+ QXmlQuery query;
+ query.setQuery(&xq, QUrl::fromLocalFile(xq.fileName()));
+
+ QXmlResultItems result;
+ query.evaluateTo(&result);
+ QXmlItem item(result.next());
+ while (!item.isNull()) {
+ if (item.isAtomicValue()) {
+ QVariant v = item.toAtomicValue();
+ switch (v.type()) {
+ case QVariant::LongLong:
+ // xs:integer
+ break;
+ case QVariant::String:
+ // xs:string
+ break;
+ default:
+ if (v.userType() == qMetaTypeId<QXmlName>()) {
+ QXmlName n = qVariantValue<QXmlName>(v);
+ // process QXmlName n...
+ }
+ else {
+ // error
+ }
+ break;
+ }
+ }
+ else if (item.isNode()) {
+ QXmlNodeModelIndex i = item.toNodeModelIndex();
+ // process node
+ }
+ item = result.next();
+ }
+//! [6]
+}
+
+{
+ QIODevice *out = 0;
+//! [7]
+ QXmlQuery query(QXmlQuery::XSLT20);
+ query.setFocus(QUrl("myInput.xml"));
+ query.setQuery(QUrl("myStylesheet.xsl"));
+ query.evaluateTo(out);
+//! [7]
+}
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlresultitems.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlresultitems.cpp
new file mode 100644
index 000000000..62bb47105
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlresultitems.cpp
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+QXmlQuery query;
+query.setQuery("<e/>, 1, 'two'");
+QXmlResultItems result;
+
+if (query.isValid()) {
+ query.evaluateTo(&result);
+ QXmlItem item(result.next());
+ while (!item.isNull()) {
+ // use item
+ item = result.next();
+ }
+ if (result.hasError())
+ /* Runtime error! */;
+}
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlserializer.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlserializer.cpp
new file mode 100644
index 000000000..32397e331
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlserializer.cpp
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+QXmlQuery query;
+query.setQuery("doc('index.html')/html/body/p[1]");
+
+QXmlSerializer serializer(query, myOutputDevice);
+query.evaluateTo(&serializer);
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_assistant_compat_lib_qassistantclient.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_assistant_compat_lib_qassistantclient.cpp
new file mode 100644
index 000000000..c0baf89ef
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_assistant_compat_lib_qassistantclient.cpp
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+ QProcess *process = new QProcess(this);
+ QString app = QLibraryInfo::location(QLibraryInfo::BinariesPath)
+ + QLatin1String("/assistant");
+
+ process->start(app, QStringList() << QLatin1String("-enableRemoteControl"));
+ if (!process->waitForStarted()) {
+ QMessageBox::critical(this, tr("Remote Control"),
+ tr("Could not start Qt Assistant from %1.").arg(app));
+ return;
+ }
+
+ // show index page
+ QTextStream str(process);
+ str << QLatin1String("SetSource qthelp://mycompany.com/doc/index.html")
+ << QLatin1Char('\0') << endl;
+ }
+//! [0]
+
+
+//! [1]
+ CONFIG += assistant
+//! [1]
+
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_extension_default_extensionfactory.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_extension_default_extensionfactory.cpp
new file mode 100644
index 000000000..4f6de9e0d
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_extension_default_extensionfactory.cpp
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+ QObject *ANewExtensionFactory::createExtension(QObject *object,
+ const QString &iid, QObject *parent) const
+ {
+ if (iid != Q_TYPEID(QDesignerContainerExtension))
+ return 0;
+
+ if (MyCustomWidget *widget = qobject_cast<MyCustomWidget*>
+ (object))
+ return new MyContainerExtension(widget, parent);
+
+ return 0;
+ }
+//! [0]
+
+
+//! [1]
+ QObject *AGeneralExtensionFactory::createExtension(QObject *object,
+ const QString &iid, QObject *parent) const
+ {
+ MyCustomWidget *widget = qobject_cast<MyCustomWidget*>(object);
+
+ if (widget && (iid == Q_TYPEID(QDesignerTaskMenuExtension))) {
+ return new MyTaskMenuExtension(widget, parent);
+
+ } else if (widget && (iid == Q_TYPEID(QDesignerContainerExtension))) {
+ return new MyContainerExtension(widget, parent);
+
+ } else {
+ return 0;
+ }
+ }
+//! [1]
+
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_extension_extension.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_extension_extension.cpp
new file mode 100644
index 000000000..14fe3764d
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_extension_extension.cpp
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+ QDesignerPropertySheetExtension *propertySheet;
+ QExtensionManager manager = formEditor->extensionManager();
+
+ propertySheet = qt_extension<QDesignerPropertySheetExtension*>(manager, widget);
+
+ if(propertySheet) {...}
+//! [0]
+
+
+//! [1]
+ Q_DECLARE_EXTENSION_INTERFACE(MyExtension, "com.mycompany.myproduct.myextension")
+//! [1]
+
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_extension_qextensionmanager.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_extension_qextensionmanager.cpp
new file mode 100644
index 000000000..dabd9f737
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_extension_qextensionmanager.cpp
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+ void MyPlugin::initialize(QDesignerFormEditorInterface *formEditor)
+ {
+ if (initialized)
+ return;
+
+ QExtensionManager *manager = formEditor->extensionManager();
+ Q_ASSERT(manager != 0);
+
+ manager->registerExtensions(new MyExtensionFactory(manager),
+ Q_TYPEID(QDesignerTaskMenuExtension));
+
+ initialized = true;
+ }
+//! [0]
+
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformeditor.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformeditor.cpp
new file mode 100644
index 000000000..2fe32e672
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformeditor.cpp
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+ QDesignerObjectInspectorInterface *objectInspector = 0;
+ objectInspector = formEditor->objectInspector();
+
+ QDesignerFormWindowManagerInterface *manager = 0;
+ manager = formEditor->formWindowManager();
+
+ objectInspector->setFormWindow(manager->formWindow(0));
+//! [0]
+
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformwindow.py b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformwindow.py
new file mode 100644
index 000000000..6cf5dd21c
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformwindow.py
@@ -0,0 +1,74 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the documentation of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+//! [0]
+ formWindow = QDesignerFormWindowInterface()
+ formWindow = QDesignerFormWindowInterface.findFormWindow(myWidget)
+//! [0]
+
+
+//! [1]
+ forms = [] # QList<QDesignerFormWindowInterface>
+ formWindow = QDesignerFormWindowInterface()
+
+ manager = formEditor.formWindowManager()
+
+ for i in range(manager.formWindowCount()):
+ formWindow = manager.formWindow(i)
+ forms.append(formWindow)
+//! [1]
+
+
+//! [2]
+ if formWindow.isManaged(myWidget):
+ formWindow.manageWidget(myWidget.childWidget)
+//! [2]
+
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformwindowcursor.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformwindowcursor.cpp
new file mode 100644
index 000000000..79b98f0ce
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformwindowcursor.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+ QDesignerFormWindowInterface *formWindow = 0;
+ formWindow = QDesignerFormWindowInterface::findFormWindow(myWidget);
+
+ formWindow->cursor()->setProperty(myWidget, myProperty, newValue);
+//! [0]
+
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformwindowmanager.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformwindowmanager.cpp
new file mode 100644
index 000000000..d6654b3eb
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformwindowmanager.cpp
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+ QDesignerFormWindowManagerInterface *manager = 0;
+ QDesignerFormWindowInterface *formWindow = 0;
+
+ manager = formEditor->formWindowManager();
+ formWindow = manager->formWindow(0);
+
+ manager->setActiveFormWindow(formWindow);
+//! [0]
+
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractobjectinspector.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractobjectinspector.cpp
new file mode 100644
index 000000000..2fe32e672
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractobjectinspector.cpp
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+ QDesignerObjectInspectorInterface *objectInspector = 0;
+ objectInspector = formEditor->objectInspector();
+
+ QDesignerFormWindowManagerInterface *manager = 0;
+ manager = formEditor->formWindowManager();
+
+ objectInspector->setFormWindow(manager->formWindow(0));
+//! [0]
+
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractpropertyeditor.py b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractpropertyeditor.py
new file mode 100644
index 000000000..1e2ac506f
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractpropertyeditor.py
@@ -0,0 +1,71 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the documentation of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+//! [0]
+ propertyEdit = QDesignerPropertyEditorInterface()
+ propertyEditor = formEditor.propertyEditor()
+
+ propertyEditor.propertyChanged.connect(self.checkProperty)
+//! [0]
+
+
+//! [1]
+ def checkProperty(self, property, value):
+ propertyEditor = QDesignerPropertyEditorInterface()
+ propertyEditor = formEditor.propertyEditor()
+
+ object = propertyeditor.object()
+ widget = MyCustomWidget(object)
+
+ if (widget and property == aProperty and value != expectedValue):
+ # ...
+//! [1]
+
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractwidgetbox.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractwidgetbox.cpp
new file mode 100644
index 000000000..7c0a4150a
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractwidgetbox.cpp
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+ QDesignerWidgetBoxInterface *widgetBox = 0:
+ widgetBox = formEditor->widgetBox();
+
+ widgetBox->load();
+//! [0]
+
+
+//! [1]
+ QString originalFile = widgetBox->fileName();
+
+ widgetBox->setFileName("myWidgetBox.xml");
+ widgetBox->save();
+//! [1]
+
+
+//! [2]
+ widgetBox->setFileName(originalFile);
+ widgetBox->load();
+//! [2]
+
+
+//! [3]
+ if (widgetBox->filename() != "myWidgetBox.xml") {
+ widgetBox->setFileName("myWidgetBox.xml");
+ widgetBox->load();
+ }
+//! [3]
+
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_uilib_abstractformbuilder.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_uilib_abstractformbuilder.cpp
new file mode 100644
index 000000000..781ce7542
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_uilib_abstractformbuilder.cpp
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+ MyForm::MyForm(QWidget *parent)
+ : QWidget(parent)
+ {
+ QFormBuilder builder;
+ QFile file(":/forms/myWidget.ui");
+ file.open(QFile::ReadOnly);
+ QWidget *myWidget = builder.load(&file, this);
+ file.close();
+
+ QVBoxLayout *layout = new QVBoxLayout;
+ layout->addWidget(myWidget);
+ setLayout(layout);
+ }
+//! [0]
+
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_uilib_formbuilder.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_uilib_formbuilder.cpp
new file mode 100644
index 000000000..fc58aa505
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_uilib_formbuilder.cpp
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+ MyForm::MyForm(QWidget *parent)
+ : QWidget(parent)
+ {
+ QFormBuilder builder;
+ QFile file(":/forms/myWidget.ui");
+ file.open(QFile::ReadOnly);
+ QWidget *myWidget = builder.load(&file, this);
+ file.close();
+
+ QVBoxLayout *layout = new QVBoxLayout;
+ layout->addWidget(myWidget);
+ setLayout(layout);
+ }
+//! [0]
+
+
+//! [1]
+ <!DOCTYPE RCC><RCC version="1.0">
+ <qresource prefix="/forms">
+ <file>mywidget.ui</file>
+ </qresource>
+ </RCC>
+//! [1]
+
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_patternist_qapplicationargumentparser.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_patternist_qapplicationargumentparser.cpp
new file mode 100644
index 000000000..91bd24bc3
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_patternist_qapplicationargumentparser.cpp
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+ \include main.cpp
+//! [0]
+
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_shared_qtgradienteditor_qtgradientdialog.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_shared_qtgradienteditor_qtgradientdialog.cpp
new file mode 100644
index 000000000..a9c6a26c9
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_shared_qtgradienteditor_qtgradientdialog.cpp
@@ -0,0 +1,94 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+ bool ok;
+ QGradient gradient = QtGradientDialog::getGradient(&ok, QRadialGradient(), this);
+ if (ok) {
+ // the user clicked OK and gradient is set to the gradient the user selected
+ } else {
+ // the user canceled the dialog; gradient is set to the initial
+ // value, in this case radial gradient
+ }
+//! [0]
+
+
+//! [1]
+ bool detailsVisible;
+ QColor::Spec spec;
+ QGradient gradient;
+
+ QtGradientDialog dlg(this);
+ dlg.setDetailsVisible(detailsVisible);
+ dlg.setSpec(spec);
+ dlg.setGradient(gradient);
+ if (dlg.exec() != QDialog::Accepted)
+ return;
+
+ gradient = dlg.gradient();
+ // detailsVisible and spec properties can be changed interactively by the user too,
+ // we store the values of these properties for the next time QtGradientDialog is executed.
+ detailsVisible = dlg.detailsVisible();
+ spec = dlg.spec();
+//! [1]
+
+
+//! [2]
+ QtGradientDialog dlg;
+ dlg.setBackgroundCheckered(true);
+//! [2]
+
+
+//! [3]
+ QtGradientDialog dlg;
+ dlg.setBackgroundCheckered(false);
+//! [3]
+
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_shared_qtpropertybrowser_qtpropertybrowser.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_shared_qtpropertybrowser_qtpropertybrowser.cpp
new file mode 100644
index 000000000..64bdb67f5
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_shared_qtpropertybrowser_qtpropertybrowser.cpp
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+ QtSpinBoxFactory *factory;
+ QSet<QtIntPropertyManager *> managers = factory->propertyManagers();
+//! [0]
+
+
+//! [1]
+ QtBrowserItem *item;
+ QList<QtBrowserItem *> childrenItems = item->children();
+
+ QList<QtProperty *> childrenProperties = item->property()->subProperties();
+//! [1]
+
+
+//! [2]
+ QtProperty *property1, *property2, *property3;
+
+ property2->addSubProperty(property1);
+ property3->addSubProperty(property2);
+
+ QtAbstractPropertyBrowser *editor;
+
+ editor->addProperty(property1);
+ editor->addProperty(property2);
+ editor->addProperty(property3);
+//! [2]
+
+
+//! [3]
+ QtIntPropertyManager *intManager;
+ QtDoublePropertyManager *doubleManager;
+
+ QtProperty *myInteger = intManager->addProperty();
+ QtProperty *myDouble = doubleManager->addProperty();
+
+ QtSpinBoxFactory *spinBoxFactory;
+ QtDoubleSpinBoxFactory *doubleSpinBoxFactory;
+
+ QtAbstractPropertyBrowser *editor;
+ editor->setFactoryForManager(intManager, spinBoxFactory);
+ editor->setFactoryForManager(doubleManager, doubleSpinBoxFactory);
+
+ editor->addProperty(myInteger);
+ editor->addProperty(myDouble);
+//! [3]
+
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_shared_qtpropertybrowser_qtvariantproperty.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_shared_qtpropertybrowser_qtvariantproperty.cpp
new file mode 100644
index 000000000..95de10d4d
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_shared_qtpropertybrowser_qtvariantproperty.cpp
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+ QtVariantPropertyManager *variantPropertyManager;
+ QtProperty *property;
+
+ variantPropertyManager->setValue(property, 10);
+//! [0]
+
+
+//! [1]
+ QtVariantPropertyManager *variantPropertyManager;
+ QtVariantProperty *property;
+
+ property->setValue(10);
+//! [1]
+
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_shared_qttoolbardialog_qttoolbardialog.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_shared_qttoolbardialog_qttoolbardialog.cpp
new file mode 100644
index 000000000..93a9b53c1
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_shared_qttoolbardialog_qttoolbardialog.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+ QtToolBarManager *toolBarManager;
+
+ void MyMainWindow::customize()
+ {
+ QtToolBarDialog dialog(this);
+ dialog.setToolBarManager(toolBarManager);
+ dialog.exec();
+ }
+//! [0]
+
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/console/dbus_pingpong.txt b/sources/pyside6/doc/codesnippets/doc/src/snippets/console/dbus_pingpong.txt
new file mode 100644
index 000000000..3c700db5c
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/console/dbus_pingpong.txt
@@ -0,0 +1,3 @@
+[qtuser@workstation:~/dev/qt-4.4/examples/dbus/pingpong]$ ./pong &
+[qtuser@workstation:~/dev/qt-4.4/examples/dbus/pingpong]$ ./ping Hello
+Reply was: ping("Hello") got called
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/customstyle/customstyle.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/customstyle/customstyle.h
new file mode 100644
index 000000000..8aead8e9c
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/customstyle/customstyle.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 CUSTOMSTYLE_H
+#define CUSTOMSTYLE_H
+
+#include <QProxyStyle>
+
+//! [0]
+class CustomStyle(QProxyStyle):
+ ...
+
+ def drawPrimitive(PrimitiveElement element, const QStyleOption *option,
+ QPainter *painter, const QWidget *widget) const;
+ # element : PrimitiveElement
+ # option : QStyleOption
+ # painter : QPainter
+ # widget : QWidget
+ ...
+//! [0]
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/autoconnection/imagedialog.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/autoconnection/imagedialog.h
new file mode 100644
index 000000000..d5852c9c3
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/autoconnection/imagedialog.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 IMAGEDIALOG_H
+#define IMAGEDIALOG_H
+
+#include "ui_imagedialog.h"
+
+//! [0]
+class ImageDialog : public QDialog, private Ui::ImageDialog
+{
+ Q_OBJECT
+
+public:
+ ImageDialog(QWidget *parent = 0);
+
+private slots:
+ void on_okButton_clicked();
+};
+//! [0]
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/autoconnection/imagedialog.ui b/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/autoconnection/imagedialog.ui
new file mode 100644
index 000000000..1c5e546f2
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/autoconnection/imagedialog.ui
@@ -0,0 +1,389 @@
+<ui version="4.0" >
+ <comment></comment>
+ <class>ImageDialog</class>
+ <widget class="QDialog" >
+ <property name="objectName" >
+ <string notr="true" >ImageDialog</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>320</width>
+ <height>180</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Create Image</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <layout class="QGridLayout" >
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="margin" >
+ <number>1</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="widthLabel" >
+ <property name="objectName" >
+ <string notr="true" >widthLabel</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>27</y>
+ <width>67</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="text" >
+ <string>Width:</string>
+ </property>
+ <property name="textFormat" >
+ <enum>Qt::AutoText</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="heightLabel" >
+ <property name="objectName" >
+ <string notr="true" >heightLabel</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>55</y>
+ <width>67</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="text" >
+ <string>Height:</string>
+ </property>
+ <property name="textFormat" >
+ <enum>Qt::AutoText</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QComboBox" name="colorDepthCombo" >
+ <property name="objectName" >
+ <string notr="true" >colorDepthCombo</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>74</x>
+ <y>83</y>
+ <width>227</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="insertPolicy" >
+ <enum>QComboBox::InsertAtBottom</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="nameLineEdit" >
+ <property name="objectName" >
+ <string notr="true" >nameLineEdit</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>74</x>
+ <y>83</y>
+ <width>227</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Untitled image</string>
+ </property>
+ <property name="echoMode" >
+ <enum>QLineEdit::Normal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QSpinBox" name="spinBox" >
+ <property name="objectName" >
+ <string notr="true" >spinBox</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>74</x>
+ <y>1</y>
+ <width>227</width>
+ <height>20</height>
+ </rect>
+ </property>
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="buttonSymbols" >
+ <enum>QAbstractSpinBox::UpDownArrows</enum>
+ </property>
+ <property name="value" >
+ <number>32</number>
+ </property>
+ <property name="maximum" >
+ <number>1024</number>
+ </property>
+ <property name="minimum" >
+ <number>1</number>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QSpinBox" name="spinBox_2" >
+ <property name="objectName" >
+ <string notr="true" >spinBox_2</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>74</x>
+ <y>27</y>
+ <width>227</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="buttonSymbols" >
+ <enum>QAbstractSpinBox::UpDownArrows</enum>
+ </property>
+ <property name="value" >
+ <number>32</number>
+ </property>
+ <property name="maximum" >
+ <number>1024</number>
+ </property>
+ <property name="minimum" >
+ <number>1</number>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0" >
+ <widget class="QLabel" name="nameLabel" >
+ <property name="objectName" >
+ <string notr="true" >nameLabel</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>1</y>
+ <width>67</width>
+ <height>20</height>
+ </rect>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="text" >
+ <string>Name:</string>
+ </property>
+ <property name="textFormat" >
+ <enum>Qt::AutoText</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="colorDepthLabel" >
+ <property name="objectName" >
+ <string notr="true" >colorDepthLabel</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>83</y>
+ <width>67</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="text" >
+ <string>Color depth:</string>
+ </property>
+ <property name="textFormat" >
+ <enum>Qt::AutoText</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>9</x>
+ <y>121</y>
+ <width>302</width>
+ <height>18</height>
+ </rect>
+ </property>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="margin" >
+ <number>1</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <spacer>
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>1</y>
+ <width>128</width>
+ <height>24</height>
+ </rect>
+ </property>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="okButton" >
+ <property name="objectName" >
+ <string notr="true" >okButton</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>135</x>
+ <y>1</y>
+ <width>80</width>
+ <height>24</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>OK</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="cancelButton" >
+ <property name="objectName" >
+ <string notr="true" >cancelButton</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>221</x>
+ <y>1</y>
+ <width>80</width>
+ <height>24</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>Cancel</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <pixmapfunction></pixmapfunction>
+ <tabstops>
+ <tabstop>nameLineEdit</tabstop>
+ <tabstop>spinBox</tabstop>
+ <tabstop>spinBox_2</tabstop>
+ <tabstop>colorDepthCombo</tabstop>
+ <tabstop>okButton</tabstop>
+ <tabstop>cancelButton</tabstop>
+ </tabstops>
+ <connections>
+ <connection>
+ <sender>nameLineEdit</sender>
+ <signal>returnPressed()</signal>
+ <receiver>okButton</receiver>
+ <slot>animateClick()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>-1</x>
+ <y>7</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>-1</x>
+ <y>7</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/imagedialog/imagedialog.ui b/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/imagedialog/imagedialog.ui
new file mode 100644
index 000000000..1c5e546f2
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/imagedialog/imagedialog.ui
@@ -0,0 +1,389 @@
+<ui version="4.0" >
+ <comment></comment>
+ <class>ImageDialog</class>
+ <widget class="QDialog" >
+ <property name="objectName" >
+ <string notr="true" >ImageDialog</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>320</width>
+ <height>180</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Create Image</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <layout class="QGridLayout" >
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="margin" >
+ <number>1</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="widthLabel" >
+ <property name="objectName" >
+ <string notr="true" >widthLabel</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>27</y>
+ <width>67</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="text" >
+ <string>Width:</string>
+ </property>
+ <property name="textFormat" >
+ <enum>Qt::AutoText</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="heightLabel" >
+ <property name="objectName" >
+ <string notr="true" >heightLabel</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>55</y>
+ <width>67</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="text" >
+ <string>Height:</string>
+ </property>
+ <property name="textFormat" >
+ <enum>Qt::AutoText</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QComboBox" name="colorDepthCombo" >
+ <property name="objectName" >
+ <string notr="true" >colorDepthCombo</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>74</x>
+ <y>83</y>
+ <width>227</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="insertPolicy" >
+ <enum>QComboBox::InsertAtBottom</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="nameLineEdit" >
+ <property name="objectName" >
+ <string notr="true" >nameLineEdit</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>74</x>
+ <y>83</y>
+ <width>227</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Untitled image</string>
+ </property>
+ <property name="echoMode" >
+ <enum>QLineEdit::Normal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QSpinBox" name="spinBox" >
+ <property name="objectName" >
+ <string notr="true" >spinBox</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>74</x>
+ <y>1</y>
+ <width>227</width>
+ <height>20</height>
+ </rect>
+ </property>
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="buttonSymbols" >
+ <enum>QAbstractSpinBox::UpDownArrows</enum>
+ </property>
+ <property name="value" >
+ <number>32</number>
+ </property>
+ <property name="maximum" >
+ <number>1024</number>
+ </property>
+ <property name="minimum" >
+ <number>1</number>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QSpinBox" name="spinBox_2" >
+ <property name="objectName" >
+ <string notr="true" >spinBox_2</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>74</x>
+ <y>27</y>
+ <width>227</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="buttonSymbols" >
+ <enum>QAbstractSpinBox::UpDownArrows</enum>
+ </property>
+ <property name="value" >
+ <number>32</number>
+ </property>
+ <property name="maximum" >
+ <number>1024</number>
+ </property>
+ <property name="minimum" >
+ <number>1</number>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0" >
+ <widget class="QLabel" name="nameLabel" >
+ <property name="objectName" >
+ <string notr="true" >nameLabel</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>1</y>
+ <width>67</width>
+ <height>20</height>
+ </rect>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="text" >
+ <string>Name:</string>
+ </property>
+ <property name="textFormat" >
+ <enum>Qt::AutoText</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="colorDepthLabel" >
+ <property name="objectName" >
+ <string notr="true" >colorDepthLabel</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>83</y>
+ <width>67</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="text" >
+ <string>Color depth:</string>
+ </property>
+ <property name="textFormat" >
+ <enum>Qt::AutoText</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>9</x>
+ <y>121</y>
+ <width>302</width>
+ <height>18</height>
+ </rect>
+ </property>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="margin" >
+ <number>1</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <spacer>
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>1</y>
+ <width>128</width>
+ <height>24</height>
+ </rect>
+ </property>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="okButton" >
+ <property name="objectName" >
+ <string notr="true" >okButton</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>135</x>
+ <y>1</y>
+ <width>80</width>
+ <height>24</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>OK</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="cancelButton" >
+ <property name="objectName" >
+ <string notr="true" >cancelButton</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>221</x>
+ <y>1</y>
+ <width>80</width>
+ <height>24</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>Cancel</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <pixmapfunction></pixmapfunction>
+ <tabstops>
+ <tabstop>nameLineEdit</tabstop>
+ <tabstop>spinBox</tabstop>
+ <tabstop>spinBox_2</tabstop>
+ <tabstop>colorDepthCombo</tabstop>
+ <tabstop>okButton</tabstop>
+ <tabstop>cancelButton</tabstop>
+ </tabstops>
+ <connections>
+ <connection>
+ <sender>nameLineEdit</sender>
+ <signal>returnPressed()</signal>
+ <receiver>okButton</receiver>
+ <slot>animateClick()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>-1</x>
+ <y>7</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>-1</x>
+ <y>7</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/multipleinheritance/imagedialog.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/multipleinheritance/imagedialog.h
new file mode 100644
index 000000000..1b95cb310
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/multipleinheritance/imagedialog.h
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 IMAGEDIALOG_H
+#define IMAGEDIALOG_H
+
+#include "ui_imagedialog.h"
+
+class ImageDialog : public QDialog, private Ui::ImageDialog
+{
+ Q_OBJECT
+
+public:
+ ImageDialog(QWidget *parent = 0);
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/multipleinheritance/imagedialog.ui b/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/multipleinheritance/imagedialog.ui
new file mode 100644
index 000000000..1c5e546f2
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/multipleinheritance/imagedialog.ui
@@ -0,0 +1,389 @@
+<ui version="4.0" >
+ <comment></comment>
+ <class>ImageDialog</class>
+ <widget class="QDialog" >
+ <property name="objectName" >
+ <string notr="true" >ImageDialog</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>320</width>
+ <height>180</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Create Image</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <layout class="QGridLayout" >
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="margin" >
+ <number>1</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="widthLabel" >
+ <property name="objectName" >
+ <string notr="true" >widthLabel</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>27</y>
+ <width>67</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="text" >
+ <string>Width:</string>
+ </property>
+ <property name="textFormat" >
+ <enum>Qt::AutoText</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="heightLabel" >
+ <property name="objectName" >
+ <string notr="true" >heightLabel</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>55</y>
+ <width>67</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="text" >
+ <string>Height:</string>
+ </property>
+ <property name="textFormat" >
+ <enum>Qt::AutoText</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QComboBox" name="colorDepthCombo" >
+ <property name="objectName" >
+ <string notr="true" >colorDepthCombo</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>74</x>
+ <y>83</y>
+ <width>227</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="insertPolicy" >
+ <enum>QComboBox::InsertAtBottom</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="nameLineEdit" >
+ <property name="objectName" >
+ <string notr="true" >nameLineEdit</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>74</x>
+ <y>83</y>
+ <width>227</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Untitled image</string>
+ </property>
+ <property name="echoMode" >
+ <enum>QLineEdit::Normal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QSpinBox" name="spinBox" >
+ <property name="objectName" >
+ <string notr="true" >spinBox</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>74</x>
+ <y>1</y>
+ <width>227</width>
+ <height>20</height>
+ </rect>
+ </property>
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="buttonSymbols" >
+ <enum>QAbstractSpinBox::UpDownArrows</enum>
+ </property>
+ <property name="value" >
+ <number>32</number>
+ </property>
+ <property name="maximum" >
+ <number>1024</number>
+ </property>
+ <property name="minimum" >
+ <number>1</number>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QSpinBox" name="spinBox_2" >
+ <property name="objectName" >
+ <string notr="true" >spinBox_2</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>74</x>
+ <y>27</y>
+ <width>227</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="buttonSymbols" >
+ <enum>QAbstractSpinBox::UpDownArrows</enum>
+ </property>
+ <property name="value" >
+ <number>32</number>
+ </property>
+ <property name="maximum" >
+ <number>1024</number>
+ </property>
+ <property name="minimum" >
+ <number>1</number>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0" >
+ <widget class="QLabel" name="nameLabel" >
+ <property name="objectName" >
+ <string notr="true" >nameLabel</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>1</y>
+ <width>67</width>
+ <height>20</height>
+ </rect>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="text" >
+ <string>Name:</string>
+ </property>
+ <property name="textFormat" >
+ <enum>Qt::AutoText</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="colorDepthLabel" >
+ <property name="objectName" >
+ <string notr="true" >colorDepthLabel</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>83</y>
+ <width>67</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="text" >
+ <string>Color depth:</string>
+ </property>
+ <property name="textFormat" >
+ <enum>Qt::AutoText</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>9</x>
+ <y>121</y>
+ <width>302</width>
+ <height>18</height>
+ </rect>
+ </property>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="margin" >
+ <number>1</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <spacer>
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>1</y>
+ <width>128</width>
+ <height>24</height>
+ </rect>
+ </property>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="okButton" >
+ <property name="objectName" >
+ <string notr="true" >okButton</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>135</x>
+ <y>1</y>
+ <width>80</width>
+ <height>24</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>OK</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="cancelButton" >
+ <property name="objectName" >
+ <string notr="true" >cancelButton</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>221</x>
+ <y>1</y>
+ <width>80</width>
+ <height>24</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>Cancel</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <pixmapfunction></pixmapfunction>
+ <tabstops>
+ <tabstop>nameLineEdit</tabstop>
+ <tabstop>spinBox</tabstop>
+ <tabstop>spinBox_2</tabstop>
+ <tabstop>colorDepthCombo</tabstop>
+ <tabstop>okButton</tabstop>
+ <tabstop>cancelButton</tabstop>
+ </tabstops>
+ <connections>
+ <connection>
+ <sender>nameLineEdit</sender>
+ <signal>returnPressed()</signal>
+ <receiver>okButton</receiver>
+ <slot>animateClick()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>-1</x>
+ <y>7</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>-1</x>
+ <y>7</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/noautoconnection/imagedialog.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/noautoconnection/imagedialog.h
new file mode 100644
index 000000000..16ff0ec18
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/noautoconnection/imagedialog.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 IMAGEDIALOG_H
+#define IMAGEDIALOG_H
+
+#include "ui_imagedialog.h"
+
+//! [0]
+class ImageDialog : public QDialog, private Ui::ImageDialog
+{
+ Q_OBJECT
+
+public:
+ ImageDialog(QWidget *parent = 0);
+
+private slots:
+ void checkValues();
+};
+//! [0]
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/noautoconnection/imagedialog.ui b/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/noautoconnection/imagedialog.ui
new file mode 100644
index 000000000..1c5e546f2
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/noautoconnection/imagedialog.ui
@@ -0,0 +1,389 @@
+<ui version="4.0" >
+ <comment></comment>
+ <class>ImageDialog</class>
+ <widget class="QDialog" >
+ <property name="objectName" >
+ <string notr="true" >ImageDialog</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>320</width>
+ <height>180</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Create Image</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <layout class="QGridLayout" >
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="margin" >
+ <number>1</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="widthLabel" >
+ <property name="objectName" >
+ <string notr="true" >widthLabel</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>27</y>
+ <width>67</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="text" >
+ <string>Width:</string>
+ </property>
+ <property name="textFormat" >
+ <enum>Qt::AutoText</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="heightLabel" >
+ <property name="objectName" >
+ <string notr="true" >heightLabel</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>55</y>
+ <width>67</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="text" >
+ <string>Height:</string>
+ </property>
+ <property name="textFormat" >
+ <enum>Qt::AutoText</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QComboBox" name="colorDepthCombo" >
+ <property name="objectName" >
+ <string notr="true" >colorDepthCombo</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>74</x>
+ <y>83</y>
+ <width>227</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="insertPolicy" >
+ <enum>QComboBox::InsertAtBottom</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="nameLineEdit" >
+ <property name="objectName" >
+ <string notr="true" >nameLineEdit</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>74</x>
+ <y>83</y>
+ <width>227</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Untitled image</string>
+ </property>
+ <property name="echoMode" >
+ <enum>QLineEdit::Normal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QSpinBox" name="spinBox" >
+ <property name="objectName" >
+ <string notr="true" >spinBox</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>74</x>
+ <y>1</y>
+ <width>227</width>
+ <height>20</height>
+ </rect>
+ </property>
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="buttonSymbols" >
+ <enum>QAbstractSpinBox::UpDownArrows</enum>
+ </property>
+ <property name="value" >
+ <number>32</number>
+ </property>
+ <property name="maximum" >
+ <number>1024</number>
+ </property>
+ <property name="minimum" >
+ <number>1</number>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QSpinBox" name="spinBox_2" >
+ <property name="objectName" >
+ <string notr="true" >spinBox_2</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>74</x>
+ <y>27</y>
+ <width>227</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="buttonSymbols" >
+ <enum>QAbstractSpinBox::UpDownArrows</enum>
+ </property>
+ <property name="value" >
+ <number>32</number>
+ </property>
+ <property name="maximum" >
+ <number>1024</number>
+ </property>
+ <property name="minimum" >
+ <number>1</number>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0" >
+ <widget class="QLabel" name="nameLabel" >
+ <property name="objectName" >
+ <string notr="true" >nameLabel</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>1</y>
+ <width>67</width>
+ <height>20</height>
+ </rect>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="text" >
+ <string>Name:</string>
+ </property>
+ <property name="textFormat" >
+ <enum>Qt::AutoText</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="colorDepthLabel" >
+ <property name="objectName" >
+ <string notr="true" >colorDepthLabel</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>83</y>
+ <width>67</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="text" >
+ <string>Color depth:</string>
+ </property>
+ <property name="textFormat" >
+ <enum>Qt::AutoText</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>9</x>
+ <y>121</y>
+ <width>302</width>
+ <height>18</height>
+ </rect>
+ </property>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="margin" >
+ <number>1</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <spacer>
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>1</y>
+ <width>128</width>
+ <height>24</height>
+ </rect>
+ </property>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="okButton" >
+ <property name="objectName" >
+ <string notr="true" >okButton</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>135</x>
+ <y>1</y>
+ <width>80</width>
+ <height>24</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>OK</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="cancelButton" >
+ <property name="objectName" >
+ <string notr="true" >cancelButton</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>221</x>
+ <y>1</y>
+ <width>80</width>
+ <height>24</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>Cancel</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <pixmapfunction></pixmapfunction>
+ <tabstops>
+ <tabstop>nameLineEdit</tabstop>
+ <tabstop>spinBox</tabstop>
+ <tabstop>spinBox_2</tabstop>
+ <tabstop>colorDepthCombo</tabstop>
+ <tabstop>okButton</tabstop>
+ <tabstop>cancelButton</tabstop>
+ </tabstops>
+ <connections>
+ <connection>
+ <sender>nameLineEdit</sender>
+ <signal>returnPressed()</signal>
+ <receiver>okButton</receiver>
+ <slot>animateClick()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>-1</x>
+ <y>7</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>-1</x>
+ <y>7</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/singleinheritance/imagedialog.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/singleinheritance/imagedialog.h
new file mode 100644
index 000000000..a14a628f2
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/singleinheritance/imagedialog.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 IMAGEDIALOG_H
+#define IMAGEDIALOG_H
+
+#include "ui_imagedialog.h"
+
+class ImageDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ ImageDialog(QWidget *parent = 0);
+
+private:
+ Ui::ImageDialog ui;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/singleinheritance/imagedialog.ui b/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/singleinheritance/imagedialog.ui
new file mode 100644
index 000000000..1c5e546f2
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/singleinheritance/imagedialog.ui
@@ -0,0 +1,389 @@
+<ui version="4.0" >
+ <comment></comment>
+ <class>ImageDialog</class>
+ <widget class="QDialog" >
+ <property name="objectName" >
+ <string notr="true" >ImageDialog</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>320</width>
+ <height>180</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Create Image</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <layout class="QGridLayout" >
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="margin" >
+ <number>1</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="widthLabel" >
+ <property name="objectName" >
+ <string notr="true" >widthLabel</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>27</y>
+ <width>67</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="text" >
+ <string>Width:</string>
+ </property>
+ <property name="textFormat" >
+ <enum>Qt::AutoText</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="heightLabel" >
+ <property name="objectName" >
+ <string notr="true" >heightLabel</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>55</y>
+ <width>67</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="text" >
+ <string>Height:</string>
+ </property>
+ <property name="textFormat" >
+ <enum>Qt::AutoText</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QComboBox" name="colorDepthCombo" >
+ <property name="objectName" >
+ <string notr="true" >colorDepthCombo</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>74</x>
+ <y>83</y>
+ <width>227</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="insertPolicy" >
+ <enum>QComboBox::InsertAtBottom</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="nameLineEdit" >
+ <property name="objectName" >
+ <string notr="true" >nameLineEdit</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>74</x>
+ <y>83</y>
+ <width>227</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Untitled image</string>
+ </property>
+ <property name="echoMode" >
+ <enum>QLineEdit::Normal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QSpinBox" name="spinBox" >
+ <property name="objectName" >
+ <string notr="true" >spinBox</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>74</x>
+ <y>1</y>
+ <width>227</width>
+ <height>20</height>
+ </rect>
+ </property>
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="buttonSymbols" >
+ <enum>QAbstractSpinBox::UpDownArrows</enum>
+ </property>
+ <property name="value" >
+ <number>32</number>
+ </property>
+ <property name="maximum" >
+ <number>1024</number>
+ </property>
+ <property name="minimum" >
+ <number>1</number>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QSpinBox" name="spinBox_2" >
+ <property name="objectName" >
+ <string notr="true" >spinBox_2</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>74</x>
+ <y>27</y>
+ <width>227</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="buttonSymbols" >
+ <enum>QAbstractSpinBox::UpDownArrows</enum>
+ </property>
+ <property name="value" >
+ <number>32</number>
+ </property>
+ <property name="maximum" >
+ <number>1024</number>
+ </property>
+ <property name="minimum" >
+ <number>1</number>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0" >
+ <widget class="QLabel" name="nameLabel" >
+ <property name="objectName" >
+ <string notr="true" >nameLabel</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>1</y>
+ <width>67</width>
+ <height>20</height>
+ </rect>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="text" >
+ <string>Name:</string>
+ </property>
+ <property name="textFormat" >
+ <enum>Qt::AutoText</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="colorDepthLabel" >
+ <property name="objectName" >
+ <string notr="true" >colorDepthLabel</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>83</y>
+ <width>67</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="text" >
+ <string>Color depth:</string>
+ </property>
+ <property name="textFormat" >
+ <enum>Qt::AutoText</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>9</x>
+ <y>121</y>
+ <width>302</width>
+ <height>18</height>
+ </rect>
+ </property>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="margin" >
+ <number>1</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <spacer>
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>1</y>
+ <width>128</width>
+ <height>24</height>
+ </rect>
+ </property>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="okButton" >
+ <property name="objectName" >
+ <string notr="true" >okButton</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>135</x>
+ <y>1</y>
+ <width>80</width>
+ <height>24</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>OK</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="cancelButton" >
+ <property name="objectName" >
+ <string notr="true" >cancelButton</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>221</x>
+ <y>1</y>
+ <width>80</width>
+ <height>24</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>Cancel</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <pixmapfunction></pixmapfunction>
+ <tabstops>
+ <tabstop>nameLineEdit</tabstop>
+ <tabstop>spinBox</tabstop>
+ <tabstop>spinBox_2</tabstop>
+ <tabstop>colorDepthCombo</tabstop>
+ <tabstop>okButton</tabstop>
+ <tabstop>cancelButton</tabstop>
+ </tabstops>
+ <connections>
+ <connection>
+ <sender>nameLineEdit</sender>
+ <signal>returnPressed()</signal>
+ <receiver>okButton</receiver>
+ <slot>animateClick()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>-1</x>
+ <y>7</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>-1</x>
+ <y>7</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/dialogs/dialogs.py b/sources/pyside6/doc/codesnippets/doc/src/snippets/dialogs/dialogs.py
new file mode 100644
index 000000000..7bdcb0c91
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/dialogs/dialogs.py
@@ -0,0 +1,123 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+
+//! [0]
+def find(self):
+ if not self.findDialog:
+ self.findDialog = FindDialog(self)
+ self.findDialog.findNext.connect(self.findNext)
+
+ self.findDialog.show()
+ self.findDialog.raise()
+ self.findDialog.activateWindow()
+
+//! [0]
+
+//! [1]
+def countWords(self):
+ dialog = WordCountDialog(self)
+ dialog.setWordCount(document().wordCount())
+ dialog.exec_()
+
+//! [1]
+
+//! [2]
+ mb = QMessageBox("Application Name",
+ "Hardware failure.\n\nDisk error detected\nDo you want to stop?",
+ QMessageBox.Question,
+ QMessageBox.Yes | QMessageBox.Default,
+ QMessageBox.No | QMessageBox.Escape,
+ QMessageBox.NoButton)
+ if mb.exec() == QMessageBox.No:
+ # try again
+//! [2]
+
+//! [3]
+ progress = QProgressDialog("Copying files...", "Abort Copy", 0, numFiles, self)
+ progress.setWindowModality(Qt.WindowModal)
+
+ for i in range(numFiles):
+ progress.setValue(i)
+
+ if progress.wasCanceled():
+ break
+ #... copy one file
+
+ progress.setValue(numFiles)
+//! [3]
+
+//! [4]
+# Operation constructor
+def __init__(self, parent=None):
+ QObject.__init__(self, parent)
+
+ pd = QProgressDialog("Operation in progress.", "Cancel", 0, 100)
+ pd.canceled.connect(self.cancel)
+ t = QTimer(self)
+ t.timeout.connect(self.perform)
+ t.start(0)
+
+//! [4] //! [5]
+
+def perform(self):
+ pd.setValue(steps)
+ #... perform one percent of the operation
+ steps += 1
+ if steps > pd.maximum():
+ t.stop()
+
+//! [5] //! [6]
+
+def cancel(self):
+ t.stop()
+ #... cleanup
+
+//! [6]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/doc_src_qtcharts.py b/sources/pyside6/doc/codesnippets/doc/src/snippets/doc_src_qtcharts.py
new file mode 100644
index 000000000..e8364cd7c
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/doc_src_qtcharts.py
@@ -0,0 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [0]
+import PySide6.QtCharts
+//! [0]
+
+//! [3]
+series = QtCharts.QLineSeries()
+series.append(0,6)
+series.append(2,4)
+...
+chartView = QtCharts.QChartView()
+chartView.chart().addSeries(series)
+chartView.chart().createDefaultAxes()
+chartView.show()
+//! [3]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/doc_src_qtgui.py b/sources/pyside6/doc/codesnippets/doc/src/snippets/doc_src_qtgui.py
new file mode 100644
index 000000000..206cea4ad
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/doc_src_qtgui.py
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+import PySide6.QtCore
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/doc_src_qtmultimedia.py b/sources/pyside6/doc/codesnippets/doc/src/snippets/doc_src_qtmultimedia.py
new file mode 100644
index 000000000..7b5945258
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/doc_src_qtmultimedia.py
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+import PySide6.QtMultimedia
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/doc_src_qtxmlpatterns.py b/sources/pyside6/doc/codesnippets/doc/src/snippets/doc_src_qtxmlpatterns.py
new file mode 100644
index 000000000..211c25430
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/doc_src_qtxmlpatterns.py
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+
+//! [0]
+import PySide6.QtXmlPatterns
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/modules.html b/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/modules.html
new file mode 100644
index 000000000..9c67393da
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/modules.html
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<!-- /home/dboddie/dev/qt-4.0/doc/src/classes.qdoc -->
+<head>
+ <title>Qt 4.0: Qt Classes by Module</title>
+ <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
+a:link { color: #004faf; text-decoration: none }
+a:visited { color: #672967; text-decoration: none }
+td.postheader { font-family: sans-serif }
+tr.address { font-family: sans-serif }
+body { background: #ffffff; color: black; }</style>
+ <link rel="next" href="qtcore.html" />
+ <link rel="start" href="index.html" />
+</head>
+<body>
+<h1 align="center">Qt Classes by Module</h1>
+<table align="center" cellpadding="2" cellspacing="1" border="0">
+<tr valign="top" bgcolor="#f0f0f0"><td>QtCore</td><td>Core classes used by other modules.</td></tr>
+<tr valign="top" bgcolor="#e0e0e0"><td>QtGui</td><td>Graphical User Interface components</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td>QtNetwork</td><td>Classes for network programming.</td></tr>
+<tr valign="top" bgcolor="#e0e0e0"><td>QtOpenGL</td><td>OpenGL support classes.</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td>QtSql</td><td>Classes for database integration using SQL.</td></tr>
+<tr valign="top" bgcolor="#e0e0e0"><td>QtXml</td><td>Classes for handling XML.</td></tr>
+</table>
+</body>
+</html>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtcore.html b/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtcore.html
new file mode 100644
index 000000000..947ad4038
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtcore.html
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<!-- /home/dboddie/dev/qt-4.0/doc/src/classes.qdoc -->
+<head>
+ <title>Qt 4.0: QtCore Classes</title>
+ <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
+a:link { color: #004faf; text-decoration: none }
+a:visited { color: #672967; text-decoration: none }
+td.postheader { font-family: sans-serif }
+tr.address { font-family: sans-serif }
+body { background: #ffffff; color: black; }</style>
+ <link rel="prev" href="modules.html" />
+ <link rel="contents" href="modules.html" />
+ <link rel="next" href="qtgui.html" />
+</head>
+<body>
+<h1 align="center">QtCore Classes</h1>
+<p><table width="100%">
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QAbstractEventDispatcher</b></td><td>Manages Qt's event queue, excluding GUI-related events</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QAbstractItemModel</b></td><td>The abstract interface for item model classes</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QAbstractListModel</b></td><td>Abstract model that can be subclassed to create one-dimensional list models</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QAbstractTableModel</b></td><td>Abstract model that can be subclassed to create table models</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QBasicTimer</b></td><td>Timer events for </td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QBitArray</b></td><td>Array of bits</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QBuffer</b></td><td>QIODevice interface for a QByteArray</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QByteArray</b></td><td>Array of bytes</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QByteArrayMatcher</b></td><td>Holds a sequence of bytes that can be quickly matched in a byte array</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QCache</b></td><td>Template class that provides a cache</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QChar</b></td><td>16-bit Unicode character</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QChildEvent</b></td><td>Event parameters for child object events</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QCoreApplication</b></td><td>Event loop for Qt applications</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QCustomEvent</b></td><td>Support for custom events</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDataStream</b></td><td>Serialization of binary data to a QIODevice</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDate</b></td><td>Date functions</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDateTime</b></td><td>Date and time functions</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDir</b></td><td>Access to directory structures and their contents</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QEvent</b></td><td>The base class of all event classes. Event objects contain event parameters</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QFile</b></td><td>Interface for reading from and writing to files</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QFileEngine</b></td><td>Abstraction for accessing the filesystem</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QFileEngineHandler</b></td><td>Allows custom QFileEngines to be plugged into Qt</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QFileInfo</b></td><td>System-independent file information</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QHash</b></td><td>Template class that provides a hash-table-based dictionary</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QIODevice</b></td><td>The base interface class of all I/O devices in Qt</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QLatin1Char</b></td><td>8-bit ASCII/Latin-1 character</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QLatin1String</b></td><td>Thin wrapper around an ASCII/Latin-1 encoded string literal</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QLibrary</b></td><td>Loads shared libraries at runtime</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QLibraryInfo</b></td><td>Information about the Qt library</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QLine</b></td><td>Two-dimensional vector that uses integer point coordinates for accuracy</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QLineF</b></td><td>Two-dimensional vector that uses floating point coordinates for accuracy</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QLinkedList</b></td><td>Template class that provides linked lists</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QList</b></td><td>Template class that provides lists</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QLocale</b></td><td>Converts between numbers and their string representations in various languages</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QMap</b></td><td>Template class that provides a skip-list-based dictionary</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QMetaClassInfo</b></td><td>Additional information about a class</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QMetaEnum</b></td><td>Meta data about an enumerator</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QMetaMember</b></td><td>Meta data about a member function</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QMetaObject</b></td><td>Meta information about Qt objects</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QMetaProperty</b></td><td>Meta data about a property</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QMetaType</b></td><td>Manages named types in the meta object system</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QMimeData</b></td><td>Container for data that records information about its MIME type</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QModelIndex</b></td><td>Used to locate data in a data model</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QMultiHash</b></td><td>Convenience QHash subclass that provides multi-valued hashes</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QMultiMap</b></td><td>Convenience QMap subclass that provides multi-valued maps</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QMutex</b></td><td>Access serialization between threads</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QMutexLocker</b></td><td>Convenience class that simplifies locking and unlocking mutexes</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QObject</b></td><td>The base class of all Qt objects</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QObjectCleanupHandler</b></td><td>Watches the lifetime of multiple QObjects</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QPair</b></td><td>Template class that stores a pair of items</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QPersistentModelIndex</b></td><td>Used to locate data in a data model</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QPluginLoader</b></td><td>Loads a plugin at runtime</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QPoint</b></td><td>Defines a point in the plane</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QPointF</b></td><td>Point object that uses floating point coordinates for accuracy</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QPointer</b></td><td>Template class that provides guarded pointers to QObjects</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QProcess</b></td><td>Used to start external programs and to communicate with them</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QQueue</b></td><td>Generic container that provides a queue</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QReadLocker</b></td><td>Convenience class that simplifies locking and unlocking read-write locks for read access</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QReadWriteLock</b></td><td>Read-write locking</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QRect</b></td><td>Defines a rectangle in the plane</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QRectF</b></td><td>Defines a rectangle in the plane using floating point coordinates for accuracy</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QRegExp</b></td><td>Pattern matching using regular expressions</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QResource</b></td><td>Access to application resource data</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSemaphore</b></td><td>General counting semaphore</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSet</b></td><td>Template class that provides a hash-table-based set</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSettings</b></td><td>Persistent platform-independent application settings</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSharedData</b></td><td>Base class for shared data objects</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSharedDataPointer</b></td><td>Pointer to a shared data object</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSignal</b></td><td>Can be used to send signals for classes that do not inherit QObject</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSignalMapper</b></td><td>Bundles signals from identifiable senders</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSize</b></td><td>Defines the size of a two-dimensional object</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSizeF</b></td><td>Defines the size of a two-dimensional object using floating point values for accuracy</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSocketNotifier</b></td><td>Support for monitoring activity on a file descriptor</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QStack</b></td><td>Template class that provides a stack</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QString</b></td><td>Unicode character string</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QStringList</b></td><td>List of strings</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTemporaryFile</b></td><td>I/O device that operates on temporary files</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextCodec</b></td><td>Conversions between text encodings</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextCodecPlugin</b></td><td>Abstract base for custom QTextCodec plugins</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextDecoder</b></td><td>State-based decoder</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextEncoder</b></td><td>State-based encoder</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextIStream</b></td><td>Convenience class for input streams</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextOStream</b></td><td>Convenience class for output streams</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextStream</b></td><td>Convenient interface for reading and writing text</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QThread</b></td><td>Platform-independent threads</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QThreadStorage</b></td><td>Per-thread data storage</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTime</b></td><td>Clock time functions</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTimer</b></td><td>Repetitive and single-shot timers</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTimerEvent</b></td><td>Parameters that describe a timer event</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTranslator</b></td><td>Internationalization support for text output</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTranslatorMessage</b></td><td>Translator message and its properties</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTsciiCodec</b></td><td>Conversion to and from the Tamil TSCII encoding</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QUrl</b></td><td>Convenient interface for working with URLs</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QUuid</b></td><td>Defines a Universally Unique Identifier (UUID)</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QVarLengthArray</b></td><td>Low-level variable-length array</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QVariant</b></td><td>Acts like a union for the most common Qt data types</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QVector</b></td><td>Template class that provides a dynamic array</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QWaitCondition</b></td><td>Condition variable for synchronizing threads</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QWriteLocker</b></td><td>Convenience class that simplifies locking and unlocking read-write locks for write access</td></tr>
+</table></p>
+</body>
+</html>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtgui.html b/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtgui.html
new file mode 100644
index 000000000..9182b4cb4
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtgui.html
@@ -0,0 +1,276 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<!-- /home/dboddie/dev/qt-4.0/doc/src/classes.qdoc -->
+<head>
+ <title>Qt 4.0: QtGui Classes</title>
+ <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
+a:link { color: #004faf; text-decoration: none }
+a:visited { color: #672967; text-decoration: none }
+td.postheader { font-family: sans-serif }
+tr.address { font-family: sans-serif }
+body { background: #ffffff; color: black; }</style>
+ <link rel="prev" href="qtcore.html" />
+ <link rel="contents" href="modules.html" />
+ <link rel="next" href="qtnetwork.html" />
+</head>
+<body>
+<h1 align="center">QtGui Classes</h1>
+<p><table width="100%">
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QAbstractButton</b></td><td>The abstract base class of button widgets, providing functionality common to buttons</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QAbstractItemDelegate</b></td><td>Used to display and edit data items from a model</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QAbstractItemView</b></td><td>The basic functionality for item view classes</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QAbstractScrollArea</b></td><td>Scrolling area with on-demand scroll bars</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QAbstractSlider</b></td><td>Integer value within a range</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QAbstractSpinBox</b></td><td>Spinwidget and a line edit to display values</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QAbstractTextDocumentLayout</b></td><td>Abstract base class used to implement custom layouts for QTextDocuments</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QAccessible</b></td><td>Enums and static functions relating to accessibility</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QAccessibleInterface</b></td><td>Defines an interface that exposes information about accessible objects</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QAccessibleObject</b></td><td>Implements parts of the QAccessibleInterface for QObjects</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QAccessiblePlugin</b></td><td>Abstract base for accessibility plugins</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QAccessibleWidget</b></td><td>Implements the QAccessibleInterface for QWidgets</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QAction</b></td><td>Abstract user interface action that can be inserted into widgets with QWidget::addAction()</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QActionGroup</b></td><td>Groups actions together</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QApplication</b></td><td>Manages the GUI application's control flow and main settings</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QBitmap</b></td><td>Monochrome (1-bit depth) pixmaps</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QBoxLayout</b></td><td>Lines up child widgets horizontally or vertically</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QBrush</b></td><td>Defines the fill pattern of shapes drawn by a QPainter</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QButtonGroup</b></td><td>Container to organize groups of button widgets</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QCDEStyle</b></td><td>CDE look and feel</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QCheckBox</b></td><td>Checkbox with a text label</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QClipboard</b></td><td>Access to the window system clipboard</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QCloseEvent</b></td><td>Parameters that describe a close event</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QColor</b></td><td>Colors based on RGB or HSV values</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QColorDialog</b></td><td>Dialog widget for specifying colors</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QColorGroup</b></td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QComboBox</b></td><td>Combined button and popup list</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QCommonStyle</b></td><td>Encapsulates the common Look and Feel of a GUI</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QConicalGradient</b></td><td>Used in combination with QBrush to specify a conical gradient brush</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QContextMenuEvent</b></td><td>Parameters that describe a context menu event</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QCopChannel</b></td><td>Communication capabilities between several clients</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QCursor</b></td><td>Mouse cursor with an arbitrary shape</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDateTimeEdit</b></td><td>Widget for editing dates and times</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDecoration</b></td><td>Allows the appearance of the Qtopia Core Window Manager to be customized</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDecorationFactory</b></td><td>Creates QDecoration objects</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDecorationPlugin</b></td><td>Abstract base for custom QDecoration plugins</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDesktopWidget</b></td><td>Access to screen information on multi-head systems</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDial</b></td><td>Rounded range control (like a speedometer or potentiometer)</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDialog</b></td><td>The base class of dialog windows</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDirModel</b></td><td>Data model for the local filesystem</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDirectPainter</b></td><td>Direct access to the video hardware</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDockWidget</b></td><td>Widget that can be docked inside a QMainWindow or floated as a top-level window on the desktop</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDoubleSpinBox</b></td><td>Spin box widget that takes doubles</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDoubleValidator</b></td><td>Range checking of floating-point numbers</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDrag</b></td><td>Support for MIME-based drag and drop data transfer</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDragEnterEvent</b></td><td>Event which is sent to a widget when a drag and drop action enters it</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDragLeaveEvent</b></td><td>Event that is sent to a widget when a drag and drop action leaves it</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDragMoveEvent</b></td><td>Event which is sent while a drag and drop action is in progress</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDropEvent</b></td><td>Event which is sent when a drag and drop action is completed</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QErrorMessage</b></td><td>Error message display dialog</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QFileDialog</b></td><td>Dialog that allow users to select files or directories</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QFileIconProvider</b></td><td>File icon for the QDirModel class</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QFileOpenEvent</b></td><td>Event that will be sent when there is a request to open a file</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QFocusEvent</b></td><td>Event parameters for widget focus events</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QFocusFrame</b></td><td>Focus frame which can be outside of a widget's normal paintable area</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QFont</b></td><td>Font used for drawing text</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QFontDatabase</b></td><td>Information about the fonts available in the underlying window system</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QFontDialog</b></td><td>Dialog widget for selecting a font</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QFontInfo</b></td><td>General information about fonts</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QFontMetrics</b></td><td>Font metrics information</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QFontMetricsF</b></td><td>Font metrics information</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QFrame</b></td><td>The base class of widgets that can have a frame</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QGfxDriverFactory</b></td><td>Creates QScreen objects for Qtopia Core</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QGfxDriverPlugin</b></td><td>Abstract base for Qtopia Core graphics driver plugins</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QGradient</b></td><td>Used in combination with QBrush to specify gradient fills</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QGridLayout</b></td><td>Lays out widgets in a grid</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QGridWidget</b></td><td>Simple geometry management of its children</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QGroupBox</b></td><td>Group box frame with a title</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QHBoxLayout</b></td><td>Lines up widgets horizontally</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QHBoxWidget</b></td><td>Horizontal geometry management for its child widgets</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QHeaderView</b></td><td>Header row or header column for item views</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QHideEvent</b></td><td>Event which is sent after a widget is hidden</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QHoverEvent</b></td><td>Parameters that describe a mouse event</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QIcon</b></td><td>Scalable icons in different modes and states</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QIconDragEvent</b></td><td>Indicates that a main icon drag has begun</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QIconEngine</b></td><td>Abstract base class for QIcon renderers</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QIconEnginePlugin</b></td><td>Abstract base for custom QIconEngine plugins</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QImage</b></td><td>Hardware-independent pixmap that allows direct access to the pixel data, and can be used as a paint device</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QImageIOHandler</b></td><td>Defines the common image I/O interface for all image formats in Qt</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QImageIOHandlerFactoryInterface</b></td><td>The factory interface for QImageIOPlugin</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QImageIOPlugin</b></td><td>Defines an interface for writing an image format plugin</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QImageReader</b></td><td>Format independent interface for reading images from files or other devices</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QImageWriter</b></td><td>Format independent interface for writing images to files or other devices</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QInputContext</b></td><td>Abstracts the input method dependent data and composing state</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QInputContextPlugin</b></td><td>Abstract base for custom QInputContext plugins</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QInputDialog</b></td><td>Simple convenience dialog to get a single value from the user</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QInputEvent</b></td><td>The base class for events that describe user input</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QInputMethodEvent</b></td><td>Parameters for input method events</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QIntValidator</b></td><td>Validator that ensures a string contains a valid integer within a specified range</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QItemDelegate</b></td><td>Display and editing facilities for data items from a model</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QItemSelection</b></td><td>Manages information about selected items in a model</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QItemSelectionModel</b></td><td>Keeps track of a view's selected items</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QItemSelectionRange</b></td><td>Manages information about a range of selected items in a model</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QKbdDriverFactory</b></td><td>Creates QWSKeyboardHandler objects for Qtopia Core</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QKbdDriverPlugin</b></td><td>Abstract base for Qtopia Core keyboard driver plugins</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QKeyEvent</b></td><td>Describes a key event</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QKeySequence</b></td><td>Encapsulates a key sequence as used by shortcuts</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QLCDNumber</b></td><td>Displays a number with LCD-like digits</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QLabel</b></td><td>Text or image display</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QLayout</b></td><td>The base class of geometry managers</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QLayoutItem</b></td><td>Abstract item that a QLayout manipulates</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QLineEdit</b></td><td>One-line text editor</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QLinearGradient</b></td><td>Used in combination with QBrush to specify a linear gradient brush</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QListView</b></td><td>Default model/view implementation of a list, and of an icon view</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QListWidget</b></td><td>Item-based list widget</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QListWidgetItem</b></td><td>Item for use with the QListWidget item view class</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QMacMime</b></td><td>Maps open-standard MIME to Mac flavors</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QMacStyle</b></td><td>Implements an Appearance Manager style</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QMainWindow</b></td><td>Main application window</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QMatrix</b></td><td>2D transformations of a coordinate system</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QMenu</b></td><td>Menu widget for use in menu bars, context menus, and other popup menus</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QMenuBar</b></td><td>Horizontal menu bar</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QMenuItem</b></td><td>Represents an item in a menu</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QMessageBox</b></td><td>Modal dialog with a short message, an icon, and some buttons</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QMotifPlusStyle</b></td><td>More sophisticated Motif-ish look and feel</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QMotifStyle</b></td><td>Motif look and feel</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QMouseDriverFactory</b></td><td>Creates QWSMouseHandler objects for Qtopia Core</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QMouseDriverPlugin</b></td><td>Abstract base for Qtopia Core mouse driver plugins</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QMouseEvent</b></td><td>Parameters that describe a mouse event</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QMoveEvent</b></td><td>Event parameters for move events</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QMovie</b></td><td>Convenience class for playing movies with QImageReader</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QPaintDevice</b></td><td>The base class of objects that can be painted</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QPaintEngine</b></td><td>Abstract definition of how QPainter draws to a given device on a given platform</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QPaintEvent</b></td><td>Event parameters for paint events</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QPainter</b></td><td>Does low-level painting e.g. on widgets</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QPainterPath</b></td><td>Container for painting operations, enabling graphical shapes to be constructed and reused</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QPalette</b></td><td>Color groups for each widget state</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QPen</b></td><td>Defines how a QPainter should draw lines and outlines of shapes</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QPicture</b></td><td>Paint device that records and replays QPainter commands</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QPictureFormatPlugin</b></td><td>Abstract base for custom picture format plugins</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QPictureIO</b></td><td>Parameters for loading and saving pictures</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QPixmap</b></td><td>Off-screen, pixel-based paint device</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QPixmapCache</b></td><td>Application-wide cache for pixmaps</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QPlatinumStyle</b></td><td>Mac/Platinum look and feel</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QPolygon</b></td><td>Vector of points</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QPolygonF</b></td><td>Vector of points</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QPrintEngine</b></td><td>Defines an interface for how QPrinter interacts with a given printing subsystem</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QPrinter</b></td><td>Paint device that paints on a printer</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QProgressBar</b></td><td>Horizontal progress bar</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QProgressDialog</b></td><td>Feedback on the progress of a slow operation</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QProxyModel</b></td><td>Support for filtering and sorting data that is passed between another model and a view</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QPushButton</b></td><td>Command button</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QRadialGradient</b></td><td>Used in combination with QBrush to specify a radial gradient brush</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QRadioButton</b></td><td>Radio button with a text label</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QRegExpValidator</b></td><td>Used to check a string against a regular expression</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QRegion</b></td><td>Clip region for a painter</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QResizeEvent</b></td><td>Event parameters for resize events</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QRubberBand</b></td><td>Rectangle or line that can indicate a selection or a boundary</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSGIStyle</b></td><td>SGI/Irix look and feel</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QScreen</b></td><td>And its descendants manage the framebuffer and palette</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QScrollArea</b></td><td>Scrolling view onto another widget</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QScrollBar</b></td><td>Vertical or horizontal scroll bar</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSessionManager</b></td><td>Access to the session manager</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QShortcut</b></td><td>Used to create keyboard shortcuts</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QShowEvent</b></td><td>Event that is sent when a widget is shown</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSizeGrip</b></td><td>Corner-grip for resizing a top-level window</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSizePolicy</b></td><td>Layout attribute describing horizontal and vertical resizing policy</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSlider</b></td><td>Vertical or horizontal slider</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSound</b></td><td>Access to the platform audio facilities</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSpacerItem</b></td><td>Blank space in a layout</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSpinBox</b></td><td>Spin box widget</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSplashScreen</b></td><td>Splash screen that can be shown during application startup</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSplitter</b></td><td>Implements a splitter widget</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSplitterHandle</b></td><td>Handle functionality of the splitter</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QStackedLayout</b></td><td>Stack of widgets where only one widget is visible at a time</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QStackedWidget</b></td><td>Stack of widgets where only one widget is visible at a time</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QStandardItemModel</b></td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QStatusBar</b></td><td>Horizontal bar suitable for presenting status information</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QStyle</b></td><td>Abstract base class that encapsulates the look and feel of a GUI</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QStyleFactory</b></td><td>Creates QStyle objects</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QStyleHintReturn</b></td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QStyleOption</b></td><td>Stores the parameters used by QStyle functions</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QStyleOptionButton</b></td><td>Used to describe the parameters for drawing buttons</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QStyleOptionComboBox</b></td><td>Used to describe the parameter for drawing a combobox</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QStyleOptionComplex</b></td><td>Used to hold parameters that are common to all complex controls</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QStyleOptionDockWidget</b></td><td>Used to describe the parameters for drawing a dock window</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QStyleOptionFocusRect</b></td><td>Used to describe the parameters for drawing a focus rectangle with QStyle</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QStyleOptionFrame</b></td><td>Used to describe the parameters for drawing a frame</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QStyleOptionHeader</b></td><td>Used to describe the parameters for drawing a header</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QStyleOptionMenuItem</b></td><td>Used to describe the parameter necessary for drawing a menu item</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QStyleOptionProgressBar</b></td><td>Used to describe the parameters necessary for drawing a progress bar</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QStyleOptionQ3DockWindow</b></td><td>Used to describe the parameters for drawing various parts of a </td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QStyleOptionQ3ListView</b></td><td>Used to describe the parameters for drawing a Q3ListView</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QStyleOptionQ3ListViewItem</b></td><td>Used to describe an item drawn in a Q3ListView</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QStyleOptionSlider</b></td><td>Used to describe the parameters needed for drawing a slider</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QStyleOptionSpinBox</b></td><td>Used to describe the parameters necessary for drawing a spin box</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QStyleOptionTab</b></td><td>Used to describe the parameters for drawing a tab bar</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QStyleOptionTitleBar</b></td><td>Used to describe the parameters for drawing a title bar</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QStyleOptionToolBox</b></td><td>Used to describe the parameters needed for drawing a tool box</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QStyleOptionToolButton</b></td><td>Used to describe the parameters for drawing a tool button</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QStyleOptionViewItem</b></td><td>Used to describe the parameters used to draw an item in a view widget</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QStylePainter</b></td><td>Convenience class for drawing QStyle elements inside a widget</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QStylePlugin</b></td><td>Abstract base for custom QStyle plugins</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTabBar</b></td><td>Tab bar, e.g. for use in tabbed dialogs</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTabWidget</b></td><td>Stack of tabbed widgets</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTableView</b></td><td>Default model/view implementation of a table view</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTableWidget</b></td><td>Item-based table view with a default model</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTableWidgetItem</b></td><td>Item for use with the QTableWidget class</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTableWidgetSelectionRange</b></td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTabletEvent</b></td><td>Parameters that describe a Tablet event</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextBlock</b></td><td>Container for text fragments in a QTextDocument</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextBlockFormat</b></td><td>Formatting information for blocks of text in a QTextDocument</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextBlockGroup</b></td><td>Container for text blocks within a QTextDocument</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextBrowser</b></td><td>Rich text browser with hypertext navigation</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextCharFormat</b></td><td>Formatting information for characters in a QTextDocument</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextCursor</b></td><td>Offers an API to access and modify QTextDocuments</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextDocument</b></td><td>Holds formatted text that can be viewed and edited using a QTextEdit</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextDocumentFragment</b></td><td>Represents a piece of formatted text from a QTextDocument</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextEdit</b></td><td>Widget that is used to edit and display both plain and rich text</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextFormat</b></td><td>Formatting information for a QTextDocument</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextFragment</b></td><td>Holds a piece of text in a QTextDocument with a single QTextCharFormat</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextFrame</b></td><td>Represents a frame in a QTextDocument</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextFrameFormat</b></td><td>Formatting information for frames in a QTextDocument</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextImageFormat</b></td><td>Formatting information for images in a QTextDocument</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextInlineObject</b></td><td>Represents an inline object in a QTextLayout</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextLayout</b></td><td>Used to lay out and paint a single paragraph of text</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextLength</b></td><td>Encapsulates the different types of length used in a QTextDocument</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextLine</b></td><td>Represents a line of text inside a QTextLayout</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextList</b></td><td>Decorated list of items in a QTextDocument</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextListFormat</b></td><td>Formatting information for lists in a QTextDocument</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextObject</b></td><td>Base class for different kinds of objects that can group parts of a QTextDocument together</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextOption</b></td><td>Description of general rich text properties</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextTable</b></td><td>Represents a table in a QTextDocument</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextTableCell</b></td><td>Represents the properties of a cell in a QTextTable</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTextTableFormat</b></td><td>Formatting information for tables in a QTextDocument</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QToolBar</b></td><td>Movable panel that contains a set of controls</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QToolBarChangeEvent</b></td><td>Event that is sent whenever a the toolbar button is clicked on Mac OS X</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QToolBox</b></td><td>Column of tabbed widget items</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QToolButton</b></td><td>Quick-access button to commands or options, usually used inside a QToolBar</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QToolTip</b></td><td>Tool tips (balloon help) for any widget</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTreeView</b></td><td>Default model/view implementation of a tree view</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTreeWidget</b></td><td>Tree view that uses a predefined tree model</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTreeWidgetItem</b></td><td>Item for use with the QTreeWidget convenience class</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QVBoxLayout</b></td><td>Lines up widgets vertically</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QVBoxWidget</b></td><td>Vertical geometry management of its child widgets</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QValidator</b></td><td>Validation of input text</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QWSInputMethod</b></td><td>International input methods for Qtopia Core</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QWSKeyboardHandler</b></td><td>Implements the keyboard driver for Qtopia Core</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QWSMouseHandler</b></td><td>Mouse driver for Qtopia Core</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QWSServer</b></td><td>Server-specific functionality in Qtopia Core</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QWSWindow</b></td><td>Server-specific functionality in Qtopia Core</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QWhatsThis</b></td><td>Simple description of any widget, i.e. answering the question &quot;What's this?&quot;</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QWhatsThisAction</b></td><td>Ready-made action to invoke &quot;What's This&quot; context help</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QWheelEvent</b></td><td>Parameters that describe a wheel event</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QWidget</b></td><td>The base class of all user interface objects</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QWidgetContainerPlugin</b></td><td>Abstract base for complex custom container QWidget plugins</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QWidgetItem</b></td><td>Layout item that represents a widget</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QWidgetPlugin</b></td><td>Abstract base for custom QWidget plugins</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QWindowsMime</b></td><td>Maps open-standard MIME to Window Clipboard formats</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QWindowsStyle</b></td><td>Microsoft Windows-like look and feel</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QWindowsXPStyle</b></td><td>Microsoft WindowsXP-like look and feel</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QWorkspace</b></td><td>Workspace window that be used in an MDI application</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QX11Info</b></td><td>Information about the X display configuration</td></tr>
+</table></p>
+</body>
+</html>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtnetwork.html b/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtnetwork.html
new file mode 100644
index 000000000..01e1fa48b
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtnetwork.html
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<!-- /home/dboddie/dev/qt-4.0/doc/src/classes.qdoc -->
+<head>
+ <title>Qt 4.0: QtNetwork Classes</title>
+ <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
+a:link { color: #004faf; text-decoration: none }
+a:visited { color: #672967; text-decoration: none }
+td.postheader { font-family: sans-serif }
+tr.address { font-family: sans-serif }
+body { background: #ffffff; color: black; }</style>
+ <link rel="prev" href="qtgui.html" />
+ <link rel="contents" href="modules.html" />
+ <link rel="next" href="qtopengl.html" />
+</head>
+<body>
+<h1 align="center">QtNetwork Classes</h1>
+<p><table width="100%">
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QAbstractSocket</b></td><td>The base functionality common to all socket types</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QFtp</b></td><td>Implementation of the FTP protocol</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QHostAddress</b></td><td>IP address</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QHostInfo</b></td><td>Static functions for host name lookups</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QHttp</b></td><td>Implementation of the HTTP protocol</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QHttpHeader</b></td><td>Header information for HTTP</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QHttpRequestHeader</b></td><td>Request header information for HTTP</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QHttpResponseHeader</b></td><td>Response header information for HTTP</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTcpServer</b></td><td>TCP-based server</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QTcpSocket</b></td><td>TCP socket</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QUdpSocket</b></td><td>UDP socket</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QUrlInfo</b></td><td>Stores information about URLs</td></tr>
+</table></p>
+</body>
+</html>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtopengl.html b/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtopengl.html
new file mode 100644
index 000000000..c42c4ae26
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtopengl.html
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<!-- /home/dboddie/dev/qt-4.0/doc/src/classes.qdoc -->
+<head>
+ <title>Qt 4.0: QtOpenGL Classes</title>
+ <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
+a:link { color: #004faf; text-decoration: none }
+a:visited { color: #672967; text-decoration: none }
+td.postheader { font-family: sans-serif }
+tr.address { font-family: sans-serif }
+body { background: #ffffff; color: black; }</style>
+ <link rel="prev" href="qtnetwork.html" />
+ <link rel="contents" href="modules.html" />
+ <link rel="next" href="qtsql.html" />
+</head>
+<body>
+<h1 align="center">QtOpenGL Classes</h1>
+<p><table width="100%">
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QGLColormap</b></td><td>Used for installing custom colormaps into QGLWidgets</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QGLContext</b></td><td>Encapsulates an OpenGL rendering context</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QGLFormat</b></td><td>The display format of an OpenGL rendering context</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QGLWidget</b></td><td>Widget for rendering OpenGL graphics</td></tr>
+</table></p>
+</body>
+</html>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtsql.html b/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtsql.html
new file mode 100644
index 000000000..db44d6d36
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtsql.html
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<!-- /home/dboddie/dev/qt-4.0/doc/src/classes.qdoc -->
+<head>
+ <title>Qt 4.0: QtSql Classes</title>
+ <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
+a:link { color: #004faf; text-decoration: none }
+a:visited { color: #672967; text-decoration: none }
+td.postheader { font-family: sans-serif }
+tr.address { font-family: sans-serif }
+body { background: #ffffff; color: black; }</style>
+ <link rel="prev" href="qtopengl.html" />
+ <link rel="contents" href="modules.html" />
+ <link rel="next" href="qtxml.html" />
+</head>
+<body>
+<h1 align="center">QtSql Classes</h1>
+<p><table width="100%">
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSqlDatabase</b></td><td>Represents a connection to a database</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSqlDriver</b></td><td>Abstract base class for accessing specific SQL databases</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSqlDriverCreator</b></td><td>Template class that provides a SQL driver factory for a specific driver type</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSqlDriverCreatorBase</b></td><td>The base class for SQL driver factories</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSqlDriverPlugin</b></td><td>Abstract base for custom QSqlDriver plugins</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSqlError</b></td><td>SQL database error information</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSqlField</b></td><td>Manipulates the fields in SQL database tables and views</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSqlIndex</b></td><td>Functions to manipulate and describe database indexes</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSqlQuery</b></td><td>Means of executing and manipulating SQL statements</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSqlQueryModel</b></td><td>Read-only data model for SQL result sets</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSqlRecord</b></td><td>Encapsulates a database record</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSqlRelation</b></td><td>Stores information about an SQL foreign key</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSqlRelationalDelegate</b></td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSqlRelationalTableModel</b></td><td>Editable data model for a single database table, with foreign key support</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSqlResult</b></td><td>Abstract interface for accessing data from specific SQL databases</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QSqlTableModel</b></td><td>Editable data model for a single database table</td></tr>
+</table></p>
+</body>
+</html>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtxml.html b/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtxml.html
new file mode 100644
index 000000000..d10d54237
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtxml.html
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<!-- /home/dboddie/dev/qt-4.0/doc/src/classes.qdoc -->
+<head>
+ <title>Qt 4.0: QtXml Classes</title>
+ <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
+a:link { color: #004faf; text-decoration: none }
+a:visited { color: #672967; text-decoration: none }
+td.postheader { font-family: sans-serif }
+tr.address { font-family: sans-serif }
+body { background: #ffffff; color: black; }</style>
+ <link rel="prev" href="qtsql.html" />
+ <link rel="contents" href="modules.html" />
+</head>
+<body>
+<h1 align="center">QtXml Classes</h1>
+<p><table width="100%">
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDomAttr</b></td><td>Represents one attribute of a QDomElement</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDomCDATASection</b></td><td>Represents an XML CDATA section</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDomCharacterData</b></td><td>Represents a generic string in the DOM</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDomComment</b></td><td>Represents an XML comment</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDomDocument</b></td><td>Represents an XML document</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDomDocumentFragment</b></td><td>Tree of QDomNodes which is not usually a complete QDomDocument</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDomDocumentType</b></td><td>The representation of the DTD in the document tree</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDomElement</b></td><td>Represents one element in the DOM tree</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDomEntity</b></td><td>Represents an XML entity</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDomEntityReference</b></td><td>Represents an XML entity reference</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDomImplementation</b></td><td>Information about the features of the DOM implementation</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDomNamedNodeMap</b></td><td>Collection of nodes that can be accessed by name</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDomNode</b></td><td>The base class for all the nodes in a DOM tree</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDomNodeList</b></td><td>List of QDomNode objects</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDomNotation</b></td><td>Represents an XML notation</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDomProcessingInstruction</b></td><td>Represents an XML processing instruction</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QDomText</b></td><td>Represents text data in the parsed XML document</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QXmlAttributes</b></td><td>XML attributes</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QXmlContentHandler</b></td><td>Interface to report the logical content of XML data</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QXmlDTDHandler</b></td><td>Interface to report DTD content of XML data</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QXmlDeclHandler</b></td><td>Interface to report declaration content of XML data</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QXmlDefaultHandler</b></td><td>Default implementation of all the XML handler classes</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QXmlEntityResolver</b></td><td>Interface to resolve external entities contained in XML data</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QXmlErrorHandler</b></td><td>Interface to report errors in XML data</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QXmlInputSource</b></td><td>The input data for the QXmlReader subclasses</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QXmlLexicalHandler</b></td><td>Interface to report the lexical content of XML data</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QXmlLocator</b></td><td>The XML handler classes with information about the parsing position within a file</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QXmlNamespaceSupport</b></td><td>Helper class for XML readers which want to include namespace support</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QXmlParseException</b></td><td>Used to report errors with the QXmlErrorHandler interface</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QXmlReader</b></td><td>Interface for XML readers (i.e. parsers)</td></tr>
+<tr valign="top" bgcolor="#f0f0f0"><td><b>QXmlSimpleReader</b></td><td>Implementation of a simple XML parser</td></tr>
+</table></p>
+</body>
+</html>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/titles.txt b/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/titles.txt
new file mode 100644
index 000000000..016825d87
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/titles.txt
@@ -0,0 +1,7 @@
+Qt Classes by Module :/Resources/modules.html
+QtCore :/Resources/qtcore.html
+QtGui :/Resources/qtgui.html
+QtNetwork :/Resources/qtnetwork.html
+QtOpenGL :/Resources/qtopengl.html
+QtSql :/Resources/qtsql.html
+QtXml :/Resources/qtxml.html
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/dockwidgets.qrc b/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/dockwidgets.qrc
new file mode 100644
index 000000000..8c462a517
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/dockwidgets.qrc
@@ -0,0 +1,12 @@
+<RCC>
+ <qresource>
+ <file>Resources/titles.txt</file>
+ <file>Resources/modules.html</file>
+ <file>Resources/qtcore.html</file>
+ <file>Resources/qtgui.html</file>
+ <file>Resources/qtnetwork.html</file>
+ <file>Resources/qtopengl.html</file>
+ <file>Resources/qtsql.html</file>
+ <file>Resources/qtxml.html</file>
+ </qresource>
+</RCC>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/mainwindow.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/mainwindow.h
new file mode 100644
index 000000000..e9891d628
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/mainwindow.h
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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>
+
+class QDockWidget;
+class QListWidget;
+class QListWidgetItem;
+class QTextBrowser;
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+public:
+ MainWindow(QWidget *parent = 0);
+
+private slots:
+ void updateText(QListWidgetItem *item);
+
+private:
+ void setupContents();
+ void setupDockWindow();
+ void setupMenus();
+
+ QDockWidget *contentsWindow;
+ QListWidget *headingList;
+ QTextBrowser *textBrowser;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/draganddrop/dragwidget.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/draganddrop/dragwidget.h
new file mode 100644
index 000000000..88bff6669
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/draganddrop/dragwidget.h
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 DRAGWIDGET_H
+#define DRAGWIDGET_H
+
+#include <QByteArray>
+#include <QFrame>
+#include <QString>
+#include <QStringList>
+
+class QComboBox;
+class QFrame;
+class QLabel;
+class QTextBrowser;
+
+class DragWidget : public QFrame
+{
+ Q_OBJECT
+
+public:
+ DragWidget(QWidget *parent);
+ void setData(const QString &mimetype, const QByteArray &newData);
+
+signals:
+ void dragResult(const QString &actionText);
+ void mimeTypes(const QStringList &types);
+
+protected:
+ void dragEnterEvent(QDragEnterEvent *event);
+ void dropEvent(QDropEvent *event);
+ void mouseMoveEvent(QMouseEvent *event);
+ void mousePressEvent(QMouseEvent *event);
+
+private:
+ QByteArray data;
+ QLabel *dragDropLabel;
+ QPoint dragStartPosition;
+ QString mimeType;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/draganddrop/mainwindow.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/draganddrop/mainwindow.h
new file mode 100644
index 000000000..ece2a8190
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/draganddrop/mainwindow.h
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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>
+#include <QPixmap>
+#include <QPoint>
+
+class QComboBox;
+class QLabel;
+class QLineEdit;
+class QMouseEvent;
+class QTextEdit;
+class DragWidget;
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow(QWidget *parent = 0);
+
+public slots:
+ void setDragResult(const QString &actionText);
+ void setMimeTypes(const QStringList &types);
+
+private:
+ QComboBox *mimeTypeCombo;
+ DragWidget *dragWidget;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/dragging/images.qrc b/sources/pyside6/doc/codesnippets/doc/src/snippets/dragging/images.qrc
new file mode 100644
index 000000000..30b8a2986
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/dragging/images.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>images/file.png</file>
+</qresource>
+</RCC>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/dragging/images/file.png b/sources/pyside6/doc/codesnippets/doc/src/snippets/dragging/images/file.png
new file mode 100644
index 000000000..9520080ed
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/dragging/images/file.png
Binary files differ
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/dragging/mainwindow.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/dragging/mainwindow.cpp
new file mode 100644
index 000000000..6e4073499
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/dragging/mainwindow.cpp
@@ -0,0 +1,72 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+
+//! [0]
+def mousePressEvent(self, event):
+ if event.button() == Qt.LeftButton
+ && iconLabel.geometry().contains(event.pos()):
+
+//! [1]
+ drag = QDrag(self)
+ mimeData = QMimeData()
+
+ mimeData.setText(commentEdit.toPlainText())
+ drag.setMimeData(mimeData)
+//! [1]
+ drag.setPixmap(iconPixmap)
+
+ dropAction = drag.exec_()
+//! [0]
+
+//! [2]
+
+
+//! [2]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/dragging/mainwindow.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/dragging/mainwindow.h
new file mode 100644
index 000000000..fccb01a0e
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/dragging/mainwindow.h
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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>
+#include <QPixmap>
+#include <QPoint>
+
+class QLabel;
+class QLineEdit;
+class QMouseEvent;
+class QTextEdit;
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow(QWidget *parent = 0);
+
+protected:
+ void mousePressEvent(QMouseEvent *event);
+
+private:
+ QLabel *iconLabel;
+ QLineEdit *nameEdit;
+ QPixmap iconPixmap;
+ QPoint dragStartPosition;
+ QTextEdit *commentEdit;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/dropactions/window.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/dropactions/window.h
new file mode 100644
index 000000000..8607b6953
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/dropactions/window.h
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 <QString>
+#include <QStringList>
+#include <QWidget>
+
+class QComboBox;
+class QFrame;
+class QTextBrowser;
+
+class Window : public QWidget
+{
+ Q_OBJECT
+
+public:
+ Window(QWidget *parent = 0);
+
+protected:
+ void dragEnterEvent(QDragEnterEvent *event);
+ void dropEvent(QDropEvent *event);
+
+private:
+ QComboBox *mimeTypeCombo;
+ QFrame *dropFrame;
+ QTextBrowser *textBrowser;
+ QString oldText;
+ QStringList oldMimeTypes;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/droparea.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/droparea.cpp
new file mode 100644
index 000000000..77f97455b
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/droparea.cpp
@@ -0,0 +1,147 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+from PySide6.QtGui import *
+
+
+DropArea.DropArea(QWidget *parent)
+ : QLabel(parent)
+{
+ setMinimumSize(200, 200)
+ setFrameStyle(QFrame.Sunken | QFrame::StyledPanel)
+ setAlignment(Qt.AlignCenter)
+ setAcceptDrops(True)
+ setAutoFillBackground(True)
+ clear()
+}
+
+void DropArea.dragEnterEvent(QDragEnterEvent *event)
+{
+ setText(tr("<drop content>"))
+ setBackgroundRole(QPalette.Highlight)
+
+ event.acceptProposedAction()
+ emit changed(event.mimeData())
+}
+
+void DropArea.dragMoveEvent(QDragMoveEvent *event)
+{
+ event.acceptProposedAction()
+}
+
+void DropArea.dropEvent(QDropEvent *event)
+{
+ const QMimeData *mimeData = event.mimeData()
+
+ if (mimeData.hasImage()) {
+ setPixmap(qvariant_cast<QPixmap>(mimeData.imageData()))
+ } else if (mimeData.hasHtml()) {
+ setText(mimeData.html())
+ setTextFormat(Qt.RichText)
+ } else if (mimeData.hasText()) {
+ setText(mimeData.text())
+ setTextFormat(Qt.PlainText)
+ } else {
+ setText(tr("Cannot display data"))
+ }
+
+ setBackgroundRole(QPalette.Dark)
+ event.acceptProposedAction()
+}
+
+//![0]
+def paste(self):
+ clipboard = QGuiApplication.clipboard()
+ mimeData = clipboard.mimeData()
+
+ if mimeData.hasImage():
+ setPixmap(mimeData.imageData())
+ elif mimeData.hasHtml():
+ setText(mimeData.html())
+ setTextFormat(Qt.RichText)
+ elif (mimeData.hasText():
+ setText(mimeData.text())
+ setTextFormat(Qt.PlainText)
+ else:
+ setText(tr("Cannot display data"))
+//![0]
+
+ emit changed(mimeData)
+ setBackgroundRole(QPalette.Dark)
+ //event.acceptProposedAction()
+}
+
+void DropArea.dragLeaveEvent(QDragLeaveEvent *event)
+{
+ clear()
+ event.accept()
+}
+
+void DropArea.clear()
+{
+ setText(tr("<drop content>"))
+ setBackgroundRole(QPalette.Dark)
+
+ emit changed()
+}
+
+QPixmap DropArea.extractPixmap(const QByteArray &data, const QString &format)
+{
+ QList<QByteArray> imageFormats = QImageReader.supportedImageFormats()
+ QPixmap pixmap
+
+ foreach (QByteArray imageFormat, imageFormats) {
+ if (format.mid(6) == QString(imageFormat)) {
+ pixmap.loadFromData(data, imageFormat)
+ break
+ }
+ }
+ return pixmap
+}
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/dropevents/window.py b/sources/pyside6/doc/codesnippets/doc/src/snippets/dropevents/window.py
new file mode 100644
index 000000000..9793762ad
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/dropevents/window.py
@@ -0,0 +1,65 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+from PySide6.QtWidgets import QWidget, QComboBox, QFrame, QTextBrowser
+
+class Window(QWidget):
+
+ def __init__(self, parent=None):
+ self.mimeTypeCombo = QComboBox()
+ self.dropFrame = QFrame()
+ self.textBrowser = QTextBrowser()
+ self.oldText = ""
+ self.oldMimeTypes = []
+
+ def dragEnterEvent(self, event):
+ pass
+ def dropEvent(self, event):
+ pass
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/droprectangle/window.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/droprectangle/window.h
new file mode 100644
index 000000000..e7854bcfd
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/droprectangle/window.h
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 <QString>
+#include <QStringList>
+#include <QWidget>
+
+class QComboBox;
+class QFrame;
+class QTextBrowser;
+
+class Window : public QWidget
+{
+ Q_OBJECT
+
+public:
+ Window(QWidget *parent = 0);
+
+protected:
+ void dragMoveEvent(QDragMoveEvent *event);
+ void dropEvent(QDropEvent *event);
+
+private:
+ QComboBox *mimeTypeCombo;
+ QFrame *dropFrame;
+ QTextBrowser *textBrowser;
+ QString oldText;
+ QStringList oldMimeTypes;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/eventfilters/filterobject.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/eventfilters/filterobject.h
new file mode 100644
index 000000000..18fd7b8c5
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/eventfilters/filterobject.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 FILTEROBJECT_H
+#define FILTEROBJECT_H
+
+#include <QObject>
+
+class FilterObject : public QObject
+{
+ Q_OBJECT
+
+public:
+ FilterObject(QObject *parent = 0);
+ bool eventFilter(QObject *object, QEvent *event);
+ void setFilteredObject(QObject *object);
+
+private:
+ QObject *target;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/explicitlysharedemployee/employee.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/explicitlysharedemployee/employee.h
new file mode 100644
index 000000000..66ca6b36b
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/explicitlysharedemployee/employee.h
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 EMPLOYEE_H
+#define EMPLOYEE_H
+
+#include <QSharedData>
+#include <QString>
+
+class EmployeeData : public QSharedData
+{
+public:
+ EmployeeData();
+ EmployeeData(const EmployeeData &other);
+ ~EmployeeData();
+
+ int id;
+ QString *name;
+};
+
+class Employee
+{
+public:
+ Employee();
+ Employee(int id, const QString &name);
+
+ void setId(int id) { d->id = id; }
+ void setName(const QString &name);
+
+ int id() const { return d->id; }
+ QString name() const;
+
+private:
+ QExplicitlySharedDataPointer<EmployeeData> d;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/i18n-non-qt-class/myclass.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/i18n-non-qt-class/myclass.h
new file mode 100644
index 000000000..0f49fe256
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/i18n-non-qt-class/myclass.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 MYCLASS_H
+#define MYCLASS_H
+
+#include <QCoreApplication>
+
+//! [0]
+class MyClass
+{
+ Q_DECLARE_TR_FUNCTIONS(MyClass)
+
+public:
+ MyClass();
+//! [0]
+ /* ... */
+//! [1]
+};
+//! [1]
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/i18n-non-qt-class/myclass.ts b/sources/pyside6/doc/codesnippets/doc/src/snippets/i18n-non-qt-class/myclass.ts
new file mode 100644
index 000000000..9bd90f244
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/i18n-non-qt-class/myclass.ts
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS><TS version="1.1">
+<context>
+ <name>MyClass</name>
+ <message>
+ <location filename="myclass.cpp" line="6"/>
+ <source>Hello Qt!
+</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/i18n-non-qt-class/resources.qrc b/sources/pyside6/doc/codesnippets/doc/src/snippets/i18n-non-qt-class/resources.qrc
new file mode 100644
index 000000000..903ac8578
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/i18n-non-qt-class/resources.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>translations/i18n-non-qt-class_en.qm</file>
+ <file>translations/i18n-non-qt-class_fr.qm</file>
+</qresource>
+</RCC>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/i18n-non-qt-class/translations/i18n-non-qt-class_en.ts b/sources/pyside6/doc/codesnippets/doc/src/snippets/i18n-non-qt-class/translations/i18n-non-qt-class_en.ts
new file mode 100644
index 000000000..54f188694
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/i18n-non-qt-class/translations/i18n-non-qt-class_en.ts
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS><TS version="1.1">
+<context>
+ <name>MyClass</name>
+ <message>
+ <location filename="../myclass.cpp" line="6"/>
+ <source>Hello Qt!
+</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/i18n-non-qt-class/translations/i18n-non-qt-class_fr.ts b/sources/pyside6/doc/codesnippets/doc/src/snippets/i18n-non-qt-class/translations/i18n-non-qt-class_fr.ts
new file mode 100644
index 000000000..3f3cebc23
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/i18n-non-qt-class/translations/i18n-non-qt-class_fr.ts
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS><TS version="1.1" language="fr">
+<context>
+ <name>MyClass</name>
+ <message>
+ <location filename="../myclass.cpp" line="6"/>
+ <source>Hello Qt!
+</source>
+ <translation>Bonjour Qt!
+</translation>
+ </message>
+</context>
+</TS>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/image/image.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/image/image.cpp
new file mode 100644
index 000000000..a35f95c94
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/image/image.cpp
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+ image = QImage()
+ ba = QByteArray()
+ buffer(ba)
+ buffer.open(QIODevice.WriteOnly)
+ image.save(buffer, "PNG") # writes image into ba in PNG format
+//! [0]
+//! [1]
+ pixmap = QPixmap()
+ bytes = QByteArray()
+ buffer(bytes)
+ buffer.open(QIODevice.WriteOnly)
+ pixmap.save(buffer, "PNG") # writes pixmap into bytes in PNG format
+//! [1]
+//! [2]
+ alpha = QPixmap("image-with-alpha.png")
+ alphacopy = alpha
+ alphacopy.setMask(alphacopy.mask())
+//! [2]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/image/supportedformat.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/image/supportedformat.cpp
new file mode 100644
index 000000000..2d8459f3e
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/image/supportedformat.cpp
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+ writer = QImageWriter()
+ writer.setFormat("png")
+ if writer.supportsOption(QImageIOHandler.Description):
+ print "Png supports embedded text"
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/inherited-slot/button.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/inherited-slot/button.h
new file mode 100644
index 000000000..855bea055
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/inherited-slot/button.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 <QPushButton>
+
+//! [Button class with reimplemented slot]
+class Button : public QPushButton
+{
+ Q_OBJECT
+
+public:
+ Button(QWidget *parent = 0);
+
+public slots:
+ void animateClick();
+};
+//! [Button class with reimplemented slot]
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/itemselection/model.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/itemselection/model.h
new file mode 100644
index 000000000..6b4076815
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/itemselection/model.h
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 MODEL_H
+#define MODEL_H
+
+#include <QAbstractTableModel>
+#include <QStringList>
+#include <QVariant>
+
+class TableModel : public QAbstractTableModel
+{
+ Q_OBJECT
+
+public:
+ TableModel(int rows = 1, int columns = 1, QObject *parent = 0);
+
+ int rowCount(const QModelIndex &parent = QModelIndex()) const;
+ int columnCount(const QModelIndex &parent = QModelIndex()) const;
+ QVariant data(const QModelIndex &index, int role) const;
+ QVariant headerData(int section, Qt::Orientation orientation,
+ int role = Qt::DisplayRole) const;
+
+ Qt::ItemFlags flags(const QModelIndex &index) const;
+ bool setData(const QModelIndex &index, const QVariant &value,
+ int role = Qt::EditRole);
+
+ bool insertRows(int position, int rows, const QModelIndex &parent = QModelIndex());
+ bool insertColumns(int position, int columns, const QModelIndex &parent = QModelIndex());
+ bool removeRows(int position, int rows, const QModelIndex &parent = QModelIndex());
+ bool removeColumns(int position, int columns, const QModelIndex &parent = QModelIndex());
+
+private:
+ QList<QStringList> rowList;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/layouts/layouts.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/layouts/layouts.cpp
new file mode 100644
index 000000000..9bcc5dbe0
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/layouts/layouts.cpp
@@ -0,0 +1,126 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+//! [0]
+ window = QWidget()
+//! [0] //! [1]
+ button1 = QPushButton("One")
+//! [1] //! [2]
+ button2 = QPushButton("Two")
+ button3 = QPushButton("Three")
+ button4 = QPushButton("Four")
+ button5 = QPushButton("Five")
+//! [2]
+
+//! [3]
+ layout = QHBoxLayout()
+//! [3] //! [4]
+ layout.addWidget(button1)
+ layout.addWidget(button2)
+ layout.addWidget(button3)
+ layout.addWidget(button4)
+ layout.addWidget(button5)
+
+ window.setLayout(layout)
+//! [4] //! [5]
+ window.show()
+//! [5]
+
+//! [6]
+ window = QWidget()
+//! [6] //! [7]
+ button1 = QPushButton("One")
+//! [7] //! [8]
+ button2 = QPushButton("Two")
+ button3 = QPushButton("Three")
+ button4 = QPushButton("Four")
+ button5 = QPushButton("Five")
+//! [8]
+
+//! [9]
+ layout = QVBoxLayout()
+
+//! [9] //! [10]
+ layout.addWidget(button1)
+ layout.addWidget(button2)
+ layout.addWidget(button3)
+ layout.addWidget(button4)
+ layout.addWidget(button5)
+
+ window.setLayout(layout)
+//! [10] //! [11]
+ window.show()
+//! [11]
+
+//! [12]
+ window = QWidget()
+//! [12] //! [13]
+ button1 = QPushButton("One")
+//! [13] //! [14]
+ button2 = QPushButton("Two")
+ button3 = QPushButton("Three")
+ button4 = QPushButton("Four")
+ button5 = QPushButton("Five")
+//! [14]
+
+//! [15]
+ layout = QGridLayout()
+
+//! [15] //! [16]
+ layout.addWidget(button1, 0, 0)
+ layout.addWidget(button2, 0, 1)
+ layout.addWidget(button3, 1, 0, 1, 2)
+ layout.addWidget(button4, 2, 0)
+ layout.addWidget(button5, 2, 1)
+
+ window.setLayout(layout)
+//! [16] //! [17]
+ window.show()
+//! [17]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/mainwindowsnippet.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/mainwindowsnippet.cpp
new file mode 100644
index 000000000..1b0f94e8e
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/mainwindowsnippet.cpp
@@ -0,0 +1,58 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+//! [0]
+ dockWidget = QDockWidget(tr("Dock Widget"), self)
+ dockWidget.setAllowedAreas(Qt.LeftDockWidgetArea |
+ Qt.RightDockWidgetArea)
+ dockWidget.setWidget(dockWidgetContents)
+ addDockWidget(Qt.LeftDockWidgetArea, dockWidget)
+//! [0]
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/matrix/matrix.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/matrix/matrix.cpp
new file mode 100644
index 000000000..369d25af5
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/matrix/matrix.cpp
@@ -0,0 +1,112 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+//! [0]
+def paintEvent(self, event):
+ painter = QPainter(self)
+ painter.setPen(QPen(Qt.blue, 1, Qt.DashLine))
+ painter.drawRect(0, 0, 100, 100)
+
+ painter.rotate(45)
+
+ painter.setFont(QFont("Helvetica", 24))
+ painter.setPen(QPen(Qt.black, 1))
+ painter.drawText(20, 10, "QMatrix")
+//! [0]
+
+
+//! [1]
+def paintEvent(self, event)
+
+ painter = QPainter(self)
+ painter.setPen(QPen(Qt.blue, 1, Qt.DashLine))
+ painter.drawRect(0, 0, 100, 100)
+
+ matrix = QMatrix()
+ matrix.translate(50, 50)
+ matrix.rotate(45)
+ matrix.scale(0.5, 1.0)
+ painter.setMatrix(matrix)
+
+ painter.setFont(QFont("Helvetica", 24))
+ painter.setPen(QPen(Qt.black, 1))
+ painter.drawText(20, 10, "QMatrix")
+
+//! [1]
+
+
+//! [2]
+def paintEvent(self, event)
+
+ pi = 3.14
+
+ a = pi/180 * 45.0
+ sina = sin(a)
+ cosa = cos(a)
+
+ translationMatrix = QMatrix(1, 0, 0, 1, 50.0, 50.0)
+ rotationMatrix = QMatrix(cosa, sina, -sina, cosa, 0, 0)
+ scalingMatrix = QMatrix(0.5, 0, 0, 1.0, 0, 0)
+
+ matrix = QMatrix()
+ matrix = scalingMatrix * rotationMatrix * translationMatrix
+
+ painter = QPainter(self)
+ painter.setPen(QPen(Qt.blue, 1, Qt::DashLine))
+ painter.drawRect(0, 0, 100, 100)
+
+ painter.setMatrix(matrix)
+
+ painter.setFont(QFont("Helvetica", 24))
+ painter.setPen(QPen(Qt.black, 1))
+ painter.drawText(20, 10, "QMatrix")
+
+//! [2]
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/mdiareasnippets.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/mdiareasnippets.cpp
new file mode 100644
index 000000000..f7d07c8f4
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/mdiareasnippets.cpp
@@ -0,0 +1,66 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+//! [0]
+ mainWindow = QMainWindow()
+ mainWindow.setCentralWidget(mdiArea)
+//! [0]
+
+//! [1]
+ mdiArea = QMdiArea()
+ subWindow1 = QMdiSubWindow()
+ subWindow1.setWidget(internalWidget1)
+ subWindow1.setAttribute(Qt.WA_DeleteOnClose)
+ mdiArea.addSubWindow(subWindow1)
+
+ subWindow2 = QMdiSubWindow()
+ mdiArea.addSubWindow(internalWidget2)
+//! [1]
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/moc/myclass1.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/moc/myclass1.h
new file mode 100644
index 000000000..0391b48aa
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/moc/myclass1.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 MYCLASS1_H
+#define MYCLASS1_H
+
+#include <QObject>
+
+#define MyClass MyClass1
+
+//! [0]
+class MyClass : public QObject
+{
+ Q_OBJECT
+
+public:
+ MyClass(QObject *parent = 0);
+ ~MyClass();
+
+signals:
+ void mySignal();
+
+public slots:
+ void mySlot();
+};
+//! [0]
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/moc/myclass2.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/moc/myclass2.h
new file mode 100644
index 000000000..e39cb6a58
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/moc/myclass2.h
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 MYCLASS2_H
+#define MYCLASS2_H
+
+#include <QObject>
+
+#define MyClass MyClass2
+
+//! [0]
+class MyClass : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(Priority priority READ priority WRITE setPriority)
+ Q_ENUMS(Priority)
+
+public:
+ enum Priority { High, Low, VeryHigh, VeryLow };
+
+ MyClass(QObject *parent = 0);
+ ~MyClass();
+
+ void setPriority(Priority priority);
+ Priority priority() const;
+};
+//! [0]
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/moc/myclass3.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/moc/myclass3.h
new file mode 100644
index 000000000..5110c6203
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/moc/myclass3.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 MYCLASS3_H
+#define MYCLASS3_H
+
+#include <QObject>
+
+//! [0]
+class MyClass : public QObject
+{
+ Q_OBJECT
+ Q_CLASSINFO("Author", "Oscar Peterson")
+ Q_CLASSINFO("Status", "Active")
+
+public:
+ MyClass(QObject *parent = 0);
+ ~MyClass();
+};
+//! [0]
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/modelview-subclasses/model.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/modelview-subclasses/model.h
new file mode 100644
index 000000000..e9f85877a
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/modelview-subclasses/model.h
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 MODEL_H
+#define MODEL_H
+
+#include <QAbstractListModel>
+#include <QObject>
+#include <qvector.h>
+
+class LinearModel : public QAbstractListModel
+{
+ Q_OBJECT
+public:
+ LinearModel(QObject *parent = 0)
+ : QAbstractListModel(parent) {}
+
+ int rowCount(const QModelIndex &parent = QModelIndex()) const;
+ QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const;
+ QVariant data(const QModelIndex &index, int role) const;
+
+ Qt::ItemFlags flags(const QModelIndex &index) const;
+ bool setData(const QModelIndex &index, const QVariant &value,
+ int role = Qt::EditRole);
+
+ bool insertRows(int position, int rows, const QModelIndex &index = QModelIndex());
+ bool removeRows(int position, int rows, const QModelIndex &index = QModelIndex());
+
+private:
+ QVector<int> values;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/modelview-subclasses/view.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/modelview-subclasses/view.h
new file mode 100644
index 000000000..f6a5e710c
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/modelview-subclasses/view.h
@@ -0,0 +1,100 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 VIEW_H
+#define VIEW_H
+
+#include <QAbstractItemView>
+#include <QItemSelection>
+#include <QItemSelectionModel>
+#include <QModelIndex>
+#include <QRect>
+#include <QSize>
+#include <QWidget>
+
+class LinearView : public QAbstractItemView
+{
+ Q_OBJECT
+public:
+ LinearView(QWidget *parent = 0);
+
+ QRect itemViewportRect(const QModelIndex &index) const;
+ void ensureVisible(const QModelIndex &index);
+ QModelIndex itemAt(int x, int y) const;
+
+protected slots:
+ /*void dataChanged(const QModelIndex &topLeft, const QModelIndex
+ &bottomRight);*/
+ void rowsInserted(const QModelIndex &parent, int start, int end);
+ void rowsRemoved(const QModelIndex &parent, int start, int end);
+ /*void selectionChanged(const QItemSelection &deselected, const QItemSelection &selected);
+ void verticalScrollbarAction(int action);
+ void horizontalScrollbarAction(int action);*/
+
+protected:
+ void setSelection(const QRect&, QItemSelectionModel::SelectionFlags command);
+ QRect selectionViewportRect(const QItemSelection &selection) const;
+ QRect itemRect(const QModelIndex &item) const;
+ bool isIndexHidden(const QModelIndex &index) const;
+ int horizontalOffset() const;
+ int verticalOffset() const;
+ QModelIndex moveCursor(QAbstractItemView::CursorAction cursorAction,
+ Qt::KeyboardModifiers modifiers);
+
+ void paintEvent(QPaintEvent *event);
+ void resizeEvent(QResizeEvent *event);
+ QSize sizeHint() const;
+
+private:
+ int rows(const QModelIndex &index = QModelIndex()) const;
+ void updateGeometries();
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/modelview-subclasses/window.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/modelview-subclasses/window.h
new file mode 100644
index 000000000..ac4988f5e
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/modelview-subclasses/window.h
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 <QMainWindow>
+#include <QString>
+#include <QWidget>
+
+#include "model.h"
+#include "view.h"
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+public:
+ MainWindow::MainWindow(QWidget *parent = 0);
+
+public slots:
+ void selectOpenFile();
+
+private:
+ void setupModelView();
+ void openFile(const QString &fileName);
+
+ LinearModel *model;
+ LinearView *view;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/myscrollarea.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/myscrollarea.cpp
new file mode 100644
index 000000000..375df1b90
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/myscrollarea.cpp
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+from PySide6.QtCore import *
+from PySide6.QtGui import *
+import sys
+
+class MyScrollArea (QAbstractScrollArea):
+ widget = None
+
+ def __init__(widget):
+ self.setWidget(widget);
+
+ def setWidget(w):
+ self.widget = w;
+ self.widget.setParent(viewport());
+ if not self.widget.testAttribute(Qt.WA_Resized):
+ self.widget.resize(widget.sizeHint())
+
+ self.verticalScrollBar().setValue(0)
+ self.verticalScrollBar().setValue(0)
+
+ self.updateArea()
+
+
+ def updateWidgetPosition():
+//! [0]
+ hvalue = self.horizontalScrollBar().value()
+ vvalue = self.verticalScrollBar().value()
+ topLeft = self.viewport().rect().topLeft()
+
+ self.widget.move(topLeft.x() - hvalue, topLeft.y() - vvalue)
+//! [0]
+
+
+ def scrollContentsBy(dx, dy):
+ self.updateWidgetPosition()
+
+ def updateArea():
+//! [1]
+ areaSize = viewport().size()
+ widgetSize = widget.size()
+
+ self.verticalScrollBar().setPageStep(widgetSize.height())
+ self.horizontalScrollBar().setPageStep(widgetSize.width())
+ self.verticalScrollBar().setRange(0, widgetSize.height() - areaSize.height())
+ self.horizontalScrollBar().setRange(0, widgetSize.width() - areaSize.width())
+ self.updateWidgetPosition()
+//! [1]
+
+ def resizeEvent(QResizeEvent):
+ self.updateArea()
+
+app = QApplication(sys.argv)
+pixmap = QPixmap("mypixmap.png")
+label = QLabel()
+label.setPixmap(pixmap)
+area = MyScrollArea(label)
+area.resize(300, 300)
+area.show()
+
+area.setWidget(label)
+
+app.exec_();
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/network/tcpwait.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/network/tcpwait.cpp
new file mode 100644
index 000000000..426d0f844
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/network/tcpwait.cpp
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+from PySide6.QtGui import *
+from PySide6.QtNetwork import QTcpSocket
+
+def main():
+ app = QCoreApplication()
+
+ socket = QTcpSocket()
+ socket.connectToHost("localhost", 1025)
+
+//! [0]
+ numRead = 0
+ numReadTotal = 0
+
+ while(True):
+ buffer = socket.read(50)
+ # do whatever with array
+ numReadTotal += buffer.size()
+ if (buffer.size() == 0 && !socket.waitForReadyRead()):
+ break
+//! [0]
+ return app.exec_()
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/ntfsp.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/ntfsp.cpp
new file mode 100644
index 000000000..c50c3cd82
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/ntfsp.cpp
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+
+//! [0]
+extern Q_CORE_EXPORT int qt_ntfs_permission_lookup;
+//! [0]
+
+//! [1]
+qt_ntfs_permission_lookup += 1 // turn checking on
+qt_ntfs_permission_lookup += 1 // turn it off again
+//! [1]
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/anyHTMLElement.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/anyHTMLElement.xq
new file mode 100644
index 000000000..9f5ee1275
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/anyHTMLElement.xq
@@ -0,0 +1 @@
+doc('data.xml')/*:body
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/anyXLinkAttribute.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/anyXLinkAttribute.xq
new file mode 100644
index 000000000..059bcc081
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/anyXLinkAttribute.xq
@@ -0,0 +1,2 @@
+declare namespace xlink = "http://www.w3.org/1999/xlink";
+doc('image.svg')//@xlink:*
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/bracesIncluded.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/bracesIncluded.xq
new file mode 100644
index 000000000..3961c2838
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/bracesIncluded.xq
@@ -0,0 +1 @@
+<e>{sum((1, 2, 3))}</e>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/bracesIncludedResult.xml b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/bracesIncludedResult.xml
new file mode 100644
index 000000000..0004c7126
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/bracesIncludedResult.xml
@@ -0,0 +1 @@
+<e>6</e>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/bracesOmitted.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/bracesOmitted.xq
new file mode 100644
index 000000000..ffbadd077
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/bracesOmitted.xq
@@ -0,0 +1 @@
+<e>sum({(1, 2, 3)})</e>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/bracesOmittedResult.xml b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/bracesOmittedResult.xml
new file mode 100644
index 000000000..744fb8fe6
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/bracesOmittedResult.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<e>sum(1 2 3)</e> \ No newline at end of file
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/computedTreeFragment.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/computedTreeFragment.xq
new file mode 100644
index 000000000..c5b93ada6
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/computedTreeFragment.xq
@@ -0,0 +1,14 @@
+declare default element namespace "http://example.com/Namespace";
+declare variable $documentElementName := "doc";
+
+element {$documentElementName}
+{
+ attribute xml:base {"http://example.com/"},
+ element anotherElement
+ {
+ comment {" a comment "},
+ processing-instruction target {"data"},
+ element anotherElement {()},
+ text {"some text"}
+ }
+}
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/copyAttribute.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/copyAttribute.xq
new file mode 100644
index 000000000..40e44942c
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/copyAttribute.xq
@@ -0,0 +1,9 @@
+<html>
+ <body>
+ <p>
+ {
+ doc('feed.rss')/rss/@version
+ }
+ </p>
+ </body>
+</html>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/copyID.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/copyID.xq
new file mode 100644
index 000000000..2409cafe6
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/copyID.xq
@@ -0,0 +1,3 @@
+(: Copy the value of xml:id attribute from other.html. This is a comment by the way! :)
+<html xmlns="http://www.w3.org/1999/xhtml/"
+ xml:id="{doc("other.html")/html/@xml:id}"/>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/directTreeFragment.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/directTreeFragment.xq
new file mode 100644
index 000000000..96bc963b4
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/directTreeFragment.xq
@@ -0,0 +1,7 @@
+<doc xmlns="http://example.com/Namespace" xml:base="http://example.com/">
+
+ <!-- a comment -->
+ <?target data?>
+ <anotherElement/>
+ some text
+</doc>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/doc.txt b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/doc.txt
new file mode 100644
index 000000000..d30b057b2
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/doc.txt
@@ -0,0 +1,35 @@
+<doc>
+ <p>
+ <span>1</span>
+ <span>2</span>
+ </p>
+ <p>
+ <span>3</span>
+ <span>4</span>
+ </p>
+ <p>
+ <span>5</span>
+ <span>6</span>
+ </p>
+ <p>
+ <span>7</span>
+ <span>8</span>
+ </p>
+ <p>
+ <span>9</span>
+ <span>a</span>
+ </p>
+ <p>
+ <span>b</span>
+ <span>c</span>
+ </p>
+ <p>
+ <span>d</span>
+ <span>e</span>
+ </p>
+ <p>
+ <span>f</span>
+ <span>0</span>
+ </p>
+</doc>
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/docPlainHTML.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/docPlainHTML.xq
new file mode 100644
index 000000000..622bec891
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/docPlainHTML.xq
@@ -0,0 +1 @@
+doc("myPlainHTML.html")/body
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/docPlainHTML2.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/docPlainHTML2.xq
new file mode 100644
index 000000000..5e7fbaedc
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/docPlainHTML2.xq
@@ -0,0 +1 @@
+doc("myPlainHTML.html")/html/body
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/embedDataInXHTML.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/embedDataInXHTML.xq
new file mode 100644
index 000000000..b513922a3
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/embedDataInXHTML.xq
@@ -0,0 +1,10 @@
+declare default element namespace "http://www.w3.org/1999/xhtml";
+<html>
+ <body>
+ {
+ for $i in doc("testResult.xml")/tests/test[@status = "failure"]
+ order by $i/@name
+ return <p>{$i/@name}</p>
+ }
+ </body>
+</html>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/embedDataInXHTML2.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/embedDataInXHTML2.xq
new file mode 100644
index 000000000..754ddba87
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/embedDataInXHTML2.xq
@@ -0,0 +1,10 @@
+declare namespace x = "http://www.w3.org/1998/xhtml";
+<x:html>
+ <x:body>
+ {
+ for $i in doc("testResult.xml")/tests/test[@status = "failure"]
+ order by $i/@name
+ return <x:p>{$i/@name}</x:p>
+ }
+ </x:body>
+</x:html>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/emptyParagraphs.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/emptyParagraphs.xq
new file mode 100644
index 000000000..6024d28a8
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/emptyParagraphs.xq
@@ -0,0 +1 @@
+doc('index.html')//p[string-length(.) = 0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/escapeCurlyBraces.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/escapeCurlyBraces.xq
new file mode 100644
index 000000000..669e7c197
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/escapeCurlyBraces.xq
@@ -0,0 +1,4 @@
+<doc>
+ This is one left followed by one right curly brace: {{ }}
+ Here they are again, but with character references: &#x7B; &#x7D;
+</doc>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/escapeStringLiterals.xml b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/escapeStringLiterals.xml
new file mode 100644
index 000000000..425ccb075
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/escapeStringLiterals.xml
@@ -0,0 +1,2 @@
+<p>"I hate quotations" -- Ralph Waldo Emerson"
+ '"I hate quotations"" -- Ralph Waldo Emerson"', appeared above</p> \ No newline at end of file
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/escapeStringLiterals.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/escapeStringLiterals.xq
new file mode 100644
index 000000000..4a6054ba6
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/escapeStringLiterals.xq
@@ -0,0 +1,7 @@
+<p>
+{
+ """I hate quotations"" -- Ralph Waldo Emerson""",
+ "&#xA;",
+ '''"I hate quotations"" -- Ralph Waldo Emerson"'', appeared above'
+}
+</p>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/expressionInsideAttribute.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/expressionInsideAttribute.xq
new file mode 100644
index 000000000..97f46b1c4
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/expressionInsideAttribute.xq
@@ -0,0 +1,2 @@
+declare variable $additionalClass := "example";
+<p class="important {$additionalClass} obsolete"/>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/filterOnPath.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/filterOnPath.xq
new file mode 100644
index 000000000..d23dfe8c7
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/filterOnPath.xq
@@ -0,0 +1,2 @@
+let $doc := doc('doc.txt')
+return ($doc/doc/p/span)[1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/filterOnStep.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/filterOnStep.xq
new file mode 100644
index 000000000..46b77fa3c
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/filterOnStep.xq
@@ -0,0 +1,2 @@
+let $doc := doc('doc.txt')
+return $doc/doc/p/span[1] \ No newline at end of file
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/firstParagraph.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/firstParagraph.xq
new file mode 100644
index 000000000..db5e2c720
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/firstParagraph.xq
@@ -0,0 +1 @@
+doc("index.html")/html/body/p[@xml:id = "thatSpecialOne"]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/fnStringOnAttribute.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/fnStringOnAttribute.xq
new file mode 100644
index 000000000..b26e9f2f4
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/fnStringOnAttribute.xq
@@ -0,0 +1,9 @@
+<html>
+ <body>
+ <p>
+ {
+ string(doc('feed.rss')/rss/@version)
+ }
+ </p>
+ </body>
+</html>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/forClause.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/forClause.xq
new file mode 100644
index 000000000..a412dca47
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/forClause.xq
@@ -0,0 +1,3 @@
+for $i in(reverse(1 to 10)),
+ $d in xs:integer(doc("numbers.xml")/numbers/number)
+return ($i + $d)
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/forClause2.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/forClause2.xq
new file mode 100644
index 000000000..4fa505d53
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/forClause2.xq
@@ -0,0 +1,3 @@
+for $i in(reverse(1 to 10)),
+ $d in xs:integer(doc("numbers.xml")/numbers/number)
+return $i + $d
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/forClauseOnFeed.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/forClauseOnFeed.xq
new file mode 100644
index 000000000..9ec33397b
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/forClauseOnFeed.xq
@@ -0,0 +1,6 @@
+for $item in doc('feed.rss')//item
+return <p>
+ {
+ $item/description/node()
+ }
+ </p>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/indented.xml b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/indented.xml
new file mode 100644
index 000000000..a312c63f2
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/indented.xml
@@ -0,0 +1,5 @@
+<a>
+ <b/>
+ <c/>
+ <p>Some Text</p>
+</a>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introAcneRemover.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introAcneRemover.xq
new file mode 100644
index 000000000..4e6ee8044
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introAcneRemover.xq
@@ -0,0 +1,8 @@
+<result>
+ <para>The following skin care products have shipped, ordered by shipping date(oldest first):</para>
+ {
+ for $i in doc("myOrders.xml")/orders/order[@product = "Acme Skin Care"]
+ order by xs:date($i/@shippingDate) descending
+ return $i
+ }
+</result>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introExample2.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introExample2.xq
new file mode 100644
index 000000000..411cc171f
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introExample2.xq
@@ -0,0 +1,5 @@
+<bibliography>
+{
+ doc($file)/bib/book[publisher = $publisher and @year > $year]/<book year="{@year}">{title}</book>
+}
+</bibliography>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introFileHierarchy.xml b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introFileHierarchy.xml
new file mode 100644
index 000000000..cfa6151ce
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introFileHierarchy.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<directory name="home">
+
+ <file name="myNote.txt" mimetype="text/plain" size="8" extension="txt" uri="file:///home/frans/myNote.txt">
+ <content asBase64Binary="TXkgTm90ZSE=" asStringFromUTF-8="My Note!"/>
+ </file>
+
+ <directory name="src">
+ ...
+ </directory>
+
+ ...
+
+</directory>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introNavigateFS.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introNavigateFS.xq
new file mode 100644
index 000000000..1f5a3a73e
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introNavigateFS.xq
@@ -0,0 +1,12 @@
+declare variable $myRoot := <e/>; (: This line is a dummy and shouldn't appear in the documentation. :)
+<html>
+ <body>
+ {
+ $myRoot//file[@mimetype = 'text/xml' or @mimetype = 'application/xml']
+ /
+ (if(doc-available(@uri))
+ then ()
+ else <p>Failed to parse file {@uri}.</p>)
+ }
+ </body>
+</html>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introductionExample.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introductionExample.xq
new file mode 100644
index 000000000..1a309dd7f
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introductionExample.xq
@@ -0,0 +1,3 @@
+<bibliography>
+{doc("library.xml")/bib/book[publisher="Addison-Wesley" and @year>1991]/<book year="{@year}">{title}</book>}
+</bibliography>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/invalidLetOrderBy.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/invalidLetOrderBy.xq
new file mode 100644
index 000000000..d65f24066
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/invalidLetOrderBy.xq
@@ -0,0 +1,3 @@
+let $i := (2, 3, 1)
+order by $i[1]
+return $i
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/items.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/items.xq
new file mode 100644
index 000000000..0b46ec14e
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/items.xq
@@ -0,0 +1,5 @@
+<aNode/>,
+xs:base64Binary("FFFF"),
+current-date(),
+3e3, (: A floating point value :)
+attribute {"name"} {()}
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/letOrderBy.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/letOrderBy.xq
new file mode 100644
index 000000000..f4106d280
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/letOrderBy.xq
@@ -0,0 +1,4 @@
+for $a in (8, -4, 2)
+let $b := ($a * -1, $a)
+order by $a
+return $b
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/literalsAndOperators.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/literalsAndOperators.xq
new file mode 100644
index 000000000..ec4af33ba
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/literalsAndOperators.xq
@@ -0,0 +1,2 @@
+declare variable $date := fn:current-date(); (: This line should not be part of the example. It exists in order to make the query valid. :)
+fn:current-date() - $date > xs:dayTimeDuration("P365D")
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/mobeyDick.xml b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/mobeyDick.xml
new file mode 100644
index 000000000..32d0b6cae
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/mobeyDick.xml
@@ -0,0 +1,4 @@
+<book xmlns:dc='http://purl.org/dc/elements/1.1'
+ xmlns='http://example.com/MyDefault'>
+ <dc:title>Mobey Dick</dc:title> ...
+</book>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/nextLastParagraph.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/nextLastParagraph.xq
new file mode 100644
index 000000000..9424f792b
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/nextLastParagraph.xq
@@ -0,0 +1 @@
+doc('index.html')//p[last() - 1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/nodeConstructorsAreExpressions.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/nodeConstructorsAreExpressions.xq
new file mode 100644
index 000000000..ce36e843a
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/nodeConstructorsAreExpressions.xq
@@ -0,0 +1,4 @@
+let $docURI := 'maybeNotWellformed.xml'
+return if(doc-available($docURI))
+ then doc($docURI)//p/<para>{./node()}</para>
+ else <para>Failed to load {$docURI}</para>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/nodeConstructorsInPaths.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/nodeConstructorsInPaths.xq
new file mode 100644
index 000000000..beb294fba
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/nodeConstructorsInPaths.xq
@@ -0,0 +1 @@
+doc('feed.rss')//item/<p>{description/node()}</p>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/nodeTestChildElement.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/nodeTestChildElement.xq
new file mode 100644
index 000000000..7aa7b3437
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/nodeTestChildElement.xq
@@ -0,0 +1 @@
+doc('index.html')/descendant-or-self::element(p)/child::element(span)
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/notIndented.xml b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/notIndented.xml
new file mode 100644
index 000000000..b3321f286
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/notIndented.xml
@@ -0,0 +1 @@
+<a><b/><c/><p>Some Text</p></a>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/oneElementConstructor.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/oneElementConstructor.xq
new file mode 100644
index 000000000..b7eb615f8
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/oneElementConstructor.xq
@@ -0,0 +1 @@
+<myElement/>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/paragraphsExceptTheFiveFirst.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/paragraphsExceptTheFiveFirst.xq
new file mode 100644
index 000000000..16438d188
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/paragraphsExceptTheFiveFirst.xq
@@ -0,0 +1 @@
+doc('index.html')//p[position() > 5]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/paragraphsWithTables.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/paragraphsWithTables.xq
new file mode 100644
index 000000000..dbb9fcf94
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/paragraphsWithTables.xq
@@ -0,0 +1 @@
+doc('index.html')/html/body/p[table]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/pathAB.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/pathAB.xq
new file mode 100644
index 000000000..26fd1e5dc
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/pathAB.xq
@@ -0,0 +1 @@
+doc('index.html')//p/span
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/pathsAllParagraphs.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/pathsAllParagraphs.xq
new file mode 100644
index 000000000..ba47900f9
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/pathsAllParagraphs.xq
@@ -0,0 +1 @@
+doc('index.html')//p
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/simpleHTML.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/simpleHTML.xq
new file mode 100644
index 000000000..93ac31ec6
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/simpleHTML.xq
@@ -0,0 +1 @@
+doc("index.html")/html/body/p[@class="example"]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/simpleXHTML.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/simpleXHTML.xq
new file mode 100644
index 000000000..fda537167
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/simpleXHTML.xq
@@ -0,0 +1,2 @@
+declare namespace x = "http://www.w3.org/1999/xhtml/";
+doc("index.html")/x:html/x:body/x:p[@class="example"]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/svgDocumentElement.xml b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/svgDocumentElement.xml
new file mode 100644
index 000000000..0c7be4e2d
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/svgDocumentElement.xml
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg"/>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/tablesInParagraphs.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/tablesInParagraphs.xq
new file mode 100644
index 000000000..fc92cf003
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/tablesInParagraphs.xq
@@ -0,0 +1 @@
+doc('index.html')/html/body/p/table
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/twoSVGElements.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/twoSVGElements.xq
new file mode 100644
index 000000000..ab4fe3580
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/twoSVGElements.xq
@@ -0,0 +1,5 @@
+declare namespace s = "http://www.w3.org/2000/svg";
+declare default element namespace "http://www.w3.org/2000/svg";
+let $doc := doc('image.svg')
+return ($doc/svg,
+ $doc/s:svg)
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/xmlStylesheet.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/xmlStylesheet.xq
new file mode 100644
index 000000000..9e022081b
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/xmlStylesheet.xq
@@ -0,0 +1 @@
+<?xml-stylesheet type="test/xsl" href="formatter.xsl"?>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/xsBooleanTrue.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/xsBooleanTrue.xq
new file mode 100644
index 000000000..897a99e4d
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/xsBooleanTrue.xq
@@ -0,0 +1 @@
+xs:boolean("true")
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/xsvgDocumentElement.xml b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/xsvgDocumentElement.xml
new file mode 100644
index 000000000..fb6a236e7
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/xsvgDocumentElement.xml
@@ -0,0 +1 @@
+<x:svg xmlns:x="http://www.w3.org/2000/svg"/>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/persistentindexes/mainwindow.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/persistentindexes/mainwindow.h
new file mode 100644
index 000000000..8f8c36f4e
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/persistentindexes/mainwindow.h
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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>
+#include <QModelIndex>
+
+class QAbstractItemModel;
+class QAction;
+class QItemSelectionModel;
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow(QWidget *parent = 0);
+
+private slots:
+ void insertItem();
+ void removeItem();
+ void updateMenus(const QModelIndex &currentIndex);
+
+private:
+ QAbstractItemModel *model;
+ QAction *insertAction;
+ QAction *removeAction;
+ QItemSelectionModel *selectionModel;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/persistentindexes/model.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/persistentindexes/model.h
new file mode 100644
index 000000000..0dbd0b849
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/persistentindexes/model.h
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 MODEL_H
+#define MODEL_H
+
+#include <QAbstractListModel>
+#include <QObject>
+#include <QStringList>
+
+class StringListModel : public QAbstractListModel
+{
+ Q_OBJECT
+public:
+ StringListModel(const QStringList &strings, QObject *parent = 0)
+ : QAbstractListModel(parent), stringList(strings) {}
+
+ int rowCount(const QModelIndex &parent = QModelIndex()) const;
+ QVariant data(const QModelIndex &index, int role) const;
+ QVariant headerData(int section, Qt::Orientation orientation,
+ int role = Qt::DisplayRole) const;
+
+ Qt::ItemFlags flags(const QModelIndex &index) const;
+ bool setData(const QModelIndex &index, const QVariant &value,
+ int role = Qt::EditRole);
+
+ bool insertRows(int position, int rows, const QModelIndex &index = QModelIndex());
+ bool removeRows(int position, int rows, const QModelIndex &index = QModelIndex());
+
+private:
+ QStringList stringList;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/picture/picture.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/picture/picture.cpp
new file mode 100644
index 000000000..6d4ef567c
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/picture/picture.cpp
@@ -0,0 +1,121 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+//! [0]
+ picture = QPicture()
+ painter = QPainter()
+ painter.begin(picture) # paint in picture
+ painter.drawEllipse(10,20, 80,70) # draw an ellipse
+ painter.end() # painting done
+ picture.save("drawing.pic") # save picture
+//! [0]
+
+//! [1]
+ picture = QPicture()
+ picture.load("drawing.pic") # load picture
+ painter = QPainter()
+ painter.begin(myImage) # paint in myImage
+ painter.drawPicture(0, 0, picture) # draw the picture at (0,0)
+ painter.end() # painting done
+//! [1]
+
+//! [2]
+ list = QPicture.inputFormatList()
+ for string in list:
+ myProcessing(string)
+//! [2]
+
+//! [3]
+ list = QPicture.outputFormatList()
+ for string in list:
+ myProcessing(string)
+//! [3]
+
+//! [4]
+ iio = QPictureIO()
+ pixmap = QPixmap()
+ iio.setFileName("vegeburger.pic")
+ if iio.read(): # OK
+ picture = iio.picture()
+ painter = QPainter(pixmap)
+ painter.drawPicture(0, 0, picture)
+
+//! [4]
+
+//! [5]
+ iio = QPictureIO()
+ picture = QPicture()
+ painter = QPainter(picture)
+ painter.drawPixmap(0, 0, pixmap)
+ iio.setPicture(picture)
+ iio.setFileName("vegeburger.pic")
+ iio.setFormat("PIC")
+ if iio.write():
+ return True # returned true if written successfully
+//! [5]
+
+//! [6]
+def readSVG(picture):
+ # read the picture using the picture.ioDevice()
+
+//! [6]
+
+
+//! [7]
+def writeSVG(picture):
+ # write the picture using the picture.ioDevice()
+
+//! [7]
+
+
+//! [8]
+ # add the SVG picture handler
+ # ...
+//! [8]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/plaintextlayout/window.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/plaintextlayout/window.h
new file mode 100644
index 000000000..1d14ed044
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/plaintextlayout/window.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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>
+
+class Window : public QWidget
+{
+ Q_OBJECT
+
+public:
+ Window(QWidget *parent = 0);
+
+protected:
+ void paintEvent(QPaintEvent *event);
+
+private:
+ QFont font;
+ QString text;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/polygon/polygon.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/polygon/polygon.cpp
new file mode 100644
index 000000000..03c9f40d3
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/polygon/polygon.cpp
@@ -0,0 +1,96 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+//! [0]
+ polygon = QPolygon()
+ polygon << QPoint(10, 20) << QPoint(20, 30)
+//! [0]
+
+//! [1]
+ polygon = QPolygonF()
+ polygon << QPointF(10.4, 20.5) << QPointF(20.2, 30.2)
+//! [1]
+
+//! [2]
+ points = [ 10, 20, 30, 40 ]
+ polygon = QPolygon()
+ polygon.setPoints(2, points)
+//! [2]
+
+//! [3]
+ polygon = QPolygon()
+ polygon.setPoints(2, 10, 20, 30, 40)
+//! [3]
+
+//! [4]
+ polygon = QPolygon(1)
+ polygon[0] = QPoint(4, 5)
+ polygon.putPoints(1, 2, 6,7, 8,9)
+//! [4]
+
+//! [5]
+ polygon = QPolygon(3)
+ polygon.putPoints(0, 3, 4,5, 0,0, 8,9)
+ polygon.putPoints(1, 1, 6,7)
+//! [5]
+
+//! [6]
+ polygon1 = QPolygon()
+ polygon1.putPoints(0, 3, 1,2, 0,0, 5,6)
+ # polygon1 is now the three-point polygon(1,2, 0,0, 5,6)
+
+ polygon2 = QPolygon()
+ polygon2.putPoints(0, 3, 4,4, 5,5, 6,6)
+ # polygon2 is now (4,4, 5,5, 6,6)
+
+ polygon1.putPoints(2, 3, polygon2)
+ # polygon1 is now the five-point polygon(1,2, 0,0, 4,4, 5,5, 6,6)
+//! [6]
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/porting4-dropevents/window.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/porting4-dropevents/window.h
new file mode 100644
index 000000000..56bab84f0
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/porting4-dropevents/window.h
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 <QString>
+#include <QStringList>
+#include <QWidget>
+
+class QComboBox;
+class QFrame;
+class QLabel;
+
+class MyWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ MyWidget(QWidget *parent = 0);
+
+protected:
+ void dragEnterEvent(QDragEnterEvent *event);
+ void dropEvent(QDropEvent *event);
+ void mousePressEvent(QMouseEvent *event);
+
+private:
+ QComboBox *mimeTypeCombo;
+ QFrame *dropFrame;
+ QLabel *dataLabel;
+ QString oldText;
+ QStringList oldMimeTypes;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/printing-qprinter/errors.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/printing-qprinter/errors.cpp
new file mode 100644
index 000000000..8c71d1e81
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/printing-qprinter/errors.cpp
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+ printer = QPrinter()
+ printer.setOutputFormat(QPrinter.PdfFormat)
+ printer.setOutputFileName("/foobar/nonwritable.pdf")
+ QPainter painter
+ if painter.begin(printer): # failed to open file
+ print "failed to open file, is it writable?"
+ return 1
+
+ painter.drawText(10, 10, "Test")
+ if !printer.Page():
+ print "failed in flushing page to disk, disk full?"
+ return 1
+
+ painter.drawText(10, 10, "Test 2")
+ painter.end()
+//! [0]
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/printing-qprinter/object.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/printing-qprinter/object.h
new file mode 100644
index 000000000..a70dcd16d
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/printing-qprinter/object.h
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 <QObject>
+
+class Object : public QObject
+{
+ Q_OBJECT
+
+public:
+ Object(QObject *parent = 0);
+
+public slots:
+ void print();
+};
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qabstractsliderisnippet.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/qabstractsliderisnippet.cpp
new file mode 100644
index 000000000..db93f8ecb
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qabstractsliderisnippet.cpp
@@ -0,0 +1,519 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+QAbstractSliderPrivate::QAbstractSliderPrivate()
+ : minimum(0), maximum(99), singleStep(1), pageStep(10),
+ value(0), position(0), pressValue(-1), tracking(true), blocktracking(false), pressed(false),
+ invertedAppearance(false), invertedControls(false),
+ orientation(Qt::Horizontal), repeatAction(QAbstractSlider::SliderNoAction)
+{
+}
+
+QAbstractSliderPrivate::~QAbstractSliderPrivate()
+{
+}
+
+oid QAbstractSlider::setRange(int min, int max)
+{
+ Q_D(QAbstractSlider);
+ int oldMin = d->minimum;
+ int oldMax = d->maximum;
+ d->minimum = min;
+ d->maximum = qMax(min, max);
+ if (oldMin != d->minimum || oldMax != d->maximum) {
+ sliderChange(SliderRangeChange);
+ emit rangeChanged(d->minimum, d->maximum);
+ setValue(d->value); // re-bound
+ }
+}
+
+
+void QAbstractSliderPrivate::setSteps(int single, int page)
+{
+ Q_Q(QAbstractSlider);
+ singleStep = qAbs(single);
+ pageStep = qAbs(page);
+ q->sliderChange(QAbstractSlider::SliderStepsChange);
+}
+
+AbstractSlider::QAbstractSlider(QWidget *parent)
+ :QWidget(*new QAbstractSliderPrivate, parent, 0)
+{
+}
+
+QAbstractSlider::QAbstractSlider(QAbstractSliderPrivate &dd, QWidget *parent)
+ :QWidget(dd, parent, 0)
+{
+}
+
+QAbstractSlider::~QAbstractSlider()
+{
+}
+
+void QAbstractSlider::setOrientation(Qt::Orientation orientation)
+{
+ Q_D(QAbstractSlider);
+ if (d->orientation == orientation)
+ return;
+
+ d->orientation = orientation;
+ if (!testAttribute(Qt::WA_WState_OwnSizePolicy)) {
+ QSizePolicy sp = sizePolicy();
+ sp.transpose();
+ setSizePolicy(sp);
+ setAttribute(Qt::WA_WState_OwnSizePolicy, false);
+ }
+ update();
+ updateGeometry();
+}
+
+Qt::Orientation QAbstractSlider::orientation() const
+{
+ Q_D(const QAbstractSlider);
+ return d->orientation;
+}
+
+
+void QAbstractSlider::setMinimum(int min)
+{
+ Q_D(QAbstractSlider);
+ setRange(min, qMax(d->maximum, min));
+}
+
+int QAbstractSlider::minimum() const
+{
+ Q_D(const QAbstractSlider);
+ return d->minimum;
+}
+
+
+void QAbstractSlider::setMaximum(int max)
+{
+ Q_D(QAbstractSlider);
+ setRange(qMin(d->minimum, max), max);
+}
+
+int QAbstractSlider::maximum() const
+{
+ Q_D(const QAbstractSlider);
+ return d->maximum;
+}
+
+
+
+void QAbstractSlider::setSingleStep(int step)
+{
+ Q_D(QAbstractSlider);
+ d->setSteps(step, d->pageStep);
+}
+
+int QAbstractSlider::singleStep() const
+{
+ Q_D(const QAbstractSlider);
+ return d->singleStep;
+}
+
+
+void QAbstractSlider::setPageStep(int step)
+{
+ Q_D(QAbstractSlider);
+ d->setSteps(d->singleStep, step);
+}
+
+int QAbstractSlider::pageStep() const
+{
+ Q_D(const QAbstractSlider);
+ return d->pageStep;
+}
+
+oid QAbstractSlider::setTracking(bool enable)
+{
+ Q_D(QAbstractSlider);
+ d->tracking = enable;
+}
+
+bool QAbstractSlider::hasTracking() const
+{
+ Q_D(const QAbstractSlider);
+ return d->tracking;
+}
+
+
+
+void QAbstractSlider::setSliderDown(bool down)
+{
+ Q_D(QAbstractSlider);
+ bool doEmit = d->pressed != down;
+
+ d->pressed = down;
+
+ if (doEmit) {
+ if (down)
+ emit sliderPressed();
+ else
+ emit sliderReleased();
+ }
+
+ if (!down && d->position != d->value)
+ triggerAction(SliderMove);
+}
+
+bool QAbstractSlider::isSliderDown() const
+{
+ Q_D(const QAbstractSlider);
+ return d->pressed;
+}
+
+
+void QAbstractSlider::setSliderPosition(int position)
+{
+ Q_D(QAbstractSlider);
+ position = d->bound(position);
+ if (position == d->position)
+ return;
+ d->position = position;
+ if (!d->tracking)
+ update();
+ if (d->pressed)
+ emit sliderMoved(position);
+ if (d->tracking && !d->blocktracking)
+ triggerAction(SliderMove);
+}
+
+int QAbstractSlider::sliderPosition() const
+{
+ Q_D(const QAbstractSlider);
+ return d->position;
+}
+
+
+
+int QAbstractSlider::value() const
+{
+ Q_D(const QAbstractSlider);
+ return d->value;
+}
+
+//! [0]
+void QAbstractSlider::setValue(int value)
+//! [0]
+{
+ Q_D(QAbstractSlider);
+ value = d->bound(value);
+ if (d->value == value && d->position == value)
+ return;
+ d->value = value;
+ if (d->position != value) {
+ d->position = value;
+ if (d->pressed)
+ emit sliderMoved((d->position = value));
+ }
+#ifndef QT_NO_ACCESSIBILITY
+//! [1]
+ QAccessible::updateAccessibility(this, 0, QAccessible::ValueChanged);
+//! [1]
+#endif
+ sliderChange(SliderValueChange);
+ emit valueChanged(value);
+//! [2]
+}
+//! [2]
+
+bool QAbstractSlider::invertedAppearance() const
+{
+ Q_D(const QAbstractSlider);
+ return d->invertedAppearance;
+}
+
+void QAbstractSlider::setInvertedAppearance(bool invert)
+{
+ Q_D(QAbstractSlider);
+ d->invertedAppearance = invert;
+ update();
+}
+
+
+
+bool QAbstractSlider::invertedControls() const
+{
+ Q_D(const QAbstractSlider);
+ return d->invertedControls;
+}
+
+void QAbstractSlider::setInvertedControls(bool invert)
+{
+ Q_D(QAbstractSlider);
+ d->invertedControls = invert;
+}
+
+void QAbstractSlider::triggerAction(SliderAction action)
+{
+ Q_D(QAbstractSlider);
+ d->blocktracking = true;
+ switch (action) {
+ case SliderSingleStepAdd:
+ setSliderPosition(d->value + d->singleStep);
+ break;
+ case SliderSingleStepSub:
+ setSliderPosition(d->value - d->singleStep);
+ break;
+ case SliderPageStepAdd:
+ setSliderPosition(d->value + d->pageStep);
+ break;
+ case SliderPageStepSub:
+ setSliderPosition(d->value - d->pageStep);
+ break;
+ case SliderToMinimum:
+ setSliderPosition(d->minimum);
+ break;
+ case SliderToMaximum:
+ setSliderPosition(d->maximum);
+ break;
+ case SliderMove:
+ case SliderNoAction:
+ break;
+ };
+ emit actionTriggered(action);
+ d->blocktracking = false;
+ setValue(d->position);
+}
+
+void QAbstractSlider::setRepeatAction(SliderAction action, int thresholdTime, int repeatTime)
+{
+ Q_D(QAbstractSlider);
+ if ((d->repeatAction = action) == SliderNoAction) {
+ d->repeatActionTimer.stop();
+ } else {
+ d->repeatActionTime = repeatTime;
+ d->repeatActionTimer.start(thresholdTime, this);
+ }
+}
+
+QAbstractSlider::SliderAction QAbstractSlider::repeatAction() const
+{
+ Q_D(const QAbstractSlider);
+ return d->repeatAction;
+}
+
+void QAbstractSlider::timerEvent(QTimerEvent *e)
+{
+ Q_D(QAbstractSlider);
+ if (e->timerId() == d->repeatActionTimer.timerId()) {
+ if (d->repeatActionTime) { // was threshold time, use repeat time next time
+ d->repeatActionTimer.start(d->repeatActionTime, this);
+ d->repeatActionTime = 0;
+ }
+ if (d->repeatAction == SliderPageStepAdd)
+ d->setAdjustedSliderPosition(d->value + d->pageStep);
+ else if (d->repeatAction == SliderPageStepSub)
+ d->setAdjustedSliderPosition(d->value - d->pageStep);
+ else
+ triggerAction(d->repeatAction);
+ }
+}
+
+oid QAbstractSlider::sliderChange(SliderChange)
+{
+ update();
+}
+
+
+#ifndef QT_NO_WHEELEVENT
+void QAbstractSlider::wheelEvent(QWheelEvent * e)
+{
+ Q_D(QAbstractSlider);
+ e->ignore();
+ if (e->orientation() != d->orientation && !rect().contains(e->pos()))
+ return;
+
+ static qreal offset = 0;
+ static QAbstractSlider *offset_owner = 0;
+ if (offset_owner != this){
+ offset_owner = this;
+ offset = 0;
+ }
+
+ int step = qMin(QApplication::wheelScrollLines() * d->singleStep, d->pageStep);
+ if ((e->modifiers() & Qt::ControlModifier) || (e->modifiers() & Qt::ShiftModifier))
+ step = d->pageStep;
+ offset += e->delta() * step / 120;
+ if (d->invertedControls)
+ offset = -offset;
+
+ if (qAbs(offset) < 1)
+ return;
+
+ int prevValue = d->value;
+ d->position = d->value + int(offset); // value will be updated by triggerAction()
+ triggerAction(SliderMove);
+ if (prevValue == d->value) {
+ offset = 0;
+ } else {
+ offset -= int(offset);
+ e->accept();
+ }
+}
+#endif
+void QAbstractSlider::keyPressEvent(QKeyEvent *ev)
+{
+ Q_D(QAbstractSlider);
+ SliderAction action = SliderNoAction;
+ switch (ev->key()) {
+#ifdef QT_KEYPAD_NAVIGATION
+ case Qt::Key_Select:
+ if (QApplication::keypadNavigationEnabled())
+ setEditFocus(!hasEditFocus());
+ else
+ ev->ignore();
+ break;
+ case Qt::Key_Back:
+ if (QApplication::keypadNavigationEnabled() && hasEditFocus()) {
+ setValue(d->origValue);
+ setEditFocus(false);
+ } else
+ ev->ignore();
+ break;
+#endif
+
+ // It seems we need to use invertedAppearance for Left and right, otherwise, things look weird.
+ case Qt::Key_Left:
+#ifdef QT_KEYPAD_NAVIGATION
+ if (QApplication::keypadNavigationEnabled() && !hasEditFocus()) {
+ ev->ignore();
+ return;
+ }
+ if (QApplication::keypadNavigationEnabled() && d->orientation == Qt::Vertical)
+ action = d->invertedControls ? SliderSingleStepSub : SliderSingleStepAdd;
+ else
+#endif
+ action = !d->invertedAppearance ? SliderSingleStepSub : SliderSingleStepAdd;
+ break;
+ case Qt::Key_Right:
+#ifdef QT_KEYPAD_NAVIGATION
+ if (QApplication::keypadNavigationEnabled() && !hasEditFocus()) {
+ ev->ignore();
+ return;
+ }
+ if (QApplication::keypadNavigationEnabled() && d->orientation == Qt::Vertical)
+ action = d->invertedControls ? SliderSingleStepAdd : SliderSingleStepSub;
+ else
+#endif
+ action = !d->invertedAppearance ? SliderSingleStepAdd : SliderSingleStepSub;
+ break;
+ case Qt::Key_Up:
+#ifdef QT_KEYPAD_NAVIGATION
+ if (QApplication::keypadNavigationEnabled()) {
+ ev->ignore();
+ break;
+ }
+#endif
+ action = d->invertedControls ? SliderSingleStepSub : SliderSingleStepAdd;
+ break;
+ case Qt::Key_Down:
+#ifdef QT_KEYPAD_NAVIGATION
+ if (QApplication::keypadNavigationEnabled()) {
+ ev->ignore();
+ break;
+ }
+#endif
+ action = d->invertedControls ? SliderSingleStepAdd : SliderSingleStepSub;
+ break;
+ case Qt::Key_PageUp:
+ action = d->invertedControls ? SliderPageStepSub : SliderPageStepAdd;
+ break;
+ case Qt::Key_PageDown:
+ action = d->invertedControls ? SliderPageStepAdd : SliderPageStepSub;
+ break;
+ case Qt::Key_Home:
+ action = SliderToMinimum;
+ break;
+ case Qt::Key_End:
+ action = SliderToMaximum;
+ break;
+ default:
+ ev->ignore();
+ break;
+ }
+ if (action)
+ triggerAction(action);
+}
+
+void QAbstractSlider::changeEvent(QEvent *ev)
+{
+ Q_D(QAbstractSlider);
+ switch (ev->type()) {
+ case QEvent::EnabledChange:
+ if (!isEnabled()) {
+ d->repeatActionTimer.stop();
+ setSliderDown(false);
+ }
+ // fall through...
+ default:
+ QWidget::changeEvent(ev);
+ }
+}
+
+bool QAbstractSlider::event(QEvent *e)
+{
+#ifdef QT_KEYPAD_NAVIGATION
+ Q_D(QAbstractSlider);
+ switch (e->type()) {
+ case QEvent::FocusIn:
+ d->origValue = d->value;
+ break;
+ default:
+ break;
+ }
+#endif
+
+ return QWidget::event(e);
+}
+
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qdir-listfiles/main.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/qdir-listfiles/main.cpp
new file mode 100644
index 000000000..d0189027a
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qdir-listfiles/main.cpp
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+
+from PySide6.QtCore import QDir, QCoreApplication
+import sys
+
+app = QCoreApplication(sys.argv)
+directory = QDir()
+directory.setFilter(QDir.Files | QDir.Hidden | QDir.NoSymLinks)
+directory.setSorting(QDir.Size | QDir.Reversed)
+
+for entry in directory.entryInfoList():
+ print "%s %s" % (entry.size(), entry.fileName())
+
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qdir-namefilters/main.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/qdir-namefilters/main.cpp
new file mode 100644
index 000000000..5a323a97f
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qdir-namefilters/main.cpp
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+from PySide6.QtCore import *
+
+def main():
+ dir_ = QDir()
+ dir_.setFilter(QDir.Files | QDir.Hidden | QDir.NoSymLinks)
+ dir_.setSorting(QDir.Size | QDir.Reversed)
+
+//! [0]
+ filters = ["*.cpp", "*.cxx", "*.cc"]
+ dir_.setNameFilters(filters)
+//! [0]
+//
+ lst = d.entryInfoList()
+
+ print " Bytes Filename"
+ for fileInfo in lst:
+ print '%d %s' % (fileInfo.size(), fileInfo.fileName())
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qfontdatabase/main.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/qfontdatabase/main.cpp
new file mode 100644
index 000000000..bc199b237
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qfontdatabase/main.cpp
@@ -0,0 +1,74 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+//! [0]
+ database = QFontDatabase()
+ fontTree = QTreeWidget()
+ fontTree.setColumnCount(2)
+ fontTree.setHeaderLabels(QStringList() << "Font" << "Smooth Sizes")
+
+ for family in database.families():
+ familyItem = QTreeWidgetItem(fontTree)
+ familyItem.setText(0, family)
+
+ for style in database.styles(family):
+ styleItem = QTreeWidgetItem(familyItem)
+ styleItem.setText(0, style)
+
+ sizes = 0
+ for points in database.smoothSizes(family, style):
+ sizes += QString.number(points) + " "
+
+ styleItem.setText(1, sizes.trimmed())
+
+//! [0] //! [1]
+
+//! [1]
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qlineargradient/paintwidget.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/qlineargradient/paintwidget.h
new file mode 100644
index 000000000..d43ff3eae
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qlineargradient/paintwidget.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 PAINTWIDGET_H
+#define PAINTWIDGET_H
+
+#include <QWidget>
+
+class QPaintEvent;
+
+class PaintWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ PaintWidget(QWidget *parent = 0);
+
+protected:
+ void paintEvent(QPaintEvent *event);
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qlistview-dnd/mainwindow.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/qlistview-dnd/mainwindow.h
new file mode 100644
index 000000000..9788231c0
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qlistview-dnd/mainwindow.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 <QMainWindow>
+
+class QListView;
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow();
+
+private:
+ void setupListItems();
+
+ QListView *listView;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qlistview-dnd/model.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/qlistview-dnd/model.h
new file mode 100644
index 000000000..5ced99cfe
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qlistview-dnd/model.h
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 MODEL_H
+#define MODEL_H
+
+#include <QObject>
+#include <QStringListModel>
+
+class DragDropListModel : public QStringListModel
+{
+ Q_OBJECT
+
+public:
+ DragDropListModel(const QStringList &strings, QObject *parent = 0);
+
+ Qt::ItemFlags flags(const QModelIndex &index) const;
+
+ bool dropMimeData(const QMimeData *data, Qt::DropAction action,
+ int row, int column, const QModelIndex &parent);
+ QMimeData *mimeData(const QModelIndexList &indexes) const;
+ QStringList mimeTypes() const;
+ Qt::DropActions supportedDropActions() const;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qlistview-using/mainwindow.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/qlistview-using/mainwindow.h
new file mode 100644
index 000000000..848ef6b24
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qlistview-using/mainwindow.h
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 <QMainWindow>
+#include <QModelIndex>
+
+class QAction;
+class QListView;
+class StringListModel;
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow();
+
+public slots:
+ void insertItem();
+ void removeItem();
+ void sortAscending();
+ void sortDescending();
+ void updateMenus(const QModelIndex &current);
+
+private:
+ QAction *insertAction;
+ QAction *removeAction;
+ QListView *listView;
+ StringListModel *model;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qlistview-using/model.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/qlistview-using/model.h
new file mode 100644
index 000000000..6451ac281
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qlistview-using/model.h
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 MODEL_H
+#define MODEL_H
+
+#include <QAbstractListModel>
+#include <QObject>
+#include <QStringList>
+
+class StringListModel : public QAbstractListModel
+{
+ Q_OBJECT
+
+public:
+ StringListModel(const QStringList &strings, QObject *parent = 0)
+ : QAbstractListModel(parent), stringList(strings) {}
+
+ int rowCount(const QModelIndex &parent = QModelIndex()) const;
+ QVariant data(const QModelIndex &index, int role) const;
+ QVariant headerData(int section, Qt::Orientation orientation,
+ int role = Qt::DisplayRole) const;
+
+ Qt::ItemFlags flags(const QModelIndex &index) const;
+ bool setData(const QModelIndex &index, const QVariant &value,
+ int role = Qt::EditRole);
+
+ bool insertRows(int position, int rows, const QModelIndex &index = QModelIndex());
+ bool removeRows(int position, int rows, const QModelIndex &index = QModelIndex());
+
+private:
+ QStringList stringList;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qlistwidget-dnd/mainwindow.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/qlistwidget-dnd/mainwindow.h
new file mode 100644
index 000000000..ca6e41cf5
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qlistwidget-dnd/mainwindow.h
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 <QMainWindow>
+
+class QListWidget;
+class QListWidgetItem;
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow();
+
+private:
+ void setupListItems();
+
+ QListWidget *listWidget;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qlistwidget-using/mainwindow.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/qlistwidget-using/mainwindow.h
new file mode 100644
index 000000000..b03749df2
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qlistwidget-using/mainwindow.h
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 <QMainWindow>
+
+class QAction;
+class QListWidget;
+class QListWidgetItem;
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow();
+
+public slots:
+ void insertItem();
+ void removeItem();
+ void sortAscending();
+ void sortDescending();
+ void updateMenus(QListWidgetItem *current);
+
+private:
+ void setupListItems();
+
+ QAction *insertAction;
+ QAction *removeAction;
+ QListWidget *listWidget;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qmacnativewidget/main.mm b/sources/pyside6/doc/codesnippets/doc/src/snippets/qmacnativewidget/main.mm
new file mode 100644
index 000000000..12794b1d5
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qmacnativewidget/main.mm
@@ -0,0 +1,144 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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/QtGui>
+#include <QtGui/qmacnativewidget_mac.h>
+#ifdef QT_MAC_USE_COCOA
+#import <Cocoa/Cocoa.h>
+#else
+#include <Carbon/Carbon.h>
+#endif
+
+int main(int argc, char **argv)
+{
+ QApplication app(argc, argv);
+#ifdef QT_MAC_USE_COCOA
+//![0]
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ NSWindow *window = [[NSWindow alloc] initWithContentRect:NSMakeRect(200, app.desktop()->height() - 200, 239, 200)
+ styleMask:NSTitledWindowMask | NSClosableWindowMask
+ | NSMiniaturizableWindowMask | NSResizableWindowMask
+ backing:NSBackingStoreBuffered defer:NO];
+
+ QMacNativeWidget *nativeWidget = new QMacNativeWidget();
+ nativeWidget->move(0, 0);
+ nativeWidget->setPalette(QPalette(Qt::red));
+ nativeWidget->setAutoFillBackground(true);
+ QVBoxLayout *layout = new QVBoxLayout();
+ QPushButton *pushButton = new QPushButton("An Embedded Qt Button!", nativeWidget);
+ pushButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // Don't use the layout rect calculated from QMacStyle.
+ layout->addWidget(pushButton);
+ nativeWidget->setLayout(layout);
+
+ // Adjust Cocoa layouts
+ NSView *nativeWidgetView = reinterpret_cast<NSView *>(nativeWidget->winId());
+ NSView *contentView = [window contentView];
+ [contentView setAutoresizesSubviews:YES];
+ [nativeWidgetView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
+ [nativeWidgetView setAutoresizesSubviews:YES];
+ NSView *pushButtonView = reinterpret_cast<NSView *>(pushButton->winId());
+ [pushButtonView setAutoresizingMask:NSViewWidthSizable];
+
+ // Add the nativeWidget to the window.
+ [contentView addSubview:nativeWidgetView positioned:NSWindowAbove relativeTo:nil];
+ nativeWidget->show();
+ pushButton->show();
+
+ // Show the window.
+ [window makeKeyAndOrderFront:window];
+ [pool release];
+//![0]
+#else
+//![1]
+ Rect contentRect;
+ SetRect(&contentRect, 200, 200, 400, 400);
+ HIWindowRef windowRef;
+ CreateNewWindow(kDocumentWindowClass, kWindowStandardDocumentAttributes | kWindowCompositingAttribute | kWindowStandardHandlerAttribute | kWindowLiveResizeAttribute, &contentRect, &windowRef);
+ HIViewRef contentView = 0;
+ GetRootControl(windowRef, &contentView);
+
+ QMacNativeWidget *nativeWidget = new QMacNativeWidget();
+ nativeWidget->move(0, 0);
+ nativeWidget->setPalette(QPalette(Qt::red));
+ nativeWidget->setAutoFillBackground(true);
+ QVBoxLayout *layout = new QVBoxLayout();
+ QPushButton *pushButton = new QPushButton("An Embedded Qt Button!", nativeWidget);
+ pushButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // Don't use the layout rect calculated from QMacStyle.
+ layout->addWidget(pushButton);
+ nativeWidget->setLayout(layout);
+ HIViewRef nativeWidgetView = reinterpret_cast<HIViewRef>(nativeWidget->winId());
+ // Add the nativeWidget to the window.
+ HIViewAddSubview(contentView, nativeWidgetView);
+
+ // Adjust Carbon layouts
+ HILayoutInfo layoutInfo;
+ layoutInfo.version = kHILayoutInfoVersionZero;
+ HIViewGetLayoutInfo(nativeWidgetView, &layoutInfo);
+
+ layoutInfo.binding.top.toView = contentView;
+ layoutInfo.binding.top.kind = kHILayoutBindTop;
+ layoutInfo.binding.left.toView = contentView;
+ layoutInfo.binding.left.kind = kHILayoutBindLeft;
+ layoutInfo.binding.right.toView = contentView;
+ layoutInfo.binding.right.kind = kHILayoutBindRight;
+ layoutInfo.binding.bottom.toView = contentView;
+ layoutInfo.binding.bottom.kind = kHILayoutBindBottom;
+
+ HIViewSetLayoutInfo(nativeWidgetView, &layoutInfo);
+ HIViewApplyLayout(nativeWidgetView);
+
+ pushButton->show();
+ nativeWidget->show();
+ // Show the window.
+ ShowWindow(windowRef);
+//![1]
+#endif
+ return app.exec(); // gives us the same behavior in both
+}
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/delegate.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/delegate.h
new file mode 100644
index 000000000..ff07205b9
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/delegate.h
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/main.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/main.cpp
new file mode 100644
index 000000000..ff07205b9
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/main.cpp
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/model.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/model.cpp
new file mode 100644
index 000000000..ff07205b9
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/model.cpp
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/model.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/model.h
new file mode 100644
index 000000000..ff07205b9
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/model.h
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/paintwidget_unix.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/paintwidget_unix.cpp
new file mode 100644
index 000000000..e4361c673
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/paintwidget_unix.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+int main(int argc, char *argv[])
+{
+ return 0;
+}
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/view.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/view.h
new file mode 100644
index 000000000..ff07205b9
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/view.h
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qmetaobject-invokable/window.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/qmetaobject-invokable/window.h
new file mode 100644
index 000000000..7c8711105
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qmetaobject-invokable/window.h
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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>
+
+//! [Window class with invokable method]
+class Window : public QWidget
+{
+ Q_OBJECT
+
+public:
+ Window();
+ void normalMethod();
+ Q_INVOKABLE void invokableMethod();
+};
+//! [Window class with invokable method]
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qquickview-ex.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/qquickview-ex.cpp
new file mode 100644
index 000000000..380989e4e
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qquickview-ex.cpp
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+if __name__ == '__main__':
+ app = QGuiApplication(sys.argv)
+ view = QQuickView()
+ view.setResizeMode(QQuickView.SizeRootObjectToView)
+
+ qmlFile = os.path.join(os.path.dirname(__file__), 'view.qml')
+ view.setSource(QUrl.fromLocalFile(os.path.abspath(qmlFile)))
+ if view.status() == QQuickView.Error:
+ sys.exit(-1)
+ view.show()
+
+ app.exec_()
+ # Deleting the view before it goes out of scope is required to make
+ # sure all child QML instances are destroyed in the correct order.
+ del view
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qsignalmapper/buttonwidget.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/qsignalmapper/buttonwidget.h
new file mode 100644
index 000000000..6763da00d
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qsignalmapper/buttonwidget.h
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 BUTTONWIDGET_H
+#define BUTTONWIDGET_H
+
+#include <qwidget.h>
+
+class QSignalMapper;
+class QString;
+class QStringList;
+
+//! [0]
+
+class ButtonWidget(QWidget):
+ def __init__(self, texts, parent=None):
+ QWidget.__init__(self, parent)
+ ...
+//! [0] //! [1]
+
+//! [1]
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qsignalmapper/mainwindow.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/qsignalmapper/mainwindow.h
new file mode 100644
index 000000000..18037fadd
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qsignalmapper/mainwindow.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 <QMainWindow>
+#include <QStatusBar>
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow()
+ {
+ statusBar()->showMessage(tr("Ready"));
+ }
+
+public slots:
+ void buttonPressed(const QString &text)
+ {
+ statusBar()->showMessage(tr("Chose %1").arg(text));
+ }
+};
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qsortfilterproxymodel-details/main.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/qsortfilterproxymodel-details/main.cpp
new file mode 100644
index 000000000..9b097f3bd
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qsortfilterproxymodel-details/main.cpp
@@ -0,0 +1,79 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+
+//! [0] //! [1]
+ treeView = QTreeView()
+//! [0]
+ model = MyItemModel(self)
+
+ treeView.setModel(model)
+//! [1]
+
+//! [2]
+ sourceModel = MyItemModel(self)
+ proxyModel = QSortFilterProxyModel(self)
+
+ proxyModel.setSourceModel(sourceModel)
+ treeView.setModel(proxyModel)
+//! [2]
+
+//! [3]
+ treeView.setSortingEnabled(True)
+//! [3]
+
+//! [4]
+ proxyModel.sort(2, Qt.AscendingOrder)
+//! [4] //! [5]
+ proxyModel.setFilterRegExp(QRegExp(".png", Qt.CaseInsensitive,
+ QRegExp.FixedString))
+ proxyModel.setFilterKeyColumn(1)
+//! [5]
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qsplashscreen/main.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/qsplashscreen/main.cpp
new file mode 100644
index 000000000..33b48f742
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qsplashscreen/main.cpp
@@ -0,0 +1,66 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+
+//! [0]
+def main():
+ app = QApplication(sys.argv)
+ pixmap = QPixmap(":/splash.png")
+ splash = QSplashScreen(pixmap)
+ splash.show()
+ app.processEvents()
+//! [0]
+
+//! [1]
+ window = QMainWindow()
+ window.show()
+ splash.finish(&window)
+ return app.exec_()
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qsplashscreen/mainwindow.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/qsplashscreen/mainwindow.h
new file mode 100644
index 000000000..22132039b
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qsplashscreen/mainwindow.h
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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>
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow();
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qsplashscreen/qsplashscreen.qrc b/sources/pyside6/doc/codesnippets/doc/src/snippets/qsplashscreen/qsplashscreen.qrc
new file mode 100644
index 000000000..330ec7868
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qsplashscreen/qsplashscreen.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>splash.png</file>
+</qresource>
+</RCC>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qsplashscreen/splash.png b/sources/pyside6/doc/codesnippets/doc/src/snippets/qsplashscreen/splash.png
new file mode 100644
index 000000000..d82f6d218
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qsplashscreen/splash.png
Binary files differ
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qstackedlayout/main.py b/sources/pyside6/doc/codesnippets/doc/src/snippets/qstackedlayout/main.py
new file mode 100644
index 000000000..c02080ffc
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qstackedlayout/main.py
@@ -0,0 +1,87 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the documentation 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$
+##
+############################################################################
+
+from PySide6.QtWidgets import QApplication, QWidget, QStackedLayout, QComboBox
+
+class Widget(QWidget)
+ def __init__(self, parent=None):
+ QWidget.__init__(self, parent)
+//! [0]
+ self.firstPageWidget = QWidget()
+ self.secondPageWidget = QWidget()
+ self.thirdPageWidget = QWidget()
+
+ self.stackedLayout = QStackedLayout()
+ self.stackedLayout.addWidget(self.firstPageWidget)
+ self.stackedLayout.addWidget(self.secondPageWidget)
+ self.stackedLayout.addWidget(self.thirdPageWidget)
+
+//! [0] //! [1]
+ self.pageComboBox = QComboBox()
+ self.pageComboBox.addItem(tr("Page 1"))
+ self.pageComboBox.addItem(tr("Page 2"))
+ self.pageComboBox.addItem(tr("Page 3"))
+ self.pageComboBox.activated.connect(self.stackedLayout.setCurrentIndex)
+//! [1]
+
+//! [2]
+ self.mainLayout = QVBoxLayout()
+//! [2]
+ self.mainLayout.addWidget(self.pageComboBox)
+//! [3]
+ self.mainLayout.addLayout(self.stackedLayout)
+ self.setLayout(self.mainLayout)
+//! [3]
+
+if __name__ == "__main__":
+ app = QApplication(sys.argv)
+ widget = Widget()
+ widget.show()
+ sys.exit(app.exec_())
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qstackedwidget/main.py b/sources/pyside6/doc/codesnippets/doc/src/snippets/qstackedwidget/main.py
new file mode 100644
index 000000000..6f2c49d8e
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qstackedwidget/main.py
@@ -0,0 +1,77 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+
+//! [0]
+ firstPageWidget = QWidget()
+ secondPageWidget = QWidget()
+ thirdPageWidget = QWidget()
+
+ stackedWidget = QStackedWidget()
+ stackedWidget.addWidget(firstPageWidget)
+ stackedWidget.addWidget(secondPageWidget)
+ stackedWidget.addWidget(thirdPageWidget)
+
+//! [0] //! [1]
+ pageComboBox = QComboBox()
+ pageComboBox.addItem(tr("Page 1"))
+ pageComboBox.addItem(tr("Page 2"))
+ pageComboBox.addItem(tr("Page 3"))
+ pageComboBox.activated[int].connect(stackedWidget.setCurrentIndex)
+
+//! [1] //! [2]
+ layout = QVBoxLayout()
+//! [2]
+ layout.addWidget(pageComboBox)
+//! [3]
+ layout.addWidget(stackedWidget)
+ setLayout(layout)
+//! [3]
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qstatustipevent/main.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/qstatustipevent/main.cpp
new file mode 100644
index 000000000..0ba3895a1
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qstatustipevent/main.cpp
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0] //! [1]
+def __init__(self, parent):
+ QMainWindow.__init__(self, parent)
+//! [0]
+ myWidget = QWidget()
+ myWidget.setStatusTip(tr("This is my widget."))
+
+ setCentralWidget(myWidget)
+//! [1]
+
+//! [2]
+ fileMenu = menuBar().addMenu(tr("File"))
+
+ Act = QAction(self.tr("&New"), self)
+ Act.setStatusTip(tr("Create a new file."))
+ fileMenu.addAction(Act)
+//! [2]
+
+ statusBar().showMessage(self.tr("Ready"))
+ setWindowTitle(tr("QStatusTipEvent"))
+//! [3]
+
+//! [3]
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qstyleoption/main.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/qstyleoption/main.cpp
new file mode 100644
index 000000000..12fb026f7
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qstyleoption/main.cpp
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+def paintEvent(self, qpaintevent):
+ option = QStyleOptionButton()
+ option.initFrom(self)
+ if isDown():
+ option.state = QStyle.State_Sunken
+ else:
+ option.state = QStyle.State_Raised
+
+ if self.isDefault():
+ option.features = option.features or QStyleOptionButton.DefaultButton
+ option.text = self.text()
+ option.icon = self.icon()
+
+ painter = QPainter(self)
+ self.style().drawControl(QStyle.CE_PushButton, option, painter, self)
+//! [0]
+//! [1]
+ option = QStyleOptionFrame()
+
+ if isinstance(option, QStyleOptionFrameV2):
+ frameOptionV2 = QStyleOptionFrameV2(option)
+
+ # draw the frame using frameOptionV2
+
+//! [1]
+
+//! [2]
+ if isinstance(option, QStyleOptionProgressBarV2):
+ progressBarV2 = QStyleOptionProgressBarV2(option)
+
+ # draw the progress bar using progressBarV2
+
+//! [2]
+
+//! [3]
+ if isinstance(option, QStyleOptionTabV2):
+ tabV2 = QStyleOptionTabV2(option)
+
+ # draw the tab using tabV2
+
+//! [3]
+
+
+//! [4]
+def drawPrimitive(self, element, option, painter, widget):
+ if element == self.PE_FrameFocusRect:
+ focusRectOption = QStyleOptionFocusRect(option)
+ if focusRectOption:
+ # ...
+
+
+ # ...
+
+//! [4]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qsvgwidget/qsvgwidget.qrc b/sources/pyside6/doc/codesnippets/doc/src/snippets/qsvgwidget/qsvgwidget.qrc
new file mode 100644
index 000000000..13d8b3612
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qsvgwidget/qsvgwidget.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/files" >
+ <file>spheres.svg</file>
+</qresource>
+</RCC>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qsvgwidget/spheres.svg b/sources/pyside6/doc/codesnippets/doc/src/snippets/qsvgwidget/spheres.svg
new file mode 100644
index 000000000..9e3819306
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qsvgwidget/spheres.svg
@@ -0,0 +1,79 @@
+<?xml version="1.0" standalone="no"?>
+<svg width="8cm" height="8cm" viewBox="0 0 400 400"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink/"
+ baseProfile="tiny" version="1.2">
+ <title>Spheres</title>
+ <desc>Gradient filled spheres with different colors.</desc>
+ <defs>
+ <!-- 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="shadow" 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="white" stop-opacity="0.0" />
+ </radialGradient>
+
+ <!-- Define a shadow for each sphere. -->
+ <circle id="shadow" fill="url(#shadow)" cx="0" cy="0" r="100" />
+ </defs>
+ <g fill="#ffee99" stroke="none" >
+ <rect x="0" y="0" width="400" height="400" />
+ </g>
+ <g fill="white" stroke="none" >
+ <rect x="0" y="175" width="400" height="225" />
+ </g>
+ <g transform="translate(200,290) 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" />
+ </g>
+ <g transform="translate(200,175)">
+ <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,240)">
+ <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,275)">
+ <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,325)">
+ <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>
+</svg>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qsvgwidget/sunflower.svg b/sources/pyside6/doc/codesnippets/doc/src/snippets/qsvgwidget/sunflower.svg
new file mode 100644
index 000000000..b60dd11a6
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qsvgwidget/sunflower.svg
@@ -0,0 +1,188 @@
+<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+<svg width="289.619" height="450.482"
+ xmlns="http://www.w3.org/2000/svg" baseProfile="tiny" version="1.1">
+ <defs>
+ <marker id="ArrowEnd" viewBox="0 0 10 10" refX="0" refY="5"
+ markerUnits="strokeWidth"
+ markerWidth="4"
+ markerHeight="3"
+ orient="auto">
+ <path d="M 0 0 L 10 5 L 0 10 z" />
+ </marker>
+ <marker id="ArrowStart" viewBox="0 0 10 10" refX="10" refY="5"
+ markerUnits="strokeWidth"
+ markerWidth="4"
+ markerHeight="3"
+ orient="auto">
+ <path d="M 10 0 L 0 5 L 10 10 z" />
+ </marker> </defs>
+<g>
+<defs><linearGradient id="1" x1="155.352" y1="450.482" x2="155.352" y2="140" gradientUnits="userSpaceOnUse">
+<stop offset="0" style="stop-color:#9ded37"/>
+<stop offset="1" style="stop-color:#f8ff76"/>
+</linearGradient>
+</defs><path style="stroke:#000000; stroke-width:1; fill:url(#1)" d="M 132.72 145.241C 211.668 237.549 150.166 295.646 148.222 342.665C 146.89 374.889 171.099 410.104 185.352 445.241C 185.352 445.241 185.352 445.241 132.72 352.933C 106.405 306.779 159.036 306.779 159.036 237.549C 159.036 191.395 132.72 145.241 132.72 145.241z"/>
+<defs><radialGradient id="2" cx="145.352" cy="45.2408" r="47.7391" fx="145.352" fy="45.2408" gradientUnits="userSpaceOnUse">
+<stop offset="0" style="stop-color:#ffa048"/>
+<stop offset="1" style="stop-color:#ff472e"/>
+</radialGradient>
+</defs><path style="stroke:#000000; stroke-width:1; fill:url(#2)" d="M 155.352 45.2408C 155.352 67.3199 150.872 85.2408 145.352 85.2408C 139.832 85.2408 135.352 67.3199 135.352 45.2408C 135.352 23.1618 139.832 5.24084 145.352 5.24084C 150.872 5.24084 155.352 23.1618 155.352 45.2408z"/>
+<defs><radialGradient id="3" cx="170.135" cy="48.3609" r="48.0339" fx="170.135" fy="48.3609" gradientUnits="userSpaceOnUse">
+<stop offset="0" style="stop-color:#ffa048"/>
+<stop offset="1" style="stop-color:#ff472e"/>
+</radialGradient>
+</defs><path style="stroke:#000000; stroke-width:1; fill:url(#3)" d="M 179.823 50.8388C 174.351 72.2289 165.569 88.4808 160.221 87.1129C 154.874 85.7448 154.975 67.2728 160.447 45.8828C 165.919 24.4928 174.701 8.24084 180.048 9.60886C 185.396 10.9768 185.295 29.4489 179.823 50.8388z"/>
+<g>
+<defs><radialGradient id="4" cx="192.599" cy="57.0958" r="48.4248" fx="192.599" fy="57.0958" gradientUnits="userSpaceOnUse">
+<stop offset="0" style="stop-color:#ffa048"/>
+<stop offset="1" style="stop-color:#ff472e"/>
+</radialGradient>
+</defs><path style="stroke:#000000; stroke-width:1; fill:url(#4)" d="M 201.476 61.6998C 191.31 81.2998 179.081 95.1448 174.181 92.6039C 169.282 90.0618 173.556 72.0909 183.722 52.4919C 193.888 32.8918 206.116 19.0468 211.016 21.5878C 215.916 24.1299 211.642 42.1008 201.476 61.6998z"/>
+<defs><radialGradient id="5" cx="213.162" cy="71.2758" r="48.6431" fx="213.162" fy="71.2758" gradientUnits="userSpaceOnUse">
+<stop offset="0" style="stop-color:#ffa048"/>
+<stop offset="1" style="stop-color:#ff472e"/>
+</radialGradient>
+</defs><path style="stroke:#000000; stroke-width:1; fill:url(#5)" d="M 220.621 77.9368C 205.915 94.4048 190.636 104.788 186.519 101.112C 182.402 97.4348 190.997 81.0838 205.703 64.6148C 220.409 48.1469 235.688 37.7639 239.805 41.4398C 243.922 45.1169 235.327 61.4678 220.621 77.9368z"/>
+</g>
+<defs><radialGradient id="6" cx="229.082" cy="90.7439" r="48.5357" fx="229.082" fy="90.7439" gradientUnits="userSpaceOnUse">
+<stop offset="0" style="stop-color:#ffa048"/>
+<stop offset="1" style="stop-color:#ff472e"/>
+</radialGradient>
+</defs><path style="stroke:#000000; stroke-width:1; fill:url(#6)" d="M 234.466 99.1708C 215.86 111.058 198.346 116.932 195.374 112.28C 192.403 107.629 205.092 94.2048 223.698 82.3168C 242.303 70.4298 259.817 64.5558 262.789 69.2079C 265.761 73.8589 253.071 87.2838 234.466 99.1708z"/>
+<defs><radialGradient id="7" cx="239.796" cy="113.308" r="48.1584" fx="239.796" fy="113.308" gradientUnits="userSpaceOnUse">
+<stop offset="0" style="stop-color:#ffa048"/>
+<stop offset="1" style="stop-color:#ff472e"/>
+</radialGradient>
+</defs><path style="stroke:#000000; stroke-width:1; fill:url(#7)" d="M 242.923 122.806C 221.952 129.712 203.529 131.061 201.803 125.819C 200.076 120.576 215.697 110.715 236.668 103.81C 257.639 96.9038 276.063 95.5548 277.789 100.797C 279.515 106.04 263.895 115.901 242.923 122.806z"/>
+<g>
+<defs><radialGradient id="8" cx="244.53" cy="136.94" r="47.7879" fx="244.53" fy="136.94" gradientUnits="userSpaceOnUse">
+<stop offset="0" style="stop-color:#ffa048"/>
+<stop offset="1" style="stop-color:#ff472e"/>
+</radialGradient>
+</defs><path style="stroke:#000000; stroke-width:1; fill:url(#8)" d="M 245.429 146.899C 223.44 148.885 205.188 146.035 204.692 140.538C 204.195 135.04 221.641 128.966 243.63 126.981C 265.62 124.995 283.871 127.845 284.368 133.342C 284.864 138.84 267.418 144.914 245.429 146.899z"/>
+<defs><radialGradient id="9" cx="243.651" cy="161.904" r="47.8795" fx="243.651" fy="161.904" gradientUnits="userSpaceOnUse">
+<stop offset="0" style="stop-color:#ffa048"/>
+<stop offset="1" style="stop-color:#ff472e"/>
+</radialGradient>
+</defs><path style="stroke:#000000; stroke-width:1; fill:url(#9)" d="M 242.055 171.776C 220.259 168.25 203.284 160.965 204.165 155.516C 205.047 150.067 223.453 148.506 245.249 152.032C 267.044 155.558 284.02 162.843 283.138 168.292C 282.257 173.741 263.85 175.302 242.055 171.776z"/>
+</g>
+<g>
+<g>
+<g>
+<defs><radialGradient id="10" cx="236.069" cy="186.194" r="48.3388" fx="236.069" fy="186.194" gradientUnits="userSpaceOnUse">
+<stop offset="0" style="stop-color:#ffa048"/>
+<stop offset="1" style="stop-color:#ff472e"/>
+</radialGradient>
+</defs><path style="stroke:#000000; stroke-width:1; fill:url(#10)" d="M 231.976 195.318C 211.831 186.281 197.314 174.858 199.573 169.822C 201.832 164.785 220.017 168.033 240.162 177.07C 260.306 186.107 274.824 197.53 272.565 202.566C 270.305 207.603 252.12 204.355 231.976 195.318z"/>
+<defs><radialGradient id="11" cx="223.077" cy="207.529" r="48.6188" fx="223.077" fy="207.529" gradientUnits="userSpaceOnUse">
+<stop offset="0" style="stop-color:#ffa048"/>
+<stop offset="1" style="stop-color:#ff472e"/>
+</radialGradient>
+</defs><path style="stroke:#000000; stroke-width:1; fill:url(#11)" d="M 216.851 215.354C 199.575 201.606 188.341 186.942 191.778 182.623C 195.215 178.303 212.028 185.956 229.304 199.704C 246.581 213.452 257.814 228.116 254.377 232.435C 250.94 236.755 234.128 229.102 216.851 215.354z"/>
+</g>
+<g>
+<defs><radialGradient id="12" cx="205.914" cy="224.449" r="48.6182" fx="205.914" fy="224.449" gradientUnits="userSpaceOnUse">
+<stop offset="0" style="stop-color:#ffa048"/>
+<stop offset="1" style="stop-color:#ff472e"/>
+</radialGradient>
+</defs><path style="stroke:#000000; stroke-width:1; fill:url(#12)" d="M 198.079 230.664C 184.358 213.366 176.731 196.542 181.055 193.111C 185.379 189.681 200.027 200.937 213.748 218.234C 227.469 235.532 235.097 252.356 230.772 255.787C 226.448 259.217 211.801 247.961 198.079 230.664z"/>
+<defs><radialGradient id="13" cx="184.559" cy="237.407" r="48.3362" fx="184.559" fy="237.407" gradientUnits="userSpaceOnUse">
+<stop offset="0" style="stop-color:#ffa048"/>
+<stop offset="1" style="stop-color:#ff472e"/>
+</radialGradient>
+</defs><path style="stroke:#000000; stroke-width:1; fill:url(#13)" d="M 175.429 241.486C 166.422 221.328 163.203 203.138 168.242 200.886C 173.282 198.635 184.683 213.169 193.689 233.328C 202.695 253.486 205.915 271.676 200.875 273.928C 195.836 276.179 184.435 261.645 175.429 241.486z"/>
+</g>
+</g>
+<g>
+<g>
+<defs><radialGradient id="14" cx="160.281" cy="243.964" r="47.8592" fx="160.281" fy="243.964" gradientUnits="userSpaceOnUse">
+<stop offset="0" style="stop-color:#ffa048"/>
+<stop offset="1" style="stop-color:#ff472e"/>
+</radialGradient>
+</defs><path style="stroke:#000000; stroke-width:1; fill:url(#14)" d="M 150.388 245.427C 147.158 223.586 148.968 205.202 154.428 204.395C 159.888 203.587 166.943 220.66 170.173 242.501C 173.404 264.342 171.594 282.726 166.134 283.534C 160.673 284.341 153.619 267.268 150.388 245.427z"/>
+<defs><radialGradient id="15" cx="135.307" cy="244.504" r="47.8021" fx="135.307" fy="244.504" gradientUnits="userSpaceOnUse">
+<stop offset="0" style="stop-color:#ffa048"/>
+<stop offset="1" style="stop-color:#ff472e"/>
+</radialGradient>
+</defs><path style="stroke:#000000; stroke-width:1; fill:url(#15)" d="M 125.361 243.47C 127.645 221.509 133.954 204.148 139.444 204.719C 144.934 205.289 147.537 223.578 145.254 245.538C 142.971 267.499 136.661 284.86 131.171 284.289C 125.681 283.719 123.078 265.43 125.361 243.47z"/>
+</g>
+<g>
+<defs><radialGradient id="16" cx="111.808" cy="239.15" r="48.183" fx="111.808" fy="239.15" gradientUnits="userSpaceOnUse">
+<stop offset="0" style="stop-color:#ffa048"/>
+<stop offset="1" style="stop-color:#ff472e"/>
+</radialGradient>
+</defs><path style="stroke:#000000; stroke-width:1; fill:url(#16)" d="M 102.353 235.894C 109.541 215.018 119.613 199.532 124.831 201.33C 130.05 203.127 128.452 221.53 121.263 242.406C 114.074 263.282 104.003 278.768 98.784 276.97C 93.5651 275.173 95.1639 256.77 102.353 235.894z"/>
+<defs><radialGradient id="17" cx="89.3906" cy="228.131" r="48.5494" fx="89.3906" fy="228.131" gradientUnits="userSpaceOnUse">
+<stop offset="0" style="stop-color:#ffa048"/>
+<stop offset="1" style="stop-color:#ff472e"/>
+</radialGradient>
+</defs><path style="stroke:#000000; stroke-width:1; fill:url(#17)" d="M 81.0375 222.633C 93.1756 204.19 106.771 191.684 111.381 194.718C 115.992 197.753 109.882 215.186 97.7439 233.629C 85.6057 252.072 72.0108 264.578 67.4001 261.544C 62.7894 258.509 68.8993 241.076 81.0375 222.633z"/>
+</g>
+</g>
+</g>
+<g>
+<g>
+<g>
+<defs><radialGradient id="18" cx="53.7557" cy="185.38" r="48.3405" fx="53.7557" fy="185.38" gradientUnits="userSpaceOnUse">
+<stop offset="0" style="stop-color:#ffa048"/>
+<stop offset="1" style="stop-color:#ff472e"/>
+</radialGradient>
+</defs><path style="stroke:#000000; stroke-width:1; fill:url(#18)" d="M 49.653 176.26C 69.7881 167.202 87.9697 163.935 90.2343 168.969C 92.4989 174.003 77.9935 185.441 57.8584 194.5C 37.7233 203.558 19.5417 206.825 17.2771 201.791C 15.0125 196.757 29.5179 185.319 49.653 176.26z"/>
+<defs><radialGradient id="19" cx="46.4327" cy="161.498" r="47.8981" fx="46.4327" fy="161.498" gradientUnits="userSpaceOnUse">
+<stop offset="0" style="stop-color:#ffa048"/>
+<stop offset="1" style="stop-color:#ff472e"/>
+</radialGradient>
+</defs><path style="stroke:#000000; stroke-width:1; fill:url(#19)" d="M 44.7181 151.646C 66.47 147.861 84.894 149.202 85.8404 154.64C 86.7868 160.078 69.8991 167.564 48.1473 171.35C 26.3954 175.135 7.97139 173.794 7.02501 168.356C 6.07862 162.918 22.9663 155.432 44.7181 151.646z"/>
+</g>
+<g>
+<defs><radialGradient id="20" cx="45.1827" cy="137.429" r="47.7585" fx="45.1827" fy="137.429" gradientUnits="userSpaceOnUse">
+<stop offset="0" style="stop-color:#ffa048"/>
+<stop offset="1" style="stop-color:#ff472e"/>
+</radialGradient>
+</defs><path style="stroke:#000000; stroke-width:1; fill:url(#20)" d="M 45.7397 127.445C 67.7843 128.674 85.4281 134.146 85.1206 139.657C 84.8131 145.168 66.6702 148.643 44.6257 147.413C 22.5811 146.184 4.93733 140.712 5.2448 135.201C 5.55227 129.69 23.6952 126.215 45.7397 127.445z"/>
+<defs><radialGradient id="21" cx="49.6787" cy="112.858" r="48.1368" fx="49.6787" fy="112.858" gradientUnits="userSpaceOnUse">
+<stop offset="0" style="stop-color:#ffa048"/>
+<stop offset="1" style="stop-color:#ff472e"/>
+</radialGradient>
+</defs><path style="stroke:#000000; stroke-width:1; fill:url(#21)" d="M 52.6929 103.323C 73.7448 109.978 89.4821 119.652 87.8184 124.915C 86.1547 130.178 67.7165 129.048 46.6645 122.393C 25.6126 115.738 9.87529 106.064 11.539 100.801C 13.2027 95.5378 31.6409 96.6678 52.6929 103.323z"/>
+</g>
+</g>
+<g>
+<g>
+<defs><radialGradient id="22" cx="60.9007" cy="90.3528" r="48.5468" fx="60.9007" fy="90.3528" gradientUnits="userSpaceOnUse">
+<stop offset="0" style="stop-color:#ffa048"/>
+<stop offset="1" style="stop-color:#ff472e"/>
+</radialGradient>
+</defs><path style="stroke:#000000; stroke-width:1; fill:url(#22)" d="M 66.3768 81.9858C 84.8509 94.0758 97.3927 107.639 94.3701 112.257C 91.3475 116.876 73.8987 110.811 55.4246 98.7198C 36.9505 86.6299 24.4087 73.0668 27.4313 68.4489C 30.4539 63.8298 47.9027 69.8948 66.3768 81.9858z"/>
+<defs><radialGradient id="23" cx="77.0826" cy="71.3239" r="48.6458" fx="77.0826" fy="71.3239" gradientUnits="userSpaceOnUse">
+<stop offset="0" style="stop-color:#ffa048"/>
+<stop offset="1" style="stop-color:#ff472e"/>
+</radialGradient>
+</defs><path style="stroke:#000000; stroke-width:1; fill:url(#23)" d="M 84.4616 64.5748C 99.363 80.8669 108.152 97.1148 104.079 100.84C 100.006 104.565 84.6051 94.3648 69.7038 78.0728C 54.8024 61.7809 46.013 45.5338 50.086 41.8078C 54.1589 38.0829 69.5603 48.2828 84.4616 64.5748z"/>
+</g>
+<g>
+<defs><radialGradient id="24" cx="96.6928" cy="57.3108" r="48.4711" fx="96.6928" fy="57.3108" gradientUnits="userSpaceOnUse">
+<stop offset="0" style="stop-color:#ffa048"/>
+<stop offset="1" style="stop-color:#ff472e"/>
+</radialGradient>
+</defs><path style="stroke:#000000; stroke-width:1; fill:url(#24)" d="M 105.406 52.4048C 116.239 71.6429 121.128 89.4579 116.318 92.1658C 111.508 94.8738 98.8115 81.4558 87.979 62.2168C 77.1465 42.9778 72.2579 25.1638 77.0676 22.4558C 81.8773 19.7478 94.5739 33.1658 105.406 52.4048z"/>
+<defs><radialGradient id="25" cx="119.819" cy="47.8708" r="48.0557" fx="119.819" fy="47.8708" gradientUnits="userSpaceOnUse">
+<stop offset="0" style="stop-color:#ffa048"/>
+<stop offset="1" style="stop-color:#ff472e"/>
+</radialGradient>
+</defs><path style="stroke:#000000; stroke-width:1; fill:url(#25)" d="M 129.477 45.2769C 135.203 66.6008 135.524 85.0708 130.193 86.5018C 124.863 87.9338 115.888 71.7878 110.161 50.4648C 104.434 29.1408 104.113 10.6718 109.444 9.23984C 114.775 7.80783 123.75 23.9538 129.477 45.2769z"/>
+</g>
+</g>
+</g>
+<defs><radialGradient id="26" cx="69.0797" cy="209.914" r="48.6339" fx="69.0797" fy="209.914" gradientUnits="userSpaceOnUse">
+<stop offset="0" style="stop-color:#ffa048"/>
+<stop offset="1" style="stop-color:#ff472e"/>
+</radialGradient>
+</defs><path style="stroke:#000000; stroke-width:1; fill:url(#26)" d="M 62.6124 202.287C 79.4523 188.008 96.0187 179.835 99.5885 184.045C 103.158 188.255 92.3869 203.262 75.547 217.541C 58.707 231.82 42.1406 239.993 38.5709 235.783C 35.0011 231.573 45.7725 216.566 62.6124 202.287z"/>
+<defs><radialGradient id="27" cx="145.352" cy="145.241" r="92.2646" fx="145.352" fy="145.241" gradientUnits="userSpaceOnUse">
+<stop offset="0" style="stop-color:#fff82e"/>
+<stop offset="1" style="stop-color:#ffffff"/>
+</radialGradient>
+</defs><path style="stroke:#000000; stroke-width:1; fill:url(#27)" d="M 85.3517 145.241C 85.3517 178.359 112.234 205.241 145.352 205.241C 178.47 205.241 205.352 178.359 205.352 145.241C 205.352 112.123 178.47 85.2408 145.352 85.2408C 112.234 85.2408 85.3517 112.123 85.3517 145.241z"/>
+</g>
+</svg>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-dnd/Images/cubed.png b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-dnd/Images/cubed.png
new file mode 100644
index 000000000..2cd9048ca
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-dnd/Images/cubed.png
Binary files differ
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-dnd/Images/squared.png b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-dnd/Images/squared.png
new file mode 100644
index 000000000..bfdf99328
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-dnd/Images/squared.png
Binary files differ
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-dnd/images.qrc b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-dnd/images.qrc
new file mode 100644
index 000000000..1d49b5286
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-dnd/images.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>Images/squared.png</file>
+ <file>Images/cubed.png</file>
+</qresource>
+</RCC>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-dnd/mainwindow.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-dnd/mainwindow.h
new file mode 100644
index 000000000..8387de54a
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-dnd/mainwindow.h
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 <QMainWindow>
+
+class QAction;
+class QTableWidget;
+class QTableWidgetItem;
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow();
+
+public slots:
+ void averageItems();
+ void sumItems();
+
+private:
+ void setupTableItems();
+
+ QAction *removeAction;
+ QTableWidget *tableWidget;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-resizing/mainwindow.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-resizing/mainwindow.h
new file mode 100644
index 000000000..8eaaa7e00
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-resizing/mainwindow.h
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 <QMainWindow>
+
+class QAction;
+class QTableWidget;
+class QTableWidgetItem;
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow();
+
+public slots:
+ void changeHeight();
+ void changeWidth();
+
+private:
+ void setupTableItems();
+
+ QTableWidget *tableWidget;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-using/Images/cubed.png b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-using/Images/cubed.png
new file mode 100644
index 000000000..2cd9048ca
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-using/Images/cubed.png
Binary files differ
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-using/Images/squared.png b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-using/Images/squared.png
new file mode 100644
index 000000000..bfdf99328
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-using/Images/squared.png
Binary files differ
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-using/images.qrc b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-using/images.qrc
new file mode 100644
index 000000000..1d49b5286
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-using/images.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>Images/squared.png</file>
+ <file>Images/cubed.png</file>
+</qresource>
+</RCC>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-using/mainwindow.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-using/mainwindow.h
new file mode 100644
index 000000000..9571090ca
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-using/mainwindow.h
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 <QMainWindow>
+
+class QAction;
+class QTableWidget;
+class QTableWidgetItem;
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow();
+
+public slots:
+ void averageItems();
+ void sumItems();
+
+private:
+ void setupTableItems();
+
+ QAction *removeAction;
+//! [0]
+ QTableWidget *tableWidget;
+//! [0]
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtcast/qtcast.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtcast/qtcast.h
new file mode 100644
index 000000000..eb0278fa8
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtcast/qtcast.h
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 QTCAST_H
+#define QTCAST_H
+
+#include <QWidget>
+
+class MyWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ MyWidget();
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreeview-dnd/dragdropmodel.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreeview-dnd/dragdropmodel.h
new file mode 100644
index 000000000..6c89f166b
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreeview-dnd/dragdropmodel.h
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 DRAGDROPMODEL_H
+#define DRAGDROPMODEL_H
+
+#include "treemodel.h"
+
+class DragDropModel : public TreeModel
+{
+ Q_OBJECT
+
+public:
+ DragDropModel(const QStringList &strings, QObject *parent = 0);
+
+ Qt::ItemFlags flags(const QModelIndex &index) const;
+
+ bool dropMimeData(const QMimeData *data, Qt::DropAction action,
+ int row, int column, const QModelIndex &parent);
+ QMimeData *mimeData(const QModelIndexList &indexes) const;
+ QStringList mimeTypes() const;
+ Qt::DropActions supportedDropActions() const;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreeview-dnd/mainwindow.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreeview-dnd/mainwindow.h
new file mode 100644
index 000000000..d526dce12
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreeview-dnd/mainwindow.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 <QMainWindow>
+
+class QTreeView;
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow();
+
+private:
+ void setupItems();
+
+ QTreeView *treeView;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreeview-dnd/treeitem.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreeview-dnd/treeitem.h
new file mode 100644
index 000000000..4f3a1679f
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreeview-dnd/treeitem.h
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 TREEITEM_H
+#define TREEITEM_H
+
+#include <QList>
+#include <QVariant>
+
+class TreeItem
+{
+public:
+ TreeItem(const QList<QVariant> &data, TreeItem *parent = 0);
+ ~TreeItem();
+
+ void appendChild(TreeItem *child);
+
+ TreeItem *child(int row);
+ int childCount() const;
+ int columnCount() const;
+ QVariant data(int column) const;
+ bool insertChild(int row, TreeItem *item);
+ TreeItem *parent();
+ bool removeChild(int row);
+ int row() const;
+ bool setData(int column, const QVariant &data);
+
+private:
+ QList<TreeItem*> childItems;
+ QList<QVariant> itemData;
+ TreeItem *parentItem;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreeview-dnd/treemodel.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreeview-dnd/treemodel.h
new file mode 100644
index 000000000..faf970ee9
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreeview-dnd/treemodel.h
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 TREEMODEL_H
+#define TREEMODEL_H
+
+#include <QAbstractItemModel>
+#include <QModelIndex>
+#include <QVariant>
+
+class TreeItem;
+
+class TreeModel : public QAbstractItemModel
+{
+ Q_OBJECT
+
+public:
+ TreeModel(const QStringList &strings, QObject *parent = 0);
+ ~TreeModel();
+
+ QVariant data(const QModelIndex &index, int role) const;
+ Qt::ItemFlags flags(const QModelIndex &index) const;
+ QVariant headerData(int section, Qt::Orientation orientation,
+ int role = Qt::DisplayRole) const;
+ QModelIndex index(int row, int column,
+ const QModelIndex &parent = QModelIndex()) const;
+ QModelIndex parent(const QModelIndex &index) const;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const;
+ int columnCount(const QModelIndex &parent = QModelIndex()) const;
+
+ bool insertRows(int position, int rows, const QModelIndex &parent = QModelIndex());
+ bool removeRows(int position, int rows, const QModelIndex &parent = QModelIndex());
+ bool setData(const QModelIndex &index, const QVariant &value,
+ int role = Qt::EditRole);
+
+private:
+ void setupModelData(const QStringList &lines, TreeItem *parent);
+
+ TreeItem *rootItem;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreewidget-using/mainwindow.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreewidget-using/mainwindow.cpp
new file mode 100644
index 000000000..c7b355c5e
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreewidget-using/mainwindow.cpp
@@ -0,0 +1,111 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+//! [0]
+ treeWidget = QTreeWidget(self)
+//! [0]
+
+//! [1]
+ treeWidget.setColumnCount(2)
+//! [1] //! [2]
+ headers = QStringList()
+ headers << tr("Subject") << tr("Default")
+ treeWidget.setHeaderLabels(headers)
+//! [2]
+
+//! [3]
+ cities = QTreeWidgetItem(treeWidget)
+ cities.setText(0, tr("Cities"))
+ osloItem = QTreeWidgetItem(cities)
+ osloItem.setText(0, tr("Oslo"))
+ osloItem.setText(1, tr("Yes"))
+//! [3]
+
+//! [4] //! [5]
+ planets = QTreeWidgetItem(treeWidget, cities)
+//! [4]
+ planets.setText(0, tr("Planets"))
+//! [5]
+
+//! [6]
+ item = QTreeWidgetItem()
+//! [6]
+
+//! [7]
+ found = treeWidget.findItems(itemText, Qt.MatchWildcard)
+
+ for item in found:
+ treeWidget.setItemSelected(item, True)
+ # Show the item.text(0) for each item.
+
+//! [7]
+
+//! [8]
+ parent = currentItem.parent()
+ if parent:
+ Item = QTreeWidgetItem(parent, treeWidget.currentItem())
+ else
+//! [8] //! [9]
+ Item = QTreeWidgetItem(treeWidget, treeWidget.currentItem())
+//! [9]
+
+//! [10]
+ parent = currentItem.parent()
+
+ if parent:
+ index = parent.indexOfChild(treeWidget->currentItem())
+ delete parent.takeChild(index)
+ else:
+ index = treeWidget.indexOfTopLevelItem(treeWidget->currentItem())
+ delete treeWidget.takeTopLevelItem(index)
+//! [10] //! [11]
+
+//! [11]
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreewidget-using/mainwindow.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreewidget-using/mainwindow.h
new file mode 100644
index 000000000..876ceba07
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreewidget-using/mainwindow.h
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 <QMainWindow>
+
+class QAction;
+class QTreeWidget;
+class QTreeWidgetItem;
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow();
+
+public slots:
+ void findItems();
+ void insertItem();
+ void removeItem();
+ void sortAscending();
+ void sortDescending();
+ void updateMenus(QTreeWidgetItem *current);
+ void updateSortItems();
+
+private:
+ void setupTreeItems();
+
+ QAction *ascendingAction;
+ QAction *autoSortAction;
+ QAction *descendingAction;
+ QAction *insertAction;
+ QAction *removeAction;
+ QTreeWidget *treeWidget;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreewidgetitemiterator-using/mainwindow.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreewidgetitemiterator-using/mainwindow.cpp
new file mode 100644
index 000000000..3cbe3e65d
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreewidgetitemiterator-using/mainwindow.cpp
@@ -0,0 +1,59 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+
+//! [0]
+ it = QTreeWidgetItemIterator(treeWidget)
+ while it:
+ if it.text(0) == itemText:
+ *it.setSelected(True)
+ ++it
+//! [0]
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreewidgetitemiterator-using/mainwindow.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreewidgetitemiterator-using/mainwindow.h
new file mode 100644
index 000000000..876ceba07
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreewidgetitemiterator-using/mainwindow.h
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 <QMainWindow>
+
+class QAction;
+class QTreeWidget;
+class QTreeWidgetItem;
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow();
+
+public slots:
+ void findItems();
+ void insertItem();
+ void removeItem();
+ void sortAscending();
+ void sortDescending();
+ void updateMenus(QTreeWidgetItem *current);
+ void updateSortItems();
+
+private:
+ void setupTreeItems();
+
+ QAction *ascendingAction;
+ QAction *autoSortAction;
+ QAction *descendingAction;
+ QAction *insertAction;
+ QAction *removeAction;
+ QTreeWidget *treeWidget;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtscript/registeringobjects/myobject.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtscript/registeringobjects/myobject.h
new file mode 100644
index 000000000..fa86f16d3
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtscript/registeringobjects/myobject.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 MYOBJECT_H
+#define MYOBJECT_H
+
+#include <QObject>
+
+class MyObject : public QObject
+{
+ Q_OBJECT
+
+public:
+ MyObject();
+
+public slots:
+ int calculate(int value) const;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtscript/scriptedslot/object.js b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtscript/scriptedslot/object.js
new file mode 100644
index 000000000..44ad0e657
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtscript/scriptedslot/object.js
@@ -0,0 +1,18 @@
+function Object(timer, editor)
+{
+ this.editor = editor;
+ this.counter = 0;
+ timer.timeout.connect(notify);
+ timer.timeout.connect(this, this.addLine);
+}
+
+Object.prototype.addLine = function()
+{
+ this.editor.append(this.counter);
+ this.counter += 1;
+}
+
+function notify()
+{
+ print("timeout() received");
+}
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtscript/scriptedslot/scriptedslot.qrc b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtscript/scriptedslot/scriptedslot.qrc
new file mode 100644
index 000000000..fc7ff67b9
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qtscript/scriptedslot/scriptedslot.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/" >
+ <file>object.js</file>
+ </qresource>
+</RCC>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/quiloader/doc_src_qtuiloader.py b/sources/pyside6/doc/codesnippets/doc/src/snippets/quiloader/doc_src_qtuiloader.py
new file mode 100644
index 000000000..efac0ab6d
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/quiloader/doc_src_qtuiloader.py
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [1]
+import PySide6.QtUiTools
+//! [1]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/quiloader/myform.ui b/sources/pyside6/doc/codesnippets/doc/src/snippets/quiloader/myform.ui
new file mode 100644
index 000000000..00702e860
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/quiloader/myform.ui
@@ -0,0 +1,130 @@
+<ui version="4.0" >
+ <author></author>
+ <comment></comment>
+ <exportmacro></exportmacro>
+ <class>Form</class>
+ <widget class="QWidget" name="Form" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>258</width>
+ <height>224</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Export Document</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>8</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>Export Options</string>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>8</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item row="1" column="0" >
+ <widget class="QRadioButton" name="radioButton_2" >
+ <property name="text" >
+ <string>&amp;DocBook</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0" >
+ <widget class="QRadioButton" name="radioButton" >
+ <property name="text" >
+ <string>&amp;LaTeX</string>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QCheckBox" name="checkBox_2" >
+ <property name="text" >
+ <string>Include p&amp;ictures</string>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QCheckBox" name="checkBox" >
+ <property name="text" >
+ <string>&amp;Compress</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QRadioButton" name="radioButton_2_2" >
+ <property name="text" >
+ <string>&amp;HTML</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QRadioButton" name="radioButton_3" >
+ <property name="text" >
+ <string>&amp;PostScript</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0" >
+ <widget class="QRadioButton" name="radioButton_4" >
+ <property name="text" >
+ <string>PD&amp;F</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QCheckBox" name="checkBox_3" >
+ <property name="text" >
+ <string>Include &amp;metadata</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QCheckBox" name="checkBox_4" >
+ <property name="text" >
+ <string>Create inde&amp;x</string>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <pixmapfunction></pixmapfunction>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/quiloader/mywidget.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/quiloader/mywidget.h
new file mode 100644
index 000000000..66e9235f6
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/quiloader/mywidget.h
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 MYWIDGET_H
+#define MYWIDGET_H
+
+#include <QWidget>
+
+class MyWidget : public QWidget
+{
+public:
+ MyWidget(QWidget *parent = 0);
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/quiloader/mywidget.qrc b/sources/pyside6/doc/codesnippets/doc/src/snippets/quiloader/mywidget.qrc
new file mode 100644
index 000000000..47684d68b
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/quiloader/mywidget.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/forms">
+<file>myform.ui</file>
+</qresource>
+</RCC>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qx11embedwidget/embedwidget.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/qx11embedwidget/embedwidget.h
new file mode 100644
index 000000000..1d54f7088
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qx11embedwidget/embedwidget.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 EMBEDWIDGET_H
+#define EMBEDWIDGET_H
+
+#include <QRadialGradient>
+#include <QSize>
+#include <QX11EmbedWidget>
+
+class QPaintEvent;
+
+class EmbedWidget : public QX11EmbedWidget
+{
+ Q_OBJECT
+
+public:
+ EmbedWidget(QWidget *parent = 0);
+ QSize sizeHint() const;
+
+protected:
+ void paintEvent(QPaintEvent *event);
+
+private:
+ QRadialGradient gradient;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qxmlquery/bindingExample.py b/sources/pyside6/doc/codesnippets/doc/src/snippets/qxmlquery/bindingExample.py
new file mode 100644
index 000000000..16c12b7bc
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qxmlquery/bindingExample.py
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+ device = QBuffer()
+ device.setData(myQString.toUtf8())
+ device.open(QIODevice.ReadOnly)
+
+ query = QXmlQuery()
+ query.setQuery("doc($inputDocument)/query[theDocument]")
+ query.bindVariable("inputDocument", device)
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qxmlschemavalidator/main.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/qxmlschemavalidator/main.cpp
new file mode 100644
index 000000000..0d81b914a
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/qxmlschemavalidator/main.cpp
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+def validateFromUrl():
+//! [0]
+ schema = getSchema()
+
+ url = QUrl("http://www.schema-example.org/test.xml")
+
+ validator = QXmlSchemaValidator(schema)
+ if validator.validate(url):
+ print "instance document is valid"
+ else:
+ print "instance document is invalid"
+//! [0]
+
+def validateFromFile():
+//! [1]
+ schema = getSchema()
+
+ file = QFile("test.xml")
+ file.open(QIODevice.ReadOnly)
+
+ validator = QXmlSchemaValidator(schema)
+ if validator.validate(file, QUrl.fromLocalFile(file.fileName())):
+ print "instance document is valid"
+ else:
+ print "instance document is invalid"
+//! [1]
+}
+
+def validateFromData():
+//! [2]
+ schema = getSchema()
+
+ data = QByteArray("<?xml version=\"1.0\" encoding=\"UTF-8\"?><test></test>")
+
+ buffer = QBuffer(data)
+ buffer.open(QIODevice.ReadOnly)
+
+ QXmlSchemaValidator validator(schema)
+ if validator.validate(buffer):
+ print "instance document is valid"
+ else:
+ print "instance document is invalid"
+//! [2]
+
+def validateComplete():
+//! [3]
+ schemaUrl = QUrl("file:///home/user/schema.xsd")
+
+ schema = QXmlSchema()
+ schema.load(schemaUrl)
+
+ if schema.isValid():
+ file = QFile("test.xml")
+ file.open(QIODevice.ReadOnly)
+
+ validator = QXmlSchemaValidator(schema)
+ if validator.validate(file, QUrl.fromLocalFile(file.fileName())):
+ print "instance document is valid"
+ else:
+ print "instance document is invalid"
+ }
+//! [3]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/reading-selections/model.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/reading-selections/model.h
new file mode 100644
index 000000000..6b4076815
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/reading-selections/model.h
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 MODEL_H
+#define MODEL_H
+
+#include <QAbstractTableModel>
+#include <QStringList>
+#include <QVariant>
+
+class TableModel : public QAbstractTableModel
+{
+ Q_OBJECT
+
+public:
+ TableModel(int rows = 1, int columns = 1, QObject *parent = 0);
+
+ int rowCount(const QModelIndex &parent = QModelIndex()) const;
+ int columnCount(const QModelIndex &parent = QModelIndex()) const;
+ QVariant data(const QModelIndex &index, int role) const;
+ QVariant headerData(int section, Qt::Orientation orientation,
+ int role = Qt::DisplayRole) const;
+
+ Qt::ItemFlags flags(const QModelIndex &index) const;
+ bool setData(const QModelIndex &index, const QVariant &value,
+ int role = Qt::EditRole);
+
+ bool insertRows(int position, int rows, const QModelIndex &parent = QModelIndex());
+ bool insertColumns(int position, int columns, const QModelIndex &parent = QModelIndex());
+ bool removeRows(int position, int rows, const QModelIndex &parent = QModelIndex());
+ bool removeColumns(int position, int columns, const QModelIndex &parent = QModelIndex());
+
+private:
+ QList<QStringList> rowList;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/reading-selections/window.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/reading-selections/window.h
new file mode 100644
index 000000000..7bebf72a4
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/reading-selections/window.h
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 <QItemSelection>
+#include <QMainWindow>
+#include <QAbstractItemModel>
+#include <QWidget>
+#include <QTableView>
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+public:
+ MainWindow(QWidget *parent = 0);
+
+private slots:
+ void fillSelection();
+ void clearSelection();
+ void selectAll();
+
+private:
+ QAbstractItemModel *model;
+ QItemSelectionModel *selectionModel;
+ QTableView *table;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/separations/finalwidget.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/separations/finalwidget.h
new file mode 100644
index 000000000..2b40e760f
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/separations/finalwidget.h
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 FINALWIDGET_H
+#define FINALWIDGET_H
+
+#include <QFrame>
+#include <QImage>
+#include <QPoint>
+#include <QSize>
+
+class QGridLayout;
+class QLabel;
+class QMouseEvent;
+class QWidget;
+
+class FinalWidget : public QFrame
+{
+ Q_OBJECT
+
+public:
+ FinalWidget(QWidget *parent, const QString &name, const QSize &labelSize);
+ void setPixmap(const QPixmap &pixmap);
+ const QPixmap *pixmap() const;
+
+protected:
+ void mouseMoveEvent(QMouseEvent *event);
+ void mousePressEvent(QMouseEvent *event);
+
+private:
+ void createImage();
+
+ bool hasImage;
+ QImage originalImage;
+ QLabel *imageLabel;
+ QLabel *nameLabel;
+ QPoint dragStartPosition;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/separations/screenwidget.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/separations/screenwidget.h
new file mode 100644
index 000000000..2991e759e
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/separations/screenwidget.h
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 SCREENWIDGET_H
+#define SCREENWIDGET_H
+
+#include <QColor>
+#include <QFrame>
+#include <QImage>
+#include <QSize>
+
+class QGridLayout;
+class QLabel;
+class QPushButton;
+class QWidget;
+
+class ScreenWidget : public QFrame
+{
+ Q_OBJECT
+public:
+ enum Separation { Cyan, Magenta, Yellow };
+
+ ScreenWidget(QWidget *parent, QColor initialColor, const QString &name,
+ Separation mask, const QSize &labelSize);
+ void setImage(QImage &image);
+ QImage* image();
+
+signals:
+ void imageChanged();
+
+public slots:
+ void setColor();
+ void invertImage();
+
+private:
+ void createImage();
+
+ bool inverted;
+ QColor paintColor;
+ QImage newImage;
+ QImage originalImage;
+ QLabel *imageLabel;
+ QLabel *nameLabel;
+ QPushButton *colorButton;
+ QPushButton *invertButton;
+ Separation maskColor;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/separations/viewer.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/separations/viewer.h
new file mode 100644
index 000000000..3713c27cf
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/separations/viewer.h
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 VIEWER_H
+#define VIEWER_H
+
+#include <QImage>
+#include <QMainWindow>
+#include <QMap>
+
+class QAction;
+class QFrame;
+class QGridLayout;
+class QLabel;
+class QMenu;
+class FinalWidget;
+class ScreenWidget;
+
+class Viewer : public QMainWindow
+{
+ Q_OBJECT
+public:
+ enum Brightness { None, Quarter, Half, ThreeQuarters, Full };
+ Viewer();
+
+public slots:
+ void chooseFile();
+ void setBrightness(QAction *action);
+ void createImage();
+ void saveImage();
+
+private:
+ void createMenus();
+ QFrame *createCentralWidget();
+ void openImageFile(QString &filePath);
+
+ FinalWidget *finalWidget;
+ int brightness;
+ QAction *currentBrightness;
+ QAction *saveAction;
+ QGridLayout *grid;
+ QImage scaledImage;
+ QMap <QAction*,Brightness> menuMap;
+ QMenu *brightnessMenu;
+ QMenu *fileMenu;
+ QString path;
+ ScreenWidget *cyanWidget;
+ ScreenWidget *magentaWidget;
+ ScreenWidget *yellowWidget;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/shareddirmodel/main.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/shareddirmodel/main.cpp
new file mode 100644
index 000000000..b1adec9d0
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/shareddirmodel/main.cpp
@@ -0,0 +1,90 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+"""
+ main.cpp
+
+ A simple example of how to view a model in several views, and share a
+ selection model.
+"""
+
+from PySide6.QtGui import *
+
+
+//! [0] //! [1]
+def main():
+ app = QApplication(sys.argv)
+ splitter = QSplitter()
+
+//! [2] //! [3]
+ model = QFileSystemModel()
+ model.setRootPath(QDir.currentPath())
+//! [0] //! [2] //! [4] //! [5]
+ tree = QTreeView()
+//! [3] //! [6]
+ tree.setModel(model)
+//! [4] //! [6] //! [7]
+ tree.setRootIndex(model.index(QDir.currentPath()))
+//! [7]
+
+ list = QListView(splitter)
+ list.setModel(model)
+ list.setRootIndex(model.index(QDir.currentPath()))
+
+//! [5]
+ selection = QItemSelectionModel(model)
+ tree.setSelectionModel(selection)
+ list.setSelectionModel(selection)
+
+//! [8]
+ splitter.setWindowTitle("Two views onto the same directory model")
+ splitter.show()
+ return app.exec_()
+//! [1] //! [8]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/sharedemployee/employee.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/sharedemployee/employee.h
new file mode 100644
index 000000000..23ffcddc7
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/sharedemployee/employee.h
@@ -0,0 +1,104 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 EMPLOYEE_H
+#define EMPLOYEE_H
+
+//! [0]
+#include <QSharedData>
+#include <QString>
+
+class EmployeeData : public QSharedData
+{
+ public:
+ EmployeeData() : id(-1) { name.clear(); }
+ EmployeeData(const EmployeeData &other)
+ : QSharedData(other), id(other.id), name(other.name) { }
+ ~EmployeeData() { }
+
+ int id;
+ QString name;
+};
+
+class Employee
+{
+ public:
+//! [1]
+ Employee() { d = new EmployeeData; }
+//! [1] //! [2]
+ Employee(int id, QString name) {
+ d = new EmployeeData;
+ setId(id);
+ setName(name);
+ }
+//! [2] //! [7]
+ Employee(const Employee &other)
+ : d (other.d)
+ {
+ }
+//! [7]
+//! [3]
+ void setId(int id) { d->id = id; }
+//! [3] //! [4]
+ void setName(QString name) { d->name = name; }
+//! [4]
+
+//! [5]
+ int id() const { return d->id; }
+//! [5] //! [6]
+ QString name() const { return d->name; }
+//! [6]
+
+ private:
+ QSharedDataPointer<EmployeeData> d;
+};
+//! [0]
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/sharedtablemodel/model.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/sharedtablemodel/model.h
new file mode 100644
index 000000000..6b4076815
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/sharedtablemodel/model.h
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 MODEL_H
+#define MODEL_H
+
+#include <QAbstractTableModel>
+#include <QStringList>
+#include <QVariant>
+
+class TableModel : public QAbstractTableModel
+{
+ Q_OBJECT
+
+public:
+ TableModel(int rows = 1, int columns = 1, QObject *parent = 0);
+
+ int rowCount(const QModelIndex &parent = QModelIndex()) const;
+ int columnCount(const QModelIndex &parent = QModelIndex()) const;
+ QVariant data(const QModelIndex &index, int role) const;
+ QVariant headerData(int section, Qt::Orientation orientation,
+ int role = Qt::DisplayRole) const;
+
+ Qt::ItemFlags flags(const QModelIndex &index) const;
+ bool setData(const QModelIndex &index, const QVariant &value,
+ int role = Qt::EditRole);
+
+ bool insertRows(int position, int rows, const QModelIndex &parent = QModelIndex());
+ bool insertColumns(int position, int columns, const QModelIndex &parent = QModelIndex());
+ bool removeRows(int position, int rows, const QModelIndex &parent = QModelIndex());
+ bool removeColumns(int position, int columns, const QModelIndex &parent = QModelIndex());
+
+private:
+ QList<QStringList> rowList;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/signalmapper/accountsfile.txt b/sources/pyside6/doc/codesnippets/doc/src/snippets/signalmapper/accountsfile.txt
new file mode 100644
index 000000000..2ec5ffbc1
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/signalmapper/accountsfile.txt
@@ -0,0 +1 @@
+1 + 1 = 2
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/signalmapper/filereader.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/signalmapper/filereader.h
new file mode 100644
index 000000000..6509951ba
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/signalmapper/filereader.h
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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 FILEREADER_H
+#define FILEREADER_H
+
+#include <QTextEdit>
+#include <QPushButton>
+#include <QSignalMapper>
+
+class FileReader : public QWidget
+{
+ Q_OBJECT
+
+public:
+ FileReader(QWidget *parent=0);
+ void readFromFile(QString filename);
+
+public slots:
+ void readFile(const QString &);
+
+private:
+ QTextEdit *textEdit;
+ QPushButton *taxFileButton;
+ QPushButton *accountFileButton;
+ QPushButton *reportFileButton;
+ QSignalMapper *signalMapper;
+};
+
+#endif
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/signalmapper/reportfile.txt b/sources/pyside6/doc/codesnippets/doc/src/snippets/signalmapper/reportfile.txt
new file mode 100644
index 000000000..30123cc60
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/signalmapper/reportfile.txt
@@ -0,0 +1,2 @@
+Tax this year = 50%
+Total profit = 2
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/signalmapper/taxfile.txt b/sources/pyside6/doc/codesnippets/doc/src/snippets/signalmapper/taxfile.txt
new file mode 100644
index 000000000..a682e0aaa
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/signalmapper/taxfile.txt
@@ -0,0 +1 @@
+Tax this year = 50%
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/signalsandslots/lcdnumber.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/signalsandslots/lcdnumber.h
new file mode 100644
index 000000000..68563e05c
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/signalsandslots/lcdnumber.h
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+#ifndef LCDNUMBER_H
+//! [0] //! [1]
+#define LCDNUMBER_H
+//! [1]
+
+//! [2]
+#include <QFrame>
+//! [2]
+
+//! [3]
+class LcdNumber : public QFrame
+//! [3] //! [4]
+{
+//! [4] //! [5]
+ Q_OBJECT
+//! [5]
+
+//! [6]
+public:
+//! [6] //! [7]
+ LcdNumber(QWidget *parent = 0);
+//! [7]
+
+//! [8]
+signals:
+//! [8] //! [9]
+ void overflow();
+//! [9]
+
+//! [10]
+public slots:
+//! [10] //! [11]
+ void display(int num);
+ void display(double num);
+ void display(const QString &str);
+ void setHexMode();
+ void setDecMode();
+ void setOctMode();
+ void setBinMode();
+ void setSmallDecimalPoint(bool point);
+//! [11] //! [12]
+};
+//! [12]
+
+//! [13]
+#endif
+//! [13]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/signalsandslots/signalsandslots.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/signalsandslots/signalsandslots.h
new file mode 100644
index 000000000..c89e83d37
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/signalsandslots/signalsandslots.h
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 SIGNALSANDSLOTS_H
+#define SIGNALSANDSLOTS_H
+
+#define Counter PlainCounter
+
+//! [0]
+class Counter
+{
+public:
+ Counter() { m_value = 0; }
+
+ int value() const { return m_value; }
+ void setValue(int value);
+
+private:
+ int m_value;
+};
+//! [0]
+
+#undef Counter
+#define Counter ObjectCounter
+
+//! [1]
+#include <QObject>
+//! [1]
+
+//! [2]
+class Counter : public QObject
+//! [2] //! [3]
+{
+ Q_OBJECT
+
+public:
+ Counter() { m_value = 0; }
+
+ int value() const { return m_value; }
+
+public slots:
+ void setValue(int value);
+
+signals:
+ void valueChanged(int newValue);
+
+private:
+ int m_value;
+};
+//! [3]
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/simpleparse/handler.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/simpleparse/handler.h
new file mode 100644
index 000000000..ea1b8b392
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/simpleparse/handler.h
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 HANDLER_H
+#define HANDLER_H
+
+#include <qstring.h>
+#include <qxml.h>
+
+class Handler : public QXmlDefaultHandler
+{
+public:
+ bool startDocument();
+ bool startElement(const QString &, const QString &, const QString &qName,
+ const QXmlAttributes &);
+ bool endElement(const QString &, const QString &, const QString &);
+
+ bool fatalError(const QXmlParseException &exception);
+
+ QStringList& names();
+ QList<int>& indentations();
+
+private:
+ int indentationLevel;
+ QStringList elementName;
+ QList<int> elementIndentation;
+};
+
+#endif
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/splitter/splitter.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/splitter/splitter.cpp
new file mode 100644
index 000000000..90fd928fd
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/splitter/splitter.cpp
@@ -0,0 +1,76 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+
+//! [0]
+ splitter = QSplitter(parent)
+ listview = QListView()
+ treeview = QTreeView()
+ textedit = QTextEdit()
+ splitter.addWidget(listview)
+ splitter.addWidget(treeview)
+ splitter.addWidget(textedit)
+//! [0]
+
+//! [1]
+ settings = QSettings()
+ settings.setValue("splitterSizes", splitter.saveState())
+//! [1]
+
+//! [2]
+ settings = QSettings()
+ splitter.restoreState(settings.value("splitterSizes").toByteArray())
+//! [2]
+
+//! [3]
+ for it in splitter.sizes():
+ processSize(it.next())
+//! [3]
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/splitterhandle/splitter.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/splitterhandle/splitter.h
new file mode 100644
index 000000000..5ecaafcdf
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/splitterhandle/splitter.h
@@ -0,0 +1,61 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+//! [0]
+class Splitter(QSplitter):
+ def __init__(self, orientation, parent):
+ ...
+
+ def createHandle(self):
+ ...
+}
+//! [0]
+
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/sqldatabase/sqldatabase.py b/sources/pyside6/doc/codesnippets/doc/src/snippets/sqldatabase/sqldatabase.py
new file mode 100644
index 000000000..106dc5f7f
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/sqldatabase/sqldatabase.py
@@ -0,0 +1,489 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+from PySide6.QtGui import *
+from PySide6.QtSql import *
+
+
+def tr(text):
+ return QApplication.translate(text, text)
+
+def QSqlDatabase_snippets():
+//! [0]
+ db = QSqlDatabase.addDatabase("QPSQL")
+ db.setHostName("acidalia")
+ db.setDatabaseName("customdb")
+ db.setUserName("mojito")
+ db.setPassword("J0a1m8")
+ ok = db.open()
+//! [0]
+
+//! [1]
+ db = QSqlDatabase.database()
+//! [1]
+
+def QSqlField_snippets():
+//! [2]
+ field = QSqlField("age", QVariant.Int)
+ field.setValue(QPixmap()) # WRONG
+//! [2]
+
+//! [3]
+ field = QSqlField("age", QVariant.Int)
+ field.setValue(str(123)) # casts str to int
+//! [3]
+
+//! [4]
+ query = QSqlQuery()
+//! [4] //! [5]
+ record = query.record()
+//! [5] //! [6]
+ field = record.field("country")
+//! [6]
+
+def doSomething(str):
+ pass
+
+def QSqlQuery_snippets():
+ # typical loop
+//! [7]
+ query = QSqlQuery("SELECT country FROM artist")
+ while query.next():
+ country = query.value(0)
+ doSomething(country)
+//! [7]
+
+
+ # field index lookup
+//! [8]
+ query = QSqlQuery("SELECT * FROM artist")
+ fieldNo = query.record().indexOf("country")
+ while query.next():
+ country = query.value(fieldNo)
+ doSomething(country)
+//! [8]
+
+ # named with named
+//! [9]
+ query = QSqlQuery()
+ query.prepare("INSERT INTO person (id, forename, surname) "
+ "VALUES (:id, :forename, :surname)")
+ query.bindValue(":id", 1001)
+ query.bindValue(":forename", "Bart")
+ query.bindValue(":surname", "Simpson")
+ query.exec_()
+//! [9]
+
+ # positional with named
+//! [10]
+ query = QSqlQuery()
+ query.prepare("INSERT INTO person (id, forename, surname) "
+ "VALUES (:id, :forename, :surname)")
+ query.bindValue(0, 1001)
+ query.bindValue(1, "Bart")
+ query.bindValue(2, "Simpson")
+ query.exec_()
+//! [10]
+
+ # positional 1
+//! [11]
+ query = QSqlQuery()
+ query.prepare("INSERT INTO person (id, forename, surname) "
+ "VALUES (?, ?, ?)")
+ query.bindValue(0, 1001)
+ query.bindValue(1, "Bart")
+ query.bindValue(2, "Simpson")
+ query.exec_()
+//! [11]
+
+ # positional 2
+//! [12]
+ query = QSqlQuery()
+ query.prepare("INSERT INTO person (id, forename, surname) "
+ "VALUES (?, ?, ?)")
+ query.addBindValue(1001)
+ query.addBindValue("Bart")
+ query.addBindValue("Simpson")
+ query.exec_()
+//! [12]
+
+ # stored
+//! [13]
+ query = QSqlQuery()
+ query.prepare("CALL AsciiToInt(?, ?)")
+ query.bindValue(0, "A")
+ query.bindValue(1, 0, QSql.Out)
+ query.exec_()
+ i = query.boundValue(1) # i is 65
+//! [13]
+
+ query = QSqlQuery()
+
+ # examine with named binding
+//! [14]
+ i = query.boundValues()
+ while i.hasNext():
+ i.next()
+ print i.key(), ": ", i.value()
+//! [14]
+
+ # examine with positional binding
+//! [15]
+ list_ = query.boundValues().values()
+ for item in list:
+ print item
+//! [15]
+
+def QSqlQueryModel_snippets():
+
+//! [16]
+ model = QSqlQueryModel()
+ model.setQuery("SELECT name, salary FROM employee")
+ model.setHeaderData(0, Qt.Horizontal, tr("Name"))
+ model.setHeaderData(1, Qt.Horizontal, tr("Salary"))
+
+//! [17]
+ view = QTableView()
+//! [17] //! [18]
+ view.setModel(model)
+//! [18] //! [19]
+ view.show()
+//! [16] //! [19] //! [20]
+ view.setEditTriggers(QAbstractItemView.NoEditTriggers)
+//! [20]
+
+//! [21]
+ model = QSqlQueryModel()
+ model.setQuery("SELECT * FROM employee")
+ salary = model.record(4).value("salary")
+//! [21]
+
+//! [22]
+ salary = model.data(model.index(4, 2))
+//! [22]
+
+ for row in range(model.rowCount()):
+ for (col in range(model.columnCount())):
+ print model.data(model.index(row, col))
+
+
+class MyModel(QSqlQueryModel)
+ m_specialColumnNo = 0
+ def data(item, role):
+//! [23]
+ if item.column() == self.m_specialColumnNo:
+ # handle column separately
+ pass
+
+ return QSqlQueryModel.data(item, role)
+
+//! [23]
+
+
+def QSqlTableModel_snippets():
+
+//! [24]
+ model = QSqlTableModel()
+ model.setTable("employee")
+ model.setEditStrategy(QSqlTableModel.OnManualSubmit)
+ model.select()
+ model.removeColumn(0) # don't show the ID
+ model.setHeaderData(0, Qt.Horizontal, tr("Name"))
+ model.setHeaderData(1, Qt.Horizontal, tr("Salary"))
+
+ view = QTableView()
+ view.setModel(model)
+ view.show()
+//! [24]
+
+
+//! [25]
+ model = QSqlTableModel()
+ model.setTable("employee")
+ name = model.record(4).value("name")
+//! [25]
+
+def sql_intro_snippets():
+
+//! [26]
+ db = QSqlDatabase.addDatabase("QMYSQL")
+ db.setHostName("bigblue")
+ db.setDatabaseName("flightdb")
+ db.setUserName("acarlson")
+ db.setPassword("1uTbSbAs")
+ ok = db.open()
+//! [26]
+
+//! [27]
+ firstDB = QSqlDatabase.addDatabase("QMYSQL", "first")
+ secondDB = QSqlDatabase.addDatabase("QMYSQL", "second")
+//! [27]
+
+//! [28]
+ defaultDB = QSqlDatabase.database()
+//! [28] //! [29]
+ firstDB = QSqlDatabase.database("first")
+//! [29] //! [30]
+ secondDB = QSqlDatabase.database("second")
+//! [30]
+
+ # SELECT1
+//! [31]
+ query = QSqlQuery()
+ query.exec_("SELECT name, salary FROM employee WHERE salary > 50000")
+//! [31]
+
+//! [32]
+ while query.next():
+ name = query.value(0)
+ salary = query.value(1)
+ print name, salary
+//! [32]
+
+ # FEATURE
+//! [33]
+ query = QSqlQuery()
+ query.exec_("SELECT name, salary FROM employee WHERE salary > 50000")
+
+ defaultDB = QSqlDatabase.database()
+ if defaultDB.driver().hasFeature(QSqlDriver.QuerySize):
+ numRows = query.size()
+ else:
+ # self can be very slow
+ query.last()
+ numRows = query.at() + 1
+//! [33]
+
+ # INSERT1
+//! [34]
+ query = QSqlQuery()
+ query.exec_("INSERT INTO employee (id, name, salary) "
+ "VALUES (1001, 'Thad Beaumont', 65000)")
+//! [34]
+
+ # NAMED BINDING
+//! [35]
+ query = QSqlQuery()
+ query.prepare("INSERT INTO employee (id, name, salary) "
+ "VALUES (:id, :name, :salary)")
+ query.bindValue(":id", 1001)
+ query.bindValue(":name", "Thad Beaumont")
+ query.bindValue(":salary", 65000)
+ query.exec_()
+//! [35]
+
+ # POSITIONAL BINDING
+//! [36]
+ query = QSqlQuery()
+ query.prepare("INSERT INTO employee (id, name, salary) "
+ "VALUES (?, ?, ?)")
+ query.addBindValue(1001)
+ query.addBindValue("Thad Beaumont")
+ query.addBindValue(65000)
+ query.exec_()
+//! [36]
+
+ # UPDATE1
+//! [37]
+ query = QSqlQuery()
+ query.exec_("UPDATE employee SET salary = 70000 WHERE id = 1003")
+//! [37]
+
+ # DELETE1
+//! [38]
+ query = QSqlQuery()
+ query.exec_("DELETE FROM employee WHERE id = 1007")
+//! [38]
+
+ # TRANSACTION
+//! [39]
+ QSqlDatabase.database().transaction()
+ query = QSqlQuery()
+ query.exec_("SELECT id FROM employee WHERE name = 'Torild Halvorsen'")
+ if query.next():
+ employeeId = query.value(0)
+ query.exec_("INSERT INTO project (id, name, ownerid) "
+ "VALUES (201, 'Manhattan Project', "
+ + str(employeeId) + ')')
+
+ QSqlDatabase.database().commit()
+//! [39]
+
+ # SQLQUERYMODEL1
+//! [40]
+ model = QSqlQueryModel()
+ model.setQuery("SELECT * FROM employee")
+
+ for i in range(model.rowCount()):
+ _id = model.record(i).value("id")
+ name = model.record(i).value("name")
+ print _id, name
+
+//! [40]
+ }
+
+ {
+ # SQLTABLEMODEL1
+//! [41]
+ model = QSqlTableModel()
+ model.setTable("employee")
+ model.setFilter("salary > 50000")
+ model.setSort(2, Qt.DescendingOrder)
+ model.select()
+
+ for i in range(model.rowCount()):
+ name = model.record(i).value("name")
+ salary = model.record(i).value("salary")
+ print "%s: %d" % (name, salary)
+
+//! [41]
+
+ # SQLTABLEMODEL2
+ model = QSqlTableModel()
+ model.setTable("employee")
+
+//! [42]
+ for i in range(model.rowCount()):
+ record = model.record(i)
+ salary = record.value("salary")
+ salary *= 1.1
+ record.setValue("salary", salary)
+ model.setRecord(i, record)
+
+ model.submitAll()
+//! [42]
+
+ # SQLTABLEMODEL3
+ row = 1
+ column = 2
+//! [43]
+ model.setData(model.index(row, column), 75000)
+ model.submitAll()
+//! [43]
+
+ # SQLTABLEMODEL4
+//! [44]
+ model.insertRows(row, 1)
+ model.setData(model.index(row, 0), 1013)
+ model.setData(model.index(row, 1), "Peter Gordon")
+ model.setData(model.index(row, 2), 68500)
+ model.submitAll()
+//! [44]
+
+//! [45]
+ model.removeRows(row, 5)
+//! [45]
+
+//! [46]
+ model.submitAll()
+//! [46]
+
+//! [47]
+class XyzResult(QSqlResult):
+ def __init__(driver):
+ QSqlResult.__init__(self, driver)
+ pass
+
+ def data(self, index):
+ return QVariant()
+
+ def isNull(self, index):
+ return False
+
+ def reset(self, query):
+ return False
+
+ def fetch(self, index):
+ return False
+
+ def fetchFirst(self):
+ return False
+
+ def fetchLast(self):
+ return False
+
+ def size(self):
+ return 0
+
+ def numRowsAffected(self):
+ return 0
+
+ def record(self):
+ return QSqlRecord()
+
+//! [47]
+
+//! [48]
+class XyzDriver(QSqlDriver)
+ def hasFeature(self, feature):
+ return False
+
+ def open(self, db, user, password, host, port, options):
+ return False
+
+ def close(self):
+ pass
+
+ def createResult(self):
+ return XyzResult(self)
+
+//! [48]
+
+def main():
+ app = QApplication([])
+
+ QSqlDatabase_snippets()
+ QSqlField_snippets()
+ QSqlQuery_snippets()
+ QSqlQueryModel_snippets()
+ QSqlTableModel_snippets()
+
+ driver = XyzDriver()
+ result = XyzResult(driver)
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/stringlistmodel/model.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/stringlistmodel/model.cpp
new file mode 100644
index 000000000..79c449d79
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/stringlistmodel/model.cpp
@@ -0,0 +1,170 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+/*
+ model.cpp
+
+ A simple model that uses a QStringList as its data source.
+*/
+
+/*!
+ Returns the number of items in the string list as the number of rows
+ in the model.
+*/
+
+//! [0]
+def rowCount(self, parent):
+ return len(self.stringList)
+//! [0]
+
+/*!
+ Returns an appropriate value for the requested data.
+ If the view requests an invalid index, an invalid variant is returned.
+ Any valid index that corresponds to a string in the list causes that
+ string to be returned.
+*/
+
+//! [1]
+def data(self, index, role):
+ if not index.isValid():
+ return None
+
+ if index.row() >= stringList.size():
+ return None
+
+ if role == Qt.DisplayRole:
+ return stringList[index.row()]
+ else
+ return None
+//! [1]
+
+/*!
+ Returns the appropriate header string depending on the orientation of
+ the header and the section. If anything other than the display role is
+ requested, we return an invalid variant.
+*/
+
+//! [2]
+def headerData(self, section, orientation, role):
+ if role != Qt::DisplayRole:
+ return None
+
+ if orientation == Qt::Horizontal:
+ return "Column %s" % section
+ else:
+ return "Row %s" % section
+//! [2]
+
+/*!
+ Returns an appropriate value for the item's flags. Valid items are
+ enabled, selectable, and editable.
+*/
+
+//! [3]
+def flags(self, index):
+ if not index.isValid()
+ return Qt.ItemIsEnabled
+
+ return QAbstractItemModel.flags(index) | Qt.ItemIsEditable
+//! [3]
+
+/*!
+ Changes an item in the string list, but only if the following conditions
+ are met:
+
+ * The index supplied is valid.
+ * The index corresponds to an item to be shown in a view.
+ * The role associated with editing text is specified.
+
+ The dataChanged() signal is emitted if the item is changed.
+*/
+
+//! [4]
+def setData(self, index, value, role):
+ if index.isValid() and role == Qt.EditRole:
+ self.stringList[index.row()] = value
+ self.dataChanged.emit(index, index)
+ return True;
+//! [4] //! [5]
+ return False;
+}
+//! [5]
+
+/*!
+ Inserts a number of rows into the model at the specified position.
+*/
+
+//! [6]
+def insertRows(self, position, rows, parent):
+ self.beginInsertRows(QModelIndex(), position, position+rows-1)
+
+ for row in range(0, rows):
+ self.stringList.insert(position, "")
+
+ self.endInsertRows()
+ return True;
+//! [6] //! [7]
+//! [7]
+
+/*!
+ Removes a number of rows from the model at the specified position.
+*/
+
+//! [8]
+def removeRows(self, position, rows, parent):
+ self.beginRemoveRows(QModelIndex(), position, position+rows-1)
+
+ for row in range(0, rows):
+ del self.stringList[position]
+
+ self.endRemoveRows()
+ return True;
+//! [8] //! [9]
+//! [9]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/stringlistmodel/model.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/stringlistmodel/model.h
new file mode 100644
index 000000000..5868952d5
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/stringlistmodel/model.h
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+class StringListModel (QAbstractListModel):
+ def __init__(strings, parent = None):
+ QAbstractListModel.__init__(self, parent)
+//! [5]
+ self.stringList = strings
+//! [5]
+
+ def rowCount(self, parent = QModelIndex()):
+ # ...
+ def data(self, index, role):
+ # ...
+ def headerData(self, section, orientation,
+//! [0] //! [1]
+ role = Qt.DisplayRole):
+//! [1]
+
+//! [2]
+ def flags(self, index):
+ # ...
+ def setData(self, index, value,
+//! [2] //! [3]
+ role = Qt.EditRole)
+//! [3]
+
+//! [4]
+ def insertRows(self, position, rows, index = QModelIndex()):
+ # ...
+ def removeRows(self, position, rows, index = QModelIndex()):
+ # ...
+//! [4]
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/styles/styles.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/styles/styles.cpp
new file mode 100644
index 000000000..b17445179
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/styles/styles.cpp
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0] //! [1]
+def paintEvent(self, event):
+//! [0]
+//! [2]
+ painter = QPainter(self)
+//! [2]
+
+ option = QStyleOptionFocusRect()
+ option.initFrom(self)
+ option.backgroundColor = palette().color(QPalette.Background)
+
+//! [3]
+ style().drawPrimitive(QStyle.PE_FrameFocusRect, option, painter, self)
+//! [3]
+//! [1]
+
+def paintEvent2(event):
+//! [4]
+//! [4] //! [5] //! [6]
+ painter = QStylePainter(self)
+//! [5]
+
+ option = QStyleOptionFocusRect()
+ option.initFrom(self)
+ option.backgroundColor = palette().color(QPalette.Background)
+
+//! [7]
+ painter.drawPrimitive(QStyle.PE_FrameFocusRect, option)
+//! [7]
+//! [6]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/stylesheet/common-mistakes.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/stylesheet/common-mistakes.cpp
new file mode 100644
index 000000000..a8dfe2514
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/stylesheet/common-mistakes.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [1]
+ QPushButton {
+ color: grey;
+ border-image: url(/home/kamlie/code/button.png) 3 10 3 10;
+ border-top: 3px transparent;
+ border-bottom: 3px transparent;
+ border-right: 10px transparent;
+ border-left: 10px transparent;
+ }
+//! [1]
+
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/textblock-fragments/mainwindow.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/textblock-fragments/mainwindow.h
new file mode 100644
index 000000000..4b691b543
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/textblock-fragments/mainwindow.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 <QMainWindow>
+
+class QTextEdit;
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow();
+
+public slots:
+ void insertCalendar();
+ void saveFile();
+
+private:
+ bool writeXml(const QString &fileName);
+
+ QTextEdit *editor;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/textblock-fragments/xmlwriter.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/textblock-fragments/xmlwriter.h
new file mode 100644
index 000000000..56ce14089
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/textblock-fragments/xmlwriter.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 XMLWRITER_H
+#define XMLWRITER_H
+
+#include <QDomDocument>
+
+class QTextDocument;
+
+class XmlWriter
+{
+public:
+ XmlWriter(QTextDocument *document) : textDocument(document) {}
+ QDomDocument *toXml();
+
+private:
+ void readFragment(const QTextBlock &currentBlock, QDomElement blockElement,
+ QDomDocument *document);
+ void processBlock(const QTextBlock &currentBlock);
+ void processFragment(const QTextFragment &currentFragment);
+
+ QDomDocument *document;
+ QTextDocument *textDocument;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-blocks/mainwindow.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-blocks/mainwindow.h
new file mode 100644
index 000000000..4b691b543
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-blocks/mainwindow.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 <QMainWindow>
+
+class QTextEdit;
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow();
+
+public slots:
+ void insertCalendar();
+ void saveFile();
+
+private:
+ bool writeXml(const QString &fileName);
+
+ QTextEdit *editor;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-blocks/xmlwriter.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-blocks/xmlwriter.h
new file mode 100644
index 000000000..562ce5dd0
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-blocks/xmlwriter.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 XMLWRITER_H
+#define XMLWRITER_H
+
+#include <QDomDocument>
+
+class QTextDocument;
+
+class XmlWriter
+{
+public:
+ XmlWriter(QTextDocument *document) : textDocument(document) {}
+ QDomDocument *toXml();
+
+private:
+ void createItems(QDomElement &parent, const QTextBlock &block);
+
+ QDomDocument *document;
+ QTextDocument *textDocument;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-css/main.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-css/main.cpp
new file mode 100644
index 000000000..987489d4b
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-css/main.cpp
@@ -0,0 +1,58 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+
+//! [0]
+ browser = QTextBrowser()
+ linkColor = QColor(Qt.red)
+ sheet = QString.fromLatin1("a { text-decoration: underline color: %1 }").arg(linkColor.name())
+ browser.document().setDefaultStyleSheet(sheet)
+//! [0]
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-frames/mainwindow.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-frames/mainwindow.h
new file mode 100644
index 000000000..9aad859dc
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-frames/mainwindow.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 <QMainWindow>
+
+class QTextEdit;
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow();
+
+public slots:
+ void saveFile();
+
+private:
+ bool writeXml(const QString &fileName);
+
+ QTextEdit *editor;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-frames/xmlwriter.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-frames/xmlwriter.h
new file mode 100644
index 000000000..707af5152
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-frames/xmlwriter.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 XMLWRITER_H
+#define XMLWRITER_H
+
+#include <QDomDocument>
+
+class QTextDocument;
+
+class XmlWriter
+{
+public:
+ XmlWriter(QTextDocument *document) : textDocument(document) {}
+ QDomDocument *toXml();
+
+private:
+ void processBlock(QDomElement &parent, const QTextBlock &block);
+ void processFrame(QDomElement &parent, QTextFrame *frame);
+
+ QDomDocument *document;
+//! [0]
+ QTextDocument *textDocument;
+//! [0]
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-imagedrop/textedit.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-imagedrop/textedit.h
new file mode 100644
index 000000000..a80481a4d
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-imagedrop/textedit.h
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 TEXTEDIT_H
+#define TEXTEDIT_H
+
+#include <QTextEdit>
+
+class TextEdit : public QTextEdit
+{
+ Q_OBJECT
+
+public:
+ TextEdit(QWidget *parent=0);
+ bool canInsertFromMimeData( const QMimeData *source ) const;
+ void insertFromMimeData( const QMimeData *source );
+};
+
+#endif \ No newline at end of file
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-imageformat/images.qrc b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-imageformat/images.qrc
new file mode 100644
index 000000000..6473daf34
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-imageformat/images.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>images/advert.png</file>
+ <file>images/newimage.png</file>
+</qresource>
+</RCC>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-imageformat/images/advert.png b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-imageformat/images/advert.png
new file mode 100644
index 000000000..40e10d522
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-imageformat/images/advert.png
Binary files differ
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-imageformat/images/newimage.png b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-imageformat/images/newimage.png
new file mode 100644
index 000000000..0eec048a7
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-imageformat/images/newimage.png
Binary files differ
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-images/images.qrc b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-images/images.qrc
new file mode 100644
index 000000000..09e305e8f
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-images/images.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>images/advert.png</file>
+</qresource>
+</RCC>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-images/images/advert.png b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-images/images/advert.png
new file mode 100644
index 000000000..40e10d522
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-images/images/advert.png
Binary files differ
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-listitems/mainwindow.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-listitems/mainwindow.h
new file mode 100644
index 000000000..deeeab85a
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-listitems/mainwindow.h
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 <QList>
+#include <QMainWindow>
+#include <QString>
+
+class QAction;
+class QTextDocument;
+class QTextEdit;
+class QTextList;
+class QTreeWidgetItem;
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow();
+
+public slots:
+ void insertList();
+ void highlightListItems();
+ void showList();
+
+private:
+ QString currentFile;
+ QTextEdit *editor;
+ QTextDocument *document;
+ QList<QTextList*> listStructures;
+ QList<QTreeWidgetItem*> previousItems;
+ QList<QTreeWidgetItem*> parentItems;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-lists/mainwindow.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-lists/mainwindow.h
new file mode 100644
index 000000000..a52fa764f
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-lists/mainwindow.h
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 <QMainWindow>
+#include <QTextDocumentFragment>
+
+class QAction;
+class QTextDocument;
+class QTextEdit;
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow();
+
+public slots:
+ void cutSelection();
+ void copySelection();
+ void insertList();
+ void pasteSelection();
+ void selectWord();
+ void selectLine();
+ void selectBlock();
+ void selectFrame();
+ void updateMenus();
+
+private:
+ QAction *cutAction;
+ QAction *copyAction;
+ QAction *pasteAction;
+ QString currentFile;
+ QTextEdit *editor;
+ QTextDocument *document;
+ QTextDocumentFragment selection;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-printing/mainwindow.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-printing/mainwindow.h
new file mode 100644
index 000000000..c80d42bb0
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-printing/mainwindow.h
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 <QHash>
+#include <QMainWindow>
+#include <QTextDocumentFragment>
+
+class QAction;
+class QTextDocument;
+class QTextEdit;
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow();
+
+public slots:
+ void openFile();
+ void printFile();
+ void printPdf();
+
+private:
+ QAction *printAction;
+ QAction *pdfPrintAction;
+ QString currentFile;
+ QTextEdit *editor;
+ QTextDocument *document;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-selections/mainwindow.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-selections/mainwindow.h
new file mode 100644
index 000000000..ba889195e
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-selections/mainwindow.h
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 <QMainWindow>
+#include <QTextDocumentFragment>
+
+class QAction;
+class QTextDocument;
+class QTextEdit;
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow();
+
+public slots:
+ void cutSelection();
+ void copySelection();
+ void openFile();
+ void pasteSelection();
+ void selectWord();
+ void selectLine();
+ void selectBlock();
+ void selectFrame();
+ void updateMenus();
+
+private:
+ QAction *cutAction;
+ QAction *copyAction;
+ QAction *pasteAction;
+ QString currentFile;
+ QTextEdit *editor;
+ QTextDocument *document;
+ QTextDocumentFragment selection;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-tables/mainwindow.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-tables/mainwindow.cpp
new file mode 100644
index 000000000..cf43b08c9
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-tables/mainwindow.cpp
@@ -0,0 +1,125 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+//! [0] //! [1]
+ cursor = QTextCursor(editor.textCursor())
+//! [0]
+ cursor.movePosition(QTextCursor.Start)
+//! [1]
+
+//! [2]
+ tableFormat = QTextTableFormat()
+ tableFormat.setBackground(QColor("#e0e0e0"))
+ QVector<QTextLength> constraints
+ constraints << QTextLength(QTextLength.PercentageLength, 16)
+ constraints << QTextLength(QTextLength.PercentageLength, 28)
+ constraints << QTextLength(QTextLength.PercentageLength, 28)
+ constraints << QTextLength(QTextLength.PercentageLength, 28)
+ tableFormat.setColumnWidthConstraints(constraints)
+//! [3]
+ table = cursor.insertTable(rows, columns, tableFormat)
+//! [2] //! [3]
+
+//! [4]
+ cell = table.cellAt(0, 0)
+ cellCursor = cell.firstCursorPosition()
+ cellCursor.insertText(tr("Week"), charFormat)
+//! [4]
+
+//! [5]
+ for column in range(columns):
+ cell = table.cellAt(0, column)
+ cellCursor = cell.firstCursorPosition()
+ cellCursor.insertText(tr("Team %1").arg(column), charFormat)
+
+
+ for row in range(rows):
+ cell = table.cellAt(row, 0)
+ cellCursor = cell.firstCursorPosition()
+ cellCursor.insertText(tr("%1").arg(row), charFormat)
+
+ for column in range(columns)
+ if (row-1) % 3 == column-1:
+//! [5] //! [6]
+ cell = table.cellAt(row, column)
+ cellCursor = cell.firstCursorPosition()
+ cellCursor.insertText(tr("On duty"), charFormat)
+
+//! [6] //! [7]
+
+//! [7] //! [8]
+
+//! [8]
+
+//! [9]
+ for row in range(table.rows()):
+ for column in range(table.columns()):
+ tableCell = table.cellAt(row, column)
+//! [9]
+ QTextFrame.iterator it
+ QString text
+ for (it = tableCell.begin() !(it.atEnd()); ++it):
+ QTextBlock childBlock = it.currentBlock()
+ if (childBlock.isValid())
+ text += childBlock.text()
+
+ Item = QTableWidgetItem(text)
+ tableWidget.setItem(row, column, Item)
+
+//! [10]
+ processTableCell(tableCell)
+//! [10]
+
+//! [11]
+
+//! [11] //! [12]
+
+//! [12]
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-tables/mainwindow.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-tables/mainwindow.h
new file mode 100644
index 000000000..36fd19709
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-tables/mainwindow.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 <QMainWindow>
+
+class QTextEdit;
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow();
+
+public slots:
+ void saveFile();
+ void showTable();
+
+private:
+ bool writeXml(const QString &fileName);
+
+ QTextEdit *editor;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-tables/xmlwriter.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-tables/xmlwriter.h
new file mode 100644
index 000000000..ebfbc826f
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-tables/xmlwriter.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 XMLWRITER_H
+#define XMLWRITER_H
+
+#include <QDomDocument>
+
+class QTextDocument;
+
+class XmlWriter
+{
+public:
+ XmlWriter(QTextDocument *document) : textDocument(document) {}
+ QDomDocument *toXml();
+
+private:
+ void processBlock(QDomElement &parent, const QTextBlock &block);
+ void processFrame(QDomElement &parent, QTextFrame *frame);
+ void processTable(QDomElement &parent, QTextTable *table);
+ void processTableCell(QDomElement &parent, const QTextTableCell &cell);
+
+ QDomDocument *document;
+ QTextDocument *textDocument;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-texttable/main.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-texttable/main.cpp
new file mode 100644
index 000000000..b6622636c
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-texttable/main.cpp
@@ -0,0 +1,56 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+//! [0]
+ table.mergeCells(0, 0, 1, 2)
+//! [0] //! [1]
+ table.splitCell(0, 0, 1, 1)
+//! [1]
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/threads/threads.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/threads/threads.h
new file mode 100644
index 000000000..2c4894315
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/threads/threads.h
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 <QThread>
+
+//! [0]
+class MyThread : public QThread
+{
+ Q_OBJECT
+
+protected:
+ void run();
+};
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/timers/timers.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/timers/timers.cpp
new file mode 100644
index 000000000..f1d70446b
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/timers/timers.cpp
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+from PySide6.QtCore import QTimer
+
+class Foo : public QObject
+{
+public:
+ Foo()
+}
+
+Foo::Foo()
+{
+//! [0]
+ timer = QTimer(self)
+//! [0] //! [1]
+ timer.timeout.connect(self.updateCaption)
+//! [1] //! [2]
+ timer.start(1000)
+//! [2]
+
+//! [3]
+ QTimer.singleShot(200, self.updateCaption)
+//! [3]
+
+ {
+ // ZERO-CASE
+//! [4]
+ timer = QTimer(self)
+//! [4] //! [5]
+ timer.timeout.connect(self.processOneThing)
+//! [5] //! [6]
+ timer.start()
+//! [6]
+ }
+}
+
+int main()
+{
+
+}
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/transform/main.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/transform/main.cpp
new file mode 100644
index 000000000..325ea1c7e
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/transform/main.cpp
@@ -0,0 +1,110 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+
+//! [0]
+def paintEvent(self, event)
+ painter = QPainter(self)
+ painter.setPen(QPen(Qt.blue, 1, Qt.DashLine))
+ painter.drawRect(0, 0, 100, 100)
+
+ painter.rotate(45)
+
+ painter.setFont(QFont("Helvetica", 24))
+ painter.setPen(QPen(Qt.black, 1))
+ painter.drawText(20, 10, "QTransform")
+//! [0]
+
+//! [1]
+def paintEvent(self, event)
+ painter = QPainter(self)
+ painter.setPen(QPen(Qt.blue, 1, Qt.DashLine))
+ painter.drawRect(0, 0, 100, 100)
+
+ transform = QTransform()
+ transform.translate(50, 50)
+ transform.rotate(45)
+ transform.scale(0.5, 1.0)
+ painter.setTransform(transform)
+
+ painter.setFont(QFont("Helvetica", 24))
+ painter.setPen(QPen(Qt.black, 1))
+ painter.drawText(20, 10, "QTransform")
+//! [1]
+
+
+//! [2]
+def paintEvent(self, event)
+ pi = 3.14
+
+ a = pi/180 * 45.0
+ sina = sin(a)
+ cosa = cos(a)
+
+ translationTransform = QTransform(1, 0, 0, 1, 50.0, 50.0)
+ rotationTransform = QTransform(cosa, sina, -sina, cosa, 0, 0)
+ scalingTransform = QTransform(0.5, 0, 0, 1.0, 0, 0)
+
+ transform = QTransform()
+ transform = scalingTransform * rotationTransform * translationTransform
+
+ painter = QPainter(self)
+ painter.setPen(QPen(Qt.blue, 1, Qt.DashLine))
+ painter.drawRect(0, 0, 100, 100)
+
+ painter.setTransform(transform)
+
+ painter.setFont(QFont("Helvetica", 24))
+ painter.setPen(QPen(Qt.black, 1))
+ painter.drawText(20, 10, "QTransform")
+
+//! [2]
+
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/uitools/calculatorform/calculatorform.ui b/sources/pyside6/doc/codesnippets/doc/src/snippets/uitools/calculatorform/calculatorform.ui
new file mode 100644
index 000000000..dda0e62dd
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/uitools/calculatorform/calculatorform.ui
@@ -0,0 +1,303 @@
+<ui version="4.0" >
+ <author></author>
+ <comment></comment>
+ <exportmacro></exportmacro>
+ <class>CalculatorForm</class>
+ <widget class="QWidget" name="CalculatorForm" >
+ <property name="objectName" >
+ <string notr="true" >CalculatorForm</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>276</width>
+ <height>98</height>
+ </rect>
+ </property>
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="windowTitle" >
+ <string>Calculator Builder</string>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="margin" >
+ <number>1</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <layout class="QVBoxLayout" >
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="margin" >
+ <number>1</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="label" >
+ <property name="objectName" >
+ <string notr="true" >label</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>1</y>
+ <width>45</width>
+ <height>19</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>Input 1</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="inputSpinBox1" >
+ <property name="objectName" >
+ <string notr="true" >inputSpinBox1</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>26</y>
+ <width>45</width>
+ <height>25</height>
+ </rect>
+ </property>
+ <property name="mouseTracking" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_3" >
+ <property name="objectName" >
+ <string notr="true" >label_3</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>54</x>
+ <y>1</y>
+ <width>7</width>
+ <height>52</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>+</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" >
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="margin" >
+ <number>1</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="label_2" >
+ <property name="objectName" >
+ <string notr="true" >label_2</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>1</y>
+ <width>45</width>
+ <height>19</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>Input 2</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="inputSpinBox2" >
+ <property name="objectName" >
+ <string notr="true" >inputSpinBox2</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>26</y>
+ <width>45</width>
+ <height>25</height>
+ </rect>
+ </property>
+ <property name="mouseTracking" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_3_2" >
+ <property name="objectName" >
+ <string notr="true" >label_3_2</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>120</x>
+ <y>1</y>
+ <width>7</width>
+ <height>52</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>=</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" >
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="margin" >
+ <number>1</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="label_2_2_2" >
+ <property name="objectName" >
+ <string notr="true" >label_2_2_2</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>1</y>
+ <width>37</width>
+ <height>17</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>Output</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="outputWidget" >
+ <property name="objectName" >
+ <string notr="true" >outputWidget</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>24</y>
+ <width>37</width>
+ <height>27</height>
+ </rect>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::Box</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Sunken</enum>
+ </property>
+ <property name="text" >
+ <string>0</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignAbsolute|Qt::AlignBottom|Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignHorizontal_Mask|Qt::AlignJustify|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing|Qt::AlignVCenter|Qt::AlignVertical_Mask</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0" >
+ <spacer>
+ <property name="objectName" >
+ <string notr="true" >verticalSpacer</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>85</x>
+ <y>69</y>
+ <width>20</width>
+ <height>20</height>
+ </rect>
+ </property>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="1" >
+ <spacer>
+ <property name="objectName" >
+ <string notr="true" >horizontalSpacer</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>188</x>
+ <y>26</y>
+ <width>79</width>
+ <height>20</height>
+ </rect>
+ </property>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <pixmapfunction></pixmapfunction>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/updating-selections/model.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/updating-selections/model.h
new file mode 100644
index 000000000..6b4076815
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/updating-selections/model.h
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 MODEL_H
+#define MODEL_H
+
+#include <QAbstractTableModel>
+#include <QStringList>
+#include <QVariant>
+
+class TableModel : public QAbstractTableModel
+{
+ Q_OBJECT
+
+public:
+ TableModel(int rows = 1, int columns = 1, QObject *parent = 0);
+
+ int rowCount(const QModelIndex &parent = QModelIndex()) const;
+ int columnCount(const QModelIndex &parent = QModelIndex()) const;
+ QVariant data(const QModelIndex &index, int role) const;
+ QVariant headerData(int section, Qt::Orientation orientation,
+ int role = Qt::DisplayRole) const;
+
+ Qt::ItemFlags flags(const QModelIndex &index) const;
+ bool setData(const QModelIndex &index, const QVariant &value,
+ int role = Qt::EditRole);
+
+ bool insertRows(int position, int rows, const QModelIndex &parent = QModelIndex());
+ bool insertColumns(int position, int columns, const QModelIndex &parent = QModelIndex());
+ bool removeRows(int position, int rows, const QModelIndex &parent = QModelIndex());
+ bool removeColumns(int position, int columns, const QModelIndex &parent = QModelIndex());
+
+private:
+ QList<QStringList> rowList;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/updating-selections/window.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/updating-selections/window.h
new file mode 100644
index 000000000..ba4a36a03
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/updating-selections/window.h
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 <QItemSelection>
+#include <QMainWindow>
+#include <QModelIndex>
+#include <QWidget>
+#include <QTableView>
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+public:
+ MainWindow(QWidget *parent = 0);
+
+public slots:
+ void updateSelection(const QItemSelection &selected,
+ const QItemSelection &deselected);
+ void changeCurrent(const QModelIndex &current, const QModelIndex &previous);
+
+private:
+ QAbstractItemModel *model;
+ QItemSelectionModel *selectionModel;
+ QTableView *table;
+};
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/whatsthis/whatsthis.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/whatsthis/whatsthis.cpp
new file mode 100644
index 000000000..ea97d1e35
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/whatsthis/whatsthis.cpp
@@ -0,0 +1,57 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+//! [0]
+ Act = QAction(tr("&New"), self)
+ Act.setShortcut(tr("Ctrl+N"))
+ Act.setStatusTip(QObject.tr("Create a new file"))
+ Act.setWhatsThis(QObject.tr("Click self option to create a new file."))
+//! [0]
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/widget-mask/mask.qrc b/sources/pyside6/doc/codesnippets/doc/src/snippets/widget-mask/mask.qrc
new file mode 100644
index 000000000..92f227253
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/widget-mask/mask.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/images" >
+ <file>tux.png</file>
+</qresource>
+</RCC>
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/widget-mask/tux.png b/sources/pyside6/doc/codesnippets/doc/src/snippets/widget-mask/tux.png
new file mode 100644
index 000000000..a95527f3f
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/widget-mask/tux.png
Binary files differ
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/widgetdelegate.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/widgetdelegate.cpp
new file mode 100644
index 000000000..960d50158
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/widgetdelegate.cpp
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//![0]
+class WidgetDelegate (QStyledItemDelegate):
+ # ...
+
+ def paint(painter, option, index):
+ if index.column() == 1:
+ progress = index.data().toInt()
+
+ progressBarOption = QStyleOptionProgressBar()
+ progressBarOption.rect = option.rect
+ progressBarOption.minimum = 0
+ progressBarOption.maximum = 100
+ progressBarOption.progress = progress
+ progressBarOption.text = QString::number(progress) + "%"
+ progressBarOption.textVisible = True
+
+ QApplication.style().drawControl(QStyle.CE_ProgressBar, progressBarOption, painter)
+ else:
+ QStyledItemDelegate.paint(self, painter, option, index)
+
+//![0]
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/widgets-tutorial/template.py b/sources/pyside6/doc/codesnippets/doc/src/snippets/widgets-tutorial/template.py
new file mode 100644
index 000000000..6f8f2ed39
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/widgets-tutorial/template.py
@@ -0,0 +1,66 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the documentation 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$
+##
+############################################################################
+
+//! [main.cpp body]
+import sys
+from PySide6.QtWidgets import QApplication
+
+# Include header files for application components.
+# ...
+
+if __name__ == "__main__":
+ app = QApplication(sys.argv)
+
+ # Set up and show widgets.
+ # ...
+
+ sys.exit(app.exec_())
+}
+//! [main.cpp body]
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/xml/rsslisting/handler.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/xml/rsslisting/handler.h
new file mode 100644
index 000000000..89acb5d36
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/xml/rsslisting/handler.h
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 HANDLER_H
+#define HANDLER_H
+
+#include <QObject>
+#include <QString>
+#include <QXmlDefaultHandler>
+
+/* Note that QObject must precede QXmlDefaultHandler in the following list. */
+
+class Handler : public QObject, public QXmlDefaultHandler
+{
+ Q_OBJECT
+public:
+ bool startDocument();
+ bool startElement(const QString &, const QString &, const QString &qName,
+ const QXmlAttributes &attr);
+ bool endElement(const QString &, const QString &, const QString &qName);
+ bool characters(const QString &chars);
+
+ bool fatalError(const QXmlParseException &exception);
+
+signals:
+ void newItem(QString &title, QString &link);
+
+private:
+ QString titleString;
+ QString linkString;
+ bool inItem;
+ bool inTitle;
+ bool inLink;
+};
+
+#endif
+
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/xml/rsslisting/rsslisting.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/xml/rsslisting/rsslisting.h
new file mode 100644
index 000000000..c7d75528b
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/doc/src/snippets/xml/rsslisting/rsslisting.h
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 RSSLISTING_H
+#define RSSLISTING_H
+
+#include <QHttp>
+#include <QWidget>
+#include <QXmlInputSource>
+#include <QXmlSimpleReader>
+
+#include "handler.h"
+
+class QLineEdit;
+class QTreeWidget;
+class QTreeWidgetItem;
+class QPushButton;
+
+class RSSListing : public QWidget
+{
+ Q_OBJECT
+public:
+ RSSListing(QWidget *widget = 0);
+
+public slots:
+ void addItem(QString &title, QString &link);
+ void fetch();
+ void finished(int id, bool error);
+ void readData(const QHttpResponseHeader &);
+
+private:
+ Handler *handler;
+ QXmlInputSource xmlInput;
+ QXmlSimpleReader xmlReader;
+
+ bool newInformation;
+
+ QHttp http;
+ int connectionId;
+
+ QLineEdit *lineEdit;
+ QTreeWidget *treeWidget;
+ QTreeWidgetItem *lastItemCreated;
+ QPushButton *abortButton;
+ QPushButton *fetchButton;
+};
+
+#endif
+
diff --git a/sources/pyside6/doc/codesnippets/examples/dbus/example-client.py b/sources/pyside6/doc/codesnippets/examples/dbus/example-client.py
new file mode 100644
index 000000000..663c02e96
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/dbus/example-client.py
@@ -0,0 +1,100 @@
+#!/usr/bin/env python
+
+#############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the documentation of Qt for Python.
+##
+## $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$
+##
+#############################################################################
+
+# -*- coding: utf-8 -*-
+
+# DBUS Client using PySide integration
+
+import sys
+from traceback import print_exc
+
+# import python dbus module
+import dbus
+# import python dbus GLib mainloop support
+import dbus.mainloop.glib
+# import QtCore
+from PySide6.QtCore import *
+
+# signal handler
+def button_clicked():
+ print "button clicked"
+
+# main function
+if __name__ == '__main__':
+
+ # Enable glib main loop support
+ dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+ # Get the session bus
+ bus = dbus.SessionBus()
+
+ try:
+ # Get the remote object
+ remote_object = bus.get_object("com.example.SampleService",
+ "/DBusWidget")
+ # Get the remote interface for the remote object
+ iface = dbus.Interface(remote_object, "com.example.SampleWidget")
+ except dbus.DBusException:
+ print_exc()
+ sys.exit(1)
+
+ # Start the application
+ app = QCoreApplication([])
+
+ # Call some methods of the remote interface
+ iface.show()
+ iface.setText("Emit signal")
+ # connect the DBus signal clicked to the function button_clicked
+ iface.connect_to_signal("clicked", button_clicked)
+ iface.connect_to_signal("lastWindowClosed", app.quit)
+
+ # enter in the main loop
+ app.exec_()
diff --git a/sources/pyside6/doc/codesnippets/examples/dbus/example-server.py b/sources/pyside6/doc/codesnippets/examples/dbus/example-server.py
new file mode 100644
index 000000000..78f6eac2e
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/dbus/example-server.py
@@ -0,0 +1,119 @@
+#!/usr/bin/env python
+
+#############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the documentation of Qt for Python.
+##
+## $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$
+##
+#############################################################################
+
+# -*- coding: utf-8 -*-
+
+# DBUS Server Example of use PySide with PyDBus library
+
+import dbus
+import dbus.service
+import dbus.mainloop.glib
+import random
+
+from PySide6.QtCore import *
+from PySide6.QtGui import QPushButton, QApplication
+
+# The adaptor, MUST inherit dbus.service.Object
+class DBusWidget(dbus.service.Object):
+ def __init__(self, name, session):
+ # export this object to dbus
+ dbus.service.Object.__init__(self, name, session)
+
+ # create a simple widget
+ self.widget = QPushButton()
+ self.widget.resize(200, 50)
+
+ # To export a Qt signal as a DBus-signal, you need to connect it to a method in this class.
+ # The method MUST have the signal annotation, so python-dbus will export it as a dbus-signal
+ QObject.connect(self.widget, SIGNAL("clicked()"), self.clicked)
+ QObject.connect(QApplication.instance(), SIGNAL("lastWindowClosed()"), self.lastWindowClosed)
+
+ # You can export methods to dbus like you do in python-dbus.
+ @dbus.service.method("com.example.SampleWidget", in_signature='', out_signature='')
+ def show(self):
+ self.widget.show()
+
+ # Another method... now with a parameter
+ @dbus.service.method("com.example.SampleWidget", in_signature='s', out_signature='')
+ def setText(self, value):
+ self.widget.setText(value)
+
+ # Another one...
+ @dbus.service.method("com.example.SampleWidget", in_signature='', out_signature='')
+ def exit(self):
+ qApp().quit()
+
+ # A signal that will be exported to dbus
+ @dbus.service.signal("com.example.SampleWidget", signature='')
+ def clicked(self):
+ pass
+
+ # Another signal that will be exported to dbus
+ @dbus.service.signal("com.example.SampleWidget", signature='')
+ def lastWindowClosed(self):
+ pass
+
+
+if __name__ == '__main__':
+ app = QApplication([])
+ # Use qt/glib mainloop integration to get dbus mainloop working
+ dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+
+ session_bus = dbus.SessionBus()
+ # Export the service
+ name = dbus.service.BusName("com.example.SampleService", session_bus)
+ # Export the object
+ widget = DBusWidget(session_bus, '/DBusWidget')
+
+ print "Running example service."
+ app.exec_()
+
diff --git a/sources/pyside6/doc/codesnippets/examples/declarative/cppextensions/plugins/plugin.cpp b/sources/pyside6/doc/codesnippets/examples/declarative/cppextensions/plugins/plugin.cpp
new file mode 100644
index 000000000..4b8b9234f
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/declarative/cppextensions/plugins/plugin.cpp
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//![0]
+class TimeModel (QObject):
+ hour = Property(int, getHour, notify = timeChanged)
+ minute = Property(int, getMinute, notify = timeChanged)
+//![0]
+
+//![plugin]
+class QExampleQmlPlugin (QDeclarativeExtensionPlugin):
+
+ def registerTypes(self, uri):
+ assert(uri == "com.nokia.TimeExample")
+ qmlRegisterType(TimeModel, uri, 1, 0, "Time")
+//![plugin]
+
+//![export]
+# This isn't supported by PySide yet.
+# Q_EXPORT_PLUGIN2(qmlqtimeexampleplugin, QExampleQmlPlugin);
+//![export]
diff --git a/sources/pyside6/doc/codesnippets/examples/declarative/cppextensions/plugins/plugins.qml b/sources/pyside6/doc/codesnippets/examples/declarative/cppextensions/plugins/plugins.qml
new file mode 100644
index 000000000..415531885
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/declarative/cppextensions/plugins/plugins.qml
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+//![0]
+import com.nokia.TimeExample 1.0 // import types from the plugin
+
+Clock { // this class is defined in QML (com/nokia/TimeExample/Clock.qml)
+
+ Time { // this class is defined in C++ (plugin.cpp)
+ id: time
+ }
+
+ hours: time.hour
+ minutes: time.minute
+}
+//![0]
diff --git a/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/classwizard.py b/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/classwizard.py
new file mode 100644
index 000000000..08032cf2a
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/classwizard.py
@@ -0,0 +1,254 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+//! [0] //! [1]
+def __init__(self, parent):
+ QWizard.__init__(self, parent):
+ self.addPage(IntroPage())
+ self.addPage(ClassInfoPage())
+ self.addPage(CodeStylePage())
+ self.addPage(OutputFilesPage())
+ self.addPage(ConclusionPage())
+//! [0]
+
+ self.setPixmap(QWizard.BannerPixmap, QPixmap(":/images/banner.png"))
+ self.setPixmap(QWizard.BackgroundPixmap, QPixmap(":/images/background.png"))
+
+ self.setWindowTitle(self.tr("Class Wizard"))
+//! [2]
+
+//! [1] //! [2]
+
+//! [3]
+def accept(self):
+//! [3] //! [4]
+ className = self.field("className")
+ baseClass = self.field("baseClass")
+ macroName = self.field("macroName")
+ baseInclude = self.field("baseInclude")
+
+ outputDir = self.field("outputDir")
+ header = self.field("header")
+ implementation = self.field("implementation")
+//! [4]
+
+...
+
+//! [5]
+ QDialog.accept(self)
+//! [5] //! [6]
+}
+//! [6]
+
+//! [7]
+class IntroPage (QWizardPage):
+
+ def __init__(self, parent):
+ QWizardPage.__init__(self, parent)
+
+ self.setTitle(tr("Introduction"))
+ self.setPixmap(QWizard.WatermarkPixmap, QPixmap(":/images/watermark1.png"))
+
+ label = QLabel(self.tr("This wizard will generate a skeleton C++ class " \
+ "definition, including a few functions. You simply " \
+ "need to specify the class name and set a few " \
+ "options to produce a header file and an " \
+ "implementation file for your new C++ class."))
+ label.setWordWrap(True)
+
+ layout = QVBoxLayout()
+ layout.addWidget(label)
+ self.setLayout(layout)
+}
+//! [7]
+
+//! [8] //! [9]
+class ClassInfoPage(QWizardPage):
+
+ def __init__(self, parent):
+ QWizardPage.__init__(self, parent)
+//! [8]
+ self.setTitle(self.tr("Class Information"))
+ self.setSubTitle(self.tr("Specify basic information about the class for which you " \
+ "want to generate skeleton source code files."))
+ self.setPixmap(QWizard.LogoPixmap, QPixmap(":/images/logo1.png"))
+
+//! [10]
+ classNameLabel = QLabel(self.tr("&Class name:"))
+ classNameLineEdit = QLineEdit()
+ classNameLabel.setBuddy(classNameLineEdit)
+
+ baseClassLabel = QLabel(self.tr("B&ase class:"))
+ baseClassLineEdit = QLineEdit()
+ baseClassLabel.setBuddy(baseClassLineEdit)
+
+ qobjectMacroCheckBox = QCheckBox(self.tr("Generate Q_OBJECT &macro"))
+
+//! [10]
+ groupBox = QGroupBox(self.tr("C&onstructor"))
+//! [9]
+
+ qobjectCtorRadioButton = QRadioButton(self.tr("&QObject-style constructor"))
+ qwidgetCtorRadioButton = QRadioButton(self.tr("Q&Widget-style constructor"))
+ defaultCtorRadioButton = QRadioButton(self.tr("&Default constructor"))
+ copyCtorCheckBox = QCheckBox(self.tr("&Generate copy constructor and operator="))
+
+ defaultCtorRadioButton.setChecked(True)
+
+ defaultCtorRadioButton.toggled[bool].connect(copyCtorCheckBox.setEnabled)
+
+//! [11] //! [12]
+ registerField("className*", classNameLineEdit)
+ registerField("baseClass", baseClassLineEdit)
+ registerField("qobjectMacro", qobjectMacroCheckBox)
+//! [11]
+ registerField("qobjectCtor", qobjectCtorRadioButton)
+ registerField("qwidgetCtor", qwidgetCtorRadioButton)
+ registerField("defaultCtor", defaultCtorRadioButton)
+ registerField("copyCtor", copyCtorCheckBox)
+
+ groupBoxLayout = QVBoxLayout()
+//! [12]
+ groupBoxLayout.addWidget(qobjectCtorRadioButton)
+ groupBoxLayout.addWidget(qwidgetCtorRadioButton)
+ groupBoxLayout.addWidget(defaultCtorRadioButton)
+ groupBoxLayout.addWidget(copyCtorCheckBox)
+ groupBox.setLayout(groupBoxLayout)
+
+ layout = QGridLayout()
+ layout.addWidget(classNameLabel, 0, 0)
+ layout.addWidget(classNameLineEdit, 0, 1)
+ layout.addWidget(baseClassLabel, 1, 0)
+ layout.addWidget(baseClassLineEdit, 1, 1)
+ layout.addWidget(qobjectMacroCheckBox, 2, 0, 1, 2)
+ layout.addWidget(groupBox, 3, 0, 1, 2)
+ self.setLayout(layout)
+//! [13]
+
+//! [13]
+
+//! [14]
+class CodeStylePage(QWizardPage):
+
+ def __init__(self, parent):
+ QWizardPage.__init__(self, parent)
+ self.setTitle(tr("Code Style Options"))
+ self.setSubTitle(tr("Choose the formatting of the generated code."))
+ self.setPixmap(QWizard.LogoPixmap, QPixmap(":/images/logo2.png"))
+
+ commentCheckBox = QCheckBox(self.tr("&Start generated files with a comment"))
+//! [14]
+ commentCheckBox.setChecked(True)
+
+ protectCheckBox = QCheckBox(self.tr("&Protect header file against multiple " \
+ "inclusions"))
+ protectCheckBox.setChecked(True)
+
+ macroNameLabel = QLabel(self.tr("&Macro name:"))
+ macroNameLineEdit = QLineEdit()
+ macroNameLabel.setBuddy(macroNameLineEdit)
+
+ includeBaseCheckBox = QCheckBox(self.tr("&Include base class definition"))
+ baseIncludeLabel = QLabel(self.tr("Base class include:"))
+ baseIncludeLineEdit = QLineEdit()
+ baseIncludeLabel.setBuddy(baseIncludeLineEdit)
+
+ protectCheckBox.toggled[bool].connect(macroNameLabel.setEnabled)
+ protectCheckBox.toggled[bool].connect(macroNameLineEdit.setEnabled)
+ includeBaseCheckBox.toggled[bool].connect(baseIncludeLabel.setEnabled)
+ includeBaseCheckBox.toggled[bool].connect(baseIncludeLineEdit.setEnabled)
+
+ self.registerField("comment", commentCheckBox)
+ self.registerField("protect", protectCheckBox)
+ self.registerField("macroName", macroNameLineEdit)
+ self.registerField("includeBase", includeBaseCheckBox)
+ self.registerField("baseInclude", baseIncludeLineEdit)
+
+ layout = QGridLayout()
+ layout.setColumnMinimumWidth(0, 20)
+ layout.addWidget(commentCheckBox, 0, 0, 1, 3)
+ layout.addWidget(protectCheckBox, 1, 0, 1, 3)
+ layout.addWidget(macroNameLabel, 2, 1)
+ layout.addWidget(macroNameLineEdit, 2, 2)
+ layout.addWidget(includeBaseCheckBox, 3, 0, 1, 3)
+ layout.addWidget(baseIncludeLabel, 4, 1)
+ layout.addWidget(baseIncludeLineEdit, 4, 2)
+//! [15]
+ self.setLayout(layout)
+}
+//! [15]
+
+//! [16]
+ def initializePage(self):
+ className = self.field("className")
+ self.macroNameLineEdit.setText(className.upper() + "_H")
+
+ baseClass = self.field("baseClass")
+
+ self.includeBaseCheckBox.setChecked(len(baseClass))
+ self.includeBaseCheckBox.setEnabled(len(baseClass))
+ self.baseIncludeLabel.setEnabled(len(baseClass))
+ self.baseIncludeLineEdit.setEnabled(len(baseClass))
+
+ if not baseClass:
+ self.baseIncludeLineEdit.clear()
+ elsif QRegExp("Q[A-Z].*").exactMatch(baseClass):
+ baseIncludeLineEdit.setText("<" + baseClass + ">")
+ else:
+ baseIncludeLineEdit.setText("\"" + baseClass.lower() + ".h\"")
+//! [16]
+
+//! [17]
+ def initializePage(self):
+ className = field("className")
+ self.headerLineEdit.setText(className.lower() + ".h")
+ self.implementationLineEdit.setText(className.lower() + ".cpp")
+ self.outputDirLineEdit.setText(QDir.convertSeparators(QDir.tempPath()))
+//! [17]
diff --git a/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/classwizard.qrc b/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/classwizard.qrc
new file mode 100644
index 000000000..41a5ddc7d
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/classwizard.qrc
@@ -0,0 +1,11 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>images/background.png</file>
+ <file>images/banner.png</file>
+ <file>images/logo1.png</file>
+ <file>images/logo2.png</file>
+ <file>images/logo3.png</file>
+ <file>images/watermark1.png</file>
+ <file>images/watermark2.png</file>
+</qresource>
+</RCC>
diff --git a/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/background.png b/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/background.png
new file mode 100644
index 000000000..44c7badb8
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/background.png
Binary files differ
diff --git a/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/banner.png b/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/banner.png
new file mode 100644
index 000000000..3169152b8
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/banner.png
Binary files differ
diff --git a/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/logo1.png b/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/logo1.png
new file mode 100644
index 000000000..f9b594aaf
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/logo1.png
Binary files differ
diff --git a/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/logo2.png b/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/logo2.png
new file mode 100644
index 000000000..5dcbd4669
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/logo2.png
Binary files differ
diff --git a/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/logo3.png b/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/logo3.png
new file mode 100644
index 000000000..9fd3ea235
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/logo3.png
Binary files differ
diff --git a/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/watermark1.png b/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/watermark1.png
new file mode 100644
index 000000000..0091f5c17
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/watermark1.png
Binary files differ
diff --git a/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/watermark2.png b/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/watermark2.png
new file mode 100644
index 000000000..3b88f2e36
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/watermark2.png
Binary files differ
diff --git a/sources/pyside6/doc/codesnippets/examples/dialogs/extension/finddialog.py b/sources/pyside6/doc/codesnippets/examples/dialogs/extension/finddialog.py
new file mode 100644
index 000000000..fc007ab85
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/dialogs/extension/finddialog.py
@@ -0,0 +1,119 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+
+from PySide6.QtGui import *
+
+//! [0]
+def __init__(self, parent):
+ QDialog.__init__(self, parent)
+ label = QLabel(self.tr("Find &what:"))
+ lineEdit = QLineEdit()
+ label.setBuddy(lineEdit)
+
+ caseCheckBox = QCheckBox(self.tr("Match &case"))
+ fromStartCheckBox = QCheckBox(self.tr("Search from &start"))
+ fromStartCheckBox.setChecked(True)
+
+//! [1]
+ findButton = QPushButton(self.tr("&Find"))
+ findButton.setDefault(True)
+
+ moreButton = QPushButton(self.tr("&More"))
+ moreButton.setCheckable(True)
+//! [0]
+ moreButton.setAutoDefault(False)
+
+ buttonBox = QDialogButtonBox(Qt.Vertical)
+ buttonBox.addButton(findButton, QDialogButtonBox.ActionRole)
+ buttonBox.addButton(moreButton, QDialogButtonBox.ActionRole)
+//! [1]
+
+//! [2]
+ extension = QWidget()
+
+ wholeWordsCheckBox = QCheckBox(self.tr("&Whole words"))
+ backwardCheckBox = QCheckBox(self.tr("Search &backward"))
+ searchSelectionCheckBox = QCheckBox(self.tr("Search se&lection"))
+//! [2]
+
+//! [3]
+ moreButton.toggled[bool].connect(extension.setVisible)
+
+ extensionLayout = QVBoxLayout()
+ extensionLayout.setMargin(0)
+ extensionLayout.addWidget(wholeWordsCheckBox)
+ extensionLayout.addWidget(backwardCheckBox)
+ extensionLayout.addWidget(searchSelectionCheckBox)
+ extension.setLayout(extensionLayout)
+//! [3]
+
+//! [4]
+ topLeftLayout = QHBoxLayout()
+ topLeftLayout.addWidget(label)
+ topLeftLayout.addWidget(lineEdit)
+
+ leftLayout = QVBoxLayout()
+ leftLayout.addLayout(topLeftLayout)
+ leftLayout.addWidget(caseCheckBox)
+ leftLayout.addWidget(fromStartCheckBox)
+ leftLayout.addSself.tretch(1)
+
+ mainLayout = QGridLayout()
+ mainLayout.setSizeConsself.traint(QLayout.SetFixedSize)
+ mainLayout.addLayout(leftLayout, 0, 0)
+ mainLayout.addWidget(buttonBox, 0, 1)
+ mainLayout.addWidget(extension, 1, 0, 1, 2)
+ setLayout(mainLayout)
+
+ setWindowTitle(self.tr("Extension"))
+//! [4] //! [5]
+ extension.hide()
+//! [5]
diff --git a/sources/pyside6/doc/codesnippets/examples/dialogs/licensewizard/images/logo.png b/sources/pyside6/doc/codesnippets/examples/dialogs/licensewizard/images/logo.png
new file mode 100644
index 000000000..56f17a3e5
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/dialogs/licensewizard/images/logo.png
Binary files differ
diff --git a/sources/pyside6/doc/codesnippets/examples/dialogs/licensewizard/images/watermark.png b/sources/pyside6/doc/codesnippets/examples/dialogs/licensewizard/images/watermark.png
new file mode 100644
index 000000000..124a05068
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/dialogs/licensewizard/images/watermark.png
Binary files differ
diff --git a/sources/pyside6/doc/codesnippets/examples/dialogs/licensewizard/licensewizard.h b/sources/pyside6/doc/codesnippets/examples/dialogs/licensewizard/licensewizard.h
new file mode 100644
index 000000000..f0be5fa60
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/dialogs/licensewizard/licensewizard.h
@@ -0,0 +1,173 @@
+/****************************************************************************
+**
+** 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 LICENSEWIZARD_H
+#define LICENSEWIZARD_H
+
+#include <QWizard>
+
+QT_BEGIN_NAMESPACE
+class QCheckBox;
+class QLabel;
+class QLineEdit;
+class QRadioButton;
+QT_END_NAMESPACE
+
+//! [0] //! [1]
+class LicenseWizard (QWizard):
+//! [0]
+//! [2]
+ Page_Intro = 1
+ Page_Evaluate = 2
+ Page_Register = 3
+ Page_Details = 4
+ Page_Conclusion = 5
+//! [2]
+
+ def __init__(self, parent):
+ ...
+
+ def showHelp(self):
+ ...
+//! [3]
+
+//! [1] //! [3]
+
+//! [4]
+class IntroPage : public QWizardPage
+{
+ Q_OBJECT
+
+public:
+ IntroPage(QWidget *parent = 0);
+
+ int nextId() const;
+
+private:
+ QLabel *topLabel;
+ QRadioButton *registerRadioButton;
+ QRadioButton *evaluateRadioButton;
+};
+//! [4]
+
+//! [5]
+class EvaluatePage : public QWizardPage
+{
+ Q_OBJECT
+
+public:
+ EvaluatePage(QWidget *parent = 0);
+
+ int nextId() const;
+
+private:
+ QLabel *nameLabel;
+ QLabel *emailLabel;
+ QLineEdit *nameLineEdit;
+ QLineEdit *emailLineEdit;
+};
+//! [5]
+
+class RegisterPage : public QWizardPage
+{
+ Q_OBJECT
+
+public:
+ RegisterPage(QWidget *parent = 0);
+
+ int nextId() const;
+
+private:
+ QLabel *nameLabel;
+ QLabel *upgradeKeyLabel;
+ QLineEdit *nameLineEdit;
+ QLineEdit *upgradeKeyLineEdit;
+};
+
+class DetailsPage : public QWizardPage
+{
+ Q_OBJECT
+
+public:
+ DetailsPage(QWidget *parent = 0);
+
+ int nextId() const;
+
+private:
+ QLabel *companyLabel;
+ QLabel *emailLabel;
+ QLabel *postalLabel;
+ QLineEdit *companyLineEdit;
+ QLineEdit *emailLineEdit;
+ QLineEdit *postalLineEdit;
+};
+
+//! [6]
+class ConclusionPage : public QWizardPage
+{
+ Q_OBJECT
+
+public:
+ ConclusionPage(QWidget *parent = 0);
+
+ void initializePage();
+ int nextId() const;
+ void setVisible(bool visible);
+
+private slots:
+ void printButtonClicked();
+
+private:
+ QLabel *bottomLabel;
+ QCheckBox *agreeCheckBox;
+};
+//! [6]
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/examples/dialogs/licensewizard/licensewizard.qrc b/sources/pyside6/doc/codesnippets/examples/dialogs/licensewizard/licensewizard.qrc
new file mode 100644
index 000000000..b06993851
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/dialogs/licensewizard/licensewizard.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>images/logo.png</file>
+ <file>images/watermark.png</file>
+</qresource>
+</RCC>
diff --git a/sources/pyside6/doc/codesnippets/examples/dialogs/standarddialogs/dialog.cpp b/sources/pyside6/doc/codesnippets/examples/dialogs/standarddialogs/dialog.cpp
new file mode 100644
index 000000000..db11e22f8
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/dialogs/standarddialogs/dialog.cpp
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+ i, ok = QInputDialog().getInteger(self, "QInputDialog().getInteger()",
+ "Percentage:", 25, 0, 100, 1)
+ if ok:
+ self.integerLabel.setText("{}%".format(i))
+//! [0]
+
+//! [1]
+ d, ok = QInputDialog().getDouble(self, "QInputDialog().getDouble()",
+ "Amount:", 37.56, -10000, 10000, 2)
+ if ok:
+ doubleLabel.setText("${}".format())
+//! [1]
+
+//! [2]
+ items = ["Spring", "Summer", "Fall", "Winter"]
+
+ item, ok = QInputDialog().getItem(self, "QInputDialog().getItem()",
+ "Season:", items, 0, False)
+ if ok and not item.isEmpty():
+ itemLabel.setText(item)
+//! [2]
+
+//! [3]
+ text, ok = QInputDialog().getText(self, "QInputDialog().getText()",
+ "User name:", QLineEdit.Normal,
+ QDir().home().dirName())
+ if ok and text:
+ textLabel.setText(text)
+//! [3]
diff --git a/sources/pyside6/doc/codesnippets/examples/dialogs/tabdialog/tabdialog.cpp b/sources/pyside6/doc/codesnippets/examples/dialogs/tabdialog/tabdialog.cpp
new file mode 100644
index 000000000..4fff4d631
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/dialogs/tabdialog/tabdialog.cpp
@@ -0,0 +1,193 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+class TabDialog (QDialog):
+ def __init__(self, fileName, parent = None):
+ QDialog.__init__(self, parent)
+ fileInfo = QFileInfo(fileName)
+
+ self.tabWidget = QTabWidget()
+ self.tabWidget.addTab(GeneralTab(fileInfo), "General")
+ self.tabWidget.addTab(PermissionsTab(fileInfo), "Permissions")
+ self.tabWidget.addTab(ApplicationsTab(fileInfo), "Applications")
+//! [0]
+
+//! [1] //! [2]
+ self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok
+//! [1] //! [3]
+ | QDialogButtonBox.Cancel)
+
+ self.buttonBox.accepted.connect(self.accept)
+ self.buttonBox.rejected.connect(self.reject)
+//! [2] //! [3]
+
+//! [4]
+ mainLayout = QVBoxLayout()
+ mainLayout.addWidget(tabWidget)
+ mainLayout.addWidget(buttonBox)
+ self.setLayout(mainLayout)
+//! [4]
+
+//! [5]
+ self.setWindowTitle("Tab Dialog")
+//! [5]
+
+//! [6]
+class GeneralTab (QWidget):
+ def __init__(self, fileInfo, parent = None):
+ QWidget.__init__(self, parent)
+ fileNameLabel = QLabel("File Name:")
+ fileNameEdit = QLineEdit(fileInfo.fileName())
+
+ pathLabel = QLabel("Path:")
+ pathValueLabel = QLabel(fileInfo.absoluteFilePath())
+ pathValueLabel.setFrameStyle(QFrame.Panel | QFrame.Sunken)
+
+ sizeLabel = QLabel("Size:")
+ size = fileInfo.size()/1024
+ sizeValueLabel = QLabel("%d K" % size)
+ sizeValueLabel.setFrameStyle(QFrame.Panel | QFrame.Sunken)
+
+ lastReadLabel = QLabel("Last Read:")
+ lastReadValueLabel = QLabel(fileInfo.lastRead().toString())
+ lastReadValueLabel.setFrameStyle(QFrame.Panel | QFrame.Sunken)
+
+ lastModLabel = QLabel("Last Modified:")
+ lastModValueLabel = QLabel(fileInfo.lastModified().toString())
+ lastModValueLabel.setFrameStyle(QFrame.Panel | QFrame.Sunken)
+
+ mainLayout = QVBoxLayout()
+ mainLayout.addWidget(fileNameLabel)
+ mainLayout.addWidget(fileNameEdit)
+ mainLayout.addWidget(pathLabel)
+ mainLayout.addWidget(pathValueLabel)
+ mainLayout.addWidget(sizeLabel)
+ mainLayout.addWidget(sizeValueLabel)
+ mainLayout.addWidget(lastReadLabel)
+ mainLayout.addWidget(lastReadValueLabel)
+ mainLayout.addWidget(lastModLabel)
+ mainLayout.addWidget(lastModValueLabel)
+ mainLayout.addStretch(1)
+ self.setLayout(mainLayout)
+//! [6]
+
+//! [7]
+class PermissionsTab (QWidget):
+ def __init__(self, fileInfo, parent = None):
+ QWidget.__init__(self, parent)
+ permissionsGroup = QGroupBox("Permissions")
+
+ readable = QCheckBox("Readable")
+ if fileInfo.isReadable():
+ readable.setChecked(True)
+
+ writable = QCheckBox("Writable")
+ if fileInfo.isWritable():
+ writable.setChecked(True)
+
+ executable = QCheckBox("Executable")
+ if fileInfo.isExecutable():
+ executable.setChecked(True)
+
+ ownerGroup = QGroupBox("Ownership")
+
+ ownerLabel = QLabel("Owner")
+ ownerValueLabel = QLabel(fileInfo.owner())
+ ownerValueLabel.setFrameStyle(QFrame.Panel | QFrame.Sunken)
+
+ groupLabel = QLabel("Group")
+ groupValueLabel = QLabel(fileInfo.group())
+ groupValueLabel.setFrameStyle(QFrame.Panel | QFrame.Sunken)
+
+ permissionsLayout = QVBoxLayout()
+ permissionsLayout.addWidget(readable)
+ permissionsLayout.addWidget(writable)
+ permissionsLayout.addWidget(executable)
+ permissionsGroup.setLayout(permissionsLayout)
+
+ ownerLayout = QVBoxLayout()
+ ownerLayout.addWidget(ownerLabel)
+ ownerLayout.addWidget(ownerValueLabel)
+ ownerLayout.addWidget(groupLabel)
+ ownerLayout.addWidget(groupValueLabel)
+ ownerGroup.setLayout(ownerLayout)
+
+ mainLayout = QVBoxLayout()
+ mainLayout.addWidget(permissionsGroup)
+ mainLayout.addWidget(ownerGroup)
+ mainLayout.addStretch(1)
+ self.setLayout(mainLayout)
+//! [7]
+
+//! [8]
+class ApplicationsTab (QWidget):
+ def __init__(self, fileInfo, parent = None):
+ QWidget.__init__(self, parent)
+ topLabel = QLabel("Open with:")
+
+ applicationsListBox = QListWidget()
+ applications = []
+
+ for i in range(30):
+ applications.append("Application %d" %s i)
+ applicationsListBox.insertItems(0, applications)
+
+ if fileInfo.suffix().isEmpty():
+ alwaysCheckBox = QCheckBox("Always use this application to open this type of file")
+ else:
+ alwaysCheckBox = QCheckBox("Always use this application to open files with the extension '%s'" % fileInfo.suffix())
+
+ layout = QVBoxLayout()
+ layout.addWidget(topLabel)
+ layout.addWidget(applicationsListBox)
+ layout.addWidget(alwaysCheckBox)
+ self.setLayout(layout)
+//! [8]
diff --git a/sources/pyside6/doc/codesnippets/examples/graphicsview/simpleanchorlayout/main.cpp b/sources/pyside6/doc/codesnippets/examples/graphicsview/simpleanchorlayout/main.cpp
new file mode 100644
index 000000000..818d865e3
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/graphicsview/simpleanchorlayout/main.cpp
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [adding a corner anchor in two steps]
+layout.addAnchor(a, Qt.AnchorTop, layout, Qt.AnchorTop)
+layout.addAnchor(a, Qt.AnchorLeft, layout, Qt.AnchorLeft)
+//! [adding a corner anchor in two steps]
+
+//! [adding a corner anchor]
+layout.addCornerAnchors(a, Qt.TopLeftCorner, layout, Qt.TopLeftCorner)
+//! [adding a corner anchor]
+
+//! [adding anchors]
+layout.addAnchor(b, Qt.AnchorLeft, a, Qt.AnchorRight)
+layout.addAnchor(b, Qt.AnchorTop, a, Qt.AnchorBottom)
+//! [adding anchors]
+
+//! [adding anchors to match sizes in two steps]
+layout.addAnchor(b, Qt.AnchorLeft, c, Qt.AnchorLeft)
+layout.addAnchor(b, Qt.AnchorRight, c, Qt.AnchorRight)
+//! [adding anchors to match sizes in two steps]
+
+//! [adding anchors to match sizes]
+layout.addAnchors(b, c, Qt.Horizontal)
+//! [adding anchors to match sizes]
diff --git a/sources/pyside6/doc/codesnippets/examples/imageprovider/imageprovider-example.qml b/sources/pyside6/doc/codesnippets/examples/imageprovider/imageprovider-example.qml
new file mode 100644
index 000000000..58f2599dc
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/imageprovider/imageprovider-example.qml
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import "ImageProviderCore" // import the plugin that registers the color image provider
+
+//![0]
+Column {
+ Image { source: "image://colors/yellow" }
+ Image { source: "image://colors/red" }
+}
+//![0]
diff --git a/sources/pyside6/doc/codesnippets/examples/imageprovider/imageprovider.cpp b/sources/pyside6/doc/codesnippets/examples/imageprovider/imageprovider.cpp
new file mode 100644
index 000000000..b3890114b
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/imageprovider/imageprovider.cpp
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//![0]
+class ColorImageProvider (QQuickImageProvider):
+ def __init__(self):
+ QQuickImageProvider.__init__(self, QQuickImageProvider.Pixmap)
+
+ def requestPixmap(id, size, requestedSize):
+ width = 100
+ height = 50
+
+ if size:
+ size.setWidth(width)
+ size.setHeight(height)
+
+ if requestedSize.width() > 0:
+ width = requestedSize.width()
+ if requestedSize.height() > 0:
+ height = requestedSize.height()
+
+ pixmap = QPixmap(width, height)
+ pixmap.fill(QColor(id).rgba())
+//![0]
+ # write the color name
+ painter = QPainter(pixmap)
+ f = painter.font()
+ f.setPixelSize(20)
+ painter.setFont(f)
+ painter.setPen(Qt.black)
+ if requestedSize.isValid():
+ painter.scale(requestedSize.width() / width, requestedSize.height() / height)
+ painter.drawText(QRectF(0, 0, width, height), Qt.AlignCenter, id)
+//![1]
+ return pixmap
+//![1]
diff --git a/sources/pyside6/doc/codesnippets/examples/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp b/sources/pyside6/doc/codesnippets/examples/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp
new file mode 100644
index 000000000..f99b7e18e
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp
@@ -0,0 +1,109 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+//! [0]
+def __init__(self, parent):
+ QSortFilterProxyModel.__init__(self, parent)
+//! [0]
+
+//! [1]
+def setFilterMinimumDate(self, date):
+ self.minDate = date
+ self.invalidateFilter()
+
+//! [1]
+
+//! [2]
+def setFilterMaximumDate(self, date):
+ self.maxDate = date
+ self.invalidateFilter()
+
+//! [2]
+
+//! [3]
+def filterAcceptsRow(self, sourceRow, sourceParent):
+ index0 = sourceModel().index(sourceRow, 0, sourceParent)
+ index1 = sourceModel().index(sourceRow, 1, sourceParent)
+ index2 = sourceModel().index(sourceRow, 2, sourceParent)
+
+ regex = filterRegExp()
+ return (regex.indexIn(sourceModel().data(index0)) != -1
+ or regex.indexIn(sourceModel().data(index1)) != -1
+ and dateInRange(sourceModel().data(index2))
+//! [3]
+
+//! [4] //! [5]
+def lessThan(self, left, right):
+ leftData = sourceModel().data(left)
+ rightData = sourceModel().data(right)
+//! [4]
+
+//! [6]
+ if isinstance(leftData, QDateTime):
+ return leftData < rightData
+ else:
+ emailPattern = QRegExp("([\\w\\.]*@[\\w\\.]*)")
+
+ if left.column() == 1 && emailPattern.indexIn(leftData) != -1:
+ leftData = emailPattern.cap(1)
+
+ if right.column() == 1 && emailPattern.indexIn(rightData) != -1:
+ rightData = emailPattern.cap(1)
+
+ return leftString < rightString
+
+//! [5] //! [6]
+
+//! [7]
+def dateInRange(self, date):
+ return (!minDate.isValid() || date > minDate)
+ && (!maxDate.isValid() || date < maxDate)
+
+//! [7]
diff --git a/sources/pyside6/doc/codesnippets/examples/itemviews/pixelator/pixeldelegate.cpp b/sources/pyside6/doc/codesnippets/examples/itemviews/pixelator/pixeldelegate.cpp
new file mode 100644
index 000000000..7c207d19c
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/itemviews/pixelator/pixeldelegate.cpp
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+def __init__(self, parent):
+ QAbstractItemDelegate.__init__(self, parent)
+ self.pixelSize = 12
+//! [0]
+
+//! [1]
+def paint(self, painter, option, index):
+//! [2]
+ if option.state and QStyle.State_Selected:
+ painter.fillRect(option.rect, option.palette.highlight())
+//! [1]
+
+//! [3]
+ size = qMin(option.rect.width(), option.rect.height())
+//! [3] //! [4]
+ brightness = index.model().data(index, Qt.DisplayRole).toInt()
+ radius = (size/2.0) - (brightness/255.0 * size/2.0)
+ if radius == 0.0:
+ return
+//! [4]
+
+//! [5]
+ painter.save()
+//! [5] //! [6]
+ painter.setRenderHint(QPainter.Antialiasing, true)
+//! [6] //! [7]
+ painter.setPen(Qt.NoPen)
+//! [7] //! [8]
+ if option.state and QStyle.State_Selected:
+//! [8] //! [9]
+ painter.setBrush(option.palette.highlightedText())
+ else
+//! [2]
+ painter.setBrush(QBrush(Qt.black))
+//! [9]
+
+//! [10]
+ painter.drawEllipse(QRectF(option.rect.x() + option.rect.width()/2 - radius,
+ option.rect.y() + option.rect.height()/2 - radius,
+ 2*radius, 2*radius))
+ painter.restore()
+//! [10]
+
+//! [11]
+def sizeHint(self, option, index):
+ return QSize(self.pixelSize, self.pixelSize)
+//! [11]
+
+//! [12]
+def setPixelSize(self, size):
+ self.pixelSize = size
+//! [12]
diff --git a/sources/pyside6/doc/codesnippets/examples/mainwindows/application/mainwindow.h b/sources/pyside6/doc/codesnippets/examples/mainwindows/application/mainwindow.h
new file mode 100644
index 000000000..ce3eafb89
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/mainwindows/application/mainwindow.h
@@ -0,0 +1,113 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+from PySide6.QtGui import QAction
+from PySide6.QtWidgets import (QApplication, QMainWindow, QMenu,
+ QPlainTextEdit, QSessionManager)
+
+
+//! [0]
+class MainWindow(QMainWindow):
+ def __init__(self, parent=None):
+ self.textEdit = QPlainTextEdit()
+ self.curFile = ""
+ # ...
+
+ def loadFile(self, fileName):
+ pass
+
+ def closeEvent(self, event):
+ pass
+
+ def newFile(self):
+ pass
+
+ def open(self):
+ pass
+
+ def save(self):
+ pass
+
+ def saveAs(self):
+ pass
+
+ def about(self):
+ pass
+
+ def documentWasModified(self):
+ pass
+ # Enable this only if QT_NO_SESSIONMANAGER is not defined
+ # def commitData(self):
+ # pass
+
+ def createActions(self):
+ pass
+
+ def createStatusBar(self):
+ pass
+
+ def readSettings(self):
+ pass
+
+ def writeSettings(self):
+ pass
+
+ def maybeSave(self):
+ pass
+
+ def saveFile(self, fileName):
+ pass
+
+ def setCurrentFile(self, fileName):
+ pass
+
+ def strippedName(self, fullFileName):
+ pass
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/examples/mainwindows/application/mainwindow.py b/sources/pyside6/doc/codesnippets/examples/mainwindows/application/mainwindow.py
new file mode 100644
index 000000000..f9a93cfc8
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/mainwindows/application/mainwindow.py
@@ -0,0 +1,357 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+//! [0]
+from PySide6.QtCore import Qt, QFile, QFileInfo, QSettings, QTextStream
+from PySide6.QtGui import QIcon
+from PySide6.Widgets import (QAction, QApplication, QFileDialog, QMainWindow,
+ QPlainTextEdit, QFileDialog, QMessageBox, )
+//! [0]
+
+//! [1]
+def __init__(self, parent=None):
+ QMainWindow.__init__(self)
+//! [1] //! [2]
+ self.textEdit = QPlainTextEdit()
+ self.setCentralWidget(textEdit)
+
+ self.createActions()
+ self.createMenus()
+ self.createToolBars()
+ self.createStatusBar()
+
+ self.readSettings()
+
+ self.textEdit.document().contentsChanged.connect(self.documentWasModified)
+
+ self.setCurrentFile("")
+ self.setUnifiedTitleAndToolBarOnMac(True)
+
+//! [2]
+
+//! [3]
+def closeEvent(self, event):
+//! [3] //! [4]
+ if maybeSave():
+ writeSettings()
+ event.accept()
+ else:
+ event.ignore()
+//! [4]
+
+//! [5]
+def File(self):
+//! [5] //! [6]
+ if maybeSave():
+ textEdit.clear()
+ setCurrentFile("")
+//! [6]
+
+//! [7]
+def open(self):
+//! [7] //! [8]
+ if maybeSave():
+ fileName = QFileDialog.getOpenFileName(self)
+ if not fileName.isEmpty():
+ loadFile(fileName)
+//! [8]
+
+//! [9]
+def save(self):
+//! [9] //! [10]
+ if curFile.isEmpty():
+ return saveAs()
+ else:
+ return saveFile(curFile)
+//! [10]
+
+//! [11]
+def saveAs(self):
+//! [11] //! [12]
+ fileName = QFileDialog.getSaveFileName(self)
+ if fileName.isEmpty():
+ return False
+
+ return saveFile(fileName)
+//! [12]
+
+//! [13]
+def about(self):
+//! [13] //! [14]
+ QMessageBox.about(self, tr("About Application"),
+ tr("The <b>Application</b> example demonstrates how to "
+ "write modern GUI applications using Qt, with a menu bar, "
+ "toolbars, and a status bar."))
+
+//! [14]
+
+//! [15]
+def documentWasModified(self):
+//! [15] //! [16]
+ setWindowModified(textEdit.document().isModified())
+//! [16]
+
+//! [17]
+def MainWindow.createActions(self):
+//! [17] //! [18]
+ Act = QAction(QIcon(":/images/new.png"), tr("&New"), self)
+ Act.setShortcuts(QKeySequence.New)
+ Act.setStatusTip(tr("Create a new file"))
+ Act.triggered.connect(newFile)
+
+//! [19]
+ openAct = QAction(QIcon(":/images/open.png"), tr("&Open..."), self)
+ openAct.setShortcuts(QKeySequence.Open)
+ openAct.setStatusTip(tr("Open an existing file"))
+ openAct.triggered.connect(open)
+//! [18] //! [19]
+
+ saveAct = QAction(QIcon(":/images/save.png"), tr("&Save"), self)
+ saveAct.setShortcuts(QKeySequence.Save)
+ saveAct.setStatusTip(tr("Save the document to disk"))
+ saveAct.triggered.connect(save)
+
+ saveAsAct = QAction(tr("Save &As..."), self)
+ saveAsAct.setShortcuts(QKeySequence.SaveAs)
+ saveAsAct.setStatusTip(tr("Save the document under a name"))
+ saveAsAct.triggered.connect(saveAs)
+
+//! [20]
+ exitAct = QAction(tr("E&xit"), self)
+ exitAct.setShortcut(tr("Ctrl+Q"))
+//! [20]
+ exitAct.setStatusTip(tr("Exit the application"))
+ exitAct.triggered.connect(close)
+
+//! [21]
+ cutAct = QAction(QIcon(":/images/cut.png"), tr("Cu&t"), self)
+//! [21]
+ cutAct.setShortcuts(QKeySequence.Cut)
+ cutAct.setStatusTip(tr("Cut the current selection's contents to the "
+ "clipboard"))
+ cutAct.triggered.connect(cut)
+
+ copyAct = QAction(QIcon(":/images/copy.png"), tr("&Copy"), self)
+ copyAct.setShortcuts(QKeySequence.Copy)
+ copyAct.setStatusTip(tr("Copy the current selection's contents to the "
+ "clipboard"))
+ copyAct.triggered.connect(copy)
+
+ pasteAct = QAction(QIcon(":/images/paste.png"), tr("&Paste"), self)
+ pasteAct.setShortcuts(QKeySequence.Paste)
+ pasteAct.setStatusTip(tr("Paste the clipboard's contents into the current "
+ "selection"))
+ pasteAct.triggered.connect(textEdit.paste)
+
+ aboutAct = QAction(tr("&About"), self)
+ aboutAct.setStatusTip(tr("Show the application's About box"))
+ aboutAct.triggered.connect(about)
+
+//! [22]
+ aboutQtAct = QAction(tr("About &Qt"), self)
+ aboutQtAct.setStatusTip(tr("Show the Qt library's About box"))
+ aboutQtAct.triggered.connect(qApp.aboutQt)
+//! [22]
+
+//! [23]
+ cutAct.setEnabled(False)
+//! [23] //! [24]
+ copyAct.setEnabled(False)
+ textEdit.copyAvailable[bool].connect(cutAct.setEnabled)
+ textEdit.copyAvailable[bool].connect(copyAct.setEnabled)
+}
+//! [24]
+
+//! [25] //! [26]
+def createMenus(self):
+//! [25] //! [27]
+ fileMenu = menuBar().addMenu(tr("&File"))
+ fileMenu.addAction(Act)
+//! [28]
+ fileMenu.addAction(openAct)
+//! [28]
+ fileMenu.addAction(saveAct)
+//! [26]
+ fileMenu.addAction(saveAsAct)
+ fileMenu.addSeparator()
+ fileMenu.addAction(exitAct)
+
+ editMenu = menuBar().addMenu(tr("&Edit"))
+ editMenu.addAction(cutAct)
+ editMenu.addAction(copyAct)
+ editMenu.addAction(pasteAct)
+
+ menuBar().addSeparator()
+
+ helpMenu = menuBar().addMenu(tr("&Help"))
+ helpMenu.addAction(aboutAct)
+ helpMenu.addAction(aboutQtAct)
+
+//! [27]
+
+//! [29] //! [30]
+def createToolBars(self):
+ fileToolBar = addToolBar(tr("File"))
+ fileToolBar.addAction(Act)
+//! [29] //! [31]
+ fileToolBar.addAction(openAct)
+//! [31]
+ fileToolBar.addAction(saveAct)
+
+ editToolBar = addToolBar(tr("Edit"))
+ editToolBar.addAction(cutAct)
+ editToolBar.addAction(copyAct)
+ editToolBar.addAction(pasteAct)
+//! [30]
+
+//! [32]
+def createStatusBar(self):
+//! [32] //! [33]
+ statusBar().showMessage(tr("Ready"))
+
+//! [33]
+
+//! [34] //! [35]
+def readSettings(self):
+//! [34] //! [36]
+ settings("Trolltech", "Application Example")
+ pos = settings.value("pos", QPoint(200, 200)).toPoint()
+ size = settings.value("size", QSize(400, 400)).toSize()
+ resize(size)
+ move(pos)
+
+//! [35] //! [36]
+
+//! [37] //! [38]
+def writeSettings(self):
+//! [37] //! [39]
+ settings = QSettings("Trolltech", "Application Example")
+ settings.setValue("pos", pos())
+ settings.setValue("size", size())
+
+//! [38] //! [39]
+
+//! [40]
+def maybeSave(self):
+//! [40] //! [41]
+ if textEdit.document()->isModified():
+ ret = QMessageBox.warning(self, tr("Application"),
+ tr("The document has been modified.\n"
+ "Do you want to save your changes?"),
+ QMessageBox.Save | QMessageBox.Discard | QMessageBox.Cancel)
+ if ret == QMessageBox.Save:
+ return save()
+ elif ret == QMessageBox.Cancel:
+ return False
+ return True
+//! [41]
+
+//! [42]
+def loadFile(self, fileName):
+//! [42] //! [43]
+ file = QFile(fileName)
+ if !file.open(QFile.ReadOnly | QFile.Text):
+ QMessageBox.warning(self, tr("Application"), tr("Cannot read file "
+ "{}:\n{}.".format(fileName, file.errorString())))
+ return
+
+ in = QTextStream(file)
+ QApplication.setOverrideCursor(Qt::WaitCursor)
+ textEdit.setPlainText(in.readAll())
+ QApplication.restoreOverrideCursor()
+
+ self.setCurrentFile(fileName)
+ self.statusBar().showMessage(tr("File loaded"), 2000)
+
+//! [43]
+
+//! [44]
+def saveFile(self, fileName):
+//! [44] //! [45]
+ file = QFile(fileName)
+ if !file.open(QFile.WriteOnly | QFile::Text):
+ QMessageBox.warning(self, tr("Application"),
+ tr("Cannot write file %1:\n%2.")
+ .arg(fileName)
+ .arg(file.errorString()))
+ return False
+
+ out = QTextStream(file)
+ QApplication.setOverrideCursor(Qt.WaitCursor)
+ out << textEdit.toPlainText()
+ QApplication.restoreOverrideCursor()
+
+ setCurrentFile(fileName)
+ statusBar().showMessage(tr("File saved"), 2000)
+ return True
+
+//! [45]
+
+//! [46]
+def setCurrentFile(fileName):
+//! [46] //! [47]
+ curFile = fileName
+ textEdit.document().setModified(False)
+ setWindowModified(False)
+
+ if curFile.isEmpty():
+ shownName = "untitled.txt"
+ else:
+ shownName = strippedName(curFile)
+
+ setWindowTitle(tr("%1[*] - %2").arg(shownName).arg(tr("Application")))
+
+//! [47]
+
+//! [48]
+def strippedName(self, fullFileName):
+//! [48] //! [49]
+ return QFileInfo(fullFileName).fileName()
+//! [49]
diff --git a/sources/pyside6/doc/codesnippets/examples/mainwindows/dockwidgets/mainwindow.py b/sources/pyside6/doc/codesnippets/examples/mainwindows/dockwidgets/mainwindow.py
new file mode 100644
index 000000000..b8ff9d5bc
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/mainwindows/dockwidgets/mainwindow.py
@@ -0,0 +1,253 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+//! [0]
+from PySide6.QtGui import *
+//! [0]
+
+//! [1]
+def __init__(self):
+ textEdit = QTextEdit()
+ setCentralWidget(textEdit)
+
+ createActions()
+ createMenus()
+ createToolBars()
+ createStatusBar()
+ createDockWindows()
+
+ setWindowTitle(tr("Dock Widgets"))
+
+ Letter()
+ setUnifiedTitleAndToolBarOnMac(True)
+//! [1]
+
+//! [2]
+def Letter(self)
+ textEdit.clear()
+
+ cursor = QTextCursor(textEdit.textCursor())
+ cursor.movePosition(QTextCursor.Start)
+ topFrame = cursor.currentFrame()
+ topFrameFormat = topFrame.frameFormat()
+ topFrameFormat.setPadding(16)
+ topFrame.setFrameFormat(topFrameFormat)
+
+ textFormat = QTextCharFormat()
+ boldFormat = QTextCharFormat()
+ boldFormat.setFontWeight(QFont.Bold)
+ italicFormat = QTextCharFormat()
+ italicFormat.setFontItalic(True)
+
+ tableFormat = QTextTableFormat()
+ tableFormat.setBorder(1)
+ tableFormat.setCellPadding(16)
+ tableFormat.setAlignment(Qt.AlignRight)
+ cursor.insertTable(1, 1, tableFormat)
+ cursor.insertText("The Firm", boldFormat)
+ cursor.insertBlock()
+ cursor.insertText("321 City Street", textFormat)
+ cursor.insertBlock()
+ cursor.insertText("Industry Park")
+ cursor.insertBlock()
+ cursor.insertText("Some Country")
+ cursor.setPosition(topFrame.lastPosition())
+ cursor.insertText(QDate.currentDate().toString("d MMMM yyyy"), textFormat)
+ cursor.insertBlock()
+ cursor.insertBlock()
+ cursor.insertText("Dear ", textFormat)
+ cursor.insertText("NAME", italicFormat)
+ cursor.insertText(",", textFormat)
+ for i in range(3):
+ cursor.insertBlock()
+ cursor.insertText(tr("Yours sincerely,"), textFormat)
+ for i in range(3):
+ cursor.insertBlock()
+ cursor.insertText("The Boss", textFormat)
+ cursor.insertBlock()
+ cursor.insertText("ADDRESS", italicFormat)
+//! [2]
+
+//! [3]
+def print(self)
+ document = textEdit.document()
+ printer = QPrinter()
+
+ dlg = QPrintDialog(&printer, self)
+ if dlg.exec() != QDialog.Accepted:
+ return
+
+ document.print(printer)
+ statusBar().showMessage(tr("Ready"), 2000)
+//! [3]
+
+//! [4]
+def save(self):
+ fileName = QFileDialog.getSaveFileName(self,
+ tr("Choose a file name"), ".",
+ tr("HTML (*.html *.htm)"))
+ if fileName.isEmpty():
+ return
+ file = QFile(fileName)
+ if !file.open(QFile.WriteOnly | QFile::Text):
+ QMessageBox.warning(self, tr("Dock Widgets"),
+ tr("Cannot write file %1:\n%2.")
+ .arg(fileName)
+ .arg(file.errorString()))
+ return
+
+
+ out = QTextStream(file)
+ QApplication.setOverrideCursor(Qt::WaitCursor)
+ out << textEdit.toHtml()
+ QApplication.restoreOverrideCursor()
+
+ statusBar().showMessage(tr("Saved '%1'").arg(fileName), 2000)
+
+//! [4]
+
+//! [5]
+def undo(self):
+ document = textEdit.document()
+ document.undo()
+
+//! [5]
+
+//! [6]
+def insertCustomer(self, customer):
+ if customer.isEmpty():
+ return
+
+ customerList = customer.split(", ")
+ document = textEdit.document()
+ cursor = document.find("NAME")
+ if not cursor.isNull():
+ cursor.beginEditBlock()
+ cursor.insertText(customerList.at(0))
+ oldcursor = cursor
+ cursor = document.find("ADDRESS")
+ if not cursor.isNull():
+ for i in range(customerList.size()):
+ cursor.insertBlock()
+ cursor.insertText(customerList.at(i))
+
+ cursor.endEditBlock()
+ else:
+ oldcursor.endEditBlock()
+//! [6]
+
+//! [7]
+def addParagraph(self, paragraph):
+ if (paragraph.isEmpty())
+ return
+
+ document = textEdit.document()
+ cursor = document.find(tr("Yours sincerely,"))
+ if cursor.isNull():
+ return
+ cursor.beginEditBlock()
+ cursor.movePosition(QTextCursor.PreviousBlock, QTextCursor.MoveAnchor, 2)
+ cursor.insertBlock()
+ cursor.insertText(paragraph)
+ cursor.insertBlock()
+ cursor.endEditBlock()
+
+//! [7]
+
+
+//! [8]
+def createStatusBar(self):
+ statusBar().showMessage(tr("Ready"))
+
+//! [8]
+
+//! [9]
+def createDockWindows(self):
+ dock = QDockWidget(tr("Customers"), self)
+ dock.setAllowedAreas(Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea)
+ customerList = QListWidget(dock)
+ customerList.addItems(QStringList()
+ << "John Doe, Harmony Enterprises, 12 Lakeside, Ambleton"
+ << "Jane Doe, Memorabilia, 23 Watersedge, Beaton"
+ << "Tammy Shea, Tiblanka, 38 Sea Views, Carlton"
+ << "Tim Sheen, Caraba Gifts, 48 Ocean Way, Deal"
+ << "Sol Harvey, Chicos Coffee, 53 New Springs, Eccleston"
+ << "Sally Hobart, Tiroli Tea, 67 Long River, Fedula")
+ dock.setWidget(customerList)
+ addDockWidget(Qt.RightDockWidgetArea, dock)
+ viewMenu.addAction(dock.toggleViewAction())
+
+ dock = QDockWidget(tr("Paragraphs"), self)
+ paragraphsList = QListWidget(dock)
+ paragraphsList.addItems(QStringList()
+ << "Thank you for your payment which we have received today."
+ << "Your order has been dispatched and should be with you "
+ "within 28 days."
+ << "We have dispatched those items that were in stock. The "
+ "rest of your order will be dispatched once all the "
+ "remaining items have arrived at our warehouse. No "
+ "additional shipping charges will be made."
+ << "You made a small overpayment (less than $5) which we "
+ "will keep on account for you, or return at your request."
+ << "You made a small underpayment (less than $1), but we have "
+ "sent your order anyway. We'll add self underpayment to "
+ "your next bill."
+ << "Unfortunately you did not send enough money. Please remit "
+ "an additional $. Your order will be dispatched as soon as "
+ "the complete amount has been received."
+ << "You made an overpayment (more than $5). Do you wish to "
+ "buy more items, or should we return the excess to you?")
+ dock.setWidget(paragraphsList)
+ addDockWidget(Qt.RightDockWidgetArea, dock)
+ viewMenu.addAction(dock.toggleViewAction())
+
+ customerList.currentTextChanged[str].connect(self.insertCostumer)
+ paragraphsList.currentTextChanged[str].connect(self.addParagraph)
+//! [9]
diff --git a/sources/pyside6/doc/codesnippets/examples/mainwindows/mainwindow.py b/sources/pyside6/doc/codesnippets/examples/mainwindows/mainwindow.py
new file mode 100644
index 000000000..d39604b6c
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/mainwindows/mainwindow.py
@@ -0,0 +1,366 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+from PySide6.QtGui import *
+
+//! [0]
+def __init__(self):
+ Q__init__(self)
+
+ widget = QWidget()
+ setCentralWidget(widget)
+//! [0]
+
+//! [1]
+ topFiller = QWidget()
+ topFiller.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
+
+ infoLabel = QLabel(tr("<i>Choose a menu option, or right-click to "
+ "invoke a context menu</i>"))
+ infoLabel.setFrameStyle(QFrame.StyledPanel | QFrame.Sunken)
+ infoLabel.setAlignment(Qt.AlignCenter)
+
+ bottomFiller = QWidget()
+ bottomFiller.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
+
+ layout = QVBoxLayout()
+ layout.setMargin(5)
+ layout.addWidget(topFiller)
+ layout.addWidget(infoLabel)
+ layout.addWidget(bottomFiller)
+ widget.setLayout(layout)
+//! [1]
+
+//! [2]
+ createActions()
+ createMenus()
+
+ message = tr("A context menu is available by right-clicking")
+ statusBar().showMessage(message)
+
+ setWindowTitle(tr("Menus"))
+ setMinimumSize(160, 160)
+ resize(480, 320)
+
+//! [2]
+
+//! [3]
+def contextMenuEvent(self, event):
+ menu = QMenu(self)
+ menu.addAction(cutAct)
+ menu.addAction(copyAct)
+ menu.addAction(pasteAct)
+ menu.exec_(event.globalPos()")
+
+//! [3]
+
+def File(self):
+ infoLabel.setText(tr("Invoked <b>File|New</b>"))
+
+
+def open(self):
+ infoLabel.setText(tr("Invoked <b>File|Open</b>"))
+
+
+def save(self):
+ infoLabel.setText(tr("Invoked <b>File|Save</b>"))
+
+def print_(self):
+ infoLabel.setText(tr("Invoked <b>File|Print</b>"))
+
+def undo(self):
+ infoLabel.setText(tr("Invoked <b>Edit|Undo</b>"))
+
+def redo(self):
+ infoLabel.setText(tr("Invoked <b>Edit|Redo</b>"))
+
+def cut(self):
+
+ infoLabel.setText(tr("Invoked <b>Edit|Cut</b>"))
+
+
+def copy(self):
+
+ infoLabel.setText(tr("Invoked <b>Edit|Copy</b>"))
+
+
+def paste(self):
+
+ infoLabel.setText(tr("Invoked <b>Edit|Paste</b>"))
+
+
+def bold(self):
+
+ infoLabel.setText(tr("Invoked <b>Edit|Format|Bold</b>"))
+
+
+def italic(self):
+
+ infoLabel.setText(tr("Invoked <b>Edit|Format|Italic</b>"))
+
+
+def leftAlign(self):
+
+ infoLabel.setText(tr("Invoked <b>Edit|Format|Left Align</b>"))
+
+
+def rightAlign(self):
+
+ infoLabel.setText(tr("Invoked <b>Edit|Format|Right Align</b>"))
+
+
+def justify(self):
+
+ infoLabel.setText(tr("Invoked <b>Edit|Format|Justify</b>"))
+
+
+def center(self):
+
+ infoLabel.setText(tr("Invoked <b>Edit|Format|Center</b>"))
+
+
+def setLineSpacing(self):
+
+ infoLabel.setText(tr("Invoked <b>Edit|Format|Set Line Spacing</b>"))
+
+
+def setParagraphSpacing(self):
+
+ infoLabel.setText(tr("Invoked <b>Edit|Format|Set Paragraph Spacing</b>"))
+
+
+def about(self):
+
+ infoLabel.setText(tr("Invoked <b>Help|About</b>"))
+ QMessageBox.about(self, tr("About Menu"),
+ tr("The <b>Menu</b> example shows how to create "
+ "menu-bar menus and context menus."))
+
+
+def aboutQt(self):
+
+ infoLabel.setText(tr("Invoked <b>Help|About Qt</b>"))
+
+
+//! [4]
+def createActions(self):
+
+//! [5]
+ Act = new QAction(tr("&New"), self)
+ Act.setShortcuts(QKeySequence.New)
+ Act.setStatusTip(tr("Create a new file"))
+ Act.triggered.connect(newFile)
+//! [4]
+
+ openAct = QAction(tr("&Open..."), self)
+ openAct.setShortcuts(QKeySequence.Open)
+ openAct.setStatusTip(tr("Open an existing file"))
+ openAct.triggered.connect(open)
+//! [5]
+
+ saveAct = QAction(tr("&Save"), self)
+ saveAct.setShortcuts(QKeySequence.Save)
+ saveAct.setStatusTip(tr("Save the document to disk"))
+ saveAct.triggered.connect(save)
+
+ printAct = QAction(tr("&Print..."), self)
+ printAct.setShortcuts(QKeySequence.Print)
+ printAct.setStatusTip(tr("Print the document"))
+ printAct.triggered.connect(print_)
+
+ exitAct = QAction(tr("E&xit"), self)
+ exitAct.setShortcut(tr("Ctrl+Q"))
+ exitAct.setStatusTip(tr("Exit the application"))
+ exitAct.triggered.connect(close)
+
+ undoAct = QAction(tr("&Undo"), self)
+ undoAct.setShortcuts(QKeySequence.Undo)
+ undoAct.setStatusTip(tr("Undo the last operation"))
+ undoAct.triggered.connect(undo)
+
+ redoAct = QAction(tr("&Redo"), self)
+ redoAct.setShortcuts(QKeySequence.Redo)
+ redoAct.setStatusTip(tr("Redo the last operation"))
+ redoAct.triggered.connect(redo)
+
+ cutAct = QAction(tr("Cu&t"), self)
+ cutAct.setShortcuts(QKeySequence.Cut)
+ cutAct.setStatusTip(tr("Cut the current selection's contents to the "
+ "clipboard"))
+ cutAct.triggered.connect(cut)
+
+ copyAct = QAction(tr("&Copy"), self)
+ copyAct.setShortcut(tr("Ctrl+C"))
+ copyAct.setStatusTip(tr("Copy the current selection's contents to the "
+ "clipboard"))
+ copyAct.triggered.connect(copy)
+
+ pasteAct = QAction(tr("&Paste"), self)
+ pasteAct.setShortcuts(QKeySequence.Paste)
+ pasteAct.setStatusTip(tr("Paste the clipboard's contents into the current "
+ "selection"))
+ pasteAct.triggered.connect(paste)
+
+ boldAct = QAction(tr("&Bold"), self)
+ boldAct.setCheckable(True)
+ boldAct.setShortcut(tr("Ctrl+B"))
+ boldAct.setStatusTip(tr("Make the text bold"))
+ boldAct.triggered.connect(bold)
+
+ QFont boldFont = boldAct.font()
+ boldFont.setBold(True)
+ boldAct.setFont(boldFont)
+
+ italicAct = QAction(tr("&Italic"), self)
+ italicAct.setCheckable(True)
+ italicAct.setShortcut(tr("Ctrl+I"))
+ italicAct.setStatusTip(tr("Make the text italic"))
+ italicAct.triggered.connect(italic)
+
+ QFont italicFont = italicAct.font()
+ italicFont.setItalic(True)
+ italicAct.setFont(italicFont)
+
+ setLineSpacingAct = QAction(tr("Set &Line Spacing..."), self)
+ setLineSpacingAct.setStatusTip(tr("Change the gap between the lines of a "
+ "paragraph"))
+ setLineSpacingAct.triggered.connect(setLineSpacing)
+
+ setParagraphSpacingAct = QAction(tr("Set &Paragraph Spacing..."), self)
+ setLineSpacingAct.setStatusTip(tr("Change the gap between paragraphs"))
+ setParagraphSpacingAct.triggered.connect(setParagraphSpacing)
+
+ aboutAct = QAction(tr("&About"), self)
+ aboutAct.setStatusTip(tr("Show the application's About box"))
+ aboutAct.triggered.connect(about)
+
+ aboutQtAct = QAction(tr("About &Qt"), self)
+ aboutQtAct.setStatusTip(tr("Show the Qt library's About box"))
+ aboutQtAct.triggered.connect(qApp.aboutQt)
+ aboutQtAct.triggered.connect(aboutQt)
+
+ leftAlignAct = QAction(tr("&Left Align"), self)
+ leftAlignAct.setCheckable(True)
+ leftAlignAct.setShortcut(tr("Ctrl+L"))
+ leftAlignAct.setStatusTip(tr("Left align the selected text"))
+ leftAlignAct.triggered.connect(leftAlign)
+
+ rightAlignAct = QAction(tr("&Right Align"), self)
+ rightAlignAct.setCheckable(True)
+ rightAlignAct.setShortcut(tr("Ctrl+R"))
+ rightAlignAct.setStatusTip(tr("Right align the selected text"))
+ rightAlignAct.triggered.connect.(rightAlign)
+
+ justifyAct = QAction(tr("&Justify"), self)
+ justifyAct.setCheckable(True)
+ justifyAct.setShortcut(tr("Ctrl+J"))
+ justifyAct.setStatusTip(tr("Justify the selected text"))
+ justifyAct.triggered.connect(justify)
+
+ centerAct = QAction(tr("&Center"), self)
+ centerAct.setCheckable(True)
+ centerAct.setShortcut(tr("Ctrl+E"))
+ centerAct.setStatusTip(tr("Center the selected text"))
+ centerAct.triggered.connect(center)
+
+//! [6] //! [7]
+ alignmentGroup = QActionGroup(self)
+ alignmentGroup.addAction(leftAlignAct)
+ alignmentGroup.addAction(rightAlignAct)
+ alignmentGroup.addAction(justifyAct)
+ alignmentGroup.addAction(centerAct)
+ leftAlignAct.setChecked(True)
+//! [6]
+
+//! [7]
+
+//! [8]
+def createMenus(self):
+
+//! [9] //! [10]
+ fileMenu = menuBar().addMenu(tr("&File"))
+ fileMenu.addAction(Act)
+//! [9]
+ fileMenu.addAction(openAct)
+//! [10]
+ fileMenu.addAction(saveAct)
+ fileMenu.addAction(printAct)
+//! [11]
+ fileMenu.addSeparator()
+//! [11]
+ fileMenu.addAction(exitAct)
+
+ editMenu = menuBar().addMenu(tr("&Edit"))
+ editMenu.addAction(undoAct)
+ editMenu.addAction(redoAct)
+ editMenu.addSeparator()
+ editMenu.addAction(cutAct)
+ editMenu.addAction(copyAct)
+ editMenu.addAction(pasteAct)
+ editMenu.addSeparator()
+
+ helpMenu = menuBar().addMenu(tr("&Help"))
+ helpMenu.addAction(aboutAct)
+ helpMenu.addAction(aboutQtAct)
+//! [8]
+
+//! [12]
+ formatMenu = editMenu.addMenu(tr("&Format"))
+ formatMenu.addAction(boldAct)
+ formatMenu.addAction(italicAct)
+ formatMenu.addSeparator()->setText(tr("Alignment"))
+ formatMenu.addAction(leftAlignAct)
+ formatMenu.addAction(rightAlignAct)
+ formatMenu.addAction(justifyAct)
+ formatMenu.addAction(centerAct)
+ formatMenu.addSeparator()
+ formatMenu.addAction(setLineSpacingAct)
+ formatMenu.addAction(setParagraphSpacingAct)
+//! [12]
diff --git a/sources/pyside6/doc/codesnippets/examples/mainwindows/mdi/mainwindow.py b/sources/pyside6/doc/codesnippets/examples/mainwindows/mdi/mainwindow.py
new file mode 100644
index 000000000..9d0572d9a
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/mainwindows/mdi/mainwindow.py
@@ -0,0 +1,360 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+from PySide6.QtGui import *
+
+class QMdiSubWindow(QMainWindow):
+ def __init__(self, parent=None):
+ QMainWindow.__init__(self, parent)
+
+ mdiArea = QMdiArea()
+ mdiArea.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded)
+ mdiArea.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
+ setCentralWidget(mdiArea)
+ mdiArea.subWindowActivated[QMdiSubWindow].connect(updateMenus)
+ windowMapper = QSignalMapper(self)
+ windowMapper.mapped[QWidget].connect(setActiveSubWindow)
+
+ self.createActions()
+ self.createMenus()
+ self.createToolBars()
+ self.createStatusBar()
+ self.updateMenus()
+ self.readSettings()
+ self.setWindowTitle(tr("MDI"))
+ self.setUnifiedTitleAndToolBarOnMac(True)
+
+
+ def closeEvent(self, event):
+ mdiArea.closeAllSubWindows()
+ if self.activeMdiChild():
+ event.ignore()
+ else:
+ self.writeSettings()
+ event.accept()
+
+ def File(self):
+ child = self.createMdiChild()
+ child.File()
+ child.show()
+
+
+ def open(self):
+ fileName = QFileDialog.getOpenFileName(self)
+ if not fileName.isEmpty():
+ existing = self.findMdiChild(fileName)
+ if existing:
+ mdiArea.setActiveSubWindow(existing)
+ return
+
+ child = createMdiChild()
+ if child.loadFile(fileName):
+ statusBar().showMessage(tr("File loaded"), 2000)
+ child.show()
+ else:
+ child.close()
+
+ def save(self):
+ if self.activeMdiChild() and self.activeMdiChild().save():
+ self.statusBar().showMessage(tr("File saved"), 2000)
+
+ def saveAs(self):
+ if self.activeMdiChild() and self.activeMdiChild().saveAs():
+ self.statusBar().showMessage(tr("File saved"), 2000)
+
+ def cut(self):
+ if self.activeMdiChild():
+ self.activeMdiChild().cut()
+
+ def copy(self):
+ if self.activeMdiChild():
+ activeMdiChild().copy()
+
+ def paste(self):
+ if self.activeMdiChild():
+ activeMdiChild().paste()
+
+ def about(self):
+ QMessageBox.about(self, tr("About MDI"),
+ tr("The <b>MDI</b> example demonstrates how to write multiple "
+ "document interface applications using Qt."))
+
+ def updateMenus(self):
+ hasMdiChild = (activeMdiChild() != 0)
+ self.saveAct.setEnabled(hasMdiChild)
+ self.saveAsAct.setEnabled(hasMdiChild)
+ self.pasteAct.setEnabled(hasMdiChild)
+ self.closeAct.setEnabled(hasMdiChild)
+ self.closeAllAct.setEnabled(hasMdiChild)
+ self.tileAct.setEnabled(hasMdiChild)
+ self.cascadeAct.setEnabled(hasMdiChild)
+ self.nextAct.setEnabled(hasMdiChild)
+ self.previousAct.setEnabled(hasMdiChild)
+ self.separatorAct.setVisible(hasMdiChild)
+
+ hasSelection = (self.activeMdiChild() and
+ self.activeMdiChild().textCursor().hasSelection())
+ self.cutAct.setEnabled(hasSelection)
+ self.copyAct.setEnabled(hasSelection)
+
+ def updateWindowMenu(self):
+ self.windowMenu.clear()
+ self.windowMenu.addAction(closeAct)
+ self.windowMenu.addAction(closeAllAct)
+ self.windowMenu.addSeparator()
+ self.windowMenu.addAction(tileAct)
+ self.windowMenu.addAction(cascadeAct)
+ self.windowMenu.addSeparator()
+ self.windowMenu.addAction(nextAct)
+ self.windowMenu.addAction(previousAct)
+ self.windowMenu.addAction(separatorAct)
+
+ windows = mdiArea.subWindowList()
+ separatorAct.setVisible(not windows.isEmpty())
+
+ for i in range(0, windows.size()):
+ child = windows.at(i).widget()
+
+ text = ""
+ if i < 9:
+ text = "{} {}".format(i + 1, child.userFriendlyCurrentFile())
+ else:
+ text = "{} {}".format(i + 1, child.userFriendlyCurrentFile())
+
+ action = windowMenu.addAction(text)
+ action.setCheckable(True)
+ action.setChecked(child == activeMdiChild())
+ action.triggered.connect(windowMapper.map)
+ windowMapper.setMapping(action, windows.at(i))
+
+ createMdiChild = MdiChild()
+
+ child = MdiChild()
+ mdiArea.addSubWindow(child)
+
+ child.copyAvailable[bool].connect(cutAct.setEnabled)
+ child.copyAvailable[bool].connect(copyAct.setEnabled)
+
+ return child
+
+
+ def createActions(self):
+
+ Act = QAction(QIcon(":/images/new.png"), tr("&New"), self)
+ Act.setShortcuts(QKeySequence.New)
+ Act.setStatusTip(tr("Create a new file"))
+ Act.triggered.connect(self.newFile)
+
+ openAct = QAction(QIcon(":/images/open.png"), tr("&Open..."), self)
+ openAct.setShortcuts(QKeySequence.Open)
+ openAct.setStatusTip(tr("Open an existing file"))
+ openAct.triggered.connect(self.open)
+
+ saveAct = QAction(QIcon(":/images/save.png"), tr("&Save"), self)
+ saveAct.setShortcuts(QKeySequence.Save)
+ saveAct.setStatusTip(tr("Save the document to disk"))
+ saveAct.triggered.connect(self.save)
+
+ saveAsAct = QAction(tr("Save &As..."), self)
+ saveAsAct.setShortcuts(QKeySequence.SaveAs)
+ saveAsAct.setStatusTip(tr("Save the document under a name"))
+ saveAsAct.triggered.connect(self.saveAs)
+
+//! [0]
+ exitAct = QAction(tr("E&xit"), self)
+ exitAct.setShortcut(tr("Ctrl+Q"))
+ exitAct.setStatusTip(tr("Exit the application"))
+ exitAct.triggered.connect(qApp.closeAllWindows)
+//! [0]
+
+ cutAct = QAction(QIcon(":/images/cut.png"), tr("Cu&t"), self)
+ cutAct.setShortcuts(QKeySequence.Cut)
+ cutAct.setStatusTip(tr("Cut the current selection's contents to the "
+ "clipboard"))
+ cutAct.triggered.connect(self.cut)
+
+ copyAct = QAction(QIcon(":/images/copy.png"), tr("&Copy"), self)
+ copyAct.setShortcuts(QKeySequence.Copy)
+ copyAct.setStatusTip(tr("Copy the current selection's contents to the "
+ "clipboard"))
+ copyAct.triggered.connect(self.copy)
+
+ pasteAct = QAction(QIcon(":/images/paste.png"), tr("&Paste"), self)
+ pasteAct.setShortcuts(QKeySequence.Paste)
+ pasteAct.setStatusTip(tr("Paste the clipboard's contents into the current "
+ "selection"))
+ pasteAct.triggered.connect(self.paste)
+
+ closeAct = QAction(tr("Cl&ose"), self)
+ closeAct.setShortcut(tr("Ctrl+F4"))
+ closeAct.setStatusTip(tr("Close the active window"))
+ closeAct.triggered.connect(mdiArea.closeActiveSubWindow)
+
+ closeAllAct = QAction(tr("Close &All"), self)
+ closeAllAct.setStatusTip(tr("Close all the windows"))
+ closeAllAct.triggered.connect(mdiArea.closeAllSubWindows)
+
+ tileAct = QAction(tr("&Tile"), self)
+ tileAct.setStatusTip(tr("Tile the windows"))
+ tileAct.triggered.connect(mdiArea.tileSubWindows)
+
+ cascadeAct = QAction(tr("&Cascade"), self)
+ cascadeAct.setStatusTip(tr("Cascade the windows"))
+ cascadeAct.triggered.connect(mdiArea.cascadeSubWindows)
+
+ nextAct = QAction(tr("Ne&xt"), self)
+ nextAct.setShortcuts(QKeySequence.NextChild)
+ nextAct.setStatusTip(tr("Move the focus to the next window"))
+ nextAct.triggered.connect(mdiArea.activateNextSubWindow)
+
+ previousAct = QAction(tr("Pre&vious"), self)
+ previousAct.setShortcuts(QKeySequence.PreviousChild)
+ previousAct.setStatusTip(tr("Move the focus to the previous "
+ "window"))
+ previousAct.triggered.connect(mdiArea.activatePreviousSubWindow)
+
+ separatorAct = QAction(self)
+ separatorAct.setSeparator(True)
+
+ aboutAct = QAction(tr("&About"), self)
+ aboutAct.setStatusTip(tr("Show the application's About box"))
+ aboutAct.triggered.connect(self.about)
+
+ aboutQtAct = QAction(tr("About &Qt"), self)
+ aboutQtAct.setStatusTip(tr("Show the Qt library's About box"))
+ aboutQtAct.triggered.connect(qApp.aboutQt)
+
+
+ def createMenus(self):
+
+ fileMenu = menuBar().addMenu(tr("&File"))
+ fileMenu.addAction(Act)
+ fileMenu.addAction(openAct)
+ fileMenu.addAction(saveAct)
+ fileMenu.addAction(saveAsAct)
+ fileMenu.addSeparator()
+ action = fileMenu.addAction(tr("Switch layout direction"))
+ action.triggered.connect(self.switchLayoutDirection)
+ fileMenu.addAction(exitAct)
+
+ editMenu = menuBar().addMenu(tr("&Edit"))
+ editMenu.addAction(cutAct)
+ editMenu.addAction(copyAct)
+ editMenu.addAction(pasteAct)
+
+ windowMenu = menuBar().addMenu(tr("&Window"))
+ updateWindowMenu()
+ windowMenu.aboutToShow.connect(self.updateWindowMenu)
+
+ menuBar().addSeparator()
+
+ helpMenu = menuBar().addMenu(tr("&Help"))
+ helpMenu.addAction(aboutAct)
+ helpMenu.addAction(aboutQtAct)
+
+
+ def createToolBars(self):
+ fileToolBar = addToolBar(tr("File"))
+ fileToolBar.addAction(Act)
+ fileToolBar.addAction(openAct)
+ fileToolBar.addAction(saveAct)
+
+ editToolBar = addToolBar(tr("Edit"))
+ editToolBar.addAction(cutAct)
+ editToolBar.addAction(copyAct)
+ editToolBar.addAction(pasteAct)
+
+
+ def createStatusBar(self):
+ statusBar().showMessage(tr("Ready"))
+
+
+ def readSettings(self):
+ settings = QSettings("Trolltech", "MDI Example")
+ QPoint pos = settings.value("pos", QPoint(200, 200)").toPoint()
+ QSize size = settings.value("size", QSize(400, 400)").toSize()
+ move(pos)
+ resize(size)
+
+ def writeSettings(self):
+ QSettings settings("Trolltech", "MDI Example")
+ settings.setValue("pos", pos()")
+ settings.setValue("size", size()")
+
+
+ activeMdiChild = MdiChild()
+ activeSubWindow = mdiArea.activeSubWindow()
+ if activeSubWindow:
+ return activeSubWindow.widget()
+ return 0
+
+
+ def findMdiChild(self, fileName):
+
+ canonicalFilePath = QFileInfo(fileName).canonicalFilePath()
+
+ for window in mdiArea.subWindowList():
+ mdiChild = window.widget()
+ if mdiChild.currentFile() == canonicalFilePath:
+ return window
+ return 0
+
+
+ def switchLayoutDirection(self)
+ if layoutDirection() == Qt.LeftToRight:
+ qApp.setLayoutDirection(Qt.RightToLeft)
+ else:
+ qApp.setLayoutDirection(Qt.LeftToRight)
+
+
+ def setActiveSubWindow(self, window):
+ if not window:
+ return
+ mdiArea.setActiveSubWindow(window)
diff --git a/sources/pyside6/doc/codesnippets/examples/mainwindows/menus/mainwindow.py b/sources/pyside6/doc/codesnippets/examples/mainwindows/menus/mainwindow.py
new file mode 100644
index 000000000..71586723e
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/mainwindows/menus/mainwindow.py
@@ -0,0 +1,366 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+from PySide6.QtGui import *
+
+//! [0]
+def __init__(self):
+ Q__init__(self)
+
+ widget = QWidget()
+ setCentralWidget(widget)
+//! [0]
+
+//! [1]
+ topFiller = QWidget()
+ topFiller.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
+
+ infoLabel = QLabel(tr("<i>Choose a menu option, or right-click to "
+ "invoke a context menu</i>"))
+ infoLabel.setFrameStyle(QFrame.StyledPanel | QFrame.Sunken)
+ infoLabel.setAlignment(Qt.AlignCenter)
+
+ bottomFiller = QWidget()
+ bottomFiller.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
+
+ layout = QVBoxLayout()
+ layout.setMargin(5)
+ layout.addWidget(topFiller)
+ layout.addWidget(infoLabel)
+ layout.addWidget(bottomFiller)
+ widget.setLayout(layout)
+//! [1]
+
+//! [2]
+ createActions()
+ createMenus()
+
+ message = tr("A context menu is available by right-clicking")
+ statusBar().showMessage(message)
+
+ setWindowTitle(tr("Menus"))
+ setMinimumSize(160, 160)
+ resize(480, 320)
+
+//! [2]
+
+//! [3]
+def contextMenuEvent(self, event):
+ menu = QMenu(self)
+ menu.addAction(cutAct)
+ menu.addAction(copyAct)
+ menu.addAction(pasteAct)
+ menu.exec_(event.globalPos()")
+
+//! [3]
+
+def File(self):
+ infoLabel.setText(tr("Invoked <b>File|New</b>"))
+
+
+def open(self):
+ infoLabel.setText(tr("Invoked <b>File|Open</b>"))
+
+
+def save(self):
+ infoLabel.setText(tr("Invoked <b>File|Save</b>"))
+
+def print_(self):
+ infoLabel.setText(tr("Invoked <b>File|Print</b>"))
+
+def undo(self):
+ infoLabel.setText(tr("Invoked <b>Edit|Undo</b>"))
+
+def redo(self):
+ infoLabel.setText(tr("Invoked <b>Edit|Redo</b>"))
+
+def cut(self):
+
+ infoLabel.setText(tr("Invoked <b>Edit|Cut</b>"))
+
+
+def copy(self):
+
+ infoLabel.setText(tr("Invoked <b>Edit|Copy</b>"))
+
+
+def paste(self):
+
+ infoLabel.setText(tr("Invoked <b>Edit|Paste</b>"))
+
+
+def bold(self):
+
+ infoLabel.setText(tr("Invoked <b>Edit|Format|Bold</b>"))
+
+
+def italic(self):
+
+ infoLabel.setText(tr("Invoked <b>Edit|Format|Italic</b>"))
+
+
+def leftAlign(self):
+
+ infoLabel.setText(tr("Invoked <b>Edit|Format|Left Align</b>"))
+
+
+def rightAlign(self):
+
+ infoLabel.setText(tr("Invoked <b>Edit|Format|Right Align</b>"))
+
+
+def justify(self):
+
+ infoLabel.setText(tr("Invoked <b>Edit|Format|Justify</b>"))
+
+
+def center(self):
+
+ infoLabel.setText(tr("Invoked <b>Edit|Format|Center</b>"))
+
+
+def setLineSpacing(self):
+
+ infoLabel.setText(tr("Invoked <b>Edit|Format|Set Line Spacing</b>"))
+
+
+def setParagraphSpacing(self):
+
+ infoLabel.setText(tr("Invoked <b>Edit|Format|Set Paragraph Spacing</b>"))
+
+
+def about(self):
+
+ infoLabel.setText(tr("Invoked <b>Help|About</b>"))
+ QMessageBox.about(self, tr("About Menu"),
+ tr("The <b>Menu</b> example shows how to create "
+ "menu-bar menus and context menus."))
+
+
+def aboutQt(self):
+
+ infoLabel.setText(tr("Invoked <b>Help|About Qt</b>"))
+
+
+//! [4]
+def createActions(self):
+
+//! [5]
+ Act = new QAction(tr("&New"), self)
+ Act.setShortcuts(QKeySequence.New)
+ Act.setStatusTip(tr("Create a new file"))
+ Act.triggered.connect(newFile)
+//! [4]
+
+ openAct = QAction(tr("&Open..."), self)
+ openAct.setShortcuts(QKeySequence.Open)
+ openAct.setStatusTip(tr("Open an existing file"))
+ openAct.triggered.connect(open)
+//! [5]
+
+ saveAct = QAction(tr("&Save"), self)
+ saveAct.setShortcuts(QKeySequence.Save)
+ saveAct.setStatusTip(tr("Save the document to disk"))
+ saveAct.triggered.connect(save)
+
+ printAct = QAction(tr("&Print..."), self)
+ printAct.setShortcuts(QKeySequence.Print)
+ printAct.setStatusTip(tr("Print the document"))
+ printAct.triggered.connect(print_)
+
+ exitAct = QAction(tr("E&xit"), self)
+ exitAct.setShortcut(tr("Ctrl+Q"))
+ exitAct.setStatusTip(tr("Exit the application"))
+ exitAct.triggered.connect(close)
+
+ undoAct = QAction(tr("&Undo"), self)
+ undoAct.setShortcuts(QKeySequence.Undo)
+ undoAct.setStatusTip(tr("Undo the last operation"))
+ undoAct.triggered.connect(undo)
+
+ redoAct = QAction(tr("&Redo"), self)
+ redoAct.setShortcuts(QKeySequence.Redo)
+ redoAct.setStatusTip(tr("Redo the last operation"))
+ redoAct.triggered.connect(redo)
+
+ cutAct = QAction(tr("Cu&t"), self)
+ cutAct.setShortcuts(QKeySequence.Cut)
+ cutAct.setStatusTip(tr("Cut the current selection's contents to the "
+ "clipboard"))
+ cutAct.triggered.connect(cut)
+
+ copyAct = QAction(tr("&Copy"), self)
+ copyAct.setShortcut(tr("Ctrl+C"))
+ copyAct.setStatusTip(tr("Copy the current selection's contents to the "
+ "clipboard"))
+ copyAct.triggered.connect(copy)
+
+ pasteAct = QAction(tr("&Paste"), self)
+ pasteAct.setShortcuts(QKeySequence.Paste)
+ pasteAct.setStatusTip(tr("Paste the clipboard's contents into the current "
+ "selection"))
+ pasteAct.triggered.connect(paste)
+
+ boldAct = QAction(tr("&Bold"), self)
+ boldAct.setCheckable(True)
+ boldAct.setShortcut(tr("Ctrl+B"))
+ boldAct.setStatusTip(tr("Make the text bold"))
+ boldAct.triggered.connect(bold)
+
+ QFont boldFont = boldAct.font()
+ boldFont.setBold(True)
+ boldAct.setFont(boldFont)
+
+ italicAct = QAction(tr("&Italic"), self)
+ italicAct.setCheckable(True)
+ italicAct.setShortcut(tr("Ctrl+I"))
+ italicAct.setStatusTip(tr("Make the text italic"))
+ italicAct.triggered.connect(italic)
+
+ QFont italicFont = italicAct.font()
+ italicFont.setItalic(True)
+ italicAct.setFont(italicFont)
+
+ setLineSpacingAct = QAction(tr("Set &Line Spacing..."), self)
+ setLineSpacingAct.setStatusTip(tr("Change the gap between the lines of a "
+ "paragraph"))
+ setLineSpacingAct.triggered.connect(setLineSpacing)
+
+ setParagraphSpacingAct = QAction(tr("Set &Paragraph Spacing..."), self)
+ setLineSpacingAct.setStatusTip(tr("Change the gap between paragraphs"))
+ setParagraphSpacingAct.triggered.connect(setParagraphSpacing)
+
+ aboutAct = QAction(tr("&About"), self)
+ aboutAct.setStatusTip(tr("Show the application's About box"))
+ aboutAct.triggered.connect(about)
+
+ aboutQtAct = QAction(tr("About &Qt"), self)
+ aboutQtAct.setStatusTip(tr("Show the Qt library's About box"))
+ aboutQtAct.triggered.connect(qApp.aboutQt)
+ aboutQtAct.triggered.connect(aboutQt)
+
+ leftAlignAct = QAction(tr("&Left Align"), self)
+ leftAlignAct.setCheckable(True)
+ leftAlignAct.setShortcut(tr("Ctrl+L"))
+ leftAlignAct.setStatusTip(tr("Left align the selected text"))
+ leftAlignAct.triggered.connect(leftAlign)
+
+ rightAlignAct = QAction(tr("&Right Align"), self)
+ rightAlignAct.setCheckable(True)
+ rightAlignAct.setShortcut(tr("Ctrl+R"))
+ rightAlignAct.setStatusTip(tr("Right align the selected text"))
+ rightAlignAct.triggered.connect(rightAlign)
+
+ justifyAct = QAction(tr("&Justify"), self)
+ justifyAct.setCheckable(True)
+ justifyAct.setShortcut(tr("Ctrl+J"))
+ justifyAct.setStatusTip(tr("Justify the selected text"))
+ justifyAct.triggered.connect(justify)
+
+ centerAct = QAction(tr("&Center"), self)
+ centerAct.setCheckable(True)
+ centerAct.setShortcut(tr("Ctrl+E"))
+ centerAct.setStatusTip(tr("Center the selected text"))
+ centerAct.triggered.connect(center)
+
+//! [6] //! [7]
+ alignmentGroup = QActionGroup(self)
+ alignmentGroup.addAction(leftAlignAct)
+ alignmentGroup.addAction(rightAlignAct)
+ alignmentGroup.addAction(justifyAct)
+ alignmentGroup.addAction(centerAct)
+ leftAlignAct.setChecked(True)
+//! [6]
+
+//! [7]
+
+//! [8]
+def createMenus(self):
+
+//! [9] //! [10]
+ fileMenu = menuBar().addMenu(tr("&File"))
+ fileMenu.addAction(Act)
+//! [9]
+ fileMenu.addAction(openAct)
+//! [10]
+ fileMenu.addAction(saveAct)
+ fileMenu.addAction(printAct)
+//! [11]
+ fileMenu.addSeparator()
+//! [11]
+ fileMenu.addAction(exitAct)
+
+ editMenu = menuBar().addMenu(tr("&Edit"))
+ editMenu.addAction(undoAct)
+ editMenu.addAction(redoAct)
+ editMenu.addSeparator()
+ editMenu.addAction(cutAct)
+ editMenu.addAction(copyAct)
+ editMenu.addAction(pasteAct)
+ editMenu.addSeparator()
+
+ helpMenu = menuBar().addMenu(tr("&Help"))
+ helpMenu.addAction(aboutAct)
+ helpMenu.addAction(aboutQtAct)
+//! [8]
+
+//! [12]
+ formatMenu = editMenu.addMenu(tr("&Format"))
+ formatMenu.addAction(boldAct)
+ formatMenu.addAction(italicAct)
+ formatMenu.addSeparator()->setText(tr("Alignment"))
+ formatMenu.addAction(leftAlignAct)
+ formatMenu.addAction(rightAlignAct)
+ formatMenu.addAction(justifyAct)
+ formatMenu.addAction(centerAct)
+ formatMenu.addSeparator()
+ formatMenu.addAction(setLineSpacingAct)
+ formatMenu.addAction(setParagraphSpacingAct)
+//! [12]
diff --git a/sources/pyside6/doc/codesnippets/examples/mainwindows/sdi/mainwindow.cpp b/sources/pyside6/doc/codesnippets/examples/mainwindows/sdi/mainwindow.cpp
new file mode 100644
index 000000000..de169b20d
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/mainwindows/sdi/mainwindow.cpp
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [implicit tr context]
+def createMenus(self):
+ fileMenu = menuBar().addMenu("&File")
+//! [implicit tr context]
+
+//! [0]
+ fileToolBar = addToolBar("File")
+ fileToolBar.addAction(newAct)
+ fileToolBar.addAction(openAct)
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/examples/quick/plugins/plugins.qml b/sources/pyside6/doc/codesnippets/examples/quick/plugins/plugins.qml
new file mode 100644
index 000000000..f1b5c2354
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/quick/plugins/plugins.qml
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+renderer = QSvgRenderer(QLatin1String("SvgCardDeck.svg"))
+black = QGraphicsSvgItem()
+red = QGraphicsSvgItem()
+
+black.setSharedRenderer(renderer)
+black.setElementId(QLatin1String("black_joker"))
+
+red.setSharedRenderer(renderer)
+red.setElementId(QLatin1String("red_joker"))
+//! [0]
diff --git a/sources/pyside6/doc/codesnippets/examples/relationaltablemodel/relationaltablemodel.cpp b/sources/pyside6/doc/codesnippets/examples/relationaltablemodel/relationaltablemodel.cpp
new file mode 100644
index 000000000..822b66c76
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/relationaltablemodel/relationaltablemodel.cpp
@@ -0,0 +1,120 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+from PySide6.QtGui import *
+from PySide6.QtSql import *
+
+def initializeModel(model):
+//! [0]
+ model.setTable("employee")
+//! [0]
+
+ model.setEditStrategy(QSqlTableModel.OnManualSubmit)
+//! [1]
+ model.setRelation(2, QSqlRelation("city", "id", "name"))
+//! [1] //! [2]
+ model.setRelation(3, QSqlRelation("country", "id", "name"))
+//! [2]
+
+//! [3]
+ model.setHeaderData(0, Qt.Horizontal, QObject::tr("ID"))
+ model.setHeaderData(1, Qt.Horizontal, QObject::tr("Name"))
+ model.setHeaderData(2, Qt.Horizontal, QObject::tr("City"))
+ model.setHeaderData(3, Qt.Horizontal, QObject::tr("Country"))
+//! [3]
+
+ model.select()
+
+
+def createView(title, model):
+//! [4]
+ view = QTableView()
+ view.setModel(model)
+ view.setItemDelegate(QSqlRelationalDelegate(view))
+//! [4]
+ view.setWindowTitle(title)
+ return view
+
+
+def createRelationalTables():
+ query = QSqlQuery()
+ query.exec_("create table employee(id int primary key, name varchar(20), city int, country int)")
+ query.exec_("insert into employee values(1, 'Espen', 5000, 47)")
+ query.exec_("insert into employee values(2, 'Harald', 80000, 49)")
+ query.exec_("insert into employee values(3, 'Sam', 100, 1)")
+
+ query.exec_("create table city(id int, name varchar(20))")
+ query.exec_("insert into city values(100, 'San Jose')")
+ query.exec_("insert into city values(5000, 'Oslo')")
+ query.exec_("insert into city values(80000, 'Munich')")
+
+ query.exec_("create table country(id int, name varchar(20))")
+ query.exec_("insert into country values(1, 'USA')")
+ query.exec_("insert into country values(47, 'Norway')")
+ query.exec_("insert into country values(49, 'Germany')")
+
+
+def main():
+
+ app = QApplication([])
+ if !createConnection():
+ return 1
+
+ createRelationalTables()
+
+ model = QSqlRelationalTableModel()
+
+ initializeModel(model)
+
+ view = createView(QObject.tr("Relational Table Model"), model)
+ view.show()
+
+ return app.exec_()
+
diff --git a/sources/pyside6/doc/codesnippets/examples/richtext/textobject/svgtextobject.h b/sources/pyside6/doc/codesnippets/examples/richtext/textobject/svgtextobject.h
new file mode 100644
index 000000000..d0b9abf40
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/richtext/textobject/svgtextobject.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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 SVGTEXTOBJECT_H
+#define SVGTEXTOBJECT_H
+
+#include <QTextObjectInterface>
+
+QT_BEGIN_NAMESPACE
+class QTextDocument;
+class QTextFormat;
+class QPainter;
+class QRectF;
+class QSizeF;
+QT_END_NAMESPACE
+
+//![0] //![1]
+class SvgTextObject(QObject, QTextObjectInterface):
+ def __init__(self,...):
+ super(SvgTextObject, self).__init__(...)
+ ...
+//![1]
+
+public:
+ QSizeF intrinsicSize(QTextDocument *doc, int posInDocument,
+ const QTextFormat &format);
+ void drawObject(QPainter *painter, const QRectF &rect, QTextDocument *doc,
+ int posInDocument, const QTextFormat &format);
+};
+//![0]
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/examples/widgets/groupbox/window.cpp b/sources/pyside6/doc/codesnippets/examples/widgets/groupbox/window.cpp
new file mode 100644
index 000000000..a24e3536f
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/widgets/groupbox/window.cpp
@@ -0,0 +1,187 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [0]
+def __init__(self, parent = None):
+ QWidget.__init__(self, parent)
+
+ grid = QGridLayout()
+ grid.addWidget(createFirstExclusiveGroup(), 0, 0)
+ grid.addWidget(createSecondExclusiveGroup(), 1, 0)
+ grid.addWidget(createNonExclusiveGroup(), 0, 1)
+ grid.addWidget(createPushButtonGroup(), 1, 1)
+ setLayout(grid)
+
+ setWindowTitle("Group Boxes")
+ resize(480, 320)
+
+//! [0]
+
+//! [1]
+def createFirstExclusiveGroup(self):
+//! [2]
+ groupBox = QGroupBox("Exclusive Radio Buttons")
+
+ radio1 = QRadioButton("&Radio button 1")
+ radio2 = QRadioButton("R&adio button 2")
+ radio3 = QRadioButton("Ra&dio button 3")
+
+ radio1.setChecked(True)
+//! [1] //! [3]
+
+ vbox = QVBoxLayout()
+ vbox.addWidget(radio1)
+ vbox.addWidget(radio2)
+ vbox.addWidget(radio3)
+ vbox.addStretch(1)
+ groupBox.setLayout(vbox)
+//! [2]
+ return groupBox
+//! [3]
+
+//! [4]
+def createSecondExclusiveGroup(self):
+ groupBox = QGroupBox("E&xclusive Radio Buttons")
+ groupBox.setCheckable(True)
+ groupBox.setChecked(False)
+//! [4]
+
+//! [5]
+ radio1 = QRadioButton("Rad&io button 1")
+ radio2 = QRadioButton("Radi&o button 2")
+ radio3 = QRadioButton("Radio &button 3")
+ radio1.setChecked(True)
+ checkBox = QCheckBox("Ind&ependent checkbox")
+ checkBox.setChecked(True)
+//! [5]
+
+//! [6]
+ vbox = QVBoxLayout()
+ vbox.addWidget(radio1)
+ vbox.addWidget(radio2)
+ vbox.addWidget(radio3)
+ vbox.addWidget(checkBox)
+ vbox.addStretch(1)
+ groupBox.setLayout(vbox)
+
+ return groupBox
+//! [6]
+
+//! [7]
+def createNonExclusiveGroup(self):
+ groupBox = QGroupBox("Non-Exclusive Checkboxes")
+ groupBox.setFlat(True)
+//! [7]
+
+//! [8]
+ checkBox1 = QCheckBox("&Checkbox 1")
+ checkBox2 = QCheckBox("C&heckbox 2")
+ checkBox2.setChecked(True)
+ tristateBox = QCheckBox("Tri-&state button")
+ tristateBox.setTristate(True)
+//! [8]
+ tristateBox.setCheckState(Qt.PartiallyChecked)
+
+//! [9]
+ vbox = QVBoxLayout()
+ vbox.addWidget(checkBox1)
+ vbox.addWidget(checkBox2)
+ vbox.addWidget(tristateBox)
+ vbox.addStretch(1)
+ groupBox.setLayout(vbox)
+
+ return groupBox
+//! [9]
+
+//! [10]
+def createPushButtonGroup(self):
+ groupBox = QGroupBox("&Push Buttons")
+ groupBox.setCheckable(True)
+ groupBox.setChecked(True)
+//! [10]
+
+//! [11]
+ pushButton = QPushButton("&Normal Button")
+ toggleButton = QPushButton("&Toggle Button")
+ toggleButton.setCheckable(True)
+ toggleButton.setChecked(True)
+ flatButton = QPushButton("&Flat Button")
+ flatButton.setFlat(True)
+//! [11]
+
+//! [12]
+ popupButton = QPushButton("Pop&up Button")
+ menu = QMenu(self)
+ menu.addAction("&First Item")
+ menu.addAction("&Second Item")
+ menu.addAction("&Third Item")
+ menu.addAction("F&ourth Item")
+ popupButton.setMenu(menu)
+//! [12]
+
+ newAction = menu.addAction("Submenu")
+ QMenu *subMenu = QMenu("Popup Submenu")
+ subMenu.addAction("Item 1")
+ subMenu.addAction("Item 2")
+ subMenu.addAction("Item 3")
+ newAction.setMenu(subMenu)
+
+//! [13]
+ vbox = QVBoxLayout()
+ vbox.addWidget(pushButton)
+ vbox.addWidget(toggleButton)
+ vbox.addWidget(flatButton)
+ vbox.addWidget(popupButton)
+ vbox.addStretch(1)
+ groupBox.setLayout(vbox)
+
+ return groupBox
+}
+//! [13]
diff --git a/sources/pyside6/doc/codesnippets/examples/widgets/icons/iconsizespinbox.cpp b/sources/pyside6/doc/codesnippets/examples/widgets/icons/iconsizespinbox.cpp
new file mode 100644
index 000000000..a289c5cea
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/widgets/icons/iconsizespinbox.cpp
@@ -0,0 +1,72 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+
+//! [0]
+def __init__(self, parent):
+ QSpinBox.__init__(self, parent)
+
+//! [0]
+
+//! [1]
+def valueFromText(self, text):
+ regExp = QRegExp(tr("(\\d+)(\\s*[xx]\\s*\\d+)?"))
+
+ if regExp.exactMatch(text):
+ return regExp.cap(1).toInt()
+ else:
+ return 0
+//! [1]
+
+//! [2]
+def textFromValue(self, value):
+ return self.tr("%1 x %1").arg(value)
+
+//! [2]
diff --git a/sources/pyside6/doc/codesnippets/examples/widgets/spinboxes/window.py b/sources/pyside6/doc/codesnippets/examples/widgets/spinboxes/window.py
new file mode 100644
index 000000000..f54e40bca
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/widgets/spinboxes/window.py
@@ -0,0 +1,247 @@
+############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the examples of Qt for Python.
+##
+## $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$
+##
+############################################################################
+
+from PySide6.QtGui import *
+
+//! [0]
+def __init__(self):
+ createSpinBoxes()
+ createDateTimeEdits()
+ createDoubleSpinBoxes()
+
+ layout = QHBoxLayout()
+ layout.addWidget(spinBoxesGroup)
+ layout.addWidget(editsGroup)
+ layout.addWidget(doubleSpinBoxesGroup)
+ setLayout(layout)
+
+ setWindowTitle(tr("Spin Boxes"))
+//! [0]
+
+//! [1]
+def createSpinBoxes(self):
+ spinBoxesGroup = QGroupBox(tr("Spinboxes"))
+
+ integerLabel = QLabel(tr("Enter a value between "
+ "%1 and %2:").arg(-20).arg(20))
+ integerSpinBox = QSpinBox()
+ integerSpinBox.setRange(-20, 20)
+ integerSpinBox.setSingleStep(1)
+ integerSpinBox.setValue(0)
+//! [1]
+
+//! [2]
+ zoomLabel = QLabel(tr("Enter a zoom value between "
+ "%1 and %2:").arg(0).arg(1000))
+//! [3]
+ zoomSpinBox = QSpinBox()
+ zoomSpinBox.setRange(0, 1000)
+ zoomSpinBox.setSingleStep(10)
+ zoomSpinBox.setSuffix("%")
+ zoomSpinBox.setSpecialValueText(tr("Automatic"))
+ zoomSpinBox.setValue(100)
+//! [2] //! [3]
+
+//! [4]
+ priceLabel = QLabel(tr("Enter a price between "
+ "%1 and %2:").arg(0).arg(999))
+ priceSpinBox = QSpinBox()
+ priceSpinBox.setRange(0, 999)
+ priceSpinBox.setSingleStep(1)
+ priceSpinBox.setPrefix("$")
+ priceSpinBox.setValue(99)
+//! [4] //! [5]
+
+ spinBoxLayout = QVBoxLayout()
+ spinBoxLayout.addWidget(integerLabel)
+ spinBoxLayout.addWidget(integerSpinBox)
+ spinBoxLayout.addWidget(zoomLabel)
+ spinBoxLayout.addWidget(zoomSpinBox)
+ spinBoxLayout.addWidget(priceLabel)
+ spinBoxLayout.addWidget(priceSpinBox)
+ spinBoxesGroup.setLayout(spinBoxLayout)
+
+//! [5]
+
+//! [6]
+def createDateTimeEdits(self):
+ editsGroup = QGroupBox(tr("Date and time spin boxes"))
+
+ dateLabel = QLabel()
+ dateEdit = QDateEdit(QDate.currentDate())
+ dateEdit.setDateRange(QDate(2005, 1, 1), QDate(2010, 12, 31))
+ dateLabel.setText(tr("Appointment date (between %0 and %1):")
+ .arg(dateEdit.minimumDate().toString(Qt.ISODate))
+ .arg(dateEdit.maximumDate().toString(Qt.ISODate)))
+//! [6]
+
+//! [7]
+ timeLabel = QLabel()
+ timeEdit = QTimeEdit(QTime.currentTime())
+ timeEdit.setTimeRange(QTime(9, 0, 0, 0), QTime(16, 30, 0, 0))
+ timeLabel.setText(tr("Appointment time (between %0 and %1):")
+ .arg(timeEdit.minimumTime().toString(Qt.ISODate))
+ .arg(timeEdit.maximumTime().toString(Qt.ISODate)))
+//! [7]
+
+//! [8]
+ meetingLabel = QLabel()
+ meetingEdit = QDateTimeEdit(QDateTime.currentDateTime())
+//! [8]
+
+//! [9]
+ formatLabel = QLabel(tr("Format string for the meeting date "
+ "and time:"))
+ formatComboBox = QComboBox()
+ formatComboBox.addItem("yyyy-MM-dd hh:mm:ss (zzz 'ms')")
+ formatComboBox.addItem("hh:mm:ss MM/dd/yyyy")
+ formatComboBox.addItem("hh:mm:ss dd/MM/yyyy")
+ formatComboBox.addItem("hh:mm:ss")
+ formatComboBox.addItem("hh:mm ap")
+//! [9] //! [10]
+
+ formatComboBox.activated[str].connect(setFormatString)
+//! [10]
+
+ setFormatString(formatComboBox.currentText())
+
+//! [11]
+ editsLayout = QVBoxLayout()
+ editsLayout.addWidget(dateLabel)
+ editsLayout.addWidget(dateEdit)
+ editsLayout.addWidget(timeLabel)
+ editsLayout.addWidget(timeEdit)
+ editsLayout.addWidget(meetingLabel)
+ editsLayout.addWidget(meetingEdit)
+ editsLayout.addWidget(formatLabel)
+ editsLayout.addWidget(formatComboBox)
+ editsGroup.setLayout(editsLayout)
+//! [11]
+
+//! [12]
+def setFormatString(self, formatString):
+ meetingEdit.setDisplayFormat(formatString)
+//! [12] //! [13]
+ if meetingEdit.displayedSections() & QDateTimeEdit.DateSections_Mask:
+ meetingEdit.setDateRange(QDate(2004, 11, 1), QDate(2005, 11, 30))
+ meetingLabel.setText(tr("Meeting date (between %0 and %1):")
+ .arg(meetingEdit.minimumDate().toString(Qt.ISODate))
+ .arg(meetingEdit.maximumDate().toString(Qt.ISODate)))
+ else:
+ meetingEdit.setTimeRange(QTime(0, 7, 20, 0), QTime(21, 0, 0, 0))
+ meetingLabel.setText(tr("Meeting time (between %0 and %1):")
+ .arg(meetingEdit.minimumTime().toString(Qt.ISODate))
+ .arg(meetingEdit.maximumTime().toString(Qt.ISODate)))
+//! [13]
+
+//! [14]
+def createDoubleSpinBoxes():
+ doubleSpinBoxesGroup = QGroupBox(tr("Double precision spinboxes"))
+
+ precisionLabel = QLabel(tr("Number of decimal places "
+ "to show:"))
+ precisionSpinBox = QSpinBox()
+ precisionSpinBox.setRange(0, 100)
+ precisionSpinBox.setValue(2)
+//! [14]
+
+//! [15]
+ doubleLabel = QLabel(tr("Enter a value between "
+ "%1 and %2:").arg(-20).arg(20))
+ doubleSpinBox = QDoubleSpinBox ()
+ doubleSpinBox.setRange(-20.0, 20.0)
+ doubleSpinBox.setSingleStep(1.0)
+ doubleSpinBox.setValue(0.0)
+//! [15]
+
+//! [16]
+ scaleLabel = QLabel(tr("Enter a scale factor between "
+ "%1 and %2:").arg(0).arg(1000.0))
+ scaleSpinBox = QDoubleSpinBox()
+ scaleSpinBox.setRange(0.0, 1000.0)
+ scaleSpinBox.setSingleStep(10.0)
+ scaleSpinBox.setSuffix("%")
+ scaleSpinBox.setSpecialValueText(tr("No scaling"))
+ scaleSpinBox.setValue(100.0)
+//! [16]
+
+//! [17]
+ priceLabel = QLabel(tr("Enter a price between "
+ "%1 and %2:").arg(0).arg(1000))
+ priceSpinBox = QDoubleSpinBox()
+ priceSpinBox.setRange(0.0, 1000.0)
+ priceSpinBox.setSingleStep(1.0)
+ priceSpinBox.setPrefix("$")
+ priceSpinBox.setValue(99.99)
+
+ precisionSpinBox.valueChanged[int].connect(changePrecision)
+//! [17]
+
+//! [18]
+ spinBoxLayout = QVBoxLayout()
+ spinBoxLayout.addWidget(precisionLabel)
+ spinBoxLayout.addWidget(precisionSpinBox)
+ spinBoxLayout.addWidget(doubleLabel)
+ spinBoxLayout.addWidget(doubleSpinBox)
+ spinBoxLayout.addWidget(scaleLabel)
+ spinBoxLayout.addWidget(scaleSpinBox)
+ spinBoxLayout.addWidget(priceLabel)
+ spinBoxLayout.addWidget(priceSpinBox)
+ doubleSpinBoxesGroup.setLayout(spinBoxLayout)
+}
+//! [18]
+
+//! [19]
+def changePrecision(self, int)
+ doubleSpinBox.setDecimals(decimals)
+ scaleSpinBox.setDecimals(decimals)
+ priceSpinBox.setDecimals(decimals)
+
+//! [19]
diff --git a/sources/pyside6/doc/codesnippets/examples/xml/streambookmarks/xbelreader.h b/sources/pyside6/doc/codesnippets/examples/xml/streambookmarks/xbelreader.h
new file mode 100644
index 000000000..cb7207333
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/examples/xml/streambookmarks/xbelreader.h
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** 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 XBELREADER_H
+#define XBELREADER_H
+
+#include <QIcon>
+#include <QXmlStreamReader>
+
+QT_BEGIN_NAMESPACE
+class QTreeWidget;
+class QTreeWidgetItem;
+QT_END_NAMESPACE
+
+//! [0]
+class XbelReader (QXmlStreamReader):
+//! [1]
+ def __init__(self, treeWidget):
+ ...
+//! [1]
+
+ def read(self, device);
+ ...
+
+//! [2]
+ def readUnknownElement(self):
+ ...
+ def readXBEL(self):
+ ...
+ def readTitle(self, item):
+ ...
+ def readSeparator(self, item):
+ ...
+ def readFolder(self, item):
+ ...
+ def readBookmark(self, item):
+ ...
+ def createChildItem(self, item):
+ ...
+//! [2]
+//! [0]
+
+#endif
diff --git a/sources/pyside6/doc/codesnippets/snippets/customstyle/main.cpp b/sources/pyside6/doc/codesnippets/snippets/customstyle/main.cpp
new file mode 100644
index 000000000..a656ed708
--- /dev/null
+++ b/sources/pyside6/doc/codesnippets/snippets/customstyle/main.cpp
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+//! [using a custom style]
+import sys
+from PySide6.QtGui import *
+
+QApplication.setStyle(CustomStyle())
+app = QApplication(sys.argv)
+spinBox = QSpinBox()
+spinBox.show()
+sys.exit(app.exec_())
+
+//! [using a custom style]
diff --git a/sources/pyside6/doc/conf.py.in b/sources/pyside6/doc/conf.py.in
new file mode 100644
index 000000000..c9686de96
--- /dev/null
+++ b/sources/pyside6/doc/conf.py.in
@@ -0,0 +1,190 @@
+# -*- coding: utf-8 -*-
+#
+# PySide documentation build configuration file, created by
+# sphinx-quickstart on Wed Apr 22 15:04:20 2009.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+sys.path.append('@CMAKE_CURRENT_SOURCE_DIR@')
+sys.path.append('@pyside_BINARY_DIR@')
+if @HAS_WEBENGINE_WIDGETS@:
+ sys.path.append('@CMAKE_CURRENT_SOURCE_DIR@/../../../examples/webenginewidgets/tabbedbrowser')
+
+# -- General configuration -----------------------------------------------------
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+#extensions = ['sphinx.ext.todo', 'sphinx.ext.graphviz', 'inheritance_diagram', 'pysideinclude']
+extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.ifconfig',
+'sphinx.ext.coverage', 'sphinx.ext.intersphinx', 'sphinx.ext.todo',
+'sphinx.ext.graphviz', 'inheritance_diagram', 'pysideinclude',
+'sphinx.ext.viewcode']
+
+output_format='@DOC_OUTPUT_FORMAT@'
+
+def setup(app):
+ app.add_config_value('output_format','qthelp','env')
+
+rst_epilog = """
+.. |project| replace:: Qt for Python
+.. |pymodname| replace:: PySide6
+"""
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['@CMAKE_CURRENT_SOURCE_DIR@/_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+source_encoding = 'utf-8'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'PySide'
+copyright = u'© 2018 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/license/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.'
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '@BINDING_API_VERSION@'
+# The full version, including alpha/beta/rc tags.
+release = '@BINDING_API_VERSION_FULL@'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of documents that shouldn't be included in the build.
+#unused_docs = []
+
+# List of directories, relative to source directory, that shouldn't be searched
+# for source files.
+exclude_patterns = ['_build', 'extras']
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. Major themes that come with
+# Sphinx are currently 'default' and 'sphinxdoc'.
+html_theme = 'pysidedocs'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further. For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {
+#}
+
+# Add any paths that contain custom themes here, relative to this directory.
+html_theme_path = ['@CMAKE_CURRENT_SOURCE_DIR@/_themes']
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# "<project> v<release> documentation".
+html_title = u'Qt for Python'
+
+# A shorter title for the navigation bar. Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+#html_static_path = ['@CMAKE_CURRENT_SOURCE_DIR@/_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = { '' : ''}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = { 'index' : 'index.html'}
+
+# If false, no module index is generated.
+#html_use_modindex = True
+
+# If false, no index is generated.
+html_use_index = False
+
+# If true, the index is split into individual pages for each letter.
+html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+html_show_sourcelink = False
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it. The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = ''
+
+# Output file base name for HTML help builder.
+#htmlhelp_basename = 'PySideDoc'
+
+# Link to the shiboken6 sphinx project to enable linking
+# between the two projects.
+intersphinx_mapping = {'shiboken6': ('shiboken6','@SHIBOKEN_INTERSPHINX_FILE@')}
+
+add_module_names = False
+
+# Skip some warnings when building the documentation with
+# 'build_rst_docs' due to the lack of qdoc generated files, in charge
+# of sphinx modules (autodoc) and references.
+if @SKIP_SPHINX_WARNINGS@:
+ suppress_warnings = ["autodoc", "autodoc.import_object", "ref.ref"]
+
+# -- Options for qthelp output ---------------------------------------------------
+qthelp_theme = 'pysidedocs_qthelp'
+
diff --git a/sources/pyside6/doc/considerations.rst b/sources/pyside6/doc/considerations.rst
new file mode 100644
index 000000000..e386d21ee
--- /dev/null
+++ b/sources/pyside6/doc/considerations.rst
@@ -0,0 +1,149 @@
+.. _pysideapi2:
+
+|project| Considerations
+=========================
+
+API Changes
+-----------
+
+One of the goals of |pymodname| is to be API compatible with PyQt5,
+with certain exceptions.
+
+The latest considerations and known issues will be also reported
+in the `wiki <https://wiki.qt.io/Qt_for_Python/Considerations>`_.
+
+__hash__() function return value
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The hash value returned for the classes :class:`PySide6.QtCore.QDate`,
+:class:`PySide6.QtCore.QDateTime`, :class:`PySide6.QtCore.QTime`, :class:`PySide6.QtCore.QUrl`
+will be based on their string representations, thus objects with the same value will produce the
+same hash.
+
+
+QString
+~~~~~~~
+
+Methods and functions that change the contents of a QString argument were modified to receive an
+immutable Python Unicode (or str) and return another Python Unicode/str as the modified string.
+
+The following methods had their return types modified this way:
+
+**Classes:** QAbstractSpinBox, QDateTimeEdit, QDoubleSpinBox, QSpinBox, QValidator
+
+* ``fixup(string): string``
+* ``validate(string, int): [QValidator.State, string, int]``
+
+**Classes:** QDoubleValidator, QIntValidator, QRegExpValidator
+
+* ``validate(string, int): [QValidator.State, string, int]``
+
+**Class:** QClipboard
+
+* ``text(string, QClipboard.Mode mode=QClipboard.Clipboard): [string, string]``
+
+**Class:** QFileDialog
+
+Instead of ``getOpenFileNameAndFilter()``, ``getOpenFileNamesAndFilter()`` and
+``getSaveFileNameAndFilter()`` like PyQt does, PySide has modified the original methods to return
+a tuple.
+
+* ``getOpenFileName(QWidget parent=None, str caption=None, str dir=None, str filter=None, QFileDialog.Options options=0): [string, filter]``
+* ``getOpenFileNames(QWidget parent=None, str caption=None, str dir=None, str filter=None, QFileDialog.Options options=0): [list(string), filter]``
+* ``getSaveFileName(QWidget parent=None, str caption=None, str dir=None, str filter=None, QFileDialog.Options options=0): [string, filter]``
+
+**Class:** QWebPage
+
+* ``javaScriptPrompt(QWebFrame, string, string): [bool, string]``
+
+**Classes:** QFontMetrics and QFontMetricsF
+
+They had two new methods added. Both take a string of one character and convert to a QChar
+(to call the C++ counterpart):
+
+* ``widthChar(string)``
+* ``boundingRectChar(string)``
+
+
+QTextStream
+~~~~~~~~~~~
+
+Inside this class some renames were applied to avoid clashes with native Python functions.
+They are: ``bin_()``, ``hex_()`` and ``oct_()``.
+The only modification was the addition of the '_' character.
+
+
+QVariant
+~~~~~~~~
+
+As ``QVariant`` was removed, any function expecting it can receive any Python object (``None`` is
+an invalid ``QVariant``).
+The same rule is valid when returning something: the returned ``QVariant`` will be converted to
+its original Python object type.
+
+When a method expects a ``QVariant::Type`` the programmer can use a string (the type name) or the
+type itself.
+
+
+qApp "macro"
+~~~~~~~~~~~~
+
+The C++ API of QtWidgets provides a macro called ``qApp`` that roughly expands to
+``QtWidgets::QApplication->instance()``.
+
+In PySide, we tried to create a macro-like experience.
+For that, the ``qApp`` variable was implemented as a normal variable
+that lives in the builtins.
+After importing ``PySide6``, you can immediately use ``qApp``.
+
+As a useful shortcut for the action "create an application if it was not created", we recommend::
+
+ qApp or QtWidgets.QApplication()
+
+or if you want to check if there is one, simply use the truth value::
+
+ if qApp:
+ # do something if an application was created
+ pass
+
+Comparing to ``None`` is also possible, but slightly over-specified.
+
+
+Testing support
++++++++++++++++
+
+For testing purposes, you can also get rid of the application by calling::
+
+ qApp.shutdown()
+
+As for 5.14.2, this is currently an experimental feature that is not fully tested.
+
+
+Embedding status
+++++++++++++++++
+
+In embedded mode, application objects that are pre-created in C++ don't have a Python wrapper.
+The ``qApp`` variable is created together with a wrapped application.
+Therefore, ``qApp`` does not exist in that embedded mode.
+Please note that you always can use ``QtWidgets.QApplication.instance()`` instead.
+
+
+Abandoned Alternative
++++++++++++++++++++++
+
+We also tried an alternative implementation with a ``qApp()`` function that was more *pythonic*
+and problem free, but many people liked the ``qApp`` macro better for its brevity, so here it is.
+
+
+Rich Comparison
+~~~~~~~~~~~~~~~
+
+There was a long-standing bug in the ``tp_richcompare`` implementation of PySide classes.
+
+* When a class did not implement it, the default implementation of ``object`` is used.
+ This implements ``==`` and ``!=`` like the ``is`` operator.
+
+* When a class implements only a single function like ``<``, then the default implementation
+ was disabled, and expressions like ``obj in sequence`` failed with ``NotImplemented``.
+
+This oversight was fixed in version 5.15.1 .
diff --git a/sources/pyside6/doc/contents.rst b/sources/pyside6/doc/contents.rst
new file mode 100644
index 000000000..6d0b25fb7
--- /dev/null
+++ b/sources/pyside6/doc/contents.rst
@@ -0,0 +1,23 @@
+|project| Documentation
+***************************
+
+.. toctree::
+ :maxdepth: 2
+
+ quickstart.rst
+ gettingstarted.rst
+ api.rst
+ tutorials/index.rst
+ examples/index.rst
+ videos.rst
+ deployment.rst
+ licenses.rst
+ modules.rst
+ considerations.rst
+ shiboken6/index.rst
+
+Module Index
+============
+
+* :ref:`modindex`
+
diff --git a/sources/pyside6/doc/deployment-briefcase.rst b/sources/pyside6/doc/deployment-briefcase.rst
new file mode 100644
index 000000000..4042f78bb
--- /dev/null
+++ b/sources/pyside6/doc/deployment-briefcase.rst
@@ -0,0 +1,199 @@
+|project| & Briefcase
+#######################
+
+`Briefcase <https://briefcase.readthedocs.io>`_ is a packaging tool that lets you create a standalone package for a Python application. It supports the following installer formats:
+
+ * .app application bundle for macOS
+ * MSI installer for Windows
+ * AppImage for Linux
+
+For more details, see the `official documentation <https://briefcase.readthedocs.io/en/latest/index.html>`_.
+
+Preparation
+===========
+
+Install `Briefcase` using the following **pip** command::
+
+ pip install briefcase
+
+You also need : docker on linux, `WixToolset`_ on windows,
+
+If you're using a virtual environment, remember to activate it before installing `Briefcase`.
+
+After installation, the `briefcase` binary is located in your virtual environment's `bin/`
+directory, or where your Python executable is located.
+
+You can either create a brand new project using the briefcase assistant or setup your own.
+
+.. _`WixToolset`: https://wixtoolset.org/
+
+Use Briefcase Assistant
+=======================
+
+Run the following command and answer the questions to get started::
+
+ briefcase new
+
+Ensure that `PySide6` is chosen as the `GUI toolkit choice`.
+Your PySide6 application is now configured. You can jump to `Build the package`_.
+
+
+Set up your project
+===================
+
+Create a pyproject.toml
+-----------------------
+
+At the root level of your project, create a `pyproject.toml` file::
+
+ [tool.briefcase]
+ project_name = "MyPySideApp"
+ bundle = "com.example"
+ version = "0.0.1"
+ url = "https://somwhere/on/the/net"
+ license = "GNU General Public License v3 (GPLv3)"
+ author = 'MyName Firstname'
+ author_email = "cool@mailexample.com"
+
+ [tool.briefcase.app.mypysideapp]
+ formal_name = "A Cool App"
+ description = "The coolest app ever"
+ icon = "src/mypysideapp/resources/appicon" # Briecase will choose the right extension depending the os (png,ico,...)
+ sources = ['src/mypysideapp']
+ requires = ['pyside6==5.15.0',
+ 'pony>=0.7.11,<0.8',
+ 'dickens==1.0.1',
+ 'Pillow==7.1.2',
+ 'mako==1.1.2',
+ 'beautifulsoup4']
+
+
+ [tool.briefcase.app.mypysideapp.macOS]
+ requires = []
+
+ [tool.briefcase.app.mypysideapp.linux]
+ requires = []
+ system_requires = []
+
+ [tool.briefcase.app.mypysideapp.windows]
+ requires = []
+
+
+Write some code
+----------------
+
+Let's say your project tree is like this::
+
+ pyproject.toml
+ setup.cfg
+ pytest.ini
+ src/
+
+ mypysideapp/
+ resources/
+ appicon.png
+ appicon.ico
+ __init__.py
+ __main__.py
+ app.py
+
+
+Content of `__main__.py`::
+
+ import sys
+ from PySide6.QtWidgets import QApplication
+ from mypysideapp.app import MyWidget
+
+ if __name__ == "__main__":
+ app = QApplication(sys.argv)
+
+ widget = MyWidget()
+ widget.resize(800, 600)
+ widget.show()
+
+ sys.exit(app.exec_())
+
+
+Content of `app.py`::
+
+ import random
+ from PySide6.QtWidgets import (QLabel, QPushButton,
+ QVBoxLayout, QWidget)
+ from PySide6.QtCore import Slot, Qt
+
+ class MyWidget(QWidget):
+ def __init__(self):
+ QWidget.__init__(self)
+
+ self.hello = ["Hallo Welt", "你好,世界", "Hei maailma",
+ "Hola Mundo", "Привет мир"]
+
+ self.button = QPushButton("Click me!")
+ self.text = QLabel("Hello World")
+ self.text.setAlignment(Qt.AlignCenter)
+
+ self.layout = QVBoxLayout()
+ self.layout.addWidget(self.text)
+ self.layout.addWidget(self.button)
+ self.setLayout(self.layout)
+
+ # Connecting the signal
+ self.button.clicked.connect(self.magic)
+
+ @Slot()
+ def magic(self):
+ self.text.setText(random.choice(self.hello))
+
+
+Build the package
+==================
+
+Initialize the package
+------------------------
+
+Just run::
+
+ briefcase create
+
+Run the following command to initialize the building the packages for Windows, Linux, and macOS.
+It creates a subdirectory each for the different platforms.
+This step takes longer as it adds the packages listed in `requires` sections in the `pyproject.toml` file.
+
+Build the application
+---------------------
+::
+
+ briefcase build
+
+You'll get::
+
+ macOS/A Cool App/A Cool App.app
+ or
+ linux/A Cool App-x86_64-0.0.1.AppImage
+ or
+ windows\A Cool App
+
+
+Run the application
+-------------------
+::
+
+ briefcase run
+
+.. note:: You can run your project in `dev` mode (your source code not packaged) with `briefcase dev`
+
+
+Build the installer (only Windows and macOS)
+---------------------------------------------
+
+macOS::
+
+ briefcase package --no-sign
+
+It's possible to sign, see the `documentation <https://briefcase.readthedocs.io/en/latest/how-to/code-signing/index.html>`_. You get `macOS/A Cool App-0.0.1.dmg`
+
+Windows::
+
+ briefcase package
+
+You get `windows\A_Cool_App-0.0.1.msi`
diff --git a/sources/pyside6/doc/deployment-cxfreeze.rst b/sources/pyside6/doc/deployment-cxfreeze.rst
new file mode 100644
index 000000000..371e48f49
--- /dev/null
+++ b/sources/pyside6/doc/deployment-cxfreeze.rst
@@ -0,0 +1,130 @@
+=====================
+|project| & cx_Freeze
+=====================
+
+`cx_Freeze <https://anthony-tuininga.github.io/cx_Freeze/>`_ lets you
+freeze your Python application into executables. The supported
+platforms are Linux, macOS, Windows, FreeBSD, among others.
+
+You can read the `official documentation <https://cx-freeze.readthedocs.io/en/latest/index.html>`_
+to clarify any further question, and remember to contribute to
+the project by `filing issues <https://sourceforge.net/projects/cx-freeze/>`_
+if you find any, or contributing to `their development <https://bitbucket.org/anthony_tuininga/cx_freeze/src>`_.
+
+Preparation
+===========
+
+Installing `cx_Freeze` can be done using **pip**::
+
+ pip install cx_freeze
+
+If you are using a virtual environment, remember to activate it before
+installing `cx_Freeze` into it.
+
+After the installation, you will have the `cxfreeze` binary to deploy
+your application.
+
+Freezing an application
+=======================
+
+There are three options to work with `cx_Freeze`:
+
+ 1. Using the `cxfreeze` script.
+ 2. Creating `setup.py` script to build the project.
+ 3. Using the module classes directly (for advanced purposes).
+
+The following sections cover the first two use cases.
+
+Creating an example
+-------------------
+
+Now, consider the following simple script, named `hello.py`::
+
+ import sys
+ import random
+ from PySide6.QtWidgets import (QApplication, QLabel, QPushButton,
+ QVBoxLayout, QWidget)
+ from PySide6.QtCore import Slot, Qt
+
+ class MyWidget(QWidget):
+ def __init__(self):
+ QWidget.__init__(self)
+
+ self.hello = ["Hallo Welt", "你好,世界", "Hei maailma",
+ "Hola Mundo", "Привет мир"]
+
+ self.button = QPushButton("Click me!")
+ self.text = QLabel("Hello World")
+ self.text.setAlignment(Qt.AlignCenter)
+
+ self.layout = QVBoxLayout()
+ self.layout.addWidget(self.text)
+ self.layout.addWidget(self.button)
+ self.setLayout(self.layout)
+
+ # Connecting the signal
+ self.button.clicked.connect(self.magic)
+
+ @Slot()
+ def magic(self):
+ self.text.setText(random.choice(self.hello))
+
+ if __name__ == "__main__":
+ app = QApplication(sys.argv)
+
+ widget = MyWidget()
+ widget.resize(800, 600)
+ widget.show()
+
+ sys.exit(app.exec_())
+
+
+Using `cxfreeze` executable
+---------------------------
+
+Now that we have an application, try freezing it with the following
+command::
+
+ cxfreeze hello.py
+
+This command creates a `dist/` directory containing the executable.
+and a `lib/` directory containing all the shared libraries.
+
+To launch the application, go to the `dist/` directory and execute
+the file::
+
+ cd dist/
+ ./main
+
+
+Using a setuptools script
+-------------------------
+
+For this process, you need an additional script called `setup.py`::
+
+ import sys
+ from cx_Freeze import setup, Executable
+
+ setup(name = "MyApp",
+ version = "0.1",
+ description = "My GUI App",
+ executables = [Executable("hello.py")])
+
+Now, build the project using it::
+
+ python setup.py build
+
+This step creates a `build/` directory with the following structure::
+
+ build
+ └── exe.linux-x86_64-3.7
+ └── lib
+ └── main
+
+The first directory inside `build/` depends on the platform
+you are using, in this case a `x86_64` Linux using Python 3.7.
+The structure is the same as previously described, and you can simply
+enter the directory and execute the file::
+
+ cd build/exe.linux-x86_64-3.7
+ ./main
diff --git a/sources/pyside6/doc/deployment-fbs.rst b/sources/pyside6/doc/deployment-fbs.rst
new file mode 100644
index 000000000..27f4850b3
--- /dev/null
+++ b/sources/pyside6/doc/deployment-fbs.rst
@@ -0,0 +1,97 @@
+|project| & fbs
+####################
+
+`fbs`_ provides a powerful environment for packaging, creating installers, and signing your
+application. It also lets you manage updates to your application. Since `fbs` is based on
+PyInstaller, it supports Linux, macOS, and Windows.
+
+For more details, see the `fbs tutorial`_ and the `fbs manual`_.
+
+.. _fbs: https://build-system.fman.io/
+.. _fbs tutorial: https://github.com/mherrmann/fbs-tutorial
+.. _fbs manual: https://build-system.fman.io/manual/
+
+Preparation
+===========
+
+Installing `fbs`_ (>= 0.7.6) is done via **pip**::
+
+ pip install fbs
+
+If you're using a virtual environment, remember to activate it before installing `fbs`_.
+
+After the installation, you can use the `fbs`_ executable.
+
+Starting a new project
+======================
+
+`fbs`_ provides useful features for you to create a base project structure with the following
+command::
+
+ fbs startproject
+
+This command prompts you to answer a few questions to configure the details of your project, like:
+
+ * Application name
+ * Author name
+ * Qt bindings (PySide6 or PyQt5)
+ * Bundle indentified (for macOS)
+
+Afterwards, you have a `src/` directory that contains the following structure::
+
+ └── src
+ ├── build
+ │ └── settings
+ └── main
+ ├── icons
+ │ ├── base
+ │ ├── linux
+ │ └── mac
+ └── python
+
+Inside the `settings` directory, there are a few JSON files that can be edited to include more
+information about your project.
+
+The `main` file is in the `python` directory, and its default content is::
+
+ from fbs_runtime.application_context import ApplicationContext
+ from PySide6.QtWidgets import QMainWindow
+
+ import sys
+
+ if __name__ == '__main__':
+ appctxt = ApplicationContext() # 1. Instantiate ApplicationContext
+ window = QMainWindow()
+ window.resize(250, 150)
+ window.show()
+ exit_code = appctxt.app.exec_() # 2. Invoke appctxt.app.exec_()
+ sys.exit(exit_code)
+
+This example shows an empty `QMainWindow`. You can run it using the following command::
+
+ fbs run
+
+Freezing the application
+========================
+
+Once you've verified that the application is working properly, you can continue with the freezing
+process using the following command::
+
+ fbs freeze
+
+After the process completes, you see a message stating the location of your executable. For
+example::
+
+ Done. You can now run `target/MyApp/MyApp`. If that doesn't work, see
+ https://build-system.fman.io/troubleshooting.
+
+
+Now, you can try to run the application. The result is the same window as the one you saw with the
+`fbs run` command::
+
+ cd target/MyApp/
+ ./MyApp
+
+.. note:: This is the case for Linux. For other platforms like macOS, you need to enter the
+ directory: `target/MyApp.app/Contents/macOS`. For Windows, you need to find the `MyApp.exe`
+ executable.
diff --git a/sources/pyside6/doc/deployment-pyinstaller.rst b/sources/pyside6/doc/deployment-pyinstaller.rst
new file mode 100644
index 000000000..5771f0bec
--- /dev/null
+++ b/sources/pyside6/doc/deployment-pyinstaller.rst
@@ -0,0 +1,145 @@
+|project| & PyInstaller
+#######################
+
+`PyInstaller <https://www.pyinstaller.org/>`_ lets you freeze your python application into a
+stand-alone executable. This installer supports Linux, macOS, Windows, and more; and is also
+compatible with 3rd-party Python modules, such as |pymodname|.
+
+For more details, see the `official documentation <https://www.pyinstaller.org/documentation.html>`_.
+
+Preparation
+===========
+
+Install the `PyInstaller` via **pip** with the following command::
+
+ pip install pyinstaller
+
+If you're using a virtual environment, remember to activate it before installing `PyInstaller`.
+
+After installation, the `pyinstaller` binary is located in your virtual environment's `bin/`
+directory, or where your Python executable is located. If that directory isn't in your `PATH`,
+include the whole path when you run `pyinstaller`.
+
+.. warning:: If you already have a PySide6 or Shiboken6 version installed in your
+ system path, PyInstaller uses them instead of your virtual environment version.
+
+Freeze an application
+=======================
+
+`PyInstaller` has many options that you can use. To list them all, run `pyinstaller -h`.
+
+There are two main features:
+
+ * the option to package the whole project (including shared libraries) into one executable file
+ (`--onefile`)
+ * the option to place it in a directory containing the libraries
+
+Additionally, on Windows when the command is running, you can open a console with the `-c` option
+(or `--console` or `--nowindowed` equivalent).
+
+Otherwise, you can specify to not open such a console window on macOS and Windows with the `-w`
+option (or `--windowed` or `--noconsole` equivalent).
+
+Create an example
+-----------------
+
+Now, consider the following script, named `hello.py`::
+
+ import sys
+ import random
+ from PySide6.QtWidgets import (QApplication, QLabel, QPushButton,
+ QVBoxLayout, QWidget)
+ from PySide6.QtCore import Slot, Qt
+
+ class MyWidget(QWidget):
+ def __init__(self):
+ QWidget.__init__(self)
+
+ self.hello = ["Hallo Welt", "你好,世界", "Hei maailma",
+ "Hola Mundo", "Привет мир"]
+
+ self.button = QPushButton("Click me!")
+ self.text = QLabel("Hello World")
+ self.text.setAlignment(Qt.AlignCenter)
+
+ self.layout = QVBoxLayout()
+ self.layout.addWidget(self.text)
+ self.layout.addWidget(self.button)
+ self.setLayout(self.layout)
+
+ # Connecting the signal
+ self.button.clicked.connect(self.magic)
+
+ @Slot()
+ def magic(self):
+ self.text.setText(random.choice(self.hello))
+
+ if __name__ == "__main__":
+ app = QApplication(sys.argv)
+
+ widget = MyWidget()
+ widget.resize(800, 600)
+ widget.show()
+
+ sys.exit(app.exec_())
+
+
+Since it has a UI, you use the `--windowed` option.
+
+The command line to proceed looks like this::
+
+ pyinstaller --name="MyApplication" --windowed hello.py
+
+This process creates two directories: `dist/` and `build/`. The application executable and the
+required shared libraries are placed in `dist/MyApplication`.
+
+To run the application, go to `dist/MyApplication` and run the program::
+
+ cd dist/MyApplication/
+ ./MyApplication
+
+.. note:: The directory inside `dist/` and the executable have the same name.
+
+Use the `--onefile` option if you prefer to have everything bundled into one executable, without
+the shared libraries next to it::
+
+ pyinstaller --name="MyApplication" --windowed --onefile hello.py
+
+This process takes a bit longer, but in the end you have one executable in the `dist/` directory::
+
+ cd dist/
+ ./MyApplication
+
+
+Some Caveats
+============
+
+
+PyInstaller Issue
+-----------------
+
+As mentioned before, if available, `PyInstaller` picks a system installation of PySide6 or
+Shiboken6 instead of your `virtualenv` version without notice. This is negligible if those
+two versions are the same.
+
+If you're working with different versions, this can result in frustrating debugging sessions
+when you think you are testing the latest version, but `PyInstaller` is working with an older
+version.
+
+
+Safety Instructions
+-------------------
+
+- When using `PyInstaller` with `virtualenv`, make sure that there is no system
+ installation of PySide6 or shiboken6.
+
+- Before compiling, use `pip -uninstall pyside6 shiboken6 -y` multiple times, until
+ none of the programs are found anymore.
+
+- Pip is usually a good tool. But to be 100 % sure, you should directly remove
+ the PySide6 and shiboken6 folders from site-packages.
+
+- Be sure to use the right version of pip. The safest way to really run the right
+ pip, is to use the Python that you mean: Instead of the pip command, better use::
+
+ <path/to/your/>python -m pip
diff --git a/sources/pyside6/doc/deployment.rst b/sources/pyside6/doc/deployment.rst
new file mode 100644
index 000000000..3d6aa218e
--- /dev/null
+++ b/sources/pyside6/doc/deployment.rst
@@ -0,0 +1,120 @@
+|project| Deployment
+====================
+
+
+Deploying or freezing an application is an important part of a Python project,
+this means to bundle all required resources so that the application finds everything it needs to
+be able to run on a client's machine.
+However, because most large projects aren't based on a single Python file, distributing these
+applications can be a challenge.
+
+Here are a few distribution options that you can use:
+ 1. Send a normal ZIP file with the application's content.
+ 2. Build a proper `Python package (wheel) <https://packaging.python.org/>`_.
+ 3. Freeze the application into a single binary file or directory.
+ 4. Provide native installer (msi, dmg)
+
+If you choose Option 3, consider using one of these tools:
+ * `fbs`_
+ * `PyInstaller`_
+ * `cx_Freeze`_
+ * `py2exe`_
+ * `py2app`_
+ * `briefcase`_
+
+.. _fbs: https://build-system.fman.io/
+.. _PyInstaller: https://www.pyinstaller.org/
+.. _cx_Freeze: https://anthony-tuininga.github.io/cx_Freeze/
+.. _py2exe: http://www.py2exe.org/
+.. _py2app: https://py2app.readthedocs.io/en/latest/
+.. _briefcase: https://briefcase.readthedocs.io
+
+Since |project| is a cross-platform framework, we focus on solutions for the three major
+platforms that Qt supports: Windows, Linux, and macOS.
+
+The following table summarizes the platform support for those packaging tools:
+
+.. raw:: html
+
+ <table class="docutils align-default">
+ <thead>
+ <tr>
+ <th class="head">Name</th>
+ <th class="head">License</th>
+ <th class="head">Linux</th>
+ <th class="head">macOS</th>
+ <th class="head">Windows</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td><p>fbs</p></td>
+ <td><p>GPL</p></td>
+ <td><p style="color: green;">yes</p></td>
+ <td><p style="color: green;">yes</p></td>
+ <td><p style="color: green;">yes</p></td>
+ </tr>
+ <tr>
+ <td><p>PyInstaller</p></td>
+ <td><p>GPL</p></td>
+ <td><p style="color: green;">yes</p></td>
+ <td><p style="color: green;">yes</p></td>
+ <td><p style="color: green;">yes</p></td>
+ </tr>
+ <tr>
+ <td><p>cx_Freeze</p></td>
+ <td><p>MIT</p></td>
+ <td><p style="color: green;">yes</p></td>
+ <td><p style="color: green;">yes</p></td>
+ <td><p style="color: green;">yes</p></td>
+ </tr>
+ <tr>
+ <td><p>py2exe</p></td>
+ <td><p>MIT</p></td>
+ <td><p style="color: red;">no</p></td>
+ <td><p style="color: red;">no</p></td>
+ <td><p style="color: green;">yes</p></td>
+ </tr>
+ <tr>
+ <td><p>py2app</p></td>
+ <td><p>MIT</p></td>
+ <td><p style="color: red;">no</p></td>
+ <td><p style="color: green;">yes</p></td>
+ <td><p style="color: red;">no</p></td>
+ </tr>
+ <tr>
+ <td><p>briefcase</p></td>
+ <td><p>BSD3</p></td>
+ <td><p style="color: green;">yes</p></td>
+ <td><p style="color: green;">yes</p></td>
+ <td><p style="color: green;">yes</p></td>
+ </tr>
+ </tbody>
+ </table>
+
+Notice that only *fbs*, *cx_Freeze*, *briefcase*, and *PyInstaller* meet our cross-platform requirement.
+
+Since these are command-line tools, you'll need special hooks or scripts to handle resources
+such as images, icons, and meta-information, before adding them to your package. Additionally,
+these tools don't offer a mechanism to update your application packages.
+
+To create update packages, use the `PyUpdater <https://www.pyupdater.org/>`_, which is a tool
+built around PyInstaller.
+
+The `fbs`_ tool offers a nice UI for the user to install the
+application step-by-step.
+
+.. note::
+
+ Deployment is supported only from Qt for Python 5.12.2 and later.
+
+Here's a set of tutorials on how to use these tools:
+
+.. toctree::
+ :name: mastertoc
+ :maxdepth: 2
+
+ deployment-fbs.rst
+ deployment-pyinstaller.rst
+ deployment-cxfreeze.rst
+ deployment-briefcase.rst
diff --git a/sources/pyside6/doc/examples/images/tabbedbrowser.png b/sources/pyside6/doc/examples/images/tabbedbrowser.png
new file mode 100644
index 000000000..27c3daa09
--- /dev/null
+++ b/sources/pyside6/doc/examples/images/tabbedbrowser.png
Binary files differ
diff --git a/sources/pyside6/doc/examples/index.rst b/sources/pyside6/doc/examples/index.rst
new file mode 100644
index 000000000..069d54404
--- /dev/null
+++ b/sources/pyside6/doc/examples/index.rst
@@ -0,0 +1,14 @@
+|project| Examples
+===================
+
+A collection of examples are provided with |project| to help new users
+to understand different use cases of the module.
+You can find all the examples inside the ``pyside-setup`` on the ``examples``
+directory, or you can access them after installing |pymodname| from ``pip``
+inside the ``site-packages/PySide6/examples`` directory.
+
+.. toctree::
+ :maxdepth: 1
+
+ tabbedbrowser.rst
+ ../pyside-examples/all-pyside-examples.rst
diff --git a/sources/pyside6/doc/examples/tabbedbrowser.rst b/sources/pyside6/doc/examples/tabbedbrowser.rst
new file mode 100644
index 000000000..c34c50647
--- /dev/null
+++ b/sources/pyside6/doc/examples/tabbedbrowser.rst
@@ -0,0 +1,58 @@
+**********************
+Web Browser Example
+**********************
+
+The example demonstrates the power and simplicity offered by |project| to developers.
+It uses several |pymodname| submodules to offer a fluid and modern-looking UI that
+is apt for a web browser. The application offers the following features:
+
+ * Tab-based browsing experience using QTabWidget.
+ * Download manager using a QProgressBar and QWebEngineDownloadItem.
+ * Bookmark manager using QTreeView.
+
+.. image:: images/tabbedbrowser.png
+
+The application's code is organized in several parts for ease of maintenance. For example,
+:code:`DownloadWidget` provides a widget to track progress of a download item. In the following
+sections, these different parts are discussed briefly to help you understand the Python code behind
+them a little better.
+
+BookmarkWidget or :code:`bookmarkwidget.py`
+===========================================
+
+This widget docks to the left of the main window by default. It inherits QTreeView and
+loads a default set of bookmarks using a QStandardItemModel. The model is populated at startup
+from a JSON file, which is updated when you add or remove bookmarks from the tree view.
+
+.. automodule:: bookmarkwidget
+ :members:
+
+DownloadWidget or :code:`downloadwidget.py`
+=============================================
+
+The widget tracks progress of the download item. It inherits QProgressBar to display
+progress of the QWebEngineDownloadItem instance, and offers a context-menu with actions such as Launch,
+Show in folder, Cancel, and Remove.
+
+.. automodule:: downloadwidget
+ :members:
+
+BrowserTabWidget or :code:`browsertabwidget.py`
+===============================================
+
+The widget includes a QWebEngineView to enable viewing web content. It docks to the right
+of BookmarkWidget in the main window.
+
+.. automodule:: browsertabwidget
+ :members:
+
+MainWindow or :code:`main.py`
+=============================
+
+This is the parent window that collates all the other widgets together to offer the complete package.
+
+.. automodule:: main
+ :members:
+
+
+Try running the example to explore it further.
diff --git a/sources/pyside6/doc/extras/QtCore.ClassInfo.rst b/sources/pyside6/doc/extras/QtCore.ClassInfo.rst
new file mode 100644
index 000000000..b767ae153
--- /dev/null
+++ b/sources/pyside6/doc/extras/QtCore.ClassInfo.rst
@@ -0,0 +1,23 @@
+.. currentmodule:: PySide6.QtCore
+.. _ClassInfo:
+
+ClassInfo
+*********
+
+This class is used to associates extra information to the class, which is available
+using QObject.metaObject(). Qt and PySide doesn't use this information.
+
+The extra information takes the form of a dictionary with key and value in a literal string.
+
+.. note:: This Class is a implementation of Q_CLASSINFO macro.
+
+
+Example
+-------
+
+::
+
+ @ClassInfo(Author='PySide Team', URL='http://www.pyside.org')
+ class MyObject(QObject):
+ ...
+
diff --git a/sources/pyside6/doc/extras/QtCore.Property.rst b/sources/pyside6/doc/extras/QtCore.Property.rst
new file mode 100644
index 000000000..c6b2bf32e
--- /dev/null
+++ b/sources/pyside6/doc/extras/QtCore.Property.rst
@@ -0,0 +1,62 @@
+.. currentmodule:: PySide6.QtCore
+.. _Property:
+Property
+********
+
+Detailed Description
+--------------------
+
+The Property function lets you declare properties that
+behave both as Qt and Python properties, and have their
+setters and getters defined as Python functions.
+
+Here is an example that illustrates how to use this
+function:
+
+.. code-block::
+ :linenos:
+
+ from PySide6.QtCore import QObject, Property
+
+ class MyObject(QObject):
+ def __init__(self,startval=42):
+ QObject.__init__(self)
+ self.ppval = startval
+
+ def readPP(self):
+ return self.ppval
+
+ def setPP(self,val):
+ self.ppval = val
+
+ pp = Property(int, readPP, setPP)
+
+ obj = MyObject()
+ obj.pp = 47
+ print(obj.pp)
+
+Properties in QML expressions
+-----------------------------
+
+If you are using properties of your objects in QML expressions,
+QML requires that the property changes are notified. Here is an
+example illustrating how to do this:
+
+.. code-block::
+ :linenos:
+
+ from PySide6.QtCore import QObject, Signal, Property
+
+ class Person(QObject):
+ def __init__(self, name):
+ QObject.__init__(self)
+ self._person_name = name
+
+ def _name(self):
+ return self._person_name
+
+ @Signal
+ def name_changed(self):
+ pass
+
+ name = Property(str, _name, notify=name_changed)
diff --git a/sources/pyside6/doc/extras/QtCore.QEnum.rst b/sources/pyside6/doc/extras/QtCore.QEnum.rst
new file mode 100644
index 000000000..d33134264
--- /dev/null
+++ b/sources/pyside6/doc/extras/QtCore.QEnum.rst
@@ -0,0 +1,92 @@
+.. currentmodule:: PySide6.QtCore
+.. _QEnum:
+
+QEnum/QFlag
+***********
+
+This class decorator is equivalent to the `Q_ENUM` macro from Qt.
+The decorator is used to register an Enum to the meta-object system,
+which is available via `QObject.staticMetaObject`.
+The enumerator must be in a QObject derived class to be registered.
+
+
+Example
+-------
+
+::
+
+ from enum import Enum, Flag, auto
+
+ from PySide6.QtCore import QEnum, QFlag, QObject
+
+ class Demo(QObject):
+
+ @QEnum
+ class Orientation(Enum):
+ North, East, South, West = range(4)
+
+ class Color(Flag):
+ RED = auto()
+ BLUE = auto()
+ GREEN = auto()
+ WHITE = RED | BLUE | GREEN
+
+ QFlag(Color) # identical to @QFlag usage
+
+
+Caution:
+--------
+
+QEnum registers a Python Enum derived class.
+QFlag treats a variation of the Python Enum, the Flag class.
+
+Please do not confuse that with the Qt QFlags concept. Python does
+not use that concept, it has its own class hierarchy, instead.
+For more details, see the `Python enum documentation <https://docs.python.org/3/library/enum.html>`_.
+
+
+Details about Qt Flags:
+-----------------------
+
+There are some small differences between Qt flags and Python flags.
+In Qt, we have for instance these declarations:
+
+::
+
+ enum QtGui::RenderHint { Antialiasing, TextAntialiasing, SmoothPixmapTransform,
+ HighQualityAntialiasing, NonCosmeticDefaultPen }
+ flags QtGui::RenderHints
+
+The equivalent Python notation would look like this:
+
+::
+
+ @QFlag
+ class RenderHints(enum.Flag)
+ Antialiasing = auto()
+ TextAntialiasing = auto()
+ SmoothPixmapTransform = auto()
+ HighQualityAntialiasing = auto()
+ NonCosmeticDefaultPen = auto()
+
+
+As another example, the Qt::AlignmentFlag flag has 'AlignmentFlag' as the enum
+name, but 'Alignment' as the type name. Non flag enums have the same type and
+enum names.
+
+::
+
+ enum Qt::AlignmentFlag
+ flags Qt::Alignment
+
+The Python way to specify this would be
+
+::
+
+ @QFlag
+ class Alignment(enum.Flag):
+ ...
+
+We are considering to map all builtin enums and flags to Python enums as well
+in a later release.
+
diff --git a/sources/pyside6/doc/extras/QtCore.Signal.rst b/sources/pyside6/doc/extras/QtCore.Signal.rst
new file mode 100644
index 000000000..60c611482
--- /dev/null
+++ b/sources/pyside6/doc/extras/QtCore.Signal.rst
@@ -0,0 +1,39 @@
+.. currentmodule:: PySide6.QtCore
+.. _Signal:
+
+Signal
+******
+
+Synopsis
+--------
+
+Functions
+^^^^^^^^^
+
++---------------------------------------------------------------------------------------------+
+|def :meth:`connect<Signal.connect>` (receiver) |
++---------------------------------------------------------------------------------------------+
+|def :meth:`disconnect<Signal.disconnect>` (receiver) |
++---------------------------------------------------------------------------------------------+
+|def :meth:`emit<Signal.disconnect>` (\*args) |
++---------------------------------------------------------------------------------------------+
+
+Detailed Description
+--------------------
+
+ The :class:`~.Signal` class provides a way to declare and connect Qt signals in a pythonic way.
+
+ PySide adopt PyQt's new signal and slot syntax as-is. The PySide implementation is functionally compatible with the PyQt 4.5 one, with the exceptions listed bellow.
+
+.. method:: Signal.connect(receiver[, type=Qt.AutoConnection])
+
+ Create a connection between this signal and a `receiver`, the `receiver` can be a Python callable, a :class:`Slot` or a :class:`Signal`.
+
+.. method:: Signal.disconnect(receiver)
+
+ Disconnect this signal from a `receiver`, the `receiver` can be a Python callable, a :class:`Slot` or a :class:`Signal`.
+
+.. method:: Signal.emit(*args)
+
+ `args` is the arguments to pass to any connected slots, if any.
+
diff --git a/sources/pyside6/doc/extras/QtCore.Slot.rst b/sources/pyside6/doc/extras/QtCore.Slot.rst
new file mode 100644
index 000000000..99e00b5ca
--- /dev/null
+++ b/sources/pyside6/doc/extras/QtCore.Slot.rst
@@ -0,0 +1,39 @@
+.. currentmodule:: PySide6.QtCore
+.. _Slot:
+
+Slot
+****
+
+Detailed Description
+--------------------
+
+ PySide6 adopt PyQt5's new signal and slot syntax as-is. The PySide6
+ implementation is functionally compatible with the PyQt5 one, with the
+ exceptions listed below.
+
+ PyQt5's new signal and slot style utilizes method and decorator names
+ specific to their implementation. These will be generalized according to
+ the table below:
+
+ ======= ======================= =============
+ Module PyQt5 factory function PySide6 class
+ ======= ======================= =============
+ QtCore pyqtSignal Signal
+ QtCore pyqtSlot Slot
+ ======= ======================= =============
+
+Q_INVOKABLE
+-----------
+
+ There is no equivalent of the Q_INVOKABLE macro of Qt
+ since PySide6 slots can actually have return values.
+ If you need to create a invokable method that returns some value,
+ declare it as a slot, e.g.:
+
+ ::
+
+ class Foo(QObject):
+
+ @Slot(float, result=int)
+ def getFloatReturnInt(self, f):
+ return int(f)
diff --git a/sources/pyside6/doc/extras/QtCore.rst b/sources/pyside6/doc/extras/QtCore.rst
new file mode 100644
index 000000000..694fb84e9
--- /dev/null
+++ b/sources/pyside6/doc/extras/QtCore.rst
@@ -0,0 +1,5 @@
+All other Qt modules rely on this module. To include the definitions of the module's classes, use the following directive:
+
+::
+
+ import PySide6.QtCore
diff --git a/sources/pyside6/doc/extras/QtGui.rst b/sources/pyside6/doc/extras/QtGui.rst
new file mode 100644
index 000000000..d55212bdf
--- /dev/null
+++ b/sources/pyside6/doc/extras/QtGui.rst
@@ -0,0 +1,7 @@
+To include the definitions of modules classes, use the following directive:
+
+::
+
+ import PySide6.QtGui
+
+.. seealso:: :mod:`PySide6.QtCore`
diff --git a/sources/pyside6/doc/extras/QtHelp.rst b/sources/pyside6/doc/extras/QtHelp.rst
new file mode 100644
index 000000000..845d1f968
--- /dev/null
+++ b/sources/pyside6/doc/extras/QtHelp.rst
@@ -0,0 +1,5 @@
+To include the definitions of the module's classes, use the following directive:
+
+::
+
+ import PySide6.QtHelp
diff --git a/sources/pyside6/doc/extras/QtMultimedia.rst b/sources/pyside6/doc/extras/QtMultimedia.rst
new file mode 100644
index 000000000..9b6b702ce
--- /dev/null
+++ b/sources/pyside6/doc/extras/QtMultimedia.rst
@@ -0,0 +1,7 @@
+To include the definitions of the module's classes, use the following directive:
+
+::
+
+ import PySide6.QtMultimedia
+
+
diff --git a/sources/pyside6/doc/extras/QtNetwork.rst b/sources/pyside6/doc/extras/QtNetwork.rst
new file mode 100644
index 000000000..070ab77f7
--- /dev/null
+++ b/sources/pyside6/doc/extras/QtNetwork.rst
@@ -0,0 +1,5 @@
+To include the definitions of the module's classes, use the following directive:
+
+::
+
+ import PySide6.QtNetwork
diff --git a/sources/pyside6/doc/extras/QtOpenGL.rst b/sources/pyside6/doc/extras/QtOpenGL.rst
new file mode 100644
index 000000000..9979f9f03
--- /dev/null
+++ b/sources/pyside6/doc/extras/QtOpenGL.rst
@@ -0,0 +1,14 @@
+OpenGL is a standard API for rendering 3D graphics. OpenGL only deals with 3D rendering and provides little or no support for GUI programming issues. The user interface for an OpenGL application must be created with another toolkit, such as Motif on the X platform, Microsoft Foundation Classes (MFC) under Windows, or Qt on both platforms.
+
+.. note:: OpenGL is a trademark of Silicon Graphics, Inc. in the United States and other countries.
+
+The Qt OpenGL module makes it easy to use OpenGL in Qt applications. It provides an OpenGL widget class that can be used just like any other Qt widget, except that it opens an OpenGL display buffer where you can use the OpenGL API to render the contents.
+To include the definitions of the module's classes, use the following directive:
+
+::
+
+ import PySide6.QtOpenGL
+
+The Qt OpenGL module is implemented as a platform-independent wrapper around the platform-dependent GLX (version 1.3 or later), WGL, or AGL C APIs. Although the basic functionality provided is very similar to Mark Kilgard's GLUT library, applications using the Qt OpenGL module can take advantage of the whole Qt API for non-OpenGL-specific GUI functionality.
+
+The QtOpenGL module is available on Windows, X11 and Mac OS X. Qt for Embedded Linux and OpenGL supports OpenGL ES (OpenGL for Embedded Systems). \ No newline at end of file
diff --git a/sources/pyside6/doc/extras/QtQml.QmlElement.rst b/sources/pyside6/doc/extras/QtQml.QmlElement.rst
new file mode 100644
index 000000000..b567bb3cc
--- /dev/null
+++ b/sources/pyside6/doc/extras/QtQml.QmlElement.rst
@@ -0,0 +1,28 @@
+.. currentmodule:: PySide6.QtQml
+.. _QmlElement:
+
+QmlElement
+**********
+
+.. py:decorator:: QmlElement
+
+ This decorator registers a class it is attached to for use in QML, using
+ global variables to specify the import name and version.
+
+ ::
+ QML_IMPORT_NAME = "com.library.name"
+ QML_IMPORT_MAJOR_VERSION = 1
+ QML_IMPORT_MINOR_VERSION = 0 # Optional
+
+ @QmlElement
+ class ClassForQml(QObject):
+ # ...
+
+ Afterwards the class may be used in QML:
+
+ ::
+ import com.library.name 1.0
+
+ ClassForQml {
+ // ...
+ }
diff --git a/sources/pyside6/doc/extras/QtQml.qmlRegisterSingletonType.rst b/sources/pyside6/doc/extras/QtQml.qmlRegisterSingletonType.rst
new file mode 100644
index 000000000..83102bf86
--- /dev/null
+++ b/sources/pyside6/doc/extras/QtQml.qmlRegisterSingletonType.rst
@@ -0,0 +1,44 @@
+.. currentmodule:: PySide6.QtQml
+.. _qmlRegisterSingletonType:
+
+qmlRegisterSingletonType
+************************
+
+.. py:function:: qmlRegisterSingletonType(pytype: type, uri: str, versionMajor: int, versionMinor: int, typeName: str) -> int
+
+ :param type pytype: Python class
+ :param str uri: uri to use while importing the component in QML
+ :param int versionMajor: major version
+ :param int versionMinor: minor version
+ :param str typeName: name exposed to QML
+ :return: int (the QML type id)
+
+ This function registers a Python type as a singleton in the QML system.
+
+.. py:function:: qmlRegisterSingletonType(pytype: type, uri: str, versionMajor: int, versionMinor: int, typeName: str, callback: object) -> int
+
+ :param type pytype: Python class
+ :param str uri: uri to use while importing the component in QML
+ :param int versionMajor: major version
+ :param int versionMinor: minor version
+ :param str typeName: name exposed to QML
+ :param object callback: Python callable (to handle Python type)
+ :return: int (the QML type id)
+
+ This function registers a Python type as a singleton in the QML system using
+ the provided callback (which gets a QQmlEngine as a parameter) to generate
+ the singleton.
+
+
+.. py:function:: qmlRegisterSingletonType(uri: str, versionMajor: int, versionMinor: int, typeName: str, callback: object) -> int
+
+ :param str uri: uri to use while importing the component in QML
+ :param int versionMajor: major version
+ :param int versionMinor: minor version
+ :param str typeName: name exposed to QML
+ :param object callback: Python callable (to handle QJSValue)
+ :return: int (the QML type id)
+
+ This function registers a QJSValue as a singleton in the QML system using
+ the provided callback (which gets a QQmlEngine as a parameter) to
+ generate the singleton.
diff --git a/sources/pyside6/doc/extras/QtQml.qmlRegisterType.rst b/sources/pyside6/doc/extras/QtQml.qmlRegisterType.rst
new file mode 100644
index 000000000..079e15bf1
--- /dev/null
+++ b/sources/pyside6/doc/extras/QtQml.qmlRegisterType.rst
@@ -0,0 +1,41 @@
+.. currentmodule:: PySide6.QtQml
+.. _qmlRegisterType:
+
+qmlRegisterType
+***************
+
+.. py:function:: qmlRegisterType(pytype: type, uri: str, versionMajor: int, versionMinor: int, qmlName: str) -> int
+
+ :param type pytype: Python class
+ :param str uri: uri to use while importing the component in QML
+ :param int versionMajor: major version
+ :param int versionMinor: minor version
+ :param str qmlName: name exposed to QML
+ :return: int (the QML type id)
+
+ This function registers the Python *type* in the QML system with the
+ name *qmlName*, in the library imported from *uri* having the
+ version number composed from *versionMajor* and *versionMinor*.
+
+ For example, this registers a Python class 'MySliderItem' as a QML
+ type named 'Slider' for version '1.0' of a module called
+ 'com.mycompany.qmlcomponents':
+
+ ::
+
+ qmlRegisterType(MySliderItem, "com.mycompany.qmlcomponents", 1, 0, "Slider")
+
+ Once this is registered, the type can be used in QML by importing
+ the specified module name and version number:
+
+ ::
+
+ import com.mycompany.qmlcomponents 1.0
+
+ Slider { ... }
+
+ Note that it's perfectly reasonable for a library to register types
+ to older versions than the actual version of the library.
+ Indeed, it is normal for the new library to allow QML written to
+ previous versions to continue to work, even if more advanced
+ versions of some of its types are available.
diff --git a/sources/pyside6/doc/extras/QtQml.qmlRegisterUncreatableType.rst b/sources/pyside6/doc/extras/QtQml.qmlRegisterUncreatableType.rst
new file mode 100644
index 000000000..2f34cd987
--- /dev/null
+++ b/sources/pyside6/doc/extras/QtQml.qmlRegisterUncreatableType.rst
@@ -0,0 +1,36 @@
+.. currentmodule:: PySide6.QtQml
+.. _qmlRegisterUncreatableType:
+
+
+qmlRegisterUncreatableType
+**************************
+
+
+.. py:function:: qmlRegisterUncreatableType(pytype: type, uri: str, versionMajor: int, versionMinor: int, qmlName: str, noCreationReason: str) -> int
+
+
+ :param type pytype: Python class
+ :param str uri: uri to use while importing the component in QML
+ :param int versionMajor: major version
+ :param int versionMinor: minor version
+ :param str qmlName: name exposed to QML
+ :param str noCreationReason: Error message shown when trying to create the QML type
+ :return: int (the QML type id)
+
+ This function registers the Python *type* in the QML system as an uncreatable type with the
+ name *qmlName*, in the library imported from *uri* having the
+ version number composed from *versionMajor* and *versionMinor*,
+ showing *noCreationReason* as an error message when creating the type is attempted.
+
+ For example, this registers a Python class 'MySliderItem' as a QML
+ type named 'Slider' for version '1.0' of a module called
+ 'com.mycompany.qmlcomponents':
+
+ ::
+ qmlRegisterUncreatableType(MySliderItem, "com.mycompany.qmlcomponents", 1, 0, "Slider", "Slider cannot be created.")
+
+ Note that it's perfectly reasonable for a library to register types
+ to older versions than the actual version of the library.
+ Indeed, it is normal for the new library to allow QML written to
+ previous versions to continue to work, even if more advanced
+ versions of some of its types are available.
diff --git a/sources/pyside6/doc/extras/QtScript.rst b/sources/pyside6/doc/extras/QtScript.rst
new file mode 100644
index 000000000..1d2a1bd04
--- /dev/null
+++ b/sources/pyside6/doc/extras/QtScript.rst
@@ -0,0 +1,21 @@
+The QtScript module only provides core scripting facilities; the QtScriptTools module provides additional Qt Script-related components that application developers may find useful.
+
+To include the definitions of the module's classes, use the following directive:
+
+::
+
+ import PySide6.QtScript
+
+License Information
+-------------------
+
+Qt Commercial Edition licensees that wish to distribute applications that use the QtScript module need to be aware of their obligations under the GNU Library General Public License (LGPL).
+
+Developers using the Open Source Edition can choose to redistribute the module under the appropriate version of the GNU LGPL.
+QtScript is licensed under the GNU Library General Public License. Individual contributor names and copyright dates can be found inline in the code.
+
+This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/sources/pyside6/doc/extras/QtScriptTools.rst b/sources/pyside6/doc/extras/QtScriptTools.rst
new file mode 100644
index 000000000..8f0c7e12b
--- /dev/null
+++ b/sources/pyside6/doc/extras/QtScriptTools.rst
@@ -0,0 +1,5 @@
+Applications that use the Qt Script Tools classes need to be configured to be built against the QtScriptTools module. To include the definitions of the module's classes, use the following directive:
+
+::
+
+ import PySide6.QtScriptTools
diff --git a/sources/pyside6/doc/extras/QtSql.rst b/sources/pyside6/doc/extras/QtSql.rst
new file mode 100644
index 000000000..fb62f887c
--- /dev/null
+++ b/sources/pyside6/doc/extras/QtSql.rst
@@ -0,0 +1,5 @@
+To include the definitions of the module's classes, use the following directive:
+
+::
+
+ import PySide6.QtSql
diff --git a/sources/pyside6/doc/extras/QtSvg.rst b/sources/pyside6/doc/extras/QtSvg.rst
new file mode 100644
index 000000000..eae02c41e
--- /dev/null
+++ b/sources/pyside6/doc/extras/QtSvg.rst
@@ -0,0 +1,5 @@
+To include the definitions of the module's classes, use the following directive:
+
+::
+
+ import PySide6.QtSvg
diff --git a/sources/pyside6/doc/extras/QtTest.rst b/sources/pyside6/doc/extras/QtTest.rst
new file mode 100644
index 000000000..1b3f98940
--- /dev/null
+++ b/sources/pyside6/doc/extras/QtTest.rst
@@ -0,0 +1,7 @@
+To include the definitions of the module's classes, use the following directive:
+
+::
+
+ import PySide6.QtTest
+
+.. note:: All macros in the C++ version of QtTest were not binded in PySide, this module is useful only for GUI testing and benchmarking, for ordinary unit testing you should use the ``unittest`` Python module.
diff --git a/sources/pyside6/doc/extras/QtUiTools.loadUiType.rst b/sources/pyside6/doc/extras/QtUiTools.loadUiType.rst
new file mode 100644
index 000000000..8a8c4bef0
--- /dev/null
+++ b/sources/pyside6/doc/extras/QtUiTools.loadUiType.rst
@@ -0,0 +1,36 @@
+.. currentmodule:: PySide6.QtUiTools
+.. _loadUiType:
+
+loadUiType
+***********
+
+.. py:function:: loadUiType(uifile: str) -> tuple(object, object)
+
+ :param str uifile: The name of the `.ui` file
+ :return: tuple(object, object)
+
+ This function generates and loads a `.ui` file at runtime, and it returns
+ a `tuple` containing the reference to the Python class, and the base class.
+
+ We recommend not to use this approach as the workflow should be to generate a Python file
+ from the `.ui` file, and then import and load it to use it, but we do understand that
+ there are some corner cases when such functionality is required.
+
+ The internal process relies on `uic` being in the PATH.
+ The `pyside6-uic` wrapper uses a shipped `uic` that is located in the
+ `site-packages/PySide6/uic`, so PATH needs to be updated to use that if there
+ is no `uic` in the system.
+
+ A simple use case is::
+
+ from PySide6.QtUiTools import loadUiType
+
+ generated_class, base_class = loadUiType("themewidget.ui")
+ # the values will be:
+ # (<class '__main__.Ui_ThemeWidgetForm'>, <class 'PySide6.QtWidgets.QWidget'>)
+
+ widget = base_class()
+ form = generated_class()
+ form.setupUi(widget)
+ # form.a_widget_member.a_method_of_member()
+ widget.show()
diff --git a/sources/pyside6/doc/extras/QtUiTools.rst b/sources/pyside6/doc/extras/QtUiTools.rst
new file mode 100644
index 000000000..2769da4d6
--- /dev/null
+++ b/sources/pyside6/doc/extras/QtUiTools.rst
@@ -0,0 +1,9 @@
+These forms are processed at run-time to produce dynamically-generated user interfaces. In order to generate a form at run-time, a resource file containing a UI file is needed.
+
+A form loader object, provided by the QUiLoader class, is used to construct the user interface. This user interface can be retrieved from any QIODevice; for example, a QFile object can be used to obtain a form stored in a project's resources. The :meth:`PySide6.QtUiTools.QUiLoader.load` function takes the user interface description contained in the file and constructs the form widget.
+
+To include the definitions of the module's classes, use the following directive:
+
+::
+
+ import PySide.QtUiTools
diff --git a/sources/pyside6/doc/extras/QtXml.rst b/sources/pyside6/doc/extras/QtXml.rst
new file mode 100644
index 000000000..39c384e77
--- /dev/null
+++ b/sources/pyside6/doc/extras/QtXml.rst
@@ -0,0 +1,5 @@
+To include the definitions of the module's classes, use the following directive:
+
+::
+
+ import PySide6.QtXml
diff --git a/sources/pyside6/doc/extras/QtXmlPatterns.rst b/sources/pyside6/doc/extras/QtXmlPatterns.rst
new file mode 100644
index 000000000..258fdf28d
--- /dev/null
+++ b/sources/pyside6/doc/extras/QtXmlPatterns.rst
@@ -0,0 +1,12 @@
+To include the definitions of the module's classes, use the following directive:
+
+::
+
+ import PySide6.QtXmlPatterns
+
+Further Reading
+---------------
+
+General overviews of XQuery and XSchema can be found in the XQuery document.
+
+An introduction to the XQuery language can be found in A Short Path to XQuery.
diff --git a/sources/pyside6/doc/faq.rst b/sources/pyside6/doc/faq.rst
new file mode 100644
index 000000000..39084261e
--- /dev/null
+++ b/sources/pyside6/doc/faq.rst
@@ -0,0 +1,37 @@
+.. _faq:
+
+:orphan:
+
+Frequently Asked Questions
+==========================
+
+**When did The Qt Company adopt PySide6?**
+ In April 2016 `The Qt Company <https://qt.io>`_ decided to properly support the port. For more
+ information, see `<https://groups.google.com/forum/#!topic/pyside-dev/pqwzngAGLWE>`_.
+
+**Why use PySide6 and not PySide?**
+ Since PySide was developed for Qt 4, we now use PySide6 to imply that it is for a newer version,
+ after it was ported to support Qt 5.
+
+**Where I can find information about the old PySide project?**
+ The project's old wiki page is available on PySide, but the project is now deprecated and not
+ supported.
+
+**There are three wheels (pyside6, shiboken6, and shiboken6_generator), what's the difference?**
+
+ Before the official release, everything was in one big wheel, so it made sense to split these
+ into separate wheels, each for the major projects currently in development:
+
+ * **pyside6**: contains all the PySide6 modules to use the Qt framework; also depends on the
+ shiboken6 module.
+ * **shiboken6**: contains the shiboken6 module with helper functions for PySide6.
+ * **shiboken6_generator**: contains the generator binary that can work with a C++ project and a
+ typesystem to generate Python bindings.
+ If you want to generate bindings for a Qt/C++ project, there won't be any linking to the Qt
+ shared libraries; you need to do this by hand. We recommend building PySide6 from scratch
+ to have everything properly linked.
+
+**Why is the shiboken6_generator not installed automatically?**
+ It's not necessary to install the shiboken6_generator to use PySide6. The package is a result of
+ the wheel splitting process. To use the generator, it's recommended to build it from scratch to
+ have the proper Qt linking.
diff --git a/sources/pyside6/doc/gettingstarted-linux.rst b/sources/pyside6/doc/gettingstarted-linux.rst
new file mode 100644
index 000000000..cf3479f81
--- /dev/null
+++ b/sources/pyside6/doc/gettingstarted-linux.rst
@@ -0,0 +1,96 @@
+Getting Started on Linux
+==========================
+
+Requirements
+------------
+
+ * Qt package from `here`_ or a custom build of Qt 5.12+ (preferably 5.15)
+ * A Python interpreter (version Python 3.6+).
+ You can either use the one provided by your OS, or get it
+ from the `official website`_.
+ * GCC
+ * `CMake`_ version 3.1 or greater
+ * Git version 2 or greater
+ * `libclang`_ from your system or the prebuilt version from the ``Qt Downloads`` page is
+ recommended. libclang10 is required for PySide 5.15.
+ * ``sphinx`` package for the documentation (optional).
+ * Depending on your linux distribution, the following dependencies might also be required:
+
+ * ``libgl-dev``,
+ * ``python-dev``,
+ * ``python-distutils``,
+ * and ``python-setuptools``.
+
+.. _here: https://qt.io/download
+.. _official website: https://www.python.org/downloads/
+.. _CMake: https://cmake.org/download/
+.. _libclang: http://download.qt.io/development_releases/prebuilt/libclang/
+
+
+Building from source
+--------------------
+
+Creating a virtual environment
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The ``venv`` module allows you to create a local, user-writeable copy of a python environment into
+which arbitrary modules can be installed and which can be removed after use::
+
+ python -m venv testenv
+ source testenv/bin/activate
+ pip install -r requirements.txt # General dependencies, documentation, and examples.
+
+will create and use a new virtual environment, which is indicated by the command prompt changing.
+
+Setting up CLANG
+~~~~~~~~~~~~~~~~
+
+If you don't have libclang already in your system, you can download from the Qt servers::
+
+ wget https://download.qt.io/development_releases/prebuilt/libclang/libclang-release_100-based-linux-Rhel7.6-gcc5.3-x86_64.7z
+
+Extract the files, and leave it on any desired path, and then set these two required
+environment variables::
+
+ 7z x libclang-release_100-based-linux-Rhel7.6-gcc5.3-x86_64.7z
+ export CLANG_INSTALL_DIR=$PWD/libclang
+
+Getting PySide6
+~~~~~~~~~~~~~~~
+
+Cloning the official repository can be done by::
+
+ git clone --recursive https://code.qt.io/pyside/pyside-setup
+
+Checking out the version that we want to build, e.g. 5.15::
+
+ cd pyside-setup && git checkout 5.15
+
+.. note:: Keep in mind you need to use the same version as your Qt installation.
+ Additionally, ``git checkout -b 5.15 --track origin/5.14`` could be a better option
+ in case you want to work on it.
+
+Building PySide6
+~~~~~~~~~~~~~~~~
+
+Check your Qt installation path, to specifically use that version of qmake to build PySide6.
+e.g. ``/opt/Qt/5.14.0/gcc_64/bin/qmake``.
+
+Build can take a few minutes, so it is recommended to use more than one CPU core::
+
+ python setup.py build --qmake=/opt/Qt/5.15.0/gcc_64/bin/qmake --build-tests --ignore-git --parallel=8
+
+Installing PySide6
+~~~~~~~~~~~~~~~~~~
+
+To install on the current directory, just run::
+
+ python setup.py install --qmake=/opt/Qt/5.15.0/gcc_64/bin/qmake --build-tests --ignore-git --parallel=8
+
+Test installation
+~~~~~~~~~~~~~~~~~
+
+You can execute one of the examples to verify the process is properly working.
+Remember to properly set the environment variables for Qt and PySide6::
+
+ python examples/widgets/widgets/tetrix.py
diff --git a/sources/pyside6/doc/gettingstarted-macOS.rst b/sources/pyside6/doc/gettingstarted-macOS.rst
new file mode 100644
index 000000000..9777306db
--- /dev/null
+++ b/sources/pyside6/doc/gettingstarted-macOS.rst
@@ -0,0 +1,95 @@
+Getting Started on macOS
+========================
+
+Requirements
+------------
+
+ * Qt package from `here`_ or a custom build of Qt 5.12+ (preferably 5.15)
+ * A Python interpreter (version Python 3.6+).
+ You can use the one provided by HomeBrew, or you can get
+ python from the `official website`_.
+ * `XCode`_ 8.2 (macOS 10.11), 8.3.3 (macOS 10.12), 9 (macOS 10.13), 10.1 (macOS 10.14)
+ * `CMake`_ version 3.1 or greater
+ * Git version 2 or greater
+ * `libclang`_ from your system or the prebuilt version from the ``Qt Downloads`` page is
+ recommended. libclang10 is required for PySide 5.15.
+ * ``sphinx`` package for the documentation (optional).
+ * Depending on your OS, the following dependencies might also be required:
+
+ * ``libgl-dev``,
+ * ``python-dev``,
+ * ``python-distutils``,
+ * and ``python-setuptools``.
+
+.. _XCode: https://developer.apple.com/xcode/
+.. _here: https://qt.io/download
+.. _official website: https://www.python.org/downloads/
+.. _CMake: https://cmake.org/download/
+.. _libclang: http://download.qt.io/development_releases/prebuilt/libclang/
+
+
+Building from source
+--------------------
+
+Creating a virtual environment
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The ``venv`` module allows you to create a local, user-writeable copy of a python environment into
+which arbitrary modules can be installed and which can be removed after use::
+
+ python -m venv testenv # your interpreter could be called 'python3'
+ source testenv/bin/activate
+ pip install -r requirements.txt # General dependencies, documentation, and examples.
+
+will create and use a new virtual environment, which is indicated by the command prompt changing.
+
+Setting up CLANG
+~~~~~~~~~~~~~~~~
+
+If you don't have libclang already in your system, you can download from the Qt servers::
+
+ wget http://download.qt.io/development_releases/prebuilt/libclang/libclang-release_100-based-mac.7z
+
+Extract the files, and leave it on any desired path, and then set these two required
+environment variables::
+
+ 7z x libclang-release_100-based-mac.7z
+ export CLANG_INSTALL_DIR=$PWD/libclang
+
+Getting PySide6
+~~~~~~~~~~~~~~~
+
+Cloning the official repository can be done by::
+
+ git clone --recursive https://code.qt.io/pyside/pyside-setup
+
+Checking out the version that we want to build, e.g. 5.15::
+
+ cd pyside-setup && git checkout 5.15
+
+.. note:: Keep in mind you need to use the same version as your Qt installation
+
+Building PySide6
+~~~~~~~~~~~~~~~~
+
+Check your Qt installation path, to specifically use that version of qmake to build PySide6.
+e.g. ``/opt/Qt/5.15.0/gcc_64/bin/qmake``.
+
+Build can take a few minutes, so it is recommended to use more than one CPU core::
+
+ python setup.py build --qmake=/opt/Qt/5.15.0/gcc_64/bin/qmake --build-tests --ignore-git --parallel=8
+
+Installing PySide6
+~~~~~~~~~~~~~~~~~~
+
+To install on the current directory, just run::
+
+ python setup.py install --qmake=/opt/Qt/5.15.0/gcc_64/bin/qmake --build-tests --ignore-git --parallel=8
+
+Test installation
+~~~~~~~~~~~~~~~~~
+
+You can execute one of the examples to verify the process is properly working.
+Remember to properly set the environment variables for Qt and PySide6::
+
+ python examples/widgets/widgets/tetrix.py
diff --git a/sources/pyside6/doc/gettingstarted-windows.rst b/sources/pyside6/doc/gettingstarted-windows.rst
new file mode 100644
index 000000000..d9eb1a61c
--- /dev/null
+++ b/sources/pyside6/doc/gettingstarted-windows.rst
@@ -0,0 +1,97 @@
+Getting Started on Windows
+==========================
+
+The Qt library has to be built with the same version of MSVC as Python and PySide6, this can be
+selected when using the online installer.
+
+Requirements
+------------
+
+ * Qt package from `here`_ or a custom build of Qt 5.12+ (preferably Qt 5.15)
+ * A Python interpreter (version Python 3.6+). Preferably get it from the `official website`_.
+ * `MSVC2017`_ (or MSVC2019) for Python 3 on Windows,
+ * `CMake`_ version 3.1 or greater
+ * `Git`_ version 2 or greater
+ * `libclang`_ prebuilt version from the ``Qt Downloads`` page is recommended. We recommend
+ libclang10 for PySide 5.15.
+ * `OpenSSL`_ (optional for SSL support, Qt must have been configured using the same SSL library).
+ * ``venv`` or ``virtualenv`` is strongly recommended, but optional.
+ * ``sphinx`` package for the documentation (optional).
+
+.. note:: Python 3.8.0 was missing some API required for PySide/Shiboken so it's not possible
+ to use it for a Windows build.
+
+
+.. _here: https://qt.io/download
+.. _official website: https://www.python.org/downloads/
+.. _MSVC2017: https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools
+.. _CMake: https://cmake.org/download/
+.. _Git: https://git-scm.com/download/win
+.. _libclang: http://download.qt.io/development_releases/prebuilt/libclang/
+.. _OpenSSL: https://sourceforge.net/projects/openssl/
+
+
+Building from source on Windows 10
+----------------------------------
+
+Creating a virtual environment
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The ``venv`` module allows you to create a local, user-writeable copy of a python environment into
+which arbitrary modules can be installed and which can be removed after use::
+
+ python -m venv testenv
+ call testenv\Scripts\activate
+ pip install -r requirements.txt # General dependencies, documentation, and examples.
+
+will create and use a new virtual environment, which is indicated by the command prompt changing.
+
+Setting up CLANG
+~~~~~~~~~~~~~~~~
+
+If you don't have libclang already in your system, you can download from the Qt servers,
+e.g. ``libclang-release_100-based-windows-vs2019_64.7z``.
+
+Extract the files, and leave it on any desired path, e.g ``c:\``, and then set these two required
+environment variables::
+
+ set LLVM_INSTALL_DIR=c:\libclang
+ set PATH=C:\libclang\bin;%PATH%
+
+Getting PySide6
+~~~~~~~~~~~~~~~
+
+Cloning the official repository can be done by::
+
+ git clone --recursive https://code.qt.io/pyside/pyside-setup
+
+Checking out the version that we want to build, e.g. 5.15::
+
+ cd pyside-setup && git checkout 5.15
+
+.. note:: Keep in mind you need to use the same version as your Qt installation
+
+Building PySide6
+~~~~~~~~~~~~~~~~
+
+Check your Qt installation path, to specifically use that version of qmake to build PySide6.
+e.g. ``E:\Qt\5.15.0\msvc2019_64\bin\qmake.exe``.
+
+Build can take a few minutes, so it is recommended to use more than one CPU core::
+
+ python setup.py build --qmake=c:\path\to\qmake.exe --openssl=c:\path\to\openssl\bin --build-tests --ignore-git --parallel=8
+
+Installing PySide6
+~~~~~~~~~~~~~~~~~~
+
+To install on the current directory, just run::
+
+ python setup.py install --qmake=c:\path\to\qmake.exe --openssl=c:\path\to\openssl\bin --build-tests --ignore-git --parallel=8
+
+Test installation
+~~~~~~~~~~~~~~~~~
+
+You can execute one of the examples to verify the process is properly working.
+Remember to properly set the environment variables for Qt and PySide6::
+
+ python examples/widgets/widgets/tetrix.py
diff --git a/sources/pyside6/doc/gettingstarted.rst b/sources/pyside6/doc/gettingstarted.rst
new file mode 100644
index 000000000..da683f21d
--- /dev/null
+++ b/sources/pyside6/doc/gettingstarted.rst
@@ -0,0 +1,218 @@
+|project| Getting Started
+==========================
+
+This page is focused on building |project| from source, if you just want to install |pymodname|
+with ``pip`` you need to run::
+
+ pip install pyside6
+
+for more details, refer to our `Quick Start`_ guide. Additionally, you can
+check the :ref:`FAQ <faq>` related to the project.
+
+.. _Quick Start: quickstart.html
+
+General Requirements
+--------------------
+
+ * **Python**: 3.6+
+ * **Qt:** 5.12+ is recommended
+ * **libclang:** The libclang library, recommended: version 10 for PySide6 5.15.
+ Prebuilt versions of it can be `downloaded here`_.
+ * **CMake:** 3.1+ is needed.
+
+.. _downloaded here: http://download.qt.io/development_releases/prebuilt/libclang/
+
+Guides per platform
+-------------------
+
+You can refer to the following pages for platform specific instructions:
+
+ * `Windows`_
+ * `macOS`_
+ * `Linux`_
+ * Mobile platforms (iOS/Android) **(no support)**
+ * Embedded platforms **(no official support)**
+
+ .. note:: Most Linux-based embedded OS provide PySide6 with their official
+ package manager (e.g. `Raspbian`_ and `ArchlinuxARM`_).
+
+.. _Windows: gettingstarted-windows.html
+.. _macOS: gettingstarted-macOS.html
+.. _Linux: gettingstarted-linux.html
+.. _Raspbian: https://www.raspbian.org/
+.. _ArchlinuxARM: https://archlinuxarm.org/
+
+A normal building command will look like this::
+
+ python setup.py install --qmake=/path/to/qmake \
+ --ignore-git \
+ --debug \
+ --build-tests \
+ --parallel=8 \
+ --make-spec=ninja \
+ --verbose-build \
+ --module-subset=Core,Gui,Widgets
+
+Which will build and install the project with **debug** symbols, including the **tests**,
+using **ninja** (instead of make), and considering only the **module subset** of QtCore, QtGUI
+and QtWidgets.
+
+Other important options to consider are:
+ * ``--cmake``, to specify the path to the cmake binary,
+ * ``--reuse-build``, to rebuild only the modified files,
+ * ``--openssl=/path/to/openssl/bin``, to use a different path for OpenSSL,
+ * ``--standalone``, to copy over the Qt libraries into the final package
+ to make it work on other machines,
+ * ``--doc-build-online``, to build documentation using the online template.
+
+Testing the installation
+------------------------
+
+Once the installation finishes, you will be able to execute any of our examples::
+
+ python examples/widgets/widgets/tetrix.py
+
+Running Tests
+-------------
+
+Using the ``--build-tests`` option will enable us to run all the auto tests inside the project::
+
+ python testrunner.py test > testlog.txt
+
+.. note:: On Windows, don't forget to have qmake in your path
+ (``set PATH=E:\Path\to\Qt\5.15\msvc2017_64\bin;%PATH%``)
+
+You can also run a specific test (for example ``qpainter_test``) by running::
+
+ ctest -R qpainter_test --verbose
+
+Building the documentation
+--------------------------
+
+Starting from 5.15, there are two options to build the documentation:
+
+1. Building rst-only documentation (no API)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The process of parsing Qt headers to generate the PySide API documentation can take several
+minutes, this means that modifying a specific section of the rst files we currently have, might
+become a hard task.
+
+For this, you can install ``sphinx`` on a virtual environment, and execute the following command::
+
+ python setup.py build_rst_docs
+
+which will generate a ``html/`` directory with the following structure::
+
+ html
+ └── pyside6
+ ├── index.html
+ ├── ...
+ └── shiboken6
+ ├── index.html
+ └── ...
+
+so you can open the main page ``html/pyside6/index.html`` on your browser to check the generated
+files.
+
+This is useful when updating the general sections of the documentation, adding tutorials,
+modifying the build instructions, and more.
+
+2. Building the documentation (rst + API)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The documentation is being generated using **qdoc** to get the API information, and also **sphinx**
+for the local Python related notes.
+
+The system required ``libxml2`` and ``libxslt``, also on the Python environment, ``sphinx`` and
+``graphviz`` need to be installed before running the installation process::
+
+ pip install graphviz sphinx
+
+After installing ``graphviz``, the ``dot`` command needs to be in PATH, otherwise,
+the process will fail. Installing ``graphviz`` system-wide is also an option.
+
+Since the process rely on a Qt installation, you need to specify where the ``qtbase`` directory
+you will use with your ``qmake`` is located::
+
+ export QT_SRC_DIR=/path/to/qtbase
+
+Once the build process finishes, you can go to the generated ``*_build/*_release/pyside6``
+directory, and run::
+
+ make apidoc
+
+.. note:: The ``apidoc`` make target builds offline documenation in QCH (Qt Creator Help) format
+ by default. You can switch to building for the online use with the ``--doc-build-online``
+ configure option.
+
+Finally, you will get a ``html`` directory containing all the generated documentation. The offline
+help files, ``PySide.qch`` and ``Shiboken.qch``, can be moved to any directory of your choice. You
+can find ``Shiboken.qch`` in the build directory, ``*_build\*_release\shiboken6\doc\html``.
+
+Viewing offline documentation
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The offline documentation (QCH) can be viewed using the Qt Creator IDE or Qt Assistant, which is
+a standalone application for viewing QCH files.
+
+To view the QCH using Qt Creator, following the instructions outlined in
+`Using Qt Creator Help Mode <https://doc.qt.io/qtcreator/creator-help.html>`_. If you chose to
+use Qt Assistant instead, use the following command to register the QCH file before launching
+Qt Assistant:
+
+ assistant -register PySide.qch
+
+.. note:: Qt Assistant renders the QCH content using the QTextBrowser backend, which supports
+ a subset of the CSS styles, However, Qt Creator offers an alternative litehtml-based
+ backend, which offers better browsing experience. At the moment, this is not the default
+ backend, so you have to select the litehtml backend
+ explicitly under the ``General`` tab in ``Qt Creator >> Tools >> Options >> Help``.
+
+Using the internal tools
+------------------------
+
+A set of tools can be found under the ``tools/`` directory inside the ``pyside-setup`` repository.
+
+* ``checklibs.py``: Script to analyze dynamic library dependencies of Mach-O binaries.
+ To use this utility, just run::
+
+ python checklibs.py /path/to/some.app/Contents/MacOS/Some
+
+ This script was fetched from this repository_.
+
+* ``create_changelog.py``: Script used to create the CHANGELOG that you can find in the ``dist/``
+ directory. Usage::
+
+ python create_changelog.py -r 5.15.1 -v v5.15.0..5.15 -t bug-fix
+
+* ``debug_windows.py``: This script can be used to find out why PySide6 modules
+ fail to load with various DLL errors like Missing DLL or Missing symbol in DLL.
+
+ You can think of it as a Windows version of ``ldd`` / ``LD_DEBUG``.
+
+ Underneath it uses the ``cdb.exe`` command line debugger, and the ``gflags.exe`` tool, both
+ installed with the latest Windows Kit.
+
+ The aim is to ask users to run this script when they encounter PySide6 imports not working on
+ Windows. The user should then provide the generated log file.
+
+ Incidentally it can also be used for any Windows executables, not just Python.
+ To use it just run::
+
+ python debug_windows.py
+
+* ``missing_bindings.py``: This script is used to compare the state of PySide6 and PyQt5
+ regarding available modules and classses. This content is displayed in our `wiki page`_,
+ and can be used as follows::
+
+ python missing_bindings.py --qt-version 5.15.1 -w all
+
+ Please keep in mind we rely on BeautifulSoup_ to parse the content, so you will be to install
+ it besides PySide6 and PyQt5 (Including additional modules like DataVisualiztion, QtCharts,
+ WebEngine, etc).
+
+
+.. _repository: https://github.com/liyanage/macosx-shell-scripts/
+.. _`wiki page`: https://wiki.qt.io/Qt_for_Python_Missing_Bindings
+.. _BeautifulSoup: https://www.crummy.com/software/BeautifulSoup/
diff --git a/sources/pyside6/doc/index.rst b/sources/pyside6/doc/index.rst
new file mode 100644
index 000000000..339b96275
--- /dev/null
+++ b/sources/pyside6/doc/index.rst
@@ -0,0 +1,104 @@
+|project|
+*********
+
+.. ifconfig:: output_format == 'html'
+
+ **Qt for Python** offers the official Python bindings for `Qt`_, and
+ has two main components:
+
+ * `PySide6`_, so that you can use Qt5 APIs in your Python applications, and
+ * `Shiboken6 <shiboken6/index.html>`__, a binding generator tool, which can
+ be used to expose C++ projects to Python, and a Python module with
+ some utility functions.
+
+.. ifconfig:: output_format == 'qthelp'
+
+ **Qt for Python** offers the official Python bindings for `Qt`_, and
+ has two main components:
+
+ * `PySide6`_, so that you can use Qt5 APIs in your Python applications, and
+ * `Shiboken6 <../shiboken6/index.html>`__, a binding generator tool, which can
+ be used to expose C++ projects to Python, and a Python module with
+ some utility functions.
+
+This project is available under the LGPLv3/GPLv3 and the `Qt commercial license`_.
+
+.. _Qt: https://doc.qt.io
+.. _PySide6: quickstart.html
+.. _`Qt commercial license`: https://www.qt.io/licensing/
+
+
+
+Documentation
+=============
+
+.. ifconfig:: output_format == 'html'
+
+ .. raw:: html
+
+ <table class="special">
+ <colgroup>
+ <col style="width: 33%" />
+ <col style="width: 33%" />
+ <col style="width: 33%" />
+ </colgroup>
+ <tr>
+ <td><a href="quickstart.html"><p><strong>Check It Out!</strong><br/>Write your first Qt app.</p></a></td>
+ <td><a href="gettingstarted.html"><p><strong>Getting Started</strong><br/>Install and build from source.</p></a></td>
+ <td><a href="api.html"><p><strong>API Docs</strong><br/>Qt for Python API reference.</p></a></td>
+ </tr>
+
+ <tr>
+ <td><a href="tutorials/index.html"><p><strong>Tutorials</strong><br/>Learn with step-by-step guides.</p></a></td>
+ <td><a href="examples/index.html"><p><strong>Examples</strong><br/>Check all the available examples.</p></a></td>
+ <td><a href="videos.html"><p><strong>Videos</strong><br/>Watch webinars, Talks, and more.</p></a></td>
+ </tr>
+
+ <tr>
+ <td><a href="deployment.html" style="display: block;"><p><strong>Deployment</strong><br/>Learn to deploy your apps.</p></a></td>
+ <td><a href="considerations.html" style="display: block;"><p><strong>Considerations</strong><br/>API differences and known issues.</p></a></td>
+ <td><a href="shiboken6/index.html" style="display: block;"><p><strong>Shiboken</strong><br/>Generate C++ to Python binding.</p></a></td>
+ </tr>
+ </table>
+
+.. ifconfig :: output_format == 'qthelp'
+
+ .. raw:: html
+
+ <table class="special">
+ <colgroup>
+ <col style="width: 33%" />
+ <col style="width: 33%" />
+ <col style="width: 33%" />
+ </colgroup>
+ <tr>
+ <td><a href="quickstart.html"><p><strong>Check It Out!</strong><br/>Write your first Qt app.</p></a></td>
+ <td><a href="gettingstarted.html"><p><strong>Getting Started</strong><br/>Install and build from source.</p></a></td>
+ <td><a href="api.html"><p><strong>API Docs</strong><br/>Qt for Python API reference.</p></a></td>
+ </tr>
+
+ <tr>
+ <td><a href="tutorials/index.html"><p><strong>Tutorials</strong><br/>Learn with step-by-step guides.</p></a></td>
+ <td><a href="examples/index.html"><p><strong>Examples</strong><br/>Check all the available examples.</p></a></td>
+ <td><a href="videos.html"><p><strong>Videos</strong><br/>Watch webinars, Talks, and more.</p></a></td>
+ </tr>
+
+ <tr>
+ <td><a href="deployment.html" style="display: block;"><p><strong>Deployment</strong><br/>Learn to deploy your apps.</p></a></td>
+ <td><a href="considerations.html" style="display: block;"><p><strong>Considerations</strong><br/>API differences and known issues.</p></a></td>
+ <td><a href="../shiboken6/index.html" style="display: block;"><p><strong>Shiboken</strong><br/>Generate C++ to Python binding.</p></a></td>
+ </tr>
+ </table>
+
+We have also a `wiki page`_ where you can find how to report bugs, contribute or contact the community.
+
+.. _`wiki page`: https://wiki.qt.io/Qt_for_Python
+
+.. toctree::
+ :hidden:
+ :glob:
+
+ contents.rst
+ gettingstarted*
+ pyside-examples/pysideexamples*
+ overviews/*
diff --git a/sources/pyside6/doc/inheritance_diagram.py b/sources/pyside6/doc/inheritance_diagram.py
new file mode 100644
index 000000000..e8dc69532
--- /dev/null
+++ b/sources/pyside6/doc/inheritance_diagram.py
@@ -0,0 +1,372 @@
+# -*- coding: utf-8 -*-
+r"""
+ sphinx.ext.inheritance_diagram
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Defines a docutils directive for inserting inheritance diagrams.
+
+ Provide the directive with one or more classes or modules (separated
+ by whitespace). For modules, all of the classes in that module will
+ be used.
+
+ Example::
+
+ Given the following classes:
+
+ class A: pass
+ class B(A): pass
+ class C(A): pass
+ class D(B, C): pass
+ class E(B): pass
+
+ .. inheritance-diagram: D E
+
+ Produces a graph like the following:
+
+ A
+ / \
+ B C
+ / \ /
+ E D
+
+ The graph is inserted as a PNG+image map into HTML and a PDF in
+ LaTeX.
+
+ :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
+ :copyright: Copyright 2010-2011 by the PySide team.
+ :license: BSD, see LICENSE for details.
+"""
+
+import os
+import re
+import sys
+import inspect
+try:
+ from hashlib import md5
+except ImportError:
+ from md5 import md5
+
+from docutils import nodes
+from docutils.parsers.rst import directives, Directive
+
+from sphinx.ext.graphviz import render_dot_html, render_dot_latex
+
+class InheritanceException(Exception):
+ pass
+
+# When passed something like:
+# PySide6.QtCore.QStateMachine.SignalEvent
+# try to import the underlying module and return a
+# handle to the object. In a loop, import
+# PySide6.QtCore.QStateMachine.SignalEvent
+# PySide6.QtCore.QStateMachine
+# PySide6.QtCore
+# until the import succeeds and walk up the attributes
+# to obtain the object
+
+def importClassOrModule(name):
+ components = name.split('.')
+ for i in range(len(components), 0, -1):
+ importPath = '.'.join(components[: i])
+ try:
+ __import__(importPath)
+ except ImportError:
+ continue
+ if i == len(components):
+ return sys.modules[importPath]
+ remaining = components[i :]
+ cls = sys.modules[importPath]
+ for component in remaining:
+ try:
+ cls = getattr(cls, component)
+ except Exception: # No such attribute
+ return None
+ return cls
+ return None
+
+class InheritanceGraph(object):
+ """
+ Given a list of classes, determines the set of classes that they inherit
+ from all the way to the root "object", and then is able to generate a
+ graphviz dot graph from them.
+ """
+ def __init__(self, class_names, currmodule, show_builtins=False, parts=0):
+ """
+ *class_names* is a list of child classes to show bases from.
+
+ If *show_builtins* is True, then Python builtins will be shown
+ in the graph.
+ """
+ self.class_names = class_names
+ classes = self._import_classes(class_names, currmodule)
+ self.class_info = self._class_info(classes, show_builtins, parts)
+ if not self.class_info:
+ raise InheritanceException('No classes found for '
+ 'inheritance diagram')
+
+ def _import_class_or_module(self, name, currmodule):
+ """
+ Import a class using its fully-qualified *name*.
+ """
+ todoc = importClassOrModule(name)
+ if not todoc and currmodule is not None:
+ todoc = importClassOrModule(currmodule + '.' + name)
+ if not todoc:
+ moduleStr = '(module {})'.format(currmodule) if currmodule else ''
+ raise InheritanceException('Could not import class {} specified for '
+ 'inheritance diagram {}.'.format(name, moduleStr))
+ if inspect.isclass(todoc):
+ return [todoc]
+ elif inspect.ismodule(todoc):
+ classes = []
+ for cls in todoc.__dict__.values():
+ if inspect.isclass(cls) and cls.__module__ == todoc.__name__:
+ classes.append(cls)
+ return classes
+ raise InheritanceException('%r specified for inheritance diagram is '
+ 'not a class or module' % name)
+
+ def _import_classes(self, class_names, currmodule):
+ """Import a list of classes."""
+ classes = []
+ for name in class_names:
+ classes.extend(self._import_class_or_module(name, currmodule))
+ return classes
+
+ def _class_info(self, classes, show_builtins, parts):
+ """Return name and bases for all classes that are ancestors of
+ *classes*.
+
+ *parts* gives the number of dotted name parts that is removed from the
+ displayed node names.
+ """
+ all_classes = {}
+ builtins = __builtins__.values()
+
+ def recurse(cls):
+ if not show_builtins and cls in builtins:
+ return
+
+ nodename = self.class_name(cls, parts)
+ fullname = self.class_name(cls, 0)
+
+ baselist = []
+ all_classes[cls] = (nodename, fullname, baselist)
+ for base in cls.__bases__:
+ if not show_builtins and base in builtins:
+ continue
+ if base.__name__ == "Object" and base.__module__ == "Shiboken":
+ continue
+ baselist.append(self.class_name(base, parts))
+ if base not in all_classes:
+ recurse(base)
+
+ for cls in classes:
+ recurse(cls)
+
+ return list(all_classes.values())
+
+ def class_name(self, cls, parts=0):
+ """Given a class object, return a fully-qualified name.
+
+ This works for things I've tested in matplotlib so far, but may not be
+ completely general.
+ """
+ module = cls.__module__
+ if module == '__builtin__':
+ fullname = cls.__name__
+ else:
+ fullname = '%s.%s' % (module, cls.__qualname__)
+ if parts == 0:
+ return fullname
+ name_parts = fullname.split('.')
+ return '.'.join(name_parts[-parts:])
+
+ def get_all_class_names(self):
+ """
+ Get all of the class names involved in the graph.
+ """
+ return [fullname for (_, fullname, _) in self.class_info]
+
+ # These are the default attrs for graphviz
+ default_graph_attrs = {
+ 'rankdir': 'LR',
+ 'size': '"8.0, 12.0"',
+ }
+ default_node_attrs = {
+ 'shape': 'box',
+ 'fontsize': 10,
+ 'height': 0.25,
+ 'fontname': '"Vera Sans, DejaVu Sans, Liberation Sans, '
+ 'Arial, Helvetica, sans"',
+ 'style': '"setlinewidth(0.5)"',
+ }
+ default_edge_attrs = {
+ 'arrowsize': 0.5,
+ 'style': '"setlinewidth(0.5)"',
+ }
+
+ def _format_node_attrs(self, attrs):
+ return ','.join(['%s=%s' % x for x in attrs.items()])
+
+ def _format_graph_attrs(self, attrs):
+ return ''.join(['%s=%s;\n' % x for x in attrs.items()])
+
+ def generate_dot(self, name, urls={}, env=None,
+ graph_attrs={}, node_attrs={}, edge_attrs={}):
+ """
+ Generate a graphviz dot graph from the classes that
+ were passed in to __init__.
+
+ *name* is the name of the graph.
+
+ *urls* is a dictionary mapping class names to HTTP URLs.
+
+ *graph_attrs*, *node_attrs*, *edge_attrs* are dictionaries containing
+ key/value pairs to pass on as graphviz properties.
+ """
+ g_attrs = self.default_graph_attrs.copy()
+ n_attrs = self.default_node_attrs.copy()
+ e_attrs = self.default_edge_attrs.copy()
+ g_attrs.update(graph_attrs)
+ n_attrs.update(node_attrs)
+ e_attrs.update(edge_attrs)
+ if env:
+ g_attrs.update(env.config.inheritance_graph_attrs)
+ n_attrs.update(env.config.inheritance_node_attrs)
+ e_attrs.update(env.config.inheritance_edge_attrs)
+
+ res = []
+ res.append('digraph %s {\n' % name)
+ res.append(self._format_graph_attrs(g_attrs))
+
+ for name, fullname, bases in self.class_info:
+ # Write the node
+ this_node_attrs = n_attrs.copy()
+ url = urls.get(fullname)
+ if url is not None:
+ this_node_attrs['URL'] = '"%s"' % url
+ res.append(' "%s" [%s];\n' %
+ (name, self._format_node_attrs(this_node_attrs)))
+
+ # Write the edges
+ for base_name in bases:
+ res.append(' "%s" -> "%s" [%s];\n' %
+ (base_name, name,
+ self._format_node_attrs(e_attrs)))
+ res.append('}\n')
+ return ''.join(res)
+
+
+class inheritance_diagram(nodes.General, nodes.Element):
+ """
+ A docutils node to use as a placeholder for the inheritance diagram.
+ """
+ pass
+
+
+class InheritanceDiagram(Directive):
+ """
+ Run when the inheritance_diagram directive is first encountered.
+ """
+ has_content = False
+ required_arguments = 1
+ optional_arguments = 0
+ final_argument_whitespace = True
+ option_spec = {
+ 'parts': directives.nonnegative_int,
+ }
+
+ def run(self):
+ node = inheritance_diagram()
+ node.document = self.state.document
+ env = self.state.document.settings.env
+ class_names = self.arguments[0].split()
+ class_role = env.get_domain('py').role('class')
+ # Store the original content for use as a hash
+ node['parts'] = self.options.get('parts', 0)
+ node['content'] = ', '.join(class_names)
+
+ # Create a graph starting with the list of classes
+ try:
+ graph = InheritanceGraph(
+ class_names, env.temp_data.get('py:module'),
+ parts=node['parts'])
+ except InheritanceException as err:
+ return [node.document.reporter.warning(err.args[0],
+ line=self.lineno)]
+
+ # Create xref nodes for each target of the graph's image map and
+ # add them to the doc tree so that Sphinx can resolve the
+ # references to real URLs later. These nodes will eventually be
+ # removed from the doctree after we're done with them.
+ for name in graph.get_all_class_names():
+ refnodes, x = class_role(
+ 'class', ':class:`%s`' % name, name, 0, self.state)
+ node.extend(refnodes)
+ # Store the graph object so we can use it to generate the
+ # dot file later
+ node['graph'] = graph
+ return [node]
+
+
+def get_graph_hash(node):
+ hashString = node['content'] + str(node['parts'])
+ return md5(hashString.encode('utf-8')).hexdigest()[-10:]
+
+
+def html_visit_inheritance_diagram(self, node):
+ """
+ Output the graph for HTML. This will insert a PNG with clickable
+ image map.
+ """
+ graph = node['graph']
+
+ graph_hash = get_graph_hash(node)
+ name = 'inheritance%s' % graph_hash
+
+ # Create a mapping from fully-qualified class names to URLs.
+ urls = {}
+ for child in node:
+ if child.get('refuri') is not None:
+ urls[child['reftitle']] = child.get('refuri')
+ elif child.get('refid') is not None:
+ urls[child['reftitle']] = '#' + child.get('refid')
+
+ dotcode = graph.generate_dot(name, urls, env=self.builder.env)
+ render_dot_html(self, node, dotcode, {}, 'inheritance', 'inheritance',
+ alt='Inheritance diagram of ' + node['content'])
+ raise nodes.SkipNode
+
+
+def latex_visit_inheritance_diagram(self, node):
+ """
+ Output the graph for LaTeX. This will insert a PDF.
+ """
+ graph = node['graph']
+
+ graph_hash = get_graph_hash(node)
+ name = 'inheritance%s' % graph_hash
+
+ dotcode = graph.generate_dot(name, env=self.builder.env,
+ graph_attrs={'size': '"6.0,6.0"'})
+ render_dot_latex(self, node, dotcode, {}, 'inheritance')
+ raise nodes.SkipNode
+
+
+def skip(self, node):
+ raise nodes.SkipNode
+
+
+def setup(app):
+ app.setup_extension('sphinx.ext.graphviz')
+ app.add_node(
+ inheritance_diagram,
+ latex=(latex_visit_inheritance_diagram, None),
+ html=(html_visit_inheritance_diagram, None),
+ text=(skip, None),
+ man=(skip, None))
+ app.add_directive('inheritance-diagram', InheritanceDiagram)
+ app.add_config_value('inheritance_graph_attrs', {}, False),
+ app.add_config_value('inheritance_node_attrs', {}, False),
+ app.add_config_value('inheritance_edge_attrs', {}, False),
diff --git a/sources/pyside6/doc/modules.rst b/sources/pyside6/doc/modules.rst
new file mode 100644
index 000000000..830570edc
--- /dev/null
+++ b/sources/pyside6/doc/modules.rst
@@ -0,0 +1,97 @@
+Qt Modules
+===========
+
+.. toctree::
+ :hidden:
+ :glob:
+
+ PySide6/Qt*/index
+
+.. list-table::
+ :widths: 150, 150
+ :align: left
+
+ * - :mod:`Qt Core <PySide6.QtCore>`
+ Provides core non-GUI functionality.
+ - :mod:`Qt 3D Animation <PySide6.Qt3DAnimation>`
+ Provides basic elements required to animate 3D objects.
+ * - :mod:`Qt Gui <PySide6.QtGui>`
+ Extends QtCore with GUI functionality.
+ - :mod:`Qt Help <PySide6.QtHelp>`
+ Provides classes for integrating online documentation in applications.
+ * - :mod:`Qt Network <PySide6.QtNetwork>`
+ Offers classes that let you to write TCP/IP clients and servers.
+ - :mod:`Qt OpenGL <PySide6.QtOpenGL>`
+ Offers classes that make it easy to use OpenGL in Qt applications.
+ * - :mod:`Qt PrintSupport <PySide6.QtPrintSupport>`
+ Provides extensive cross-platform support for printing.
+ - :mod:`Qt Qml <PySide6.QtQml>`
+ Python API for Qt QML.
+ * - :mod:`Qt Charts <PySide6.QtCharts>`
+ Provides a set of easy to use chart components.
+ - :mod:`Qt Quick <PySide6.QtQuick>`
+ Provides classes for embedding Qt Quick in Qt applications.
+ * - :mod:`Qt DataVisualization <PySide6.QtDataVisualization>`
+ Provides a way to visualize data in 3D as bar, scatter, and surface graphs.
+ - :mod:`Qt QuickWidgets <PySide6.QtQuickWidgets>`
+ Provides the QQuickWidget class for embedding Qt Quick in widget-based applications.
+ * - :mod:`Qt TextToSpeech <PySide6.QtTextToSpeech>`
+ Provides API to access text-to-speech engines.
+ - :mod:`Qt Sql <PySide6.QtSql>`
+ Helps you provide seamless database integration to your Qt applications.
+ * - :mod:`Qt Multimedia <PySide6.QtMultimedia>`
+ Provides low-level multimedia functionality.
+ - :mod:`Qt MultimediaWidgets <PySide6.QtMultimediaWidgets>`
+ Provides the widget-based multimedia API.
+ * - :mod:`Qt MacExtras <PySide6.QtMacExtras>`
+ Provides classes and functions specific to
+ macOS and iOS operating systems.
+ - :mod:`Qt Svg <PySide6.QtSvg>`
+ Provides classes for displaying the contents of SVG files.
+ * - :mod:`Qt UiTools <PySide6.QtUiTools>`
+ Provides classes to handle forms created with Qt Designer.
+ - :mod:`Qt Test <PySide6.QtTest>`
+ Provides classes for unit testing Qt applications and libraries.
+ * - :mod:`Qt Concurrent <PySide6.QtConcurrent>`
+ Provides high-level APIs that make it possible
+ to write multi-threaded programs without using low-level threading
+ primitives such as mutexes, read-write locks, wait conditions, or semaphores.
+ - :mod:`Qt AxContainer <PySide6.QtAxContainer>`
+ Provides QAxObject and QAxWidget which act as
+ containers for COM objects and ActiveX controls.
+ * - :mod:`Qt WebEngineCore <PySide6.QtWebEngineCore>`
+ Provides the core functionality to integrate web content.
+ - :mod:`Qt WebEngineWidgets <PySide6.QtWebEngineWidgets>`
+ Provides widgets that can handle web content.
+ * - :mod:`Qt WebChannel <PySide6.QtWebChannel>`
+ Enables peer-to-peer communication between a server and a client
+ (HTML/JavaScript or QML application).
+ - :mod:`Qt WebSockets <PySide6.QtWebSockets>`
+ Provides interfaces that enable Qt applications
+ to act as a server that can process WebSocket requests, or a client that
+ can consume data received from the server, or both.
+ * - :mod:`Qt Widgets <PySide6.QtWidgets>`
+ Extends Qt GUI with C++ widget functionality.
+ - :mod:`Qt WinExtras <PySide6.QtWinExtras>`
+ Provides classes and functions for using some Windows APIs in a Qt way.
+ * - :mod:`Qt X11Extras <PySide6.QtX11Extras>`
+ Provides information about the X display configuration.
+ - :mod:`Qt Xml <PySide6.QtXml>`
+ Provides C++ implementations of SAX and DOM.
+ * - :mod:`Qt 3D Extras <PySide6.Qt3DExtras>`
+ Provides a set of prebuilt elements to help you get started with Qt 3D.
+ - :mod:`Qt 3D Input <PySide6.Qt3DInput>`
+ Provides classes for handling user input in applications using Qt 3D.
+ * - :mod:`Qt 3D Logic <PySide6.Qt3DLogic>`
+ Enables synchronizing frames with the Qt 3D backend.
+ - :mod:`Qt 3D Render <PySide6.Qt3DRender>`
+ Contains functionality to support 2D and 3D rendering using Qt 3D.
+ * - :mod:`Qt Positioning <PySide6.QtPositioning>`
+ Provides positioning information via QML and Python interfaces.
+ - :mod:`Qt Location <PySide6.QtLocation>`
+ Helps you create viable mapping solutions using the data available from some of the popular location services.
+ * - :mod:`Qt Sensors <PySide6.QtSensors>`
+ Provides access to sensor hardware via QML and Python interfaces and a motion gesture recognition API for devices.
+ - :mod:`Qt Scxml <PySide6.QtScxml>`
+ Provides classes to create and use state machines from SCXML files.
+
diff --git a/sources/pyside6/doc/pyside-config.qdocconf.in b/sources/pyside6/doc/pyside-config.qdocconf.in
new file mode 100644
index 000000000..7807c9d52
--- /dev/null
+++ b/sources/pyside6/doc/pyside-config.qdocconf.in
@@ -0,0 +1,19 @@
+buildversion = @PYSIDE_QT_VERSION@
+navigation.homepage = Qt for Python
+
+macro.nullptr = "\\c{None}"
+
+outputdir = @DOC_DATA_DIR@
+outputformats = WebXML
+WebXML.quotinginformation = true
+WebXML.nosubdirs = true
+WebXML.outputsubdir = webxml
+
+spurious += "Hostile character .*"
+
+#excludes qdoc statements that are not relevant for PySide6
+defines += qtforpython
+
+includepaths += \
+ -I @QT_INCLUDE_DIR@ \
+ -I @mkspecInclude@ \
diff --git a/sources/pyside6/doc/pyside-examples/examples.qdoc b/sources/pyside6/doc/pyside-examples/examples.qdoc
new file mode 100644
index 000000000..116ed65bb
--- /dev/null
+++ b/sources/pyside6/doc/pyside-examples/examples.qdoc
@@ -0,0 +1,37 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \group all-pyside-examples
+ \title All Qt for Python Examples
+ \brief A varied selection of examples can be found in the 'examples' directory of the
+ pyside-setup repository. This can be accessed after installing
+ PySide6 via pip, checking the 'site-packages/PySide6/examples' directory.
+
+ This page aims to document the most important use cases of the module
+ and it will be extended with each release.
+*/
diff --git a/sources/pyside6/doc/pyside-examples/images/pysideexample-classwizard.png b/sources/pyside6/doc/pyside-examples/images/pysideexample-classwizard.png
new file mode 100644
index 000000000..1706772d8
--- /dev/null
+++ b/sources/pyside6/doc/pyside-examples/images/pysideexample-classwizard.png
Binary files differ
diff --git a/sources/pyside6/doc/pyside-examples/images/pysideexample-stardelegate.png b/sources/pyside6/doc/pyside-examples/images/pysideexample-stardelegate.png
new file mode 100644
index 000000000..343416397
--- /dev/null
+++ b/sources/pyside6/doc/pyside-examples/images/pysideexample-stardelegate.png
Binary files differ
diff --git a/sources/pyside6/doc/pyside-examples/images/screenshot_hello.png b/sources/pyside6/doc/pyside-examples/images/screenshot_hello.png
new file mode 100644
index 000000000..41ebbf01b
--- /dev/null
+++ b/sources/pyside6/doc/pyside-examples/images/screenshot_hello.png
Binary files differ
diff --git a/sources/pyside6/doc/pyside-examples/pyside-classwizard.qdoc b/sources/pyside6/doc/pyside-examples/pyside-classwizard.qdoc
new file mode 100644
index 000000000..edfd68fd5
--- /dev/null
+++ b/sources/pyside6/doc/pyside-examples/pyside-classwizard.qdoc
@@ -0,0 +1,39 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example widgets/dialogs/classwizard
+ \title PySide6.QtWidgets - Classwizard Example
+ \ingroup all-pyside-examples
+ \brief Demonstrates the use of QDialog in a wizard application
+
+ This example demonstrates the use a custom QDialog in a wizard,
+ which generates necessary C++ class template code.
+
+ \image pysideexample-classwizard.png
+
+*/
diff --git a/sources/pyside6/doc/pyside-examples/pyside-stardelegate.qdoc b/sources/pyside6/doc/pyside-examples/pyside-stardelegate.qdoc
new file mode 100644
index 000000000..6251ff3e1
--- /dev/null
+++ b/sources/pyside6/doc/pyside-examples/pyside-stardelegate.qdoc
@@ -0,0 +1,39 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example widgets/itemviews/stardelegate
+ \title PySide6.QtWidgets - Star Delegate Example
+ \ingroup all-pyside-examples
+ \brief Demonstrates Qt's itemview architecture
+
+ This example demonstrates the itemview architecture, which
+ is unique to Qt.
+
+ \image pysideexample-stardelegate.png
+*/
+
diff --git a/sources/pyside6/doc/pysideinclude.py b/sources/pyside6/doc/pysideinclude.py
new file mode 100644
index 000000000..91fffe115
--- /dev/null
+++ b/sources/pyside6/doc/pysideinclude.py
@@ -0,0 +1,147 @@
+#
+# This code is a modified version of the code found in sphinx distribution
+# the same license of sphinx distribution applies to this file as well.
+#
+
+import os
+import sys
+import codecs
+from os import path
+
+from docutils import nodes
+from docutils.parsers.rst import Directive, directives
+
+from sphinx import addnodes
+from sphinx.util import parselinenos
+
+class PySideInclude(Directive):
+ """
+ Like ``.. include:: :literal:``, but only warns if the include file is
+ not found, and does not raise errors. Also has several options for
+ selecting what to include.
+ """
+
+ has_content = False
+ required_arguments = 1
+ optional_arguments = 0
+ final_argument_whitespace = False
+ option_spec = {
+ 'linenos': directives.flag,
+ 'tab-width': int,
+ 'language': directives.unchanged_required,
+ 'encoding': directives.encoding,
+ 'pyobject': directives.unchanged_required,
+ 'lines': directives.unchanged_required,
+ 'start-after': directives.unchanged_required,
+ 'end-before': directives.unchanged_required,
+ 'prepend': directives.unchanged_required,
+ 'append': directives.unchanged_required,
+ 'snippet': directives.unchanged_required,
+ }
+
+ def run(self):
+ document = self.state.document
+ filename = self.arguments[0]
+ if not document.settings.file_insertion_enabled:
+ return [document.reporter.warning('File insertion disabled',
+ line=self.lineno)]
+ env = document.settings.env
+ if filename.startswith('/') or filename.startswith(os.sep):
+ rel_fn = filename[1:]
+ else:
+ docdir = path.dirname(env.doc2path(env.docname, base=None))
+ rel_fn = path.join(docdir, filename)
+ try:
+ fn = path.join(env.srcdir, rel_fn)
+ except UnicodeDecodeError:
+ # the source directory is a bytestring with non-ASCII characters;
+ # let's try to encode the rel_fn in the file system encoding
+ rel_fn = rel_fn.encode(sys.getfilesystemencoding())
+ fn = path.join(env.srcdir, rel_fn)
+
+ if 'pyobject' in self.options and 'lines' in self.options:
+ return [document.reporter.warning(
+ 'Cannot use both "pyobject" and "lines" options',
+ line=self.lineno)]
+
+ encoding = self.options.get('encoding', env.config.source_encoding)
+ codec_info = codecs.lookup(encoding)
+ try:
+ f = codecs.StreamReaderWriter(open(fn, 'Ub'),
+ codec_info[2], codec_info[3], 'strict')
+ lines = f.readlines()
+ f.close()
+ except (IOError, OSError):
+ return [document.reporter.warning(
+ 'Include file %r not found or reading it failed' % filename,
+ line=self.lineno)]
+ except UnicodeError:
+ return [document.reporter.warning(
+ 'Encoding %r used for reading included file %r seems to '
+ 'be wrong, try giving an :encoding: option' %
+ (encoding, filename))]
+
+ objectname = self.options.get('pyobject')
+ if objectname is not None:
+ from sphinx.pycode import ModuleAnalyzer
+ analyzer = ModuleAnalyzer.for_file(fn, '')
+ tags = analyzer.find_tags()
+ if objectname not in tags:
+ return [document.reporter.warning(
+ 'Object named %r not found in include file %r' %
+ (objectname, filename), line=self.lineno)]
+ else:
+ lines = lines[tags[objectname][1]-1 : tags[objectname][2]-1]
+
+ linespec = self.options.get('lines')
+ if linespec is not None:
+ try:
+ linelist = parselinenos(linespec, len(lines))
+ except ValueError as err:
+ return [document.reporter.warning(str(err), line=self.lineno)]
+ lines = [lines[i] for i in linelist]
+
+ startafter = self.options.get('start-after')
+ endbefore = self.options.get('end-before')
+ prepend = self.options.get('prepend')
+ append = self.options.get('append')
+ snippet = self.options.get('snippet')
+
+ if snippet:
+ startafter = "//![%s]" % snippet
+ endbefore = "//![%s]" % snippet
+
+ if startafter is not None or endbefore is not None:
+ use = not startafter
+ res = []
+ for line in lines:
+ if not use and startafter and startafter in line:
+ use = True
+ elif use and endbefore and endbefore in line:
+ use = False
+ break
+ elif use:
+ if not line.startswith("//!"):
+ res.append(line)
+ lines = res
+
+ if prepend:
+ lines.insert(0, prepend + '\n')
+ if append:
+ lines.append(append + '\n')
+
+ text = ''.join(lines)
+ if self.options.get('tab-width'):
+ text = text.expandtabs(self.options['tab-width'])
+ retnode = nodes.literal_block(text, text, source=fn)
+ retnode.line = 1
+ retnode.attributes['line_number'] = self.lineno
+ if self.options.get('language', ''):
+ retnode['language'] = self.options['language']
+ if 'linenos' in self.options:
+ retnode['linenos'] = True
+ document.settings.env.note_dependency(rel_fn)
+ return [retnode]
+
+def setup(app):
+ app.add_directive('pysideinclude', PySideInclude)
diff --git a/sources/pyside6/doc/qtattributionsscannertorst.py b/sources/pyside6/doc/qtattributionsscannertorst.py
new file mode 100644
index 000000000..ff966b4cf
--- /dev/null
+++ b/sources/pyside6/doc/qtattributionsscannertorst.py
@@ -0,0 +1,131 @@
+#############################################################################
+##
+## Copyright (C) 2018 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of Qt for Python.
+##
+## $QT_BEGIN_LICENSE:LGPL$
+## 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.
+##
+## GNU Lesser General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU Lesser
+## General Public License version 3 as published by the Free Software
+## Foundation and appearing in the file LICENSE.LGPL3 included in the
+## packaging of this file. Please review the following information to
+## ensure the GNU Lesser General Public License version 3 requirements
+## will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+##
+## GNU General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU
+## General Public License version 2.0 or (at your option) the GNU General
+## Public license version 3 or any later version approved by the KDE Free
+## Qt Foundation. The licenses are as published by the Free Software
+## Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+## included in the packaging of this file. Please review the following
+## information to ensure the GNU General Public License requirements will
+## be met: https://www.gnu.org/licenses/gpl-2.0.html and
+## https://www.gnu.org/licenses/gpl-3.0.html.
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+"""
+Tool to run qtattributionsscanner and convert its output to rst
+"""
+
+import os, json, subprocess, sys, warnings
+
+def indent(lines, indent):
+ result = ''
+ for l in lines:
+ result += "{}{}\n".format(indent, l)
+ return result
+
+rstHeader="""Licenses Used in Qt for Python
+******************************
+
+Qt for Python contains some code that is not provided under the
+GNU Lesser General Public License (LGPL) or the Qt Commercial License,
+but rather under specific licenses from the original authors.
+The Qt Company gratefully acknowledges these and other contributions
+to Qt for Python. We recommend that programs that use Qt for Python
+also acknowledge these contributions, and quote these license
+statements in an appendix to the documentation.
+
+Note: You only need to comply with (and acknowledge) the licenses of
+the third-party components that you are using with your application.
+Click the name of the component to see the licensing details.
+
+Third-party Licenses
+^^^^^^^^^^^^^^^^^^^^
+
+The licenses for the third-party sources used by Qt itself are listed
+in
+`Qt documentation <http://doc.qt.io/qt-5/licenses-used-in-qt.html>`_.
+The following table lists parts of Qt for Python that incorporates
+code licensed under third-party opensource licenses:
+
+"""
+
+def rstHeadline(title):
+ return '{}\n{}\n'.format(title, '-' * len(title))
+
+def rstUrl(title, url):
+ return '`{} <{}>`_'.format(title, url)
+
+def rstLiteralBlock(lines):
+ return '::\n\n' + indent(lines, ' ') + '\n\n'
+
+def rstLiteralBlockFromText(text):
+ return rstLiteralBlock(text.strip().split('\n'))
+
+def readFile(fileName):
+ with open(fileName, 'r') as file:
+ return file.readlines()
+
+def runScanner(directory, targetFileName):
+ # qtattributionsscanner recursively searches for qt_attribution.json files
+ # and outputs them in JSON with the paths of the 'LicenseFile' made absolute
+ command = 'qtattributionsscanner --output-format json {}'.format(directory)
+ jsonS = subprocess.check_output(command, shell=True)
+ if not jsonS:
+ raise RuntimeError('{} failed to produce output.'.format(command))
+
+ with open(targetFileName, 'w') as targetFile:
+ targetFile.write(rstHeader)
+ for entry in json.loads(jsonS.decode('utf-8')):
+ content = '{}\n{}\n{}\n\n'.format(rstHeadline(entry['Name']),
+ entry['Description'], entry['QtUsage'])
+ url = entry['Homepage']
+ version = entry['Version']
+ if url and version:
+ content += '{}, upstream version: {}\n\n'.format(
+ rstUrl('Project Homepage', url), version)
+ copyright = entry['Copyright']
+ if copyright:
+ content += rstLiteralBlockFromText(copyright)
+ content += entry['License'] + '\n\n'
+ licenseFile = entry['LicenseFile']
+ if licenseFile:
+ if os.path.isfile(licenseFile):
+ content += rstLiteralBlock(readFile(licenseFile))
+ else:
+ warnings.warn('"{}" is not a file'.format(licenseFile),
+ RuntimeWarning)
+ targetFile.write(content)
+
+if len(sys.argv) < 3:
+ print("Usage: qtattributionsscannertorst [directory] [file]'")
+ sys.exit(0)
+
+directory = sys.argv[1]
+targetFileName = sys.argv[2]
+runScanner(directory, targetFileName)
diff --git a/sources/pyside6/doc/qtmodules/pyside-examples.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-examples.qdocconf.in
new file mode 100644
index 000000000..349c7f0f7
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-examples.qdocconf.in
@@ -0,0 +1,12 @@
+include(@QT_SRC_DIR@/doc/global/qt-module-defaults.qdocconf)
+
+project = PysideExamples
+description = Qt for Python Examples
+version = $QT_VERSION
+
+sourcedirs += @CMAKE_CURRENT_SOURCE_DIR@/pyside-examples
+exampledirs = @CMAKE_CURRENT_SOURCE_DIR@/../../../examples
+examples.fileextensions += *.py *.pyproject
+imagedirs += @CMAKE_CURRENT_SOURCE_DIR@/pyside-examples/images
+url.examples = "https://code.qt.io/cgit/pyside/pyside-setup.git/tree/examples/\1?h=$QT_VER"
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/doc/qtmodules/pyside-qt3dextras.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-qt3dextras.qdocconf.in
new file mode 100644
index 000000000..20bd8d730
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-qt3dextras.qdocconf.in
@@ -0,0 +1,3 @@
+include(@QT_SRC_DIR@/../qt3d/src/doc/qt3d.qdocconf)
+includepaths += -I @QT_SRC_DIR@/../qt3d/src/doc
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/doc/qtmodules/pyside-qtcharts.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-qtcharts.qdocconf.in
new file mode 100644
index 000000000..1a58c2dc4
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-qtcharts.qdocconf.in
@@ -0,0 +1,2 @@
+include(@QT_SRC_DIR@/../qtcharts/src/charts/doc/qtcharts.qdocconf)
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/doc/qtmodules/pyside-qtconcurrent.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-qtconcurrent.qdocconf.in
new file mode 100644
index 000000000..a6976c24b
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-qtconcurrent.qdocconf.in
@@ -0,0 +1,2 @@
+include(@QT_SRC_DIR@/src/concurrent/doc/qtconcurrent.qdocconf)
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/doc/qtmodules/pyside-qtcore.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-qtcore.qdocconf.in
new file mode 100644
index 000000000..5fb7248c9
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-qtcore.qdocconf.in
@@ -0,0 +1,2 @@
+include(@QT_SRC_DIR@/src/corelib/doc/qtcore.qdocconf)
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/doc/qtmodules/pyside-qtdatavisualization.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-qtdatavisualization.qdocconf.in
new file mode 100644
index 000000000..c9fcb317c
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-qtdatavisualization.qdocconf.in
@@ -0,0 +1,2 @@
+include(@QT_SRC_DIR@/../qtdatavis3d/src/datavisualization/doc/qtdatavis3d.qdocconf)
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/doc/qtmodules/pyside-qtgui.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-qtgui.qdocconf.in
new file mode 100644
index 000000000..77e7e6e18
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-qtgui.qdocconf.in
@@ -0,0 +1,2 @@
+include(@QT_SRC_DIR@/src/gui/doc/qtgui.qdocconf)
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/doc/qtmodules/pyside-qthelp.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-qthelp.qdocconf.in
new file mode 100644
index 000000000..9336909c1
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-qthelp.qdocconf.in
@@ -0,0 +1,2 @@
+include(@QT_SRC_DIR@/../qttools/src/assistant/help/doc/qthelp.qdocconf)
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/doc/qtmodules/pyside-qtlocation.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-qtlocation.qdocconf.in
new file mode 100644
index 000000000..5536e0c8b
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-qtlocation.qdocconf.in
@@ -0,0 +1,3 @@
+include(@QT_SRC_DIR@/../qtlocation/src/location/doc/qtlocation.qdocconf)
+includepaths += -I @QT_SRC_DIR@/../qtlocation/src/location/doc
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/doc/qtmodules/pyside-qtmacextras.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-qtmacextras.qdocconf.in
new file mode 100644
index 000000000..3e0e40019
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-qtmacextras.qdocconf.in
@@ -0,0 +1,2 @@
+include(@QT_SRC_DIR@/../qtmacextras/src/macextras/doc/qtmacextras.qdocconf)
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/doc/qtmodules/pyside-qtmultimediawidgets.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-qtmultimediawidgets.qdocconf.in
new file mode 100644
index 000000000..5415c392c
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-qtmultimediawidgets.qdocconf.in
@@ -0,0 +1,3 @@
+include(@QT_SRC_DIR@/../qtmultimedia/src/multimedia/doc/qtmultimedia.qdocconf)
+includepaths += -I @QT_SRC_DIR@/../qtmultimedia/src/multimedia/doc
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/doc/qtmodules/pyside-qtnetwork.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-qtnetwork.qdocconf.in
new file mode 100644
index 000000000..addec9aee
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-qtnetwork.qdocconf.in
@@ -0,0 +1,2 @@
+include(@QT_SRC_DIR@/src/network/doc/qtnetwork.qdocconf)
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/doc/qtmodules/pyside-qtopengl.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-qtopengl.qdocconf.in
new file mode 100644
index 000000000..34895f0c6
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-qtopengl.qdocconf.in
@@ -0,0 +1,2 @@
+include(@QT_SRC_DIR@/src/opengl/doc/qtopengl.qdocconf)
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/doc/qtmodules/pyside-qtpositioning.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-qtpositioning.qdocconf.in
new file mode 100644
index 000000000..4a2c677d5
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-qtpositioning.qdocconf.in
@@ -0,0 +1,3 @@
+include(@QT_SRC_DIR@/../qtlocation/src/positioning/doc/qtpositioning.qdocconf)
+includepaths += -I @QT_SRC_DIR@/../qtlocation/src/positioning/doc
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/doc/qtmodules/pyside-qtprintsupport.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-qtprintsupport.qdocconf.in
new file mode 100644
index 000000000..04c554434
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-qtprintsupport.qdocconf.in
@@ -0,0 +1,2 @@
+include(@QT_SRC_DIR@/src/printsupport/doc/qtprintsupport.qdocconf)
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/doc/qtmodules/pyside-qtqml.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-qtqml.qdocconf.in
new file mode 100644
index 000000000..546ea7b0a
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-qtqml.qdocconf.in
@@ -0,0 +1,5 @@
+#The index page for QtQml lists only the APIs. Including this qdocconf
+#should also include the text and snippets from the module page
+include(@QT_SRC_DIR@/../qtdeclarative/src/qml/doc/qtqml.qdocconf)
+includepaths += -I @QT_SRC_DIR@/../qtdeclarative/src/qml/doc
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/doc/qtmodules/pyside-qtquickwidgets.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-qtquickwidgets.qdocconf.in
new file mode 100644
index 000000000..6f59645f3
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-qtquickwidgets.qdocconf.in
@@ -0,0 +1,3 @@
+include(@QT_SRC_DIR@/../qtdeclarative/src/quick/doc/qtquick.qdocconf)
+includepaths += -I @QT_SRC_DIR@/../qtdeclarative/src/quick/doc
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/doc/qtmodules/pyside-qtscxml.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-qtscxml.qdocconf.in
new file mode 100644
index 000000000..30b61a785
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-qtscxml.qdocconf.in
@@ -0,0 +1,3 @@
+include(@QT_SRC_DIR@/../qtscxml/src/scxml/doc/qtscxml.qdocconf)
+includepaths += -I @QT_SRC_DIR@/../qtscxml/src/scxml/doc
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/doc/qtmodules/pyside-qtsensors.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-qtsensors.qdocconf.in
new file mode 100644
index 000000000..b407db75c
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-qtsensors.qdocconf.in
@@ -0,0 +1,3 @@
+include(@QT_SRC_DIR@/../qtsensors/src/sensors/doc/qtsensors.qdocconf)
+includepaths += -I @QT_SRC_DIR@/../qtsensors/src/sensors/doc
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/doc/qtmodules/pyside-qtsql.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-qtsql.qdocconf.in
new file mode 100644
index 000000000..8f41c552c
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-qtsql.qdocconf.in
@@ -0,0 +1,2 @@
+include(@QT_SRC_DIR@/src/sql/doc/qtsql.qdocconf)
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/doc/qtmodules/pyside-qtsvg.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-qtsvg.qdocconf.in
new file mode 100644
index 000000000..e3c39a645
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-qtsvg.qdocconf.in
@@ -0,0 +1,2 @@
+include(@QT_SRC_DIR@/../qtsvg/src/svg/doc/qtsvg.qdocconf)
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/doc/qtmodules/pyside-qttest.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-qttest.qdocconf.in
new file mode 100644
index 000000000..b092d9294
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-qttest.qdocconf.in
@@ -0,0 +1,2 @@
+include(@QT_SRC_DIR@/src/testlib/doc/qttestlib.qdocconf)
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/doc/qtmodules/pyside-qttexttospeech.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-qttexttospeech.qdocconf.in
new file mode 100644
index 000000000..ed49121c1
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-qttexttospeech.qdocconf.in
@@ -0,0 +1,3 @@
+include(@QT_SRC_DIR@/../qtspeech/src/doc/qtspeech.qdocconf)
+includepaths += -I @QT_SRC_DIR@/../qtspeech/src/doc
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/doc/qtmodules/pyside-qtuitools.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-qtuitools.qdocconf.in
new file mode 100644
index 000000000..7bd3941f7
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-qtuitools.qdocconf.in
@@ -0,0 +1,2 @@
+include(@QT_SRC_DIR@/../qttools/src/designer/src/uitools/doc/qtuitools.qdocconf)
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/doc/qtmodules/pyside-qtwebchannel.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-qtwebchannel.qdocconf.in
new file mode 100644
index 000000000..f3f2f5cf4
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-qtwebchannel.qdocconf.in
@@ -0,0 +1,2 @@
+include(@QT_SRC_DIR@/../qtwebchannel/src/webchannel/doc/qtwebchannel.qdocconf)
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/doc/qtmodules/pyside-qtwebenginewidgets.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-qtwebenginewidgets.qdocconf.in
new file mode 100644
index 000000000..038c803df
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-qtwebenginewidgets.qdocconf.in
@@ -0,0 +1,3 @@
+include(@QT_SRC_DIR@/../qtwebengine/src/webengine/doc/qtwebengine.qdocconf)
+includepaths += -I @QT_SRC_DIR@/../qtwebengine/src/webengine/doc
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/doc/qtmodules/pyside-qtwebsockets.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-qtwebsockets.qdocconf.in
new file mode 100644
index 000000000..082b94883
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-qtwebsockets.qdocconf.in
@@ -0,0 +1,2 @@
+include(@QT_SRC_DIR@/../qtwebsockets/src/websockets/doc/qtwebsockets.qdocconf)
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/doc/qtmodules/pyside-qtwidgets.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-qtwidgets.qdocconf.in
new file mode 100644
index 000000000..90e887f38
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-qtwidgets.qdocconf.in
@@ -0,0 +1,2 @@
+include(@QT_SRC_DIR@/src/widgets/doc/qtwidgets.qdocconf)
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/doc/qtmodules/pyside-qtwinextras.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-qtwinextras.qdocconf.in
new file mode 100644
index 000000000..d2c1d5be7
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-qtwinextras.qdocconf.in
@@ -0,0 +1,2 @@
+include(@QT_SRC_DIR@/../qtwinextras/src/winextras/doc/qtwinextras.qdocconf)
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/doc/qtmodules/pyside-qtx11extras.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-qtx11extras.qdocconf.in
new file mode 100644
index 000000000..9315fa58c
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-qtx11extras.qdocconf.in
@@ -0,0 +1,2 @@
+include(@QT_SRC_DIR@/../qtx11extras/src/x11extras/doc/qtx11extras.qdocconf)
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/doc/qtmodules/pyside-qtxml.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-qtxml.qdocconf.in
new file mode 100644
index 000000000..f9ccce7d7
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-qtxml.qdocconf.in
@@ -0,0 +1,2 @@
+include(@QT_SRC_DIR@/src/xml/doc/qtxml.qdocconf)
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/doc/quickstart.rst b/sources/pyside6/doc/quickstart.rst
new file mode 100644
index 000000000..37fbb0415
--- /dev/null
+++ b/sources/pyside6/doc/quickstart.rst
@@ -0,0 +1,118 @@
+|project| Quick start
+======================
+
+Requirements
+------------
+
+Before you can install |project|, first you must install the following software:
+
+ * Python 3.6+,
+ * We recommend using a virtual environment, such as
+ `venv <https://docs.python.org/3/library/venv.html>`_ or
+ `virtualenv <https://virtualenv.pypa.io/en/latest>`_
+
+Creating and activating an environment
+--------------------------------------
+
+You can do this by running the following on a terminal::
+
+ $ python -m venv env/ # Your binary is maybe called 'python3'
+ $ source env/bin/activate # for Linux and macOS
+ $ env\Scripts\activate.bat # for Windows
+
+
+
+Installation
+------------
+
+Now you are ready to install the |project| packages using ``pip``.
+From the terminal, run the following command::
+
+ # For the latest version on PyPi
+ pip install PySide6
+
+ # For a specific version
+ pip install PySide6==5.15.0
+
+or::
+
+ pip install --index-url=http://download.qt.io/snapshots/ci/pyside/5.15/latest pyside6 --trusted-host download.qt.io
+
+Test your Installation
+----------------------
+
+Now that you have |project| installed, you can test your setup by running the following Python
+constructs to print version information::
+
+ import PySide6.QtCore
+
+ # Prints PySide6 version
+ print(PySide6.__version__)
+
+ # Prints the Qt version used to compile PySide6
+ print(PySide6.QtCore.__version__)
+
+.. note::
+
+ As it happened in 5.14.2, PySide had a couple of new releases to fix
+ issues in 5.14.2, adding yet another version level. In that case, you
+ will have different versions being shown for Qt and PySide.
+
+Create a Simple Application
+---------------------------
+
+Your |project| setup is ready. You can explore it further by developing a simple application
+that prints "Hello World" in several languages. The following instructions will
+guide you through the development process:
+
+1. Create a new file named :code:`hello_world.py`, and add the following imports to it.::
+
+ import sys
+ import random
+ from PySide6 import QtCore, QtWidgets, QtGui
+
+ The |pymodname| Python module provides access to the Qt APIs as its submodule.
+ In this case, you are importing the :code:`QtCore`, :code:`QtWidgets`, and :code:`QtGui` submodules.
+
+2. Define a class named :code:`MyWidget`, which extends QWidget and includes a QPushButton and
+ QLabel.::
+
+ class MyWidget(QtWidgets.QWidget):
+ def __init__(self):
+ super().__init__()
+
+ self.hello = ["Hallo Welt", "Hei maailma", "Hola Mundo", "Привет мир"]
+
+ self.button = QtWidgets.QPushButton("Click me!")
+ self.text = QtWidgets.QLabel("Hello World",
+ alignment=QtCore.Qt.AlignCenter)
+
+ self.layout = QtWidgets.QVBoxLayout()
+ self.layout.addWidget(self.text)
+ self.layout.addWidget(self.button)
+ self.setLayout(self.layout)
+
+ self.button.clicked.connect(self.magic)
+
+ @QtCore.Slot()
+ def magic(self):
+ self.text.setText(random.choice(self.hello))
+
+ The MyWidget class has the :code:`magic` member function that randomly chooses an item from the
+ :code:`hello` list. When you click the button, the :code:`magic` function is called.
+
+3. Now, add a main function where you instantiate :code:`MyWidget` and :code:`show` it.::
+
+ if __name__ == "__main__":
+ app = QtWidgets.QApplication([])
+
+ widget = MyWidget()
+ widget.resize(800, 600)
+ widget.show()
+
+ sys.exit(app.exec_())
+
+Run your example. Try clicking the button at the bottom to see which greeting you get.
+
+.. image:: pyside-examples/images/screenshot_hello.png
+ :alt: Hello World application
diff --git a/sources/pyside6/doc/src/README.md b/sources/pyside6/doc/src/README.md
new file mode 100644
index 000000000..df37cf691
--- /dev/null
+++ b/sources/pyside6/doc/src/README.md
@@ -0,0 +1 @@
+Any qdoc source files in this directory will be parsed when generating docs.
diff --git a/sources/pyside6/doc/tutorials/basictutorial/clickablebutton.rst b/sources/pyside6/doc/tutorials/basictutorial/clickablebutton.rst
new file mode 100644
index 000000000..bd45f1f64
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/basictutorial/clickablebutton.rst
@@ -0,0 +1,90 @@
+A Simple Button Tutorial
+************************
+
+In this tutorial, we'll show you how to handle **signals and slots**
+using Qt for Python. **Signals and slots** is a Qt feature that lets
+your graphical widgets communicate with other graphical widgets or
+your python code. Our application creates a button that logs the
+`Button clicked, Hello!` message to the python console each time you
+click it.
+
+Let's start by importing the necessary PySide6 classes and python
+`sys` module:
+::
+
+ import sys
+ from PySide6.QtWidgets import QApplication, QPushButton
+ from PySide6.QtCore import Slot
+
+Let's also create a python function that logs the message to the
+console:
+::
+
+ # Greetings
+ @Slot()
+ def say_hello():
+ print("Button clicked, Hello!")
+
+.. note:: The `@Slot()` is a decorator that identifies a function as
+ a slot. It is not important to understand why for now,
+ but use it always to avoid unexpected behavior.
+
+Now, as mentioned in previous examples you must create the
+`QApplication` to run your PySide6 code:
+::
+
+ # Create the Qt Application
+ app = QApplication(sys.argv)
+
+Let's create the clickable button, which is a `QPushButton` instance.
+To label the button, we pass a python string to the constructor:
+::
+
+ # Create a button
+ button = QPushButton("Click me")
+
+Before we show the button, we must connect it to the `say_hello()`
+function that we defined earlier. There are two ways of doing this;
+using the old style or the new style, which is more pythonic. Let's
+use the new style in this case. You can find more information about
+both these styles in the
+`Signals and Slots in PySide6 <https://wiki.qt.io/Qt_for_Python_Signals_and_Slots>`_
+wiki page.
+
+The `QPushButton` has a predefined signal called **clicked**, which
+is triggered every time the button is clicked. We'll connect this
+signal to the `say_hello()` function:
+::
+
+ # Connect the button to the function
+ button.clicked.connect(say_hello)
+
+Finally, we show the button and start the Qt main loop:
+::
+
+ # Show the button
+ button.show()
+ # Run the main Qt loop
+ app.exec_()
+
+Here is the complete code for this example:
+::
+
+ #!/usr/bin/python
+
+ import sys
+ from PySide6.QtWidgets import QApplication, QPushButton
+ from PySide6.QtCore import Slot
+
+ @Slot()
+ def say_hello():
+ print("Button clicked, Hello!")
+
+ # Create the Qt Application
+ app = QApplication(sys.argv)
+ # Create a button, connect it and show it
+ button = QPushButton("Click me")
+ button.clicked.connect(say_hello)
+ button.show()
+ # Run the main Qt loop
+ app.exec_()
diff --git a/sources/pyside6/doc/tutorials/basictutorial/dialog.rst b/sources/pyside6/doc/tutorials/basictutorial/dialog.rst
new file mode 100644
index 000000000..0ced571db
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/basictutorial/dialog.rst
@@ -0,0 +1,145 @@
+Creating a Simple PySide6 Dialog Application
+*********************************************
+
+This tutorial shows how to build a simple dialog with some
+basic widgets. The idea is to let users provide their name
+in a `QLineEdit`, and the dialog greets them on click of a
+`QPushButton`.
+
+Let us just start with a simple stub that creates and shows
+a dialog. This stub is updated during the course of this
+tutorial, but you can use this stub as is if you need to:
+::
+
+ import sys
+ from PySide6.QtWidgets import QApplication, QDialog, QLineEdit, QPushButton
+
+ class Form(QDialog):
+
+ def __init__(self, parent=None):
+ super(Form, self).__init__(parent)
+ self.setWindowTitle("My Form")
+
+
+ if __name__ == '__main__':
+ # Create the Qt Application
+ app = QApplication(sys.argv)
+ # Create and show the form
+ form = Form()
+ form.show()
+ # Run the main Qt loop
+ sys.exit(app.exec_())
+
+The imports aren't new to you, the same for the creation of the
+`QApplication` and the execution of the Qt main loop.
+The only novelty here is the **class definition**.
+
+You can create any class that subclasses PySide6 widgets.
+In this case, we are subclassing `QDialog` to define a custom
+dialog, which we name as **Form**. We have also implemented the
+`init()` method that calls the `QDialog`'s init method with the
+parent widget, if any. Also, the new `setWindowTitle()` method
+just sets the title of the dialog window. In `main()`, you can see
+that we are creating a *Form object* and showing it to the world.
+
+Create the Widgets
+===================
+
+We are going to create two widgets: a `QLineEdit` where users can
+enter their name, and a `QPushButton` that prints the contents of
+the `QLineEdit`.
+So, let's add the following code to the `init()` method of our Form:
+::
+
+ # Create widgets
+ self.edit = QLineEdit("Write my name here..")
+ self.button = QPushButton("Show Greetings")
+
+It's obvious from the code that both widgets will show the corresponding
+texts.
+
+Create a layout to organize the Widgets
+========================================
+
+Qt comes with layout-support that helps you organize the widgets
+in your application. In this case, let's use `QVBoxLayout` to lay out
+the widgets vertically. Add the following code to the `init()` method,
+after creating the widgets:
+::
+
+ # Create layout and add widgets
+ layout = QVBoxLayout()
+ layout.addWidget(self.edit)
+ layout.addWidget(self.button)
+ # Set dialog layout
+ self.setLayout(layout)
+
+So, we create the layout, add the widgets with `addWidget()`,
+and finally we say that our **Form** will have our `QVBoxLayout`
+as its layout.
+
+Create the function to greet and connect the Button
+====================================================
+
+Finally, we just have to add a function to our custom **Form**
+and *connect* our button to it. Our function will be a part of
+the Form, so you have to add it after the `init()` function:
+::
+
+ # Greets the user
+ def greetings(self):
+ print ("Hello {}".format(self.edit.text()))
+
+Our function just prints the contents of the `QLineEdit` to the
+python console. We have access to the text by means of the
+`QLineEdit.text()` method.
+
+Now that we have everything, we just need to *connect* the
+`QPushButton` to the `Form.greetings()` method. To do so, add the
+following line to the `init()` method:
+::
+
+ # Add button signal to greetings slot
+ self.button.clicked.connect(self.greetings)
+
+Once executed, you can enter your name in the `QLineEdit` and watch
+the console for greetings.
+
+Complete code
+=============
+
+Here is the complete code for this tutorial:
+::
+
+ import sys
+ from PySide6.QtWidgets import (QLineEdit, QPushButton, QApplication,
+ QVBoxLayout, QDialog)
+
+ class Form(QDialog):
+
+ def __init__(self, parent=None):
+ super(Form, self).__init__(parent)
+ # Create widgets
+ self.edit = QLineEdit("Write my name here")
+ self.button = QPushButton("Show Greetings")
+ # Create layout and add widgets
+ layout = QVBoxLayout()
+ layout.addWidget(self.edit)
+ layout.addWidget(self.button)
+ # Set dialog layout
+ self.setLayout(layout)
+ # Add button signal to greetings slot
+ self.button.clicked.connect(self.greetings)
+
+ # Greets the user
+ def greetings(self):
+ print ("Hello %s" % self.edit.text())
+
+ if __name__ == '__main__':
+ # Create the Qt Application
+ app = QApplication(sys.argv)
+ # Create and show the form
+ form = Form()
+ form.show()
+ # Run the main Qt loop
+ sys.exit(app.exec_())
diff --git a/sources/pyside6/doc/tutorials/basictutorial/icons.png b/sources/pyside6/doc/tutorials/basictutorial/icons.png
new file mode 100644
index 000000000..0bcfd7d77
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/basictutorial/icons.png
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/basictutorial/icons/forward.png b/sources/pyside6/doc/tutorials/basictutorial/icons/forward.png
new file mode 100644
index 000000000..c7a532dfe
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/basictutorial/icons/forward.png
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/basictutorial/icons/pause.png b/sources/pyside6/doc/tutorials/basictutorial/icons/pause.png
new file mode 100644
index 000000000..d0beadb43
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/basictutorial/icons/pause.png
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/basictutorial/icons/play.png b/sources/pyside6/doc/tutorials/basictutorial/icons/play.png
new file mode 100644
index 000000000..345685337
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/basictutorial/icons/play.png
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/basictutorial/icons/previous.png b/sources/pyside6/doc/tutorials/basictutorial/icons/previous.png
new file mode 100644
index 000000000..979f18565
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/basictutorial/icons/previous.png
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/basictutorial/icons/stop.png b/sources/pyside6/doc/tutorials/basictutorial/icons/stop.png
new file mode 100644
index 000000000..1e88ded3a
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/basictutorial/icons/stop.png
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/basictutorial/player-new.png b/sources/pyside6/doc/tutorials/basictutorial/player-new.png
new file mode 100644
index 000000000..e1f660e5f
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/basictutorial/player-new.png
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/basictutorial/player.png b/sources/pyside6/doc/tutorials/basictutorial/player.png
new file mode 100644
index 000000000..3060a990d
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/basictutorial/player.png
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/basictutorial/qml.rst b/sources/pyside6/doc/tutorials/basictutorial/qml.rst
new file mode 100644
index 000000000..c972daa00
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/basictutorial/qml.rst
@@ -0,0 +1,67 @@
+Your First Application Using PySide6 and QtQuick/QML
+*****************************************************
+
+QML is a declarative language that lets you develop applications
+faster than with traditional languages. It is ideal for designing the
+UI of your application because of its declarative nature. In QML, a
+user interface is specified as a tree of objects with properties. In
+this tutorial, we will show how to make a simple "Hello World"
+application with PySide6 and QML.
+
+A PySide6/QML application consists, at least, of two different files -
+a file with the QML description of the user interface, and a python file
+that loads the QML file. To make things easier, let's save both files in
+the same directory.
+
+Here is a simple QML file called `view.qml`:
+
+.. code-block:: javascript
+
+ import QtQuick 2.0
+
+ Rectangle {
+ width: 200
+ height: 200
+ color: "green"
+
+ Text {
+ text: "Hello World"
+ anchors.centerIn: parent
+ }
+ }
+
+We start by importing `QtQuick 2.0`, which is a QML module.
+
+The rest of the QML code is pretty straightforward for those who
+have previously used HTML or XML files. Basically, we are creating
+a green rectangle with the size `200*200`, and adding a Text element
+that reads "Hello World". The code `anchors.centerIn: parent` makes
+the text appear centered in relation to its immediate parent, which
+is the Rectangle in this case.
+
+Now, let's see how the code looks on the PySide6.
+Let's call it `main.py`:
+
+.. code-block:: python
+
+ from PySide6.QtWidgets import QApplication
+ from PySide6.QtQuick import QQuickView
+ from PySide6.QtCore import QUrl
+
+ app = QApplication([])
+ view = QQuickView()
+ url = QUrl("view.qml")
+
+ view.setSource(url)
+ view.show()
+ app.exec_()
+
+If you are already familiar with PySide6 and have followed our
+tutorials, you have already seen much of this code.
+The only novelties are that you must `import QtQuick` and set the
+source of the `QQuickView` object to the URL of your QML file.
+Then, as any Qt widget, you call `QQuickView.show()`.
+
+.. note:: If you are programming for desktop, you should consider
+ adding `view.setResizeMode(QQuickView.SizeRootObjectToView)`
+ before showing the view.
diff --git a/sources/pyside6/doc/tutorials/basictutorial/qrcfiles.rst b/sources/pyside6/doc/tutorials/basictutorial/qrcfiles.rst
new file mode 100644
index 000000000..5ac560a8f
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/basictutorial/qrcfiles.rst
@@ -0,0 +1,169 @@
+Using `.qrc` Files (`pyside6-rcc`)
+**********************************
+
+The `Qt Resource System`_ is a mechanism for storing binary files
+in an application.
+
+The most common uses are for custom images, icons, fonts, among others.
+
+In this tutorial you will learn how to load custom images as button icons.
+
+For inspiration, we will try to adapt the multimedia player example
+from Qt.
+
+As you can see on the following image, the `QPushButton` that are used
+for the media actions (play, pause, stop, and so on) are using the
+default icons meant for such actions.
+
+.. image:: player.png
+ :alt: Multimedia Player Qt Example
+
+You could make the application more attractive by designing the icons,
+but in case you don't want to design them, `download the following set`_
+and use them.
+
+.. image:: icons.png
+ :alt: New Multimedia icons
+
+You can find more information about the `rcc` command, and `.qrc` file
+format, and the resource system in general in the `Qt Resource System`_
+site.
+
+.. _`download the following set`: icons/
+
+
+The `.qrc` file
+================
+
+Before running any command, add information about the resources to a `.qrc`
+file.
+In the following example, notice how the resources are listed in `icons.qrc`
+
+::
+
+ </ui>
+ <!DOCTYPE RCC><RCC version="1.0">
+ <qresource>
+ <file>icons/play.png</file>
+ <file>icons/pause.png</file>
+ <file>icons/stop.png</file>
+ <file>icons/previous.png</file>
+ <file>icons/forward.png</file>
+ </qresource>
+ </RCC>
+
+
+Generating a Python file
+=========================
+
+Now that the `icons.qrc` file is ready, use the `pyside6-rcc` tool to generate
+a Python class containing the binary information about the resources
+
+To do this, we need to run::
+
+ pyside6-rcc icons.rc -o rc_icons.py
+
+The `-o` option lets you specify the output filename,
+which is `rc_icons.py` in this case.
+
+To use the generated file, add the following import at the top of your main Python file::
+
+ import rc_icons
+
+
+Changes in the code
+===================
+
+As you are modifying an existing example, you need to modify the following
+lines:
+
+.. code-block:: python
+
+ from PySide6.QtGui import QIcon, QKeySequence
+ playIcon = self.style().standardIcon(QStyle.SP_MediaPlay)
+ previousIcon = self.style().standardIcon(QStyle.SP_MediaSkipBackward)
+ pauseIcon = self.style().standardIcon(QStyle.SP_MediaPause)
+ nextIcon = self.style().standardIcon(QStyle.SP_MediaSkipForward)
+ stopIcon = self.style().standardIcon(QStyle.SP_MediaStop)
+
+and replace them with the following:
+
+.. code-block:: python
+
+ from PySide6.QtGui import QIcon, QKeySequence, QPixmap
+ playIcon = QIcon(QPixmap(":/icons/play.png"))
+ previousIcon = QIcon(QPixmap(":/icons/previous.png"))
+ pauseIcon = QIcon(QPixmap(":/icons/pause.png"))
+ nextIcon = QIcon(QPixmap(":/icons/forward.png"))
+ stopIcon = QIcon(QPixmap(":/icons/stop.png"))
+
+This ensures that the new icons are used instead of the default ones provided
+by the application theme.
+Notice that the lines are not consecutive, but are in different parts
+of the file.
+
+After all your imports, add the following
+
+.. code-block:: python
+
+ import rc_icons
+
+Now, the constructor of your class should look like this:
+
+.. code-block:: python
+
+ def __init__(self):
+ super(MainWindow, self).__init__()
+
+ self.playlist = QMediaPlaylist()
+ self.player = QMediaPlayer()
+
+ toolBar = QToolBar()
+ self.addToolBar(toolBar)
+
+ fileMenu = self.menuBar().addMenu("&File")
+ openAction = QAction(QIcon.fromTheme("document-open"),
+ "&Open...", self, shortcut=QKeySequence.Open,
+ triggered=self.open)
+ fileMenu.addAction(openAction)
+ exitAction = QAction(QIcon.fromTheme("application-exit"), "E&xit",
+ self, shortcut="Ctrl+Q", triggered=self.close)
+ fileMenu.addAction(exitAction)
+
+ playMenu = self.menuBar().addMenu("&Play")
+ playIcon = QIcon(QPixmap(":/icons/play.png"))
+ self.playAction = toolBar.addAction(playIcon, "Play")
+ self.playAction.triggered.connect(self.player.play)
+ playMenu.addAction(self.playAction)
+
+ previousIcon = QIcon(QPixmap(":/icons/previous.png"))
+ self.previousAction = toolBar.addAction(previousIcon, "Previous")
+ self.previousAction.triggered.connect(self.previousClicked)
+ playMenu.addAction(self.previousAction)
+
+ pauseIcon = QIcon(QPixmap(":/icons/pause.png"))
+ self.pauseAction = toolBar.addAction(pauseIcon, "Pause")
+ self.pauseAction.triggered.connect(self.player.pause)
+ playMenu.addAction(self.pauseAction)
+
+ nextIcon = QIcon(QPixmap(":/icons/forward.png"))
+ self.nextAction = toolBar.addAction(nextIcon, "Next")
+ self.nextAction.triggered.connect(self.playlist.next)
+ playMenu.addAction(self.nextAction)
+
+ stopIcon = QIcon(QPixmap(":/icons/stop.png"))
+ self.stopAction = toolBar.addAction(stopIcon, "Stop")
+ self.stopAction.triggered.connect(self.player.stop)
+ playMenu.addAction(self.stopAction)
+
+ # many lines were omitted
+
+Executing the example
+=====================
+
+Run the application by calling `python main.py` to checkout the new icon-set:
+
+.. image:: player-new.png
+ :alt: New Multimedia Player Qt Example
+
+.. _`Qt Resource System`: https://doc.qt.io/qt-5/resources.html
diff --git a/sources/pyside6/doc/tutorials/basictutorial/style.qss b/sources/pyside6/doc/tutorials/basictutorial/style.qss
new file mode 100644
index 000000000..b84b98f05
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/basictutorial/style.qss
@@ -0,0 +1,23 @@
+QListWidget {
+ color: #FFFFFF;
+ background-color: #33373B;
+}
+
+QListWidget::item {
+ height: 50px;
+}
+
+QListWidget::item:selected {
+ background-color: #2ABf9E;
+}
+
+QLabel {
+ background-color: #FFFFFF;
+ qproperty-alignment: AlignCenter;
+}
+
+QPushButton {
+ background-color: #2ABf9E;
+ padding: 20px;
+ font-size: 18px;
+}
diff --git a/sources/pyside6/doc/tutorials/basictutorial/uifiles.rst b/sources/pyside6/doc/tutorials/basictutorial/uifiles.rst
new file mode 100644
index 000000000..50bb2514c
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/basictutorial/uifiles.rst
@@ -0,0 +1,187 @@
+Using `.ui` files from Designer or QtCreator with `QUiLoader` and `pyside6-uic`
+*******************************************************************************
+
+This page describes the use of Qt Creator to create graphical
+interfaces for your Qt for Python project.
+You will need **Qt Creator** to design and modify your interface (UI file).
+
+If you don't know how to use Qt Creator, refer to the
+`Using Qt Designer <http://doc.qt.io/qtcreator/creator-using-qt-designer.html>`_
+documentation page.
+
+At Qt Creator, create a new Qt Design Form, choose "Main Window" for template.
+And save as `mainwindow.ui`.
+Add a `QPushButton` to the center of the centralwidget.
+
+Your file ``mainwindow.ui`` should look something like this:
+
+.. code-block:: xml
+
+ <?xml version="1.0" encoding="UTF-8"?>
+ <ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>MainWindow</string>
+ </property>
+ <widget class="QWidget" name="centralWidget">
+ <widget class="QPushButton" name="pushButton">
+ <property name="geometry">
+ <rect>
+ <x>110</x>
+ <y>80</y>
+ <width>201</width>
+ <height>81</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>PushButton</string>
+ </property>
+ </widget>
+ </widget>
+ <widget class="QMenuBar" name="menuBar">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>20</height>
+ </rect>
+ </property>
+ </widget>
+ <widget class="QToolBar" name="mainToolBar">
+ <attribute name="toolBarArea">
+ <enum>TopToolBarArea</enum>
+ </attribute>
+ <attribute name="toolBarBreak">
+ <bool>false</bool>
+ </attribute>
+ </widget>
+ <widget class="QStatusBar" name="statusBar"/>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <resources/>
+ <connections/>
+ </ui>
+
+Now we are ready to decide how to use the **UI file** from Python.
+
+Option A: Generating a Python class
+===================================
+
+Another option to interact with a **UI file** is to generate a Python
+class from it. This is possible thanks to the `pyside6-uic` tool.
+To use this tool, you need to run the following command on a console::
+
+ pyside6-uic mainwindow.ui > ui_mainwindow.py
+
+We redirect all the output of the command to a file called `ui_mainwindow.py`,
+which will be imported directly::
+
+ from ui_mainwindow import Ui_MainWindow
+
+Now to use it, we should create a personalized class for our widget
+to **setup** this generated design.
+
+To understand the idea, let's take a look at the whole code:
+
+.. code-block:: python
+
+ import sys
+ from PySide6.QtWidgets import QApplication, QMainWindow
+ from PySide6.QtCore import QFile
+ from ui_mainwindow import Ui_MainWindow
+
+ class MainWindow(QMainWindow):
+ def __init__(self):
+ super(MainWindow, self).__init__()
+ self.ui = Ui_MainWindow()
+ self.ui.setupUi(self)
+
+ if __name__ == "__main__":
+ app = QApplication(sys.argv)
+
+ window = MainWindow()
+ window.show()
+
+ sys.exit(app.exec_())
+
+What is inside the *if* statement is already known from the previous
+examples, and our new basic class contains only two new lines
+that are in charge of loading the generated python class from the UI
+file:
+
+.. code-block:: python
+
+ self.ui = Ui_MainWindow()
+ self.ui.setupUi(self)
+
+.. note::
+
+ You must run `pyside6-uic` again every time you make changes
+ to the **UI file**.
+
+Option B: Loading it directly
+=============================
+
+To load the UI file directly, we will need a class from the **QtUiTools**
+module:
+
+.. code-block:: python
+
+ from PySide6.QtUiTools import QUiLoader
+
+The `QUiLoader` lets us load the **ui file** dynamically
+and use it right away:
+
+.. code-block:: python
+
+ ui_file = QFile("mainwindow.ui")
+ ui_file.open(QFile.ReadOnly)
+
+ loader = QUiLoader()
+ window = loader.load(ui_file)
+ window.show()
+
+The complete code of this example looks like this:
+
+.. code-block:: python
+
+ # File: main.py
+ import sys
+ from PySide6.QtUiTools import QUiLoader
+ from PySide6.QtWidgets import QApplication
+ from PySide6.QtCore import QFile, QIODevice
+
+ if __name__ == "__main__":
+ app = QApplication(sys.argv)
+
+ ui_file_name = "mainwindow.ui"
+ ui_file = QFile(ui_file_name)
+ if not ui_file.open(QIODevice.ReadOnly):
+ print("Cannot open {}: {}".format(ui_file_name, ui_file.errorString()))
+ sys.exit(-1)
+ loader = QUiLoader()
+ window = loader.load(ui_file)
+ ui_file.close()
+ if not window:
+ print(loader.errorString())
+ sys.exit(-1)
+ window.show()
+
+ sys.exit(app.exec_())
+
+Then to execute it we just need to run the following on a
+command prompt:
+
+.. code-block:: python
+
+ python main.py
diff --git a/sources/pyside6/doc/tutorials/basictutorial/widgets.rst b/sources/pyside6/doc/tutorials/basictutorial/widgets.rst
new file mode 100644
index 000000000..d86ba2623
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/basictutorial/widgets.rst
@@ -0,0 +1,45 @@
+Your First QtWidgets Application
+*********************************
+
+As with any other programming framework,
+you start with the traditional "Hello World" program.
+
+Here is a simple example of a Hello World application in PySide6:
+
+.. code-block:: python
+
+ import sys
+ from PySide6.QtWidgets import QApplication, QLabel
+
+ app = QApplication(sys.argv)
+ label = QLabel("Hello World!")
+ label.show()
+ app.exec_()
+
+
+For a widget application using PySide6, you must always start by
+importing the appropriate class from the `PySide6.QtWidgets` module.
+
+After the imports, you create a `QApplication` instance. As Qt can
+receive arguments from command line, you may pass any argument to
+the QApplication object. Usually, you don't need to pass any
+arguments so you can leave it as is, or use the following approach:
+
+.. code-block:: python
+
+ app = QApplication([])
+
+After the creation of the application object, we have created a
+`QLabel` object. A `QLabel` is a widget that can present text
+(simple or rich, like html), and images:
+
+.. code-block:: python
+
+ # This HTML approach will be valid too!
+ label = QLabel("<font color=red size=40>Hello World!</font>")
+
+.. note:: After creating the label, we call `show()` on it.
+
+Finally, we call `app.exec_()` to enter the Qt main loop and start
+to execute the Qt code. In reality, it is only here where the label
+is shown, but this can be ignored for now.
diff --git a/sources/pyside6/doc/tutorials/basictutorial/widgetstyling-no.png b/sources/pyside6/doc/tutorials/basictutorial/widgetstyling-no.png
new file mode 100644
index 000000000..c30dd621b
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/basictutorial/widgetstyling-no.png
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/basictutorial/widgetstyling-simple-no.png b/sources/pyside6/doc/tutorials/basictutorial/widgetstyling-simple-no.png
new file mode 100644
index 000000000..eb90e216d
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/basictutorial/widgetstyling-simple-no.png
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/basictutorial/widgetstyling-simple-yes.png b/sources/pyside6/doc/tutorials/basictutorial/widgetstyling-simple-yes.png
new file mode 100644
index 000000000..5a714977e
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/basictutorial/widgetstyling-simple-yes.png
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/basictutorial/widgetstyling-yes.png b/sources/pyside6/doc/tutorials/basictutorial/widgetstyling-yes.png
new file mode 100644
index 000000000..8ba49bd26
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/basictutorial/widgetstyling-yes.png
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/basictutorial/widgetstyling.py b/sources/pyside6/doc/tutorials/basictutorial/widgetstyling.py
new file mode 100644
index 000000000..94e44c5c5
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/basictutorial/widgetstyling.py
@@ -0,0 +1,95 @@
+#############################################################################
+##
+## Copyright (C) 2020 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+import sys
+
+from PySide6.QtCore import Qt
+from PySide6.QtWidgets import (QApplication, QHBoxLayout, QLabel, QListWidget,
+ QListWidgetItem, QPushButton, QVBoxLayout,
+ QWidget)
+
+_placeholder = """
+Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
+tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
+veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
+commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
+velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
+occaecat cupidatat non proident, sunt in culpa qui officia deserunt
+mollit anim id est laborum
+"""
+
+
+class Widget(QWidget):
+ def __init__(self, parent=None):
+ super(Widget, self).__init__(parent)
+
+ menu_widget = QListWidget()
+ for i in range(10):
+ item = QListWidgetItem("Item {}".format(i))
+ item.setTextAlignment(Qt.AlignCenter)
+ menu_widget.addItem(item)
+
+ text_widget = QLabel(_placeholder)
+ button = QPushButton("Something")
+
+ content_layout = QVBoxLayout()
+ content_layout.addWidget(text_widget)
+ content_layout.addWidget(button)
+ main_widget = QWidget()
+ main_widget.setLayout(content_layout)
+
+ layout = QHBoxLayout()
+ layout.addWidget(menu_widget, 1)
+ layout.addWidget(main_widget, 4)
+ self.setLayout(layout)
+
+
+if __name__ == "__main__":
+ app = QApplication()
+
+ w = Widget()
+ w.show()
+
+ _style = None
+ with open("style.qss", "r") as f:
+ _style = f.read()
+ app.setStyleSheet(_style)
+
+ sys.exit(app.exec_())
diff --git a/sources/pyside6/doc/tutorials/basictutorial/widgetstyling.rst b/sources/pyside6/doc/tutorials/basictutorial/widgetstyling.rst
new file mode 100644
index 000000000..8deef1d7f
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/basictutorial/widgetstyling.rst
@@ -0,0 +1,169 @@
+Widget Styling
+**************
+
+Qt Widgets application use a default theme depending on the platform.
+In some cases, there are system-wide configurations that modify the Qt theme,
+and applications are displayed differently.
+
+However, you can take care of your own widgets and provide a custom style
+to each component. As an example, look at the following simple snippet:
+
+.. code-block:: python
+
+ import sys
+ from PySide6.QtCore import Qt
+ from PySide6.QtWidgets import QApplication, QLabel
+
+ if __name__ == "__main__":
+ app = QApplication()
+ w = QLabel("This is a placeholder text")
+ w.setAlignment(Qt.AlignCenter)
+ w.show()
+ sys.exit(app.exec_())
+
+When you execute this code, you will see a simple `QLabel` aligned at the
+center, and with a placeholder text.
+
+.. image:: widgetstyling-simple-no.png
+ :alt: Simple Widget with no style
+
+You can style your application using the CSS-like syntax.
+For more information, see `Qt Style Sheets Reference`_.
+
+A `QLabel` can be styled differently by setting some of its CSS
+properties, such as `background-color` and `font-family`,
+so let's see how does the code look like with these changes:
+
+.. code-block:: python
+
+ import sys
+ from PySide6.QtCore import Qt
+ from PySide6.QtWidgets import QApplication, QLabel
+
+ if __name__ == "__main__":
+ app = QApplication()
+ w = QLabel("This is a placeholder text")
+ w.setAlignment(Qt.AlignCenter)
+ w.setStyleSheet("""
+ background-color: #262626;
+ color: #FFFFFF;
+ font-family: Titillium;
+ font-size: 18px;
+ """)
+ w.show()
+ sys.exit(app.exec_())
+
+Now when you run the code, notice that the `QLabel` looks different with your
+custom style:
+
+.. image:: widgetstyling-simple-yes.png
+ :alt: Simple Widget with Style
+
+
+.. note::
+
+ If you don't have the font `Titillium` installed, you can try with any
+ other you prefer.
+ Remember you can list your installed fonts using `QFontDatabase`,
+ specifically the `families()` method.
+
+
+Styling each UI element separately like you did in the previous snippet is a
+lot of work. The easier alternative for this is to use Qt Style Sheets,
+which is one or more `.qss` files defining the style for the UI elements in
+your application.
+
+More examples can be found in the `Qt Style Sheet Examples`_ documentation
+page.
+
+
+.. _`Qt Style Sheets Reference`: https://doc.qt.io/qt-5/stylesheet-reference.html
+.. _`Qt Style Sheet Examples`: https://doc.qt.io/qt-5/stylesheet-examples.html
+
+Qt Style Sheets
+===============
+
+.. warning::
+
+ Before starting modifying your application, keep in mind that you will be
+ responsible for all the graphical details of the application.
+ Altering margins, and sizes might end up looking strange or incorrect, so you
+ need to be careful when altering the style.
+ It's recommended to create a full new Qt style to cover all the possible
+ corner cases.
+
+A `qss` file is quite similar to a CSS file, but you need to specify the Widget
+component and optionally the name of the object::
+
+ QLabel {
+ background-color: red;
+ }
+
+ QLabel#title {
+ font-size: 20px;
+ }
+
+The first style defines a `background-color` for all `QLabel` objects in your
+application, whereas the later one styles the `title` object only.
+
+.. note::
+
+ You can set object names with the `setObjectName(str)` function to any Qt
+ object, for example: for a `label = QLabel("Test")`, you can write
+ `label.setObjectName("title")`
+
+
+Once you have a `qss` file for your application, you can apply it by reading
+the file and using the `QApplication.setStyleSheet(str)` function:
+
+.. code-block:: python
+
+ if __name__ == "__main__":
+ app = QApplication()
+
+ w = Widget()
+ w.show()
+
+ with open("style.qss", "r") as f:
+ _style = f.read()
+ app.setStyleSheet(_style)
+
+ sys.exit(app.exec_())
+
+Having a general `qss` file allows you to decouple the styling aspects of
+the code, without mixing it in the middle of the general functionality, and you
+can simply enable it or disable it.
+
+Look at this new example, with more widgets components:
+
+.. literalinclude:: widgetstyling.py
+ :linenos:
+ :lines: 59-81
+
+This displays a two column widget, with a `QListWidget` on the left and a
+`QLabel` and a `QPushButton` on the right. It looks like this when you run the
+code:
+
+.. image:: widgetstyling-no.png
+ :alt: Widget with no style
+
+If you add content to the previously described `style.qss` file, you can modify
+the look-n-feel of the previous example:
+
+.. literalinclude:: style.qss
+ :linenos:
+
+The style changes mainly the color of the different widgets, alter the
+alignment, and includes some spacing.
+You can also use state-based styling on the QListWidget *items* for example, to
+style them differently depending on whether they are *selected* or not.
+
+After applying all the styling alternatives you explored in this topic, notice
+that the `QLabel` example looks a lot different now.
+Try running the code to check its new look:
+
+.. image:: widgetstyling-yes.png
+ :alt: Widget with style
+
+You have the freedom to tune your style sheets and provide a really nice
+look-n-feel to all your applications.
diff --git a/sources/pyside6/doc/tutorials/datavisualize/add_chart.rst b/sources/pyside6/doc/tutorials/datavisualize/add_chart.rst
new file mode 100644
index 000000000..95b2092b3
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/datavisualize/add_chart.rst
@@ -0,0 +1,20 @@
+Chapter 5 - Add a chart view
+=============================
+
+A table is nice to present data, but a chart is even better. For this, you
+need the QtCharts module that provides many types of plots and options to
+graphically represent data.
+
+The placeholder for a plot is a QChartView, and inside that Widget you can
+place a QChart. As a first step, try including only this without any data to
+plot.
+
+Make the following highlighted changes to :code:`main_widget.py` from the
+previous chapter to add a QChartView:
+
+.. literalinclude:: datavisualize5/main_widget.py
+ :linenos:
+ :lines: 40-
+ :emphasize-lines: 2-3,6,22-36,48-50
+
+
diff --git a/sources/pyside6/doc/tutorials/datavisualize/add_mainwindow.rst b/sources/pyside6/doc/tutorials/datavisualize/add_mainwindow.rst
new file mode 100644
index 000000000..a9ff38a30
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/datavisualize/add_mainwindow.rst
@@ -0,0 +1,32 @@
+Chapter 3 - Create an empty QMainWindow
+==========================================
+
+You can now think of presenting your data in a UI. A QMainWindow provides a
+convenient structure for GUI applications, such as a menu bar and status bar.
+The following image shows the layout that QMainWindow offers out-of-the box:
+
+.. image:: images/QMainWindow-layout.png
+ :alt: QMainWindow layout
+ :align: right
+
+In this case, let your application inherit from QMainWindow, and add the
+following UI elements:
+
+* A "File" menu to open a File dialog.
+* An "Exit" menu close the window.
+* A status message on the status bar when the application starts.
+
+In addition, you can define a fixed size for the window or adjust it based on
+the resolution you currently have. In the following snippet, you will see how
+window size is defined based on available screen width (80%) and height (70%).
+
+.. note:: You can achieve a similar structure using other Qt elements like
+ QMenuBar, QWidget, and QStatusBar. Refer the QMainWindow layout for
+ guidance.
+
+.. literalinclude:: datavisualize3/main_window.py
+ :language: python
+ :linenos:
+ :lines: 40-
+
+Try running the script to see what output you get with it.
diff --git a/sources/pyside6/doc/tutorials/datavisualize/add_tableview.rst b/sources/pyside6/doc/tutorials/datavisualize/add_tableview.rst
new file mode 100644
index 000000000..720918008
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/datavisualize/add_tableview.rst
@@ -0,0 +1,70 @@
+Chapter 4 - Add a QTableView
+=============================
+
+Now that you have a QMainWindow, you can include a centralWidget to your
+interface. Usually, a QWidget is used to display data in most data-driven
+applications. Use a table view to display your data.
+
+The first step is to add a horizontal layout with just a QTableView. You
+can create a QTableView object and place it inside a QHBoxLayout. Once the
+QWidget is properly built, pass the object to the QMainWindow as its central
+widget.
+
+Remember that a QTableView needs a model to display information. In this case,
+you can use a QAbstractTableModel instance.
+
+.. note:: You could also use the default item model that comes with a
+ QTableWidget instead. QTableWidget is a convenience class that reduces
+ your codebase considerably as you don't need to implement a data model.
+ However, it's less flexible than a QTableView, as QTableWidget cannot be
+ used with just any data. For more insight about Qt's model-view framework,
+ refer to the
+ `Model View Programming <http://doc.qt.io/qt-5/model-view-programming.html>`
+ documentation.
+
+Implementing the model for your QTableView, allows you to:
+- set the headers,
+- manipulate the formats of the cell values (remember we have UTC time and float
+numbers),
+- set style properties like text alignment,
+- and even set color properties for the cell or its content.
+
+To subclass the QAbstractTable, you must reimplement its virtual methods,
+rowCount(), columnCount(), and data(). This way, you can ensure that the data
+is handled properly. In addition, reimplement the headerData() method to
+provide the header information to the view.
+
+Here is a script that implements the CustomTableModel:
+
+.. literalinclude:: datavisualize4/table_model.py
+ :language: python
+ :linenos:
+ :lines: 40-
+
+Now, create a QWidget that has a QTableView, and connect it to your
+CustomTableModel.
+
+.. literalinclude:: datavisualize4/main_widget.py
+ :language: python
+ :linenos:
+ :emphasize-lines: 12-17
+ :lines: 40-
+
+You also need minor changes to the :code:`main_window.py` and
+:code:`main.py` from chapter 3 to include the Widget inside the
+MainWindow.
+
+In the following snippets you'll see those changes highlighted:
+
+.. literalinclude:: datavisualize4/main_window.py
+ :language: python
+ :linenos:
+ :lines: 40-
+ :emphasize-lines: 8,11
+
+.. literalinclude:: datavisualize4/main.py
+ :language: python
+ :linenos:
+ :lines: 40-
+ :emphasize-lines: 46-47
+
diff --git a/sources/pyside6/doc/tutorials/datavisualize/all_hour.csv b/sources/pyside6/doc/tutorials/datavisualize/all_hour.csv
new file mode 100644
index 000000000..400947c3c
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/datavisualize/all_hour.csv
@@ -0,0 +1,8 @@
+time,latitude,longitude,depth,mag,magType,nst,gap,dmin,rms,net,id,updated,place,type,horizontalError,depthError,magError,magNst,status,locationSource,magSource
+2019-01-10T12:11:24.810Z,34.1281662,-117.7754974,4.46,1.18,ml,22,69,0.04475,0.13,ci,ci38421072,2019-01-10T12:13:30.138Z,"3km NNW of La Verne, CA",earthquake,0.3,0.55,0.246,6,automatic,ci,ci
+2019-01-10T12:04:26.320Z,19.4433327,-155.6159973,0.72,1.79,md,22,99,0.04026,0.3,hv,hv70763571,2019-01-10T12:07:28.690Z,"26km E of Honaunau-Napoopoo, Hawaii",earthquake,0.6,1.79,0.28,6,automatic,hv,hv
+2019-01-10T11:57:48.980Z,33.3225,-116.3931667,4.84,0.62,ml,15,211,0.05776,0.16,ci,ci38421064,2019-01-10T12:01:29.166Z,"8km NNW of Borrego Springs, CA",earthquake,0.71,0.68,0.111,11,automatic,ci,ci
+2019-01-10T11:52:09.490Z,38.8356667,-122.8366699,1.28,2.74,md,25,77,0.003061,0.04,nc,nc73131566,2019-01-10T12:14:02.757Z,"10km NW of The Geysers, CA",earthquake,0.19,0.29,0.06,7,automatic,nc,nc
+2019-01-10T11:25:44.854Z,65.1082,-149.3701,20.6,2.1,ml,,,,1.02,ak,ak019gq2oer,2019-01-10T11:37:07.060Z,"60km NNW of North Nenana, Alaska",earthquake,,0.3,,,automatic,ak,ak
+2019-01-10T11:25:23.786Z,69.1518,-144.4977,10.4,3.7,ml,,,,0.74,ak,ak019gq2ndz,2019-01-10T11:47:11.284Z,"114km SSW of Kaktovik, Alaska",earthquake,,1.6,,,reviewed,ak,ak
+2019-01-10T11:16:11.761Z,61.3318,-150.0708,20.1,2.7,ml,,,,0.83,ak,ak019gq0ozj,2019-01-10T11:29:24.610Z,"15km NW of Anchorage, Alaska",earthquake,,0.4,,,automatic,ak,ak
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize.tar.bz2 b/sources/pyside6/doc/tutorials/datavisualize/datavisualize.tar.bz2
new file mode 100644
index 000000000..5fe12769a
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize.tar.bz2
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize1/main.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize1/main.py
new file mode 100644
index 000000000..8a8a1dfda
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize1/main.py
@@ -0,0 +1,55 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+import argparse
+import pandas as pd
+
+
+def read_data(fname):
+ return pd.read_csv(fname)
+
+
+if __name__ == "__main__":
+ options = argparse.ArgumentParser()
+ options.add_argument("-f", "--file", type=str, required=True)
+ args = options.parse_args()
+ data = read_data(args.file)
+ print(data)
+
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize2/main.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize2/main.py
new file mode 100644
index 000000000..864cb1a6c
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize2/main.py
@@ -0,0 +1,78 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+import argparse
+import pandas as pd
+
+from PySide6.QtCore import QDateTime, QTimeZone
+
+
+def transform_date(utc, timezone=None):
+ utc_fmt = "yyyy-MM-ddTHH:mm:ss.zzzZ"
+ new_date = QDateTime().fromString(utc, utc_fmt)
+ if timezone:
+ new_date.setTimeZone(timezone)
+ return new_date
+
+
+def read_data(fname):
+ # Read the CSV content
+ df = pd.read_csv(fname)
+
+ # Remove wrong magnitudes
+ df = df.drop(df[df.mag < 0].index)
+ magnitudes = df["mag"]
+
+ # My local timezone
+ timezone = QTimeZone(b"Europe/Berlin")
+
+ # Get timestamp transformed to our timezone
+ times = df["time"].apply(lambda x: transform_date(x, timezone))
+
+ return times, magnitudes
+
+
+if __name__ == "__main__":
+ options = argparse.ArgumentParser()
+ options.add_argument("-f", "--file", type=str, required=True)
+ args = options.parse_args()
+ data = read_data(args.file)
+ print(data)
+
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize3/main.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize3/main.py
new file mode 100644
index 000000000..5dac460a5
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize3/main.py
@@ -0,0 +1,88 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+import sys
+import argparse
+import pandas as pd
+
+from PySide6.QtCore import QDateTime, QTimeZone
+from PySide6.QtWidgets import QApplication
+from main_window import MainWindow
+
+
+def transform_date(utc, timezone=None):
+ utc_fmt = "yyyy-MM-ddTHH:mm:ss.zzzZ"
+ new_date = QDateTime().fromString(utc, utc_fmt)
+ if timezone:
+ new_date.setTimeZone(timezone)
+ return new_date
+
+
+def read_data(fname):
+ # Read the CSV content
+ df = pd.read_csv(fname)
+
+ # Remove wrong magnitudes
+ df = df.drop(df[df.mag < 0].index)
+ magnitudes = df["mag"]
+
+ # My local timezone
+ timezone = QTimeZone(b"Europe/Berlin")
+
+ # Get timestamp transformed to our timezone
+ times = df["time"].apply(lambda x: transform_date(x, timezone))
+
+ return times, magnitudes
+
+
+if __name__ == "__main__":
+ options = argparse.ArgumentParser()
+ options.add_argument("-f", "--file", type=str, required=True)
+ args = options.parse_args()
+ data = read_data(args.file)
+
+ # Qt Application
+ app = QApplication(sys.argv)
+
+ window = MainWindow()
+ window.show()
+
+ sys.exit(app.exec_())
+
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize3/main_window.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize3/main_window.py
new file mode 100644
index 000000000..17fe0e141
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize3/main_window.py
@@ -0,0 +1,69 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+from PySide6.QtCore import Slot
+from PySide6.QtGui import QAction, QKeySequence
+from PySide6.QtWidgets import QMainWindow
+
+
+class MainWindow(QMainWindow):
+ def __init__(self):
+ QMainWindow.__init__(self)
+ self.setWindowTitle("Eartquakes information")
+
+ # Menu
+ self.menu = self.menuBar()
+ self.file_menu = self.menu.addMenu("File")
+
+ # Exit QAction
+ exit_action = QAction("Exit", self)
+ exit_action.setShortcut(QKeySequence.Quit)
+ exit_action.triggered.connect(self.close)
+
+ self.file_menu.addAction(exit_action)
+
+ # Status Bar
+ self.status = self.statusBar()
+ self.status.showMessage("Data loaded and plotted")
+
+ # Window dimensions
+ geometry = qApp.desktop().availableGeometry(self)
+ self.setFixedSize(geometry.width() * 0.8, geometry.height() * 0.7)
+
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/main.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/main.py
new file mode 100644
index 000000000..ffb4d00b0
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/main.py
@@ -0,0 +1,90 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+import sys
+import argparse
+import pandas as pd
+
+from PySide6.QtCore import QDateTime, QTimeZone
+from PySide6.QtWidgets import QApplication
+from main_window import MainWindow
+from main_widget import Widget
+
+
+def transform_date(utc, timezone=None):
+ utc_fmt = "yyyy-MM-ddTHH:mm:ss.zzzZ"
+ new_date = QDateTime().fromString(utc, utc_fmt)
+ if timezone:
+ new_date.setTimeZone(timezone)
+ return new_date
+
+
+def read_data(fname):
+ # Read the CSV content
+ df = pd.read_csv(fname)
+
+ # Remove wrong magnitudes
+ df = df.drop(df[df.mag < 0].index)
+ magnitudes = df["mag"]
+
+ # My local timezone
+ timezone = QTimeZone(b"Europe/Berlin")
+
+ # Get timestamp transformed to our timezone
+ times = df["time"].apply(lambda x: transform_date(x, timezone))
+
+ return times, magnitudes
+
+
+if __name__ == "__main__":
+ options = argparse.ArgumentParser()
+ options.add_argument("-f", "--file", type=str, required=True)
+ args = options.parse_args()
+ data = read_data(args.file)
+
+ # Qt Application
+ app = QApplication(sys.argv)
+
+ widget = Widget(data)
+ window = MainWindow(widget)
+ window.show()
+
+ sys.exit(app.exec_())
+
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/main_widget.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/main_widget.py
new file mode 100644
index 000000000..5113ae0b8
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/main_widget.py
@@ -0,0 +1,80 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+from PySide6.QtWidgets import (QHBoxLayout, QHeaderView, QSizePolicy,
+ QTableView, QWidget)
+
+from table_model import CustomTableModel
+
+
+class Widget(QWidget):
+ def __init__(self, data):
+ QWidget.__init__(self)
+
+ # Getting the Model
+ self.model = CustomTableModel(data)
+
+ # Creating a QTableView
+ self.table_view = QTableView()
+ self.table_view.setModel(self.model)
+
+ # QTableView Headers
+ self.horizontal_header = self.table_view.horizontalHeader()
+ self.vertical_header = self.table_view.verticalHeader()
+ self.horizontal_header.setSectionResizeMode(
+ QHeaderView.ResizeToContents
+ )
+ self.vertical_header.setSectionResizeMode(
+ QHeaderView.ResizeToContents
+ )
+ self.horizontal_header.setStretchLastSection(True)
+
+ # QWidget Layout
+ self.main_layout = QHBoxLayout()
+ size = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
+
+ ## Left layout
+ size.setHorizontalStretch(1)
+ self.table_view.setSizePolicy(size)
+ self.main_layout.addWidget(self.table_view)
+
+ # Set the layout to the QWidget
+ self.setLayout(self.main_layout)
+
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/main_window.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/main_window.py
new file mode 100644
index 000000000..a60a4a1b1
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/main_window.py
@@ -0,0 +1,69 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+from PySide6.QtCore import Slot
+from PySide6.QtGui import QAction, QKeySequence
+from PySide6.QtWidgets import QMainWindow
+
+
+class MainWindow(QMainWindow):
+ def __init__(self, widget):
+ QMainWindow.__init__(self)
+ self.setWindowTitle("Eartquakes information")
+ self.setCentralWidget(widget)
+ # Menu
+ self.menu = self.menuBar()
+ self.file_menu = self.menu.addMenu("File")
+
+ ## Exit QAction
+ exit_action = QAction("Exit", self)
+ exit_action.setShortcut(QKeySequence.Quit)
+ exit_action.triggered.connect(self.close)
+
+ self.file_menu.addAction(exit_action)
+
+ # Status Bar
+ self.status = self.statusBar()
+ self.status.showMessage("Data loaded and plotted")
+
+ # Window dimensions
+ geometry = qApp.desktop().availableGeometry(self)
+ self.setFixedSize(geometry.width() * 0.8, geometry.height() * 0.7)
+
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/table_model.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/table_model.py
new file mode 100644
index 000000000..d9c50acb3
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/table_model.py
@@ -0,0 +1,88 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+from PySide6.QtCore import Qt, QAbstractTableModel, QModelIndex
+from PySide6.QtGui import QColor
+
+
+class CustomTableModel(QAbstractTableModel):
+ def __init__(self, data=None):
+ QAbstractTableModel.__init__(self)
+ self.load_data(data)
+
+ def load_data(self, data):
+ self.input_dates = data[0].values
+ self.input_magnitudes = data[1].values
+
+ self.column_count = 2
+ self.row_count = len(self.input_magnitudes)
+
+ def rowCount(self, parent=QModelIndex()):
+ return self.row_count
+
+ def columnCount(self, parent=QModelIndex()):
+ return self.column_count
+
+ def headerData(self, section, orientation, role):
+ if role != Qt.DisplayRole:
+ return None
+ if orientation == Qt.Horizontal:
+ return ("Date", "Magnitude")[section]
+ else:
+ return "{}".format(section)
+
+ def data(self, index, role=Qt.DisplayRole):
+ column = index.column()
+ row = index.row()
+
+ if role == Qt.DisplayRole:
+ if column == 0:
+ raw_date = self.input_dates[row]
+ date = "{}".format(raw_date.toPython())
+ return date[:-3]
+ elif column == 1:
+ return "{:.2f}".format(self.input_magnitudes[row])
+ elif role == Qt.BackgroundRole:
+ return QColor(Qt.white)
+ elif role == Qt.TextAlignmentRole:
+ return Qt.AlignRight
+
+ return None
+
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/main.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/main.py
new file mode 100644
index 000000000..ffb4d00b0
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/main.py
@@ -0,0 +1,90 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+import sys
+import argparse
+import pandas as pd
+
+from PySide6.QtCore import QDateTime, QTimeZone
+from PySide6.QtWidgets import QApplication
+from main_window import MainWindow
+from main_widget import Widget
+
+
+def transform_date(utc, timezone=None):
+ utc_fmt = "yyyy-MM-ddTHH:mm:ss.zzzZ"
+ new_date = QDateTime().fromString(utc, utc_fmt)
+ if timezone:
+ new_date.setTimeZone(timezone)
+ return new_date
+
+
+def read_data(fname):
+ # Read the CSV content
+ df = pd.read_csv(fname)
+
+ # Remove wrong magnitudes
+ df = df.drop(df[df.mag < 0].index)
+ magnitudes = df["mag"]
+
+ # My local timezone
+ timezone = QTimeZone(b"Europe/Berlin")
+
+ # Get timestamp transformed to our timezone
+ times = df["time"].apply(lambda x: transform_date(x, timezone))
+
+ return times, magnitudes
+
+
+if __name__ == "__main__":
+ options = argparse.ArgumentParser()
+ options.add_argument("-f", "--file", type=str, required=True)
+ args = options.parse_args()
+ data = read_data(args.file)
+
+ # Qt Application
+ app = QApplication(sys.argv)
+
+ widget = Widget(data)
+ window = MainWindow(widget)
+ window.show()
+
+ sys.exit(app.exec_())
+
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/main_widget.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/main_widget.py
new file mode 100644
index 000000000..0f9b14df3
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/main_widget.py
@@ -0,0 +1,91 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+from PySide6.QtCore import QDateTime, Qt
+from PySide6.QtGui import QPainter
+from PySide6.QtWidgets import (QWidget, QHeaderView, QHBoxLayout, QTableView,
+ QSizePolicy)
+from PySide6.QtCharts import QtCharts
+
+from table_model import CustomTableModel
+
+
+class Widget(QWidget):
+ def __init__(self, data):
+ QWidget.__init__(self)
+
+ # Getting the Model
+ self.model = CustomTableModel(data)
+
+ # Creating a QTableView
+ self.table_view = QTableView()
+ self.table_view.setModel(self.model)
+
+ # QTableView Headers
+ self.horizontal_header = self.table_view.horizontalHeader()
+ self.vertical_header = self.table_view.verticalHeader()
+ self.horizontal_header.setSectionResizeMode(QHeaderView.ResizeToContents)
+ self.vertical_header.setSectionResizeMode(QHeaderView.ResizeToContents)
+ self.horizontal_header.setStretchLastSection(True)
+
+ # Creating QChart
+ self.chart = QtCharts.QChart()
+ self.chart.setAnimationOptions(QtCharts.QChart.AllAnimations)
+
+ # Creating QChartView
+ self.chart_view = QtCharts.QChartView(self.chart)
+ self.chart_view.setRenderHint(QPainter.Antialiasing)
+
+ # QWidget Layout
+ self.main_layout = QHBoxLayout()
+ size = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
+
+ ## Left layout
+ size.setHorizontalStretch(1)
+ self.table_view.setSizePolicy(size)
+ self.main_layout.addWidget(self.table_view)
+
+ ## Right Layout
+ size.setHorizontalStretch(4)
+ self.chart_view.setSizePolicy(size)
+ self.main_layout.addWidget(self.chart_view)
+
+ # Set the layout to the QWidget
+ self.setLayout(self.main_layout)
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/main_window.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/main_window.py
new file mode 100644
index 000000000..4b0920133
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/main_window.py
@@ -0,0 +1,69 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+from PySide6.QtCore import Slot
+from PySide6.QtGui import QAction, QKeySequence
+from PySide6.QtWidgets import QMainWindow
+
+
+class MainWindow(QMainWindow):
+ def __init__(self, widget):
+ QMainWindow.__init__(self)
+ self.setWindowTitle("Eartquakes information")
+ self.setCentralWidget(widget)
+ # Menu
+ self.menu = self.menuBar()
+ self.file_menu = self.menu.addMenu("File")
+
+ # Exit QAction
+ exit_action = QAction("Exit", self)
+ exit_action.setShortcut(QKeySequence.Quit)
+ exit_action.triggered.connect(self.close)
+
+ self.file_menu.addAction(exit_action)
+
+ # Status Bar
+ self.status = self.statusBar()
+ self.status.showMessage("Data loaded and plotted")
+
+ # Window dimensions
+ geometry = qApp.desktop().availableGeometry(self)
+ self.setFixedSize(geometry.width() * 0.8, geometry.height() * 0.7)
+
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/table_model.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/table_model.py
new file mode 100644
index 000000000..d9c50acb3
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/table_model.py
@@ -0,0 +1,88 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+from PySide6.QtCore import Qt, QAbstractTableModel, QModelIndex
+from PySide6.QtGui import QColor
+
+
+class CustomTableModel(QAbstractTableModel):
+ def __init__(self, data=None):
+ QAbstractTableModel.__init__(self)
+ self.load_data(data)
+
+ def load_data(self, data):
+ self.input_dates = data[0].values
+ self.input_magnitudes = data[1].values
+
+ self.column_count = 2
+ self.row_count = len(self.input_magnitudes)
+
+ def rowCount(self, parent=QModelIndex()):
+ return self.row_count
+
+ def columnCount(self, parent=QModelIndex()):
+ return self.column_count
+
+ def headerData(self, section, orientation, role):
+ if role != Qt.DisplayRole:
+ return None
+ if orientation == Qt.Horizontal:
+ return ("Date", "Magnitude")[section]
+ else:
+ return "{}".format(section)
+
+ def data(self, index, role=Qt.DisplayRole):
+ column = index.column()
+ row = index.row()
+
+ if role == Qt.DisplayRole:
+ if column == 0:
+ raw_date = self.input_dates[row]
+ date = "{}".format(raw_date.toPython())
+ return date[:-3]
+ elif column == 1:
+ return "{:.2f}".format(self.input_magnitudes[row])
+ elif role == Qt.BackgroundRole:
+ return QColor(Qt.white)
+ elif role == Qt.TextAlignmentRole:
+ return Qt.AlignRight
+
+ return None
+
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/main.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/main.py
new file mode 100644
index 000000000..3402ff856
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/main.py
@@ -0,0 +1,92 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+import sys
+import argparse
+import pandas as pd
+
+from PySide6.QtCore import QDateTime, QTimeZone
+from PySide6.QtWidgets import QApplication
+
+from main_window import MainWindow
+from main_widget import Widget
+
+
+def transform_date(utc, timezone=None):
+ utc_fmt = "yyyy-MM-ddTHH:mm:ss.zzzZ"
+ new_date = QDateTime().fromString(utc, utc_fmt)
+ if timezone:
+ new_date.setTimeZone(timezone)
+ return new_date
+
+
+def read_data(fname):
+ # Read the CSV content
+ df = pd.read_csv(fname)
+
+ # Remove wrong magnitudes
+ df = df.drop(df[df.mag < 0].index)
+ magnitudes = df["mag"]
+
+ # My local timezone
+ timezone = QTimeZone(b"Europe/Berlin")
+
+ # Get timestamp transformed to our timezone
+ times = df["time"].apply(lambda x: transform_date(x, timezone))
+
+ return times, magnitudes
+
+
+if __name__ == "__main__":
+ options = argparse.ArgumentParser()
+ options.add_argument("-f", "--file", type=str, required=True)
+ args = options.parse_args()
+ data = read_data(args.file)
+
+ # Qt Application
+ app = QApplication(sys.argv)
+
+ # QWidget
+ widget = Widget(data)
+ # QMainWindow using QWidget as central widget
+ window = MainWindow(widget)
+
+ window.show()
+ sys.exit(app.exec_())
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/main_widget.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/main_widget.py
new file mode 100644
index 000000000..2934a361f
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/main_widget.py
@@ -0,0 +1,131 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+from PySide6.QtCore import QDateTime, Qt
+from PySide6.QtGui import QPainter
+from PySide6.QtWidgets import (QWidget, QHeaderView, QHBoxLayout, QTableView,
+ QSizePolicy)
+from PySide6.QtCharts import QtCharts
+
+from table_model import CustomTableModel
+
+
+class Widget(QWidget):
+ def __init__(self, data):
+ QWidget.__init__(self)
+
+ # Getting the Model
+ self.model = CustomTableModel(data)
+
+ # Creating a QTableView
+ self.table_view = QTableView()
+ self.table_view.setModel(self.model)
+
+ # QTableView Headers
+ resize = QHeaderView.ResizeToContents
+ self.horizontal_header = self.table_view.horizontalHeader()
+ self.vertical_header = self.table_view.verticalHeader()
+ self.horizontal_header.setSectionResizeMode(resize)
+ self.vertical_header.setSectionResizeMode(resize)
+ self.horizontal_header.setStretchLastSection(True)
+
+ # Creating QChart
+ self.chart = QtCharts.QChart()
+ self.chart.setAnimationOptions(QtCharts.QChart.AllAnimations)
+ self.add_series("Magnitude (Column 1)", [0, 1])
+
+ # Creating QChartView
+ self.chart_view = QtCharts.QChartView(self.chart)
+ self.chart_view.setRenderHint(QPainter.Antialiasing)
+
+ # QWidget Layout
+ self.main_layout = QHBoxLayout()
+ size = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
+
+ # Left layout
+ size.setHorizontalStretch(1)
+ self.table_view.setSizePolicy(size)
+ self.main_layout.addWidget(self.table_view)
+
+ # Right Layout
+ size.setHorizontalStretch(4)
+ self.chart_view.setSizePolicy(size)
+ self.main_layout.addWidget(self.chart_view)
+
+ # Set the layout to the QWidget
+ self.setLayout(self.main_layout)
+
+ def add_series(self, name, columns):
+ # Create QLineSeries
+ self.series = QtCharts.QLineSeries()
+ self.series.setName(name)
+
+ # Filling QLineSeries
+ for i in range(self.model.rowCount()):
+ # Getting the data
+ t = self.model.index(i, 0).data()
+ date_fmt = "yyyy-MM-dd HH:mm:ss.zzz"
+
+ x = QDateTime().fromString(t, date_fmt).toSecsSinceEpoch()
+ y = float(self.model.index(i, 1).data())
+
+ if x > 0 and y > 0:
+ self.series.append(x, y)
+
+ self.chart.addSeries(self.series)
+
+ # Setting X-axis
+ self.axis_x = QtCharts.QDateTimeAxis()
+ self.axis_x.setTickCount(10)
+ self.axis_x.setFormat("dd.MM (h:mm)")
+ self.axis_x.setTitleText("Date")
+ self.chart.addAxis(self.axis_x, Qt.AlignBottom)
+ self.series.attachAxis(self.axis_x)
+ # Setting Y-axis
+ self.axis_y = QtCharts.QValueAxis()
+ self.axis_y.setTickCount(10)
+ self.axis_y.setLabelFormat("%.2f")
+ self.axis_y.setTitleText("Magnitude")
+ self.chart.addAxis(self.axis_y, Qt.AlignLeft)
+ self.series.attachAxis(self.axis_y)
+
+ # Getting the color from the QChart to use it on the QTableView
+ self.model.color = "{}".format(self.series.pen().color().name())
+
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/main_window.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/main_window.py
new file mode 100644
index 000000000..450f6de41
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/main_window.py
@@ -0,0 +1,70 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+from PySide6.QtCore import Slot
+from PySide6.QtGui import QAction, QKeySequence
+from PySide6.QtWidgets import QMainWindow
+
+
+class MainWindow(QMainWindow):
+ def __init__(self, widget):
+ QMainWindow.__init__(self)
+ self.setWindowTitle("Eartquakes information")
+
+ # Menu
+ self.menu = self.menuBar()
+ self.file_menu = self.menu.addMenu("File")
+
+ # Exit QAction
+ exit_action = QAction("Exit", self)
+ exit_action.setShortcut(QKeySequence.Quit)
+ exit_action.triggered.connect(self.close)
+
+ self.file_menu.addAction(exit_action)
+
+ # Status Bar
+ self.status = self.statusBar()
+ self.status.showMessage("Data loaded and plotted")
+
+ # Window dimensions
+ geometry = qApp.desktop().availableGeometry(self)
+ self.setFixedSize(geometry.width() * 0.8, geometry.height() * 0.7)
+ self.setCentralWidget(widget)
+
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/table_model.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/table_model.py
new file mode 100644
index 000000000..abe3bf2ae
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/table_model.py
@@ -0,0 +1,88 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+from PySide6.QtCore import Qt, QAbstractTableModel, QModelIndex
+from PySide6.QtGui import QColor
+
+
+class CustomTableModel(QAbstractTableModel):
+ def __init__(self, data=None):
+ QAbstractTableModel.__init__(self)
+ self.color = None
+ self.load_data(data)
+
+ def load_data(self, data):
+ self.input_dates = data[0].values
+ self.input_magnitudes = data[1].values
+
+ self.column_count = 2
+ self.row_count = len(self.input_magnitudes)
+
+ def rowCount(self, parent=QModelIndex()):
+ return self.row_count
+
+ def columnCount(self, parent=QModelIndex()):
+ return self.column_count
+
+ def headerData(self, section, orientation, role):
+ if role != Qt.DisplayRole:
+ return None
+ if orientation == Qt.Horizontal:
+ return ("Date", "Magnitude")[section]
+ else:
+ return "{}".format(section)
+
+ def data(self, index, role=Qt.DisplayRole):
+ column = index.column()
+ row = index.row()
+
+ if role == Qt.DisplayRole:
+ if column == 0:
+ raw_date = self.input_dates[row]
+ date = "{}".format(raw_date.toPython())
+ return date[:-3]
+ elif column == 1:
+ return "{:.2f}".format(self.input_magnitudes[row])
+ elif role == Qt.BackgroundRole:
+ return (QColor(Qt.white), QColor(self.color))[column]
+ elif role == Qt.TextAlignmentRole:
+ return Qt.AlignRight
+
+ return None
diff --git a/sources/pyside6/doc/tutorials/datavisualize/filter_data.rst b/sources/pyside6/doc/tutorials/datavisualize/filter_data.rst
new file mode 100644
index 000000000..b06b2fa15
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/datavisualize/filter_data.rst
@@ -0,0 +1,29 @@
+Chapter 2 - Filtering data
+===========================
+
+In the previous chapter, you learned how to read and print data that is a
+bit raw. Now, try to select a few columns and handle them properly.
+
+Start with these two columns: Time (time) and Magnitude (mag). After getting
+the information from these columns, filter and adapt the data. Try formatting
+the date to Qt types.
+
+There is not much to do for the Magnitude column, as it's just a floating point
+number. You could take special care to check if the data is correct. This could
+be done by filtering the data that follows the condition, "magnitude > 0", to
+avoid faulty data or unexpected behavior.
+
+The Date column provides data in UTC format (for example,
+2018-12-11T21:14:44.682Z), so you could easily map it to a QDateTime object
+defining the structure of the string. Additionally, you can adapt the time
+based on the timezone you are in, using QTimeZone.
+
+The following script filters and formats the CSV data as described earlier:
+
+.. literalinclude:: datavisualize2/main.py
+ :language: python
+ :linenos:
+ :lines: 40-
+
+Now that you have a tuple of QDateTime and float data, try improving the
+output further. That's what you'll learn in the following chapters.
diff --git a/sources/pyside6/doc/tutorials/datavisualize/images/QMainWindow-layout.png b/sources/pyside6/doc/tutorials/datavisualize/images/QMainWindow-layout.png
new file mode 100644
index 000000000..075d796b8
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/datavisualize/images/QMainWindow-layout.png
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/datavisualize/images/datavisualization_app.png b/sources/pyside6/doc/tutorials/datavisualize/images/datavisualization_app.png
new file mode 100644
index 000000000..ddac43fc3
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/datavisualize/images/datavisualization_app.png
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/datavisualize/index.rst b/sources/pyside6/doc/tutorials/datavisualize/index.rst
new file mode 100644
index 000000000..ff18c654e
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/datavisualize/index.rst
@@ -0,0 +1,26 @@
+Data Visualization Tool Tutorial
+*********************************
+
+In this tutorial, you'll learn about the data visualization capabilities
+of |project|. To start with, find some open data to visualize. For example,
+data about the magnitude of earthquakes during the last hour published on the
+US Geological Survey website. You could download the
+`All earthquakes <https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_day.csv>`_
+open data in a CSV format for this tutorial.
+
+In the following chapters of this tutorial you'll learn how to
+visualize data from a CSV in a line chart.
+
+.. toctree::
+ :glob:
+ :titlesonly:
+
+ read*
+ filter*
+ add_main*
+ add_tab*
+ add_chart*
+ plot*
+
+You can download the sources from :download:`here <datavisualize.tar.bz2>`.
+
diff --git a/sources/pyside6/doc/tutorials/datavisualize/plot_datapoints.rst b/sources/pyside6/doc/tutorials/datavisualize/plot_datapoints.rst
new file mode 100644
index 000000000..8ebdd2b08
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/datavisualize/plot_datapoints.rst
@@ -0,0 +1,25 @@
+Chapter 6 - Plot the data in the ChartView
+===========================================
+
+The last step of this tutorial is to plot the CSV data inside our QChart. For
+this, you need to go over our data and include the data on a QLineSeries.
+
+After adding the data to the series, you can modify the axis to properly
+display the QDateTime on the X-axis, and the magnitude values on the Y-axis.
+
+Here is the updated :code:`main_widget.py` that includes an additional
+function to plot data using a QLineSeries:
+
+.. literalinclude:: datavisualize6/main_widget.py
+ :language: python
+ :linenos:
+ :lines: 40-
+ :emphasize-lines: 33,56-91
+
+Now, run the application to visualize the earthquake magnitudes
+data at different times.
+
+.. image:: images/datavisualization_app.png
+
+Try modifying the sources to get different output. For example, you could try
+to plot more data from the CSV.
diff --git a/sources/pyside6/doc/tutorials/datavisualize/read_data.rst b/sources/pyside6/doc/tutorials/datavisualize/read_data.rst
new file mode 100644
index 000000000..f7bf9337a
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/datavisualize/read_data.rst
@@ -0,0 +1,41 @@
+Chapter 1 - Reading data from a CSV
+===================================
+
+There are several ways to read data from a CSV file. The following are the most
+common ways:
+
+- Native reading
+- the `CSV module <https://docs.python.org/3/library/csv.html>`_
+- the `numpy module <https://www.numpy.org>`_
+- the `pandas module <https://pandas.pydata.org/>`_
+
+In this chapter, you will learn to use pandas to read and filter CSV data.
+In addition, you could pass the data file through a command-line option to your
+script.
+
+The following python script, :code:`main.py`, demonstrates how to do it:
+
+.. literalinclude:: datavisualize1/main.py
+ :language: python
+ :linenos:
+ :lines: 40-
+
+The Python script uses the :code:`argparse` module to accept and parse input
+from the command line. It then uses the input, which in this case is the filename,
+to read and print data to the prompt.
+
+Try running the script in the following way to check if you get desired output:
+
+::
+
+ $python datavisualize1/main.py -f all_hour.csv
+ time latitude longitude depth ... magNst status locationSource magSource
+ 0 2019-01-10T12:11:24.810Z 34.128166 -117.775497 4.46 ... 6.0 automatic ci ci
+ 1 2019-01-10T12:04:26.320Z 19.443333 -155.615997 0.72 ... 6.0 automatic hv hv
+ 2 2019-01-10T11:57:48.980Z 33.322500 -116.393167 4.84 ... 11.0 automatic ci ci
+ 3 2019-01-10T11:52:09.490Z 38.835667 -122.836670 1.28 ... 7.0 automatic nc nc
+ 4 2019-01-10T11:25:44.854Z 65.108200 -149.370100 20.60 ... NaN automatic ak ak
+ 5 2019-01-10T11:25:23.786Z 69.151800 -144.497700 10.40 ... NaN reviewed ak ak
+ 6 2019-01-10T11:16:11.761Z 61.331800 -150.070800 20.10 ... NaN automatic ak ak
+
+ [7 rows x 22 columns]
diff --git a/sources/pyside6/doc/tutorials/expenses/expenses.rst b/sources/pyside6/doc/tutorials/expenses/expenses.rst
new file mode 100644
index 000000000..2aa3fb459
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/expenses/expenses.rst
@@ -0,0 +1,314 @@
+######################
+Expenses Tool Tutorial
+######################
+
+In this tutorial you will learn the following concepts:
+ * creating user interfaces programatically,
+ * layouts and widgets,
+ * overloading Qt classes,
+ * connecting signal and slots,
+ * interacting with QWidgets,
+ * and building your own application.
+
+The requirements:
+ * A simple window for the application
+ (`QMainWindow <https://doc.qt.io/qtforpython/PySide6/QtWidgets/QMainWindow.html>`_).
+ * A table to keep track of the expenses
+ (`QTableWidget <https://doc.qt.io/qtforpython/PySide6/QtWidgets/QTableWidget.html>`_).
+ * Two input fields to add expense information
+ (`QLineEdit <https://doc.qt.io/qtforpython/PySide6/QtWidgets/QLineEdit.html>`_).
+ * Buttons to add information to the table, plot data, clear table, and exit the application
+ (`QPushButton <https://doc.qt.io/qtforpython/PySide6/QtWidgets/QPushButton.html>`_).
+ * A verification step to avoid invalid data entry.
+ * A chart to visualize the expense data
+ (`QChart <https://doc.qt.io/qtforpython/PySide6/QtCharts/QtCharts.QChart.html>`_) that will
+ be embedded in a chart view
+ (`QChartView <https://doc.qt.io/qtforpython/PySide6/QtCharts/QtCharts.QChartView.html>`_).
+
+Empty window
+------------
+
+The base structure for a `QApplication` is located inside the `if __name__ == "__main__":`
+code block.
+
+.. code-block:: python
+ :linenos:
+
+ if __name__ == "__main__":
+ app = QApplication([])
+ # ...
+ sys.exit(app.exec_())
+
+Now, to start the development, create an empty window called `MainWindow`.
+You could do that by defining a class that inherits from `QMainWindow`.
+
+.. literalinclude:: steps/01-expenses.py
+ :linenos:
+ :lines: 45-59
+ :emphasize-lines: 1-4
+
+Now that our class is defined, create an instance of it and call `show()`.
+
+.. literalinclude:: steps/01-expenses.py
+ :linenos:
+ :lines: 45-59
+ :emphasize-lines: 10-12
+
+Menu bar
+--------
+
+Using a `QMainWindow` gives some features for free, among them a *menu bar*. To use it, you need
+to call the method `menuBar()` and populate it inside the `MainWindow` class.
+
+.. literalinclude:: steps/02-expenses.py
+ :linenos:
+ :lines: 46-58
+ :emphasize-lines: 6
+
+Notice that the code snippet adds a *File* menu with the *Exit* option only.
+
+First signal/slot connection
+----------------------------
+
+The *Exit* option must be connected to a slot that triggers the application to exit. The main
+idea to achieve this, is the following:
+
+.. code-block:: python
+
+ element.signal_name.connect(slot_name)
+
+All the interface's elements could be connected through signals to certain slots,
+in the case of a `QAction`, the signal `triggered` can be used:
+
+.. code-block:: python
+
+ exit_action.triggered.connect(slot_name)
+
+.. note:: Now a *slot* needs to be defined to exit the application, which can be done using
+ `QApplication.quit()`. If we put all these concepts together you will end up with the
+ following code:
+
+.. literalinclude:: steps/03-expenses.py
+ :linenos:
+ :lines: 56-65
+ :emphasize-lines: 4, 8-10
+
+Notice that the decorator `@Slot()` is required for each slot you declare to properly
+register them. Slots are normal functions, but the main difference is that they
+will be invokable from `Signals` of QObjects when connected.
+
+Empty widget and data
+---------------------
+
+The `QMainWindow` enables us to set a central widget that will be displayed when showing the window
+(`read more <https://doc.qt.io/qt-5/qmainwindow.html#details>`_).
+This central widget could be another class derived from `QWidget`.
+
+Additionally, you will define example data to visualize later.
+
+.. literalinclude:: steps/04-expenses.py
+ :linenos:
+ :lines: 46-53
+
+With the `Widget` class in place, modify `MainWindow`'s initialization code
+
+.. literalinclude:: steps/04-expenses.py
+ :linenos:
+ :lines: 80-84
+
+Window layout
+-------------
+
+Now that the main empty window is in place, you need to start adding widgets to achieve the main
+goal of creating an expenses application.
+
+After declaring the example data, you can visualize it on a simple `QTableWidget`. To do so, you
+will add this procedure to the `Widget` constructor.
+
+.. warning:: Only for the example purpose a QTableWidget will be used,
+ but for more performance-critical applications the combination
+ of a model and a QTableView is encouraged.
+
+.. literalinclude:: steps/05-expenses.py
+ :linenos:
+ :lines: 48-73
+
+As you can see, the code also includes a `QHBoxLayout` that provides the container to place widgets
+horizontally.
+
+Additionally, the `QTableWidget` allows for customizing it, like adding the labels for the two
+columns that will be used, and to *stretch* the content to use the whole `Widget` space.
+
+The last line of code refers to *filling the table**, and the code to perform that task is
+displayed below.
+
+.. literalinclude:: steps/05-expenses.py
+ :linenos:
+ :lines: 75-81
+
+Having this process on a separate method is a good practice to leave the constructor more readable,
+and to split the main functions of the class in independent processes.
+
+
+Right side layout
+-----------------
+
+Because the data that is being used is just an example, you are required to include a mechanism to
+input items to the table, and extra buttons to clear the table's content, and also quit the
+application.
+
+To distribute these input lines and buttons, you will use a `QVBoxLayout` that allows you to place
+elements vertically inside a layout.
+
+.. literalinclude:: steps/06-expenses.py
+ :linenos:
+ :lines: 64-80
+
+Leaving the table on the left side and these newly included widgets to the right side
+will be just a matter to add a layout to our main `QHBoxLayout` as you saw in the previous
+example:
+
+.. literalinclude:: steps/06-expenses.py
+ :linenos:
+ :lines: 42-47
+
+The next step will be connecting those new buttons to slots.
+
+
+Adding elements
+---------------
+
+Each `QPushButton` have a signal called *clicked*, that is emitted when you click on the button.
+This will be more than enough for this example, but you can see other signals in the `official
+documentation <https://doc.qt.io/qtforpython/PySide6/QtWidgets/QAbstractButton.html#signals>`_.
+
+.. literalinclude:: steps/07-expenses.py
+ :linenos:
+ :lines: 92-95
+
+As you can see on the previous lines, we are connecting each *clicked* signal to different slots.
+In this example slots are normal class methods in charge of perform a determined task associated
+with our buttons. It is really important to decorate each method declaration with a `@Slot()`, in
+that way PySide6 knows internally how to register them into Qt.
+
+.. literalinclude:: steps/07-expenses.py
+ :linenos:
+ :lines: 100-129
+ :emphasize-lines: 2,16,28
+
+Since these slots are methods, we can access the class variables, like our `QTableWidget` to
+interact with it.
+
+The mechanism to add elements into the table is described as the following:
+
+ * get the *description* and *price* from the fields,
+ * insert a new empty row to the table,
+ * set the values for the empty row in each column,
+ * clear the input text fields,
+ * include the global count of table rows.
+
+To exit the application you can use the `quit()` method of the unique `QApplication` instance, and
+to clear the content of the table you can just set the table *row count*, and the internal count to
+zero.
+
+Verification step
+-----------------
+
+Adding information to the table needs to be a critical action that require a verification step
+to avoid adding invalid information, for example, empty information.
+
+You can use a signal from `QLineEdit` called *textChanged[str]* which will be emitted every
+time something inside changes, i.e.: each key stroke.
+Notice that this time, there is a *[str]* section on the signal, this means that the signal
+will also emit the value of the text that was changed, which will be really useful to verify
+the current content of the `QLineEdit`.
+
+You can connect two different object's signal to the same slot, and this will be the case
+for your current application:
+
+.. literalinclude:: steps/08-expenses.py
+ :linenos:
+ :lines: 99-100
+
+The content of the *check_disable* slot will be really simple:
+
+.. literalinclude:: steps/08-expenses.py
+ :linenos:
+ :lines: 119-124
+
+You have two options, write a verification based on the current value
+of the string you retrieve, or manually get the whole content of both
+`QLineEdit`. The second is preferred in this case, so you can verify
+if the two inputs are not empty to enable the button *Add*.
+
+.. note:: Qt also provides a special class called
+ `QValidator <https://doc.qt.io/qtforpython/PySide6/QtGui/QValidator.html?highlight=qvalidator>`_
+ that you can use to validate any input.
+
+Empty chart view
+----------------
+
+New items can be added to the table, and the visualization is so far
+OK, but you can accomplish more by representing the data graphically.
+
+First you will include an empty `QChartView` placeholder into the right
+side of your application.
+
+.. literalinclude:: steps/09-expenses.py
+ :linenos:
+ :lines: 66-68
+
+Additionally the order of how you include widgets to the right
+`QVBoxLayout` will also change.
+
+.. literalinclude:: steps/09-expenses.py
+ :linenos:
+ :lines: 81-91
+ :emphasize-lines: 9
+
+Notice that before we had a line with `self.right.addStretch()`
+to fill up the vertical space between the *Add* and the *Clear* buttons,
+but now, with the `QChartView` it will not be necessary.
+
+Also, you need include a *Plot* button if you want to do it on-demand.
+
+Full application
+----------------
+
+For the final step, you will need to connect the *Plot* button
+to a slot that creates a chart and includes it into your `QChartView`.
+
+.. literalinclude:: steps/10-expenses.py
+ :linenos:
+ :lines: 103-109
+ :emphasize-lines: 6
+
+That is nothing new, since you already did it for the other buttons,
+but now take a look at how to create a chart and include it into
+your `QChartView`.
+
+.. literalinclude:: steps/10-expenses.py
+ :linenos:
+ :lines: 139-151
+
+The following steps show how to fill a `QPieSeries`:
+
+ * create a `QPieSeries`,
+ * iterate over the table row IDs,
+ * get the items at the *i* position,
+ * add those values to the *series*.
+
+Once the series has been populated with our data, you create a new `QChart`,
+add the series on it, and optionally set an alignment for the legend.
+
+The final line `self.chart_view.setChart(chart)` is in charge of bringing
+your newly created chart to the `QChartView`.
+
+The application will look like this:
+
+.. image:: expenses_tool.png
+
+And now you can see the whole code:
+
+.. literalinclude:: main.py
+ :linenos:
diff --git a/sources/pyside6/doc/tutorials/expenses/expenses_tool.png b/sources/pyside6/doc/tutorials/expenses/expenses_tool.png
new file mode 100644
index 000000000..7a6f6d1f0
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/expenses/expenses_tool.png
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/expenses/main.py b/sources/pyside6/doc/tutorials/expenses/main.py
new file mode 100644
index 000000000..2eec5defb
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/expenses/main.py
@@ -0,0 +1,207 @@
+#############################################################################
+##
+## Copyright (C) 2020 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+import sys
+from PySide6.QtCore import Qt, Slot
+from PySide6.QtGui import QAction, QPainter
+from PySide6.QtWidgets import (QApplication, QHeaderView, QHBoxLayout, QLabel, QLineEdit,
+ QMainWindow, QPushButton, QTableWidget, QTableWidgetItem,
+ QVBoxLayout, QWidget)
+from PySide6.QtCharts import QtCharts
+
+
+class Widget(QWidget):
+ def __init__(self):
+ QWidget.__init__(self)
+ self.items = 0
+
+ # Example data
+ self._data = {"Water": 24.5, "Electricity": 55.1, "Rent": 850.0,
+ "Supermarket": 230.4, "Internet": 29.99, "Bars": 21.85,
+ "Public transportation": 60.0, "Coffee": 22.45, "Restaurants": 120}
+
+ # Left
+ self.table = QTableWidget()
+ self.table.setColumnCount(2)
+ self.table.setHorizontalHeaderLabels(["Description", "Price"])
+ self.table.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch)
+
+ # Chart
+ self.chart_view = QtCharts.QChartView()
+ self.chart_view.setRenderHint(QPainter.Antialiasing)
+
+ # Right
+ self.description = QLineEdit()
+ self.price = QLineEdit()
+ self.add = QPushButton("Add")
+ self.clear = QPushButton("Clear")
+ self.quit = QPushButton("Quit")
+ self.plot = QPushButton("Plot")
+
+ # Disabling 'Add' button
+ self.add.setEnabled(False)
+
+ self.right = QVBoxLayout()
+ self.right.setMargin(10)
+ self.right.addWidget(QLabel("Description"))
+ self.right.addWidget(self.description)
+ self.right.addWidget(QLabel("Price"))
+ self.right.addWidget(self.price)
+ self.right.addWidget(self.add)
+ self.right.addWidget(self.plot)
+ self.right.addWidget(self.chart_view)
+ self.right.addWidget(self.clear)
+ self.right.addWidget(self.quit)
+
+ # QWidget Layout
+ self.layout = QHBoxLayout()
+
+ #self.table_view.setSizePolicy(size)
+ self.layout.addWidget(self.table)
+ self.layout.addLayout(self.right)
+
+ # Set the layout to the QWidget
+ self.setLayout(self.layout)
+
+ # Signals and Slots
+ self.add.clicked.connect(self.add_element)
+ self.quit.clicked.connect(self.quit_application)
+ self.plot.clicked.connect(self.plot_data)
+ self.clear.clicked.connect(self.clear_table)
+ self.description.textChanged[str].connect(self.check_disable)
+ self.price.textChanged[str].connect(self.check_disable)
+
+ # Fill example data
+ self.fill_table()
+
+ @Slot()
+ def add_element(self):
+ des = self.description.text()
+ price = self.price.text()
+
+ self.table.insertRow(self.items)
+ description_item = QTableWidgetItem(des)
+ price_item = QTableWidgetItem("{:.2f}".format(float(price)))
+ price_item.setTextAlignment(Qt.AlignRight)
+
+ self.table.setItem(self.items, 0, description_item)
+ self.table.setItem(self.items, 1, price_item)
+
+ self.description.setText("")
+ self.price.setText("")
+
+ self.items += 1
+
+ @Slot()
+ def check_disable(self, s):
+ if not self.description.text() or not self.price.text():
+ self.add.setEnabled(False)
+ else:
+ self.add.setEnabled(True)
+
+ @Slot()
+ def plot_data(self):
+ # Get table information
+ series = QtCharts.QPieSeries()
+ for i in range(self.table.rowCount()):
+ text = self.table.item(i, 0).text()
+ number = float(self.table.item(i, 1).text())
+ series.append(text, number)
+
+ chart = QtCharts.QChart()
+ chart.addSeries(series)
+ chart.legend().setAlignment(Qt.AlignLeft)
+ self.chart_view.setChart(chart)
+
+ @Slot()
+ def quit_application(self):
+ QApplication.quit()
+
+ def fill_table(self, data=None):
+ data = self._data if not data else data
+ for desc, price in data.items():
+ description_item = QTableWidgetItem(desc)
+ price_item = QTableWidgetItem("{:.2f}".format(price))
+ price_item.setTextAlignment(Qt.AlignRight)
+ self.table.insertRow(self.items)
+ self.table.setItem(self.items, 0, description_item)
+ self.table.setItem(self.items, 1, price_item)
+ self.items += 1
+
+ @Slot()
+ def clear_table(self):
+ self.table.setRowCount(0)
+ self.items = 0
+
+
+class MainWindow(QMainWindow):
+ def __init__(self, widget):
+ QMainWindow.__init__(self)
+ self.setWindowTitle("Tutorial")
+
+ # Menu
+ self.menu = self.menuBar()
+ self.file_menu = self.menu.addMenu("File")
+
+ # Exit QAction
+ exit_action = QAction("Exit", self)
+ exit_action.setShortcut("Ctrl+Q")
+ exit_action.triggered.connect(self.exit_app)
+
+ self.file_menu.addAction(exit_action)
+ self.setCentralWidget(widget)
+
+ @Slot()
+ def exit_app(self, checked):
+ QApplication.quit()
+
+
+if __name__ == "__main__":
+ # Qt Application
+ app = QApplication(sys.argv)
+ # QWidget
+ widget = Widget()
+ # QMainWindow using QWidget as central widget
+ window = MainWindow(widget)
+ window.resize(800, 600)
+ window.show()
+
+ # Execute application
+ sys.exit(app.exec_())
diff --git a/sources/pyside6/doc/tutorials/expenses/main_snake_prop.py b/sources/pyside6/doc/tutorials/expenses/main_snake_prop.py
new file mode 100644
index 000000000..cea2f5767
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/expenses/main_snake_prop.py
@@ -0,0 +1,210 @@
+#############################################################################
+##
+## Copyright (C) 2020 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+import sys
+from PySide6.QtCore import QMargins, Qt, Slot, QSize
+from PySide6.QtGui import QPainter
+from PySide6.QtWidgets import (QAction, QApplication, QHeaderView, QHBoxLayout, QLabel, QLineEdit,
+ QMainWindow, QPushButton, QTableWidget, QTableWidgetItem,
+ QVBoxLayout, QWidget)
+from PySide6.QtCharts import QtCharts
+
+from __feature__ import snake_case, true_property
+
+
+class Widget(QWidget):
+ def __init__(self):
+ QWidget.__init__(self)
+ self.items = 0
+
+ # Example data
+ self._data = {"Water": 24.5, "Electricity": 55.1, "Rent": 850.0,
+ "Supermarket": 230.4, "Internet": 29.99, "Bars": 21.85,
+ "Public transportation": 60.0, "Coffee": 22.45, "Restaurants": 120}
+
+ # Left
+ self.table = QTableWidget()
+ self.table.column_count = 2
+ self.table.horizontal_header_labels = ["Description", "Price"]
+ self.table.horizontal_header().section_resize_mode = QHeaderView.Stretch
+
+ # Chart
+ self.chart_view = QtCharts.QChartView()
+ self.chart_view.render_hint = QPainter.Antialiasing
+
+ # Right
+ self.description = QLineEdit()
+ self.price = QLineEdit()
+ self.add = QPushButton("Add")
+ self.clear = QPushButton("Clear")
+ self.quit = QPushButton("Quit")
+ self.plot = QPushButton("Plot")
+
+ # Disabling 'Add' button
+ self.add.enabled = False
+
+ self.right = QVBoxLayout()
+
+ self.right.contents_margins = QMargins(10, 10, 10, 10)
+ self.right.add_widget(QLabel("Description"))
+ self.right.add_widget(self.description)
+ self.right.add_widget(QLabel("Price"))
+ self.right.add_widget(self.price)
+ self.right.add_widget(self.add)
+ self.right.add_widget(self.plot)
+ self.right.add_widget(self.chart_view)
+ self.right.add_widget(self.clear)
+ self.right.add_widget(self.quit)
+
+ # QWidget Layout
+ self.layout = QHBoxLayout()
+
+ #self.table_view.setSizePolicy(size)
+ self.layout.add_widget(self.table)
+ self.layout.add_layout(self.right)
+
+ # Set the layout to the QWidget
+ self.set_layout(self.layout)
+
+ # Signals and Slots
+ self.add.clicked.connect(self.add_element)
+ self.quit.clicked.connect(self.quit_application)
+ self.plot.clicked.connect(self.plot_data)
+ self.clear.clicked.connect(self.clear_table)
+ self.description.textChanged[str].connect(self.check_disable)
+ self.price.textChanged[str].connect(self.check_disable)
+
+ # Fill example data
+ self.fill_table()
+
+ @Slot()
+ def add_element(self):
+ des = self.description.text
+ price = self.price.text
+
+ self.table.insert_row(self.items)
+ description_item = QTableWidgetItem(des)
+ price_item = QTableWidgetItem("{:.2f}".format(float(price)))
+ price_item.text_alignment = Qt.AlignRight
+
+ self.table.set_item(self.items, 0, description_item)
+ self.table.set_item(self.items, 1, price_item)
+
+ self.description.text = ""
+ self.price.text = ""
+
+ self.items += 1
+
+ @Slot()
+ def check_disable(self, s):
+ if not self.description.text or not self.price.text:
+ self.add.enabled = False
+ else:
+ self.add.enabled = True
+
+ @Slot()
+ def plot_data(self):
+ # Get table information
+ series = QtCharts.QPieSeries()
+ for i in range(self.table.row_count):
+ text = self.table.item(i, 0).text()
+ number = float(self.table.item(i, 1).text())
+ series.append(text, number)
+
+ chart = QtCharts.QChart()
+ chart.add_series(series)
+ chart.legend().alignment = Qt.AlignLeft
+ self.chart_view.set_chart(chart)
+
+ @Slot()
+ def quit_application(self):
+ QApplication.quit()
+
+ def fill_table(self, data=None):
+ data = self._data if not data else data
+ for desc, price in data.items():
+ description_item = QTableWidgetItem(desc)
+ price_item = QTableWidgetItem("{:.2f}".format(price))
+ price_item.text_alignment = Qt.AlignRight
+ self.table.insert_row(self.items)
+ self.table.set_item(self.items, 0, description_item)
+ self.table.set_item(self.items, 1, price_item)
+ self.items += 1
+
+ @Slot()
+ def clear_table(self):
+ self.table.row_count = 0
+ self.items = 0
+
+
+class MainWindow(QMainWindow):
+ def __init__(self, widget):
+ QMainWindow.__init__(self)
+ self.window_title = "Tutorial"
+
+ # Menu
+ self.menu = self.menu_bar()
+ self.file_menu = self.menu.add_menu("File")
+
+ # Exit QAction
+ exit_action = QAction("Exit", self)
+ exit_action.shortcut = "Ctrl+Q"
+ exit_action.triggered.connect(self.exit_app)
+
+ self.file_menu.add_action(exit_action)
+ self.set_central_widget(widget)
+
+ @Slot()
+ def exit_app(self, checked):
+ QApplication.quit()
+
+
+if __name__ == "__main__":
+ # Qt Application
+ app = QApplication(sys.argv)
+ # QWidget
+ widget = Widget()
+ # QMainWindow using QWidget as central widget
+ window = MainWindow(widget)
+ window.size = QSize(800, 600)
+ window.show()
+
+ # Execute application
+ sys.exit(app.exec_())
diff --git a/sources/pyside6/doc/tutorials/expenses/steps/01-expenses.py b/sources/pyside6/doc/tutorials/expenses/steps/01-expenses.py
new file mode 100644
index 000000000..efbbc59fc
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/expenses/steps/01-expenses.py
@@ -0,0 +1,59 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+import sys
+from PySide6.QtWidgets import QApplication, QMainWindow
+
+
+class MainWindow(QMainWindow):
+ def __init__(self):
+ QMainWindow.__init__(self)
+ self.setWindowTitle("Tutorial")
+
+if __name__ == "__main__":
+ # Qt Application
+ app = QApplication(sys.argv)
+
+ window = MainWindow()
+ window.resize(800, 600)
+ window.show()
+
+ # Execute application
+ sys.exit(app.exec_())
diff --git a/sources/pyside6/doc/tutorials/expenses/steps/02-expenses.py b/sources/pyside6/doc/tutorials/expenses/steps/02-expenses.py
new file mode 100644
index 000000000..783283d4f
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/expenses/steps/02-expenses.py
@@ -0,0 +1,71 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+import sys
+from PySide6.QtGui import QAction
+from PySide6.QtWidgets import QApplication, QMainWindow
+
+
+class MainWindow(QMainWindow):
+ def __init__(self):
+ QMainWindow.__init__(self)
+ self.setWindowTitle("Tutorial")
+
+ # Menu
+ self.menu = self.menuBar()
+ self.file_menu = self.menu.addMenu("File")
+
+ # Exit QAction
+ exit_action = QAction("Exit", self)
+ exit_action.setShortcut("Ctrl+Q")
+
+ self.file_menu.addAction(exit_action)
+
+
+if __name__ == "__main__":
+ # Qt Application
+ app = QApplication(sys.argv)
+
+ window = MainWindow()
+ window.resize(800, 600)
+ window.show()
+
+ # Execute application
+ sys.exit(app.exec_())
diff --git a/sources/pyside6/doc/tutorials/expenses/steps/03-expenses.py b/sources/pyside6/doc/tutorials/expenses/steps/03-expenses.py
new file mode 100644
index 000000000..bebf0b3ce
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/expenses/steps/03-expenses.py
@@ -0,0 +1,78 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+import sys
+from PySide6.QtCore import Slot
+from PySide6.QtGui import QAction
+from PySide6.QtWidgets import QApplication, QMainWindow
+from PySide6.QtCharts import QtCharts
+
+
+class MainWindow(QMainWindow):
+ def __init__(self):
+ QMainWindow.__init__(self)
+ self.setWindowTitle("Tutorial")
+
+ # Menu
+ self.menu = self.menuBar()
+ self.file_menu = self.menu.addMenu("File")
+
+ # Exit QAction
+ exit_action = QAction("Exit", self)
+ exit_action.setShortcut("Ctrl+Q")
+ exit_action.triggered.connect(self.exit_app)
+
+ self.file_menu.addAction(exit_action)
+
+ @Slot()
+ def exit_app(self, checked):
+ QApplication.quit()
+
+
+if __name__ == "__main__":
+ # Qt Application
+ app = QApplication(sys.argv)
+
+ window = MainWindow()
+ window.resize(800, 600)
+ window.show()
+
+ # Execute application
+ sys.exit(app.exec_())
diff --git a/sources/pyside6/doc/tutorials/expenses/steps/04-expenses.py b/sources/pyside6/doc/tutorials/expenses/steps/04-expenses.py
new file mode 100644
index 000000000..a9a4c10a1
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/expenses/steps/04-expenses.py
@@ -0,0 +1,90 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+import sys
+from PySide6.QtCore import Slot
+from PySide6.QtGui import QAction
+from PySide6.QtWidgets import QApplication, QMainWindow, QWidget
+
+
+class Widget(QWidget):
+ def __init__(self):
+ QWidget.__init__(self)
+
+ # Example data
+ self._data = {"Water": 24.5, "Electricity": 55.1, "Rent": 850.0,
+ "Supermarket": 230.4, "Internet": 29.99, "Bars": 21.85,
+ "Public transportation": 60.0, "Coffee": 22.45, "Restaurants": 120}
+
+
+class MainWindow(QMainWindow):
+ def __init__(self, widget):
+ QMainWindow.__init__(self)
+ self.setWindowTitle("Tutorial")
+
+ # Menu
+ self.menu = self.menuBar()
+ self.file_menu = self.menu.addMenu("File")
+
+ # Exit QAction
+ exit_action = QAction("Exit", self)
+ exit_action.setShortcut("Ctrl+Q")
+ exit_action.triggered.connect(self.exit_app)
+
+ self.file_menu.addAction(exit_action)
+ self.setCentralWidget(widget)
+
+ @Slot()
+ def exit_app(self, checked):
+ QApplication.quit()
+
+
+if __name__ == "__main__":
+ # Qt Application
+ app = QApplication(sys.argv)
+ # QWidget
+ widget = Widget()
+ # QMainWindow using QWidget as central widget
+ window = MainWindow(widget)
+ window.resize(800, 600)
+ window.show()
+
+ # Execute application
+ sys.exit(app.exec_())
diff --git a/sources/pyside6/doc/tutorials/expenses/steps/05-expenses.py b/sources/pyside6/doc/tutorials/expenses/steps/05-expenses.py
new file mode 100644
index 000000000..3b22c2631
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/expenses/steps/05-expenses.py
@@ -0,0 +1,118 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+import sys
+from PySide6.QtCore import Slot
+from PySide6.QtGui import QAction
+from PySide6.QtWidgets import (QApplication, QHeaderView, QHBoxLayout, QMainWindow,
+ QTableWidget, QTableWidgetItem, QWidget)
+
+
+class Widget(QWidget):
+ def __init__(self):
+ QWidget.__init__(self)
+ self.items = 0
+
+ # Example data
+ self._data = {"Water": 24.5, "Electricity": 55.1, "Rent": 850.0,
+ "Supermarket": 230.4, "Internet": 29.99, "Bars": 21.85,
+ "Public transportation": 60.0, "Coffee": 22.45, "Restaurants": 120}
+
+ # Left
+ self.table = QTableWidget()
+ self.table.setColumnCount(2)
+ self.table.setHorizontalHeaderLabels(["Description", "Price"])
+ self.table.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch)
+
+ # QWidget Layout
+ self.layout = QHBoxLayout()
+
+ #self.table_view.setSizePolicy(size)
+ self.layout.addWidget(self.table)
+
+ # Set the layout to the QWidget
+ self.setLayout(self.layout)
+
+ # Fill example data
+ self.fill_table()
+
+ def fill_table(self, data=None):
+ data = self._data if not data else data
+ for desc, price in data.items():
+ self.table.insertRow(self.items)
+ self.table.setItem(self.items, 0, QTableWidgetItem(desc))
+ self.table.setItem(self.items, 1, QTableWidgetItem(str(price)))
+ self.items += 1
+
+
+class MainWindow(QMainWindow):
+ def __init__(self, widget):
+ QMainWindow.__init__(self)
+ self.setWindowTitle("Tutorial")
+
+ # Menu
+ self.menu = self.menuBar()
+ self.file_menu = self.menu.addMenu("File")
+
+ # Exit QAction
+ exit_action = QAction("Exit", self)
+ exit_action.setShortcut("Ctrl+Q")
+ exit_action.triggered.connect(self.exit_app)
+
+ self.file_menu.addAction(exit_action)
+ self.setCentralWidget(widget)
+
+ @Slot()
+ def exit_app(self, checked):
+ QApplication.quit()
+
+
+if __name__ == "__main__":
+ # Qt Application
+ app = QApplication(sys.argv)
+ # QWidget
+ widget = Widget()
+ # QMainWindow using QWidget as central widget
+ window = MainWindow(widget)
+ window.resize(800, 600)
+ window.show()
+
+ # Execute application
+ sys.exit(app.exec_())
diff --git a/sources/pyside6/doc/tutorials/expenses/steps/06-expenses.py b/sources/pyside6/doc/tutorials/expenses/steps/06-expenses.py
new file mode 100644
index 000000000..5e6bcc0e9
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/expenses/steps/06-expenses.py
@@ -0,0 +1,138 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+import sys
+from PySide6.QtCore import Slot
+from PySide6.QtGui import QAction
+from PySide6.QtWidgets import (QApplication, QHeaderView, QHBoxLayout, QLabel, QLineEdit,
+ QMainWindow, QPushButton, QTableWidget, QTableWidgetItem,
+ QVBoxLayout, QWidget)
+
+
+class Widget(QWidget):
+ def __init__(self):
+ QWidget.__init__(self)
+ self.items = 0
+
+ # Example data
+ self._data = {"Water": 24.5, "Electricity": 55.1, "Rent": 850.0,
+ "Supermarket": 230.4, "Internet": 29.99, "Bars": 21.85,
+ "Public transportation": 60.0, "Coffee": 22.45, "Restaurants": 120}
+
+ # Left
+ self.table = QTableWidget()
+ self.table.setColumnCount(2)
+ self.table.setHorizontalHeaderLabels(["Description", "Price"])
+ self.table.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch)
+
+ # Right
+ self.description = QLineEdit()
+ self.price = QLineEdit()
+ self.add = QPushButton("Add")
+ self.clear = QPushButton("Clear")
+ self.quit = QPushButton("Quit")
+
+ self.right = QVBoxLayout()
+ self.right.setMargin(10)
+ self.right.addWidget(QLabel("Description"))
+ self.right.addWidget(self.description)
+ self.right.addWidget(QLabel("Price"))
+ self.right.addWidget(self.price)
+ self.right.addWidget(self.add)
+ self.right.addStretch()
+ self.right.addWidget(self.clear)
+ self.right.addWidget(self.quit)
+
+ # QWidget Layout
+ self.layout = QHBoxLayout()
+
+ #self.table_view.setSizePolicy(size)
+ self.layout.addWidget(self.table)
+ self.layout.addLayout(self.right)
+
+ # Set the layout to the QWidget
+ self.setLayout(self.layout)
+
+ # Fill example data
+ self.fill_table()
+
+ def fill_table(self, data=None):
+ data = self._data if not data else data
+ for desc, price in data.items():
+ self.table.insertRow(self.items)
+ self.table.setItem(self.items, 0, QTableWidgetItem(desc))
+ self.table.setItem(self.items, 1, QTableWidgetItem(str(price)))
+ self.items += 1
+
+
+class MainWindow(QMainWindow):
+ def __init__(self, widget):
+ QMainWindow.__init__(self)
+ self.setWindowTitle("Tutorial")
+
+ # Menu
+ self.menu = self.menuBar()
+ self.file_menu = self.menu.addMenu("File")
+
+ # Exit QAction
+ exit_action = QAction("Exit", self)
+ exit_action.setShortcut("Ctrl+Q")
+ exit_action.triggered.connect(self.exit_app)
+
+ self.file_menu.addAction(exit_action)
+ self.setCentralWidget(widget)
+
+ @Slot()
+ def exit_app(self, checked):
+ QApplication.quit()
+
+
+if __name__ == "__main__":
+ # Qt Application
+ app = QApplication(sys.argv)
+ # QWidget
+ widget = Widget()
+ # QMainWindow using QWidget as central widget
+ window = MainWindow(widget)
+ window.resize(800, 600)
+ window.show()
+
+ # Execute application
+ sys.exit(app.exec_())
diff --git a/sources/pyside6/doc/tutorials/expenses/steps/07-expenses.py b/sources/pyside6/doc/tutorials/expenses/steps/07-expenses.py
new file mode 100644
index 000000000..aa7ee6a3a
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/expenses/steps/07-expenses.py
@@ -0,0 +1,165 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+import sys
+from PySide6.QtCore import Slot
+from PySide6.QtGui import QAction
+from PySide6.QtWidgets import (QApplication, QHeaderView, QHBoxLayout, QLabel, QLineEdit,
+ QMainWindow, QPushButton, QTableWidget, QTableWidgetItem,
+ QVBoxLayout, QWidget)
+
+
+class Widget(QWidget):
+ def __init__(self):
+ QWidget.__init__(self)
+ self.items = 0
+
+ # Example data
+ self._data = {"Water": 24.5, "Electricity": 55.1, "Rent": 850.0,
+ "Supermarket": 230.4, "Internet": 29.99, "Bars": 21.85,
+ "Public transportation": 60.0, "Coffee": 22.45, "Restaurants": 120}
+
+ # Left
+ self.table = QTableWidget()
+ self.table.setColumnCount(2)
+ self.table.setHorizontalHeaderLabels(["Description", "Price"])
+ self.table.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch)
+
+ # Right
+ self.description = QLineEdit()
+ self.price = QLineEdit()
+ self.add = QPushButton("Add")
+ self.clear = QPushButton("Clear")
+ self.quit = QPushButton("Quit")
+
+ self.right = QVBoxLayout()
+ self.right.setMargin(10)
+ self.right.addWidget(QLabel("Description"))
+ self.right.addWidget(self.description)
+ self.right.addWidget(QLabel("Price"))
+ self.right.addWidget(self.price)
+ self.right.addWidget(self.add)
+ self.right.addStretch()
+ self.right.addWidget(self.quit)
+
+ # QWidget Layout
+ self.layout = QHBoxLayout()
+
+ #self.table_view.setSizePolicy(size)
+ self.layout.addWidget(self.table)
+ self.layout.addLayout(self.right)
+
+ # Set the layout to the QWidget
+ self.setLayout(self.layout)
+
+ # Signals and Slots
+ self.add.clicked.connect(self.add_element)
+ self.quit.clicked.connect(self.quit_application)
+ self.clear.clicked.connect(self.clear_table)
+
+ # Fill example data
+ self.fill_table()
+
+ @Slot()
+ def add_element(self):
+ des = self.description.text()
+ price = self.price.text()
+
+ self.table.insertRow(self.items)
+ self.table.setItem(self.items, 0, QTableWidgetItem(des))
+ self.table.setItem(self.items, 1, QTableWidgetItem(price))
+
+ self.description.setText("")
+ self.price.setText("")
+
+ self.items += 1
+
+ @Slot()
+ def quit_application(self):
+ QApplication.quit()
+
+ def fill_table(self, data=None):
+ data = self._data if not data else data
+ for desc, price in data.items():
+ self.table.insertRow(self.items)
+ self.table.setItem(self.items, 0, QTableWidgetItem(desc))
+ self.table.setItem(self.items, 1, QTableWidgetItem(str(price)))
+ self.items += 1
+
+ @Slot()
+ def clear_table(self):
+ self.table.setRowCount(0)
+ self.items = 0
+
+
+class MainWindow(QMainWindow):
+ def __init__(self, widget):
+ QMainWindow.__init__(self)
+ self.setWindowTitle("Tutorial")
+
+ # Menu
+ self.menu = self.menuBar()
+ self.file_menu = self.menu.addMenu("File")
+
+ # Exit QAction
+ exit_action = QAction("Exit", self)
+ exit_action.setShortcut("Ctrl+Q")
+ exit_action.triggered.connect(self.exit_app)
+
+ self.file_menu.addAction(exit_action)
+ self.setCentralWidget(widget)
+
+ @Slot()
+ def exit_app(self, checked):
+ QApplication.quit()
+
+
+if __name__ == "__main__":
+ # Qt Application
+ app = QApplication(sys.argv)
+ # QWidget
+ widget = Widget()
+ # QMainWindow using QWidget as central widget
+ window = MainWindow(widget)
+ window.resize(800, 600)
+ window.show()
+
+ # Execute application
+ sys.exit(app.exec_())
diff --git a/sources/pyside6/doc/tutorials/expenses/steps/08-expenses.py b/sources/pyside6/doc/tutorials/expenses/steps/08-expenses.py
new file mode 100644
index 000000000..0c5eb7c61
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/expenses/steps/08-expenses.py
@@ -0,0 +1,178 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+import sys
+from PySide6.QtCore import Slot
+from PySide6.QtGui import QAction
+from PySide6.QtWidgets import (QApplication, QHeaderView, QHBoxLayout, QLabel, QLineEdit,
+ QMainWindow, QPushButton, QTableWidget, QTableWidgetItem,
+ QVBoxLayout, QWidget)
+
+
+class Widget(QWidget):
+ def __init__(self):
+ QWidget.__init__(self)
+ self.items = 0
+
+ # Example data
+ self._data = {"Water": 24.5, "Electricity": 55.1, "Rent": 850.0,
+ "Supermarket": 230.4, "Internet": 29.99, "Bars": 21.85,
+ "Public transportation": 60.0, "Coffee": 22.45, "Restaurants": 120}
+
+ # Left
+ self.table = QTableWidget()
+ self.table.setColumnCount(2)
+ self.table.setHorizontalHeaderLabels(["Description", "Price"])
+ self.table.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch)
+
+ # Right
+ self.description = QLineEdit()
+ self.price = QLineEdit()
+ self.add = QPushButton("Add")
+ self.clear = QPushButton("Clear")
+ self.quit = QPushButton("Quit")
+
+ # Disabling 'Add' button
+ self.add.setEnabled(False)
+
+ self.right = QVBoxLayout()
+ self.right.setMargin(10)
+ self.right.addWidget(QLabel("Description"))
+ self.right.addWidget(self.description)
+ self.right.addWidget(QLabel("Price"))
+ self.right.addWidget(self.price)
+ self.right.addWidget(self.add)
+ self.right.addStretch()
+ self.right.addWidget(self.clear)
+ self.right.addWidget(self.quit)
+
+ # QWidget Layout
+ self.layout = QHBoxLayout()
+
+ #self.table_view.setSizePolicy(size)
+ self.layout.addWidget(self.table)
+ self.layout.addLayout(self.right)
+
+ # Set the layout to the QWidget
+ self.setLayout(self.layout)
+
+ # Signals and Slots
+ self.add.clicked.connect(self.add_element)
+ self.quit.clicked.connect(self.quit_application)
+ self.clear.clicked.connect(self.clear_table)
+ self.description.textChanged[str].connect(self.check_disable)
+ self.price.textChanged[str].connect(self.check_disable)
+
+ # Fill example data
+ self.fill_table()
+
+ @Slot()
+ def add_element(self):
+ des = self.description.text()
+ price = self.price.text()
+
+ self.table.insertRow(self.items)
+ self.table.setItem(self.items, 0, QTableWidgetItem(des))
+ self.table.setItem(self.items, 1, QTableWidgetItem(price))
+
+ self.description.setText("")
+ self.price.setText("")
+
+ self.items += 1
+
+ @Slot()
+ def check_disable(self, s):
+ if not self.description.text() or not self.price.text():
+ self.add.setEnabled(False)
+ else:
+ self.add.setEnabled(True)
+
+ @Slot()
+ def quit_application(self):
+ QApplication.quit()
+
+ def fill_table(self, data=None):
+ data = self._data if not data else data
+ for desc, price in data.items():
+ self.table.insertRow(self.items)
+ self.table.setItem(self.items, 0, QTableWidgetItem(desc))
+ self.table.setItem(self.items, 1, QTableWidgetItem(str(price)))
+ self.items += 1
+
+ @Slot()
+ def clear_table(self):
+ self.table.setRowCount(0)
+ self.items = 0
+
+
+class MainWindow(QMainWindow):
+ def __init__(self, widget):
+ QMainWindow.__init__(self)
+ self.setWindowTitle("Tutorial")
+
+ # Menu
+ self.menu = self.menuBar()
+ self.file_menu = self.menu.addMenu("File")
+
+ # Exit QAction
+ exit_action = QAction("Exit", self)
+ exit_action.setShortcut("Ctrl+Q")
+ exit_action.triggered.connect(self.exit_app)
+
+ self.file_menu.addAction(exit_action)
+ self.setCentralWidget(widget)
+
+ @Slot()
+ def exit_app(self, checked):
+ QApplication.quit()
+
+
+if __name__ == "__main__":
+ # Qt Application
+ app = QApplication(sys.argv)
+ # QWidget
+ widget = Widget()
+ # QMainWindow using QWidget as central widget
+ window = MainWindow(widget)
+ window.resize(800, 600)
+ window.show()
+
+ # Execute application
+ sys.exit(app.exec_())
diff --git a/sources/pyside6/doc/tutorials/expenses/steps/09-expenses.py b/sources/pyside6/doc/tutorials/expenses/steps/09-expenses.py
new file mode 100644
index 000000000..30e1d7f3f
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/expenses/steps/09-expenses.py
@@ -0,0 +1,185 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+import sys
+from PySide6.QtCore import Slot
+from PySide6.QtGui import QAction, QPainter
+from PySide6.QtWidgets import (QApplication, QHeaderView, QHBoxLayout, QLabel, QLineEdit,
+ QMainWindow, QPushButton, QTableWidget, QTableWidgetItem,
+ QVBoxLayout, QWidget)
+from PySide6.QtCharts import QtCharts
+
+
+class Widget(QWidget):
+ def __init__(self):
+ QWidget.__init__(self)
+ self.items = 0
+
+ # Example data
+ self._data = {"Water": 24.5, "Electricity": 55.1, "Rent": 850.0,
+ "Supermarket": 230.4, "Internet": 29.99, "Bars": 21.85,
+ "Public transportation": 60.0, "Coffee": 22.45, "Restaurants": 120}
+
+ # Left
+ self.table = QTableWidget()
+ self.table.setColumnCount(2)
+ self.table.setHorizontalHeaderLabels(["Description", "Price"])
+ self.table.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch)
+
+ # Chart
+ self.chart_view = QtCharts.QChartView()
+ self.chart_view.setRenderHint(QPainter.Antialiasing)
+
+ # Right
+ self.description = QLineEdit()
+ self.price = QLineEdit()
+ self.add = QPushButton("Add")
+ self.clear = QPushButton("Clear")
+ self.quit = QPushButton("Quit")
+ self.plot = QPushButton("Plot")
+
+ # Disabling 'Add' button
+ self.add.setEnabled(False)
+
+ self.right = QVBoxLayout()
+ self.right.setMargin(10)
+ self.right.addWidget(QLabel("Description"))
+ self.right.addWidget(self.description)
+ self.right.addWidget(QLabel("Price"))
+ self.right.addWidget(self.price)
+ self.right.addWidget(self.add)
+ self.right.addWidget(self.plot)
+ self.right.addWidget(self.chart_view)
+ self.right.addWidget(self.clear)
+ self.right.addWidget(self.quit)
+
+ # QWidget Layout
+ self.layout = QHBoxLayout()
+
+ #self.table_view.setSizePolicy(size)
+ self.layout.addWidget(self.table)
+ self.layout.addLayout(self.right)
+
+ # Set the layout to the QWidget
+ self.setLayout(self.layout)
+
+ # Signals and Slots
+ self.add.clicked.connect(self.add_element)
+ self.quit.clicked.connect(self.quit_application)
+ self.clear.clicked.connect(self.clear_table)
+ self.description.textChanged[str].connect(self.check_disable)
+ self.price.textChanged[str].connect(self.check_disable)
+
+ # Fill example data
+ self.fill_table()
+
+ @Slot()
+ def add_element(self):
+ des = self.description.text()
+ price = self.price.text()
+
+ self.table.insertRow(self.items)
+ self.table.setItem(self.items, 0, QTableWidgetItem(des))
+ self.table.setItem(self.items, 1, QTableWidgetItem(price))
+
+ self.description.setText("")
+ self.price.setText("")
+
+ self.items += 1
+
+ @Slot()
+ def check_disable(self, s):
+ if not self.description.text() or not self.price.text():
+ self.add.setEnabled(False)
+ else:
+ self.add.setEnabled(True)
+
+ @Slot()
+ def quit_application(self):
+ QApplication.quit()
+
+ def fill_table(self, data=None):
+ data = self._data if not data else data
+ for desc, price in data.items():
+ self.table.insertRow(self.items)
+ self.table.setItem(self.items, 0, QTableWidgetItem(desc))
+ self.table.setItem(self.items, 1, QTableWidgetItem(str(price)))
+ self.items += 1
+
+ @Slot()
+ def clear_table(self):
+ self.table.setRowCount(0)
+ self.items = 0
+
+
+class MainWindow(QMainWindow):
+ def __init__(self, widget):
+ QMainWindow.__init__(self)
+ self.setWindowTitle("Tutorial")
+
+ # Menu
+ self.menu = self.menuBar()
+ self.file_menu = self.menu.addMenu("File")
+
+ # Exit QAction
+ exit_action = QAction("Exit", self)
+ exit_action.setShortcut("Ctrl+Q")
+ exit_action.triggered.connect(self.exit_app)
+
+ self.file_menu.addAction(exit_action)
+ self.setCentralWidget(widget)
+
+ @Slot()
+ def exit_app(self, checked):
+ QApplication.quit()
+
+
+if __name__ == "__main__":
+ # Qt Application
+ app = QApplication(sys.argv)
+ # QWidget
+ widget = Widget()
+ # QMainWindow using QWidget as central widget
+ window = MainWindow(widget)
+ window.resize(800, 600)
+ window.show()
+
+ # Execute application
+ sys.exit(app.exec_())
diff --git a/sources/pyside6/doc/tutorials/expenses/steps/10-expenses.py b/sources/pyside6/doc/tutorials/expenses/steps/10-expenses.py
new file mode 100644
index 000000000..2329805a7
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/expenses/steps/10-expenses.py
@@ -0,0 +1,207 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+import sys
+from PySide6.QtCore import Qt, Slot
+from PySide6.QtGui import QAction, QPainter
+from PySide6.QtWidgets import (QQApplication, QHeaderView, QHBoxLayout, QLabel, QLineEdit,
+ QMainWindow, QPushButton, QTableWidget, QTableWidgetItem,
+ QVBoxLayout, QWidget)
+from PySide6.QtCharts import QtCharts
+
+
+class Widget(QWidget):
+ def __init__(self):
+ QWidget.__init__(self)
+ self.items = 0
+
+ # Example data
+ self._data = {"Water": 24.5, "Electricity": 55.1, "Rent": 850.0,
+ "Supermarket": 230.4, "Internet": 29.99, "Bars": 21.85,
+ "Public transportation": 60.0, "Coffee": 22.45, "Restaurants": 120}
+
+ # Left
+ self.table = QTableWidget()
+ self.table.setColumnCount(2)
+ self.table.setHorizontalHeaderLabels(["Description", "Price"])
+ self.table.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch)
+
+ # Chart
+ self.chart_view = QtCharts.QChartView()
+ self.chart_view.setRenderHint(QPainter.Antialiasing)
+
+ # Right
+ self.description = QLineEdit()
+ self.price = QLineEdit()
+ self.add = QPushButton("Add")
+ self.clear = QPushButton("Clear")
+ self.quit = QPushButton("Quit")
+ self.plot = QPushButton("Plot")
+
+ # Disabling 'Add' button
+ self.add.setEnabled(False)
+
+ self.right = QVBoxLayout()
+ self.right.setMargin(10)
+ self.right.addWidget(QLabel("Description"))
+ self.right.addWidget(self.description)
+ self.right.addWidget(QLabel("Price"))
+ self.right.addWidget(self.price)
+ self.right.addWidget(self.add)
+ self.right.addWidget(self.plot)
+ self.right.addWidget(self.chart_view)
+ self.right.addWidget(self.clear)
+ self.right.addWidget(self.quit)
+
+ # QWidget Layout
+ self.layout = QHBoxLayout()
+
+ #self.table_view.setSizePolicy(size)
+ self.layout.addWidget(self.table)
+ self.layout.addLayout(self.right)
+
+ # Set the layout to the QWidget
+ self.setLayout(self.layout)
+
+ # Signals and Slots
+ self.add.clicked.connect(self.add_element)
+ self.quit.clicked.connect(self.quit_application)
+ self.plot.clicked.connect(self.plot_data)
+ self.clear.clicked.connect(self.clear_table)
+ self.description.textChanged[str].connect(self.check_disable)
+ self.price.textChanged[str].connect(self.check_disable)
+
+ # Fill example data
+ self.fill_table()
+
+ @Slot()
+ def add_element(self):
+ des = self.description.text()
+ price = self.price.text()
+
+ self.table.insertRow(self.items)
+ description_item = QTableWidgetItem(des)
+ price_item = QTableWidgetItem("{:.2f}".format(float(price)))
+ price_item.setTextAlignment(Qt.AlignRight)
+
+ self.table.setItem(self.items, 0, description_item)
+ self.table.setItem(self.items, 1, price_item)
+
+ self.description.setText("")
+ self.price.setText("")
+
+ self.items += 1
+
+ @Slot()
+ def check_disable(self, s):
+ if not self.description.text() or not self.price.text():
+ self.add.setEnabled(False)
+ else:
+ self.add.setEnabled(True)
+
+ @Slot()
+ def plot_data(self):
+ # Get table information
+ series = QtCharts.QPieSeries()
+ for i in range(self.table.rowCount()):
+ text = self.table.item(i, 0).text()
+ number = float(self.table.item(i, 1).text())
+ series.append(text, number)
+
+ chart = QtCharts.QChart()
+ chart.addSeries(series)
+ chart.legend().setAlignment(Qt.AlignLeft)
+ self.chart_view.setChart(chart)
+
+ @Slot()
+ def quit_application(self):
+ QApplication.quit()
+
+ def fill_table(self, data=None):
+ data = self._data if not data else data
+ for desc, price in data.items():
+ description_item = QTableWidgetItem(desc)
+ price_item = QTableWidgetItem("{:.2f}".format(price))
+ price_item.setTextAlignment(Qt.AlignRight)
+ self.table.insertRow(self.items)
+ self.table.setItem(self.items, 0, description_item)
+ self.table.setItem(self.items, 1, price_item)
+ self.items += 1
+
+ @Slot()
+ def clear_table(self):
+ self.table.setRowCount(0)
+ self.items = 0
+
+
+class MainWindow(QMainWindow):
+ def __init__(self, widget):
+ QMainWindow.__init__(self)
+ self.setWindowTitle("Tutorial")
+
+ # Menu
+ self.menu = self.menuBar()
+ self.file_menu = self.menu.addMenu("File")
+
+ # Exit QAction
+ exit_action = QAction("Exit", self)
+ exit_action.setShortcut("Ctrl+Q")
+ exit_action.triggered.connect(self.exit_app)
+
+ self.file_menu.addAction(exit_action)
+ self.setCentralWidget(widget)
+
+ @Slot()
+ def exit_app(self, checked):
+ QApplication.quit()
+
+
+if __name__ == "__main__":
+ # Qt Application
+ app = QApplication(sys.argv)
+ # QWidget
+ widget = Widget()
+ # QMainWindow using QWidget as central widget
+ window = MainWindow(widget)
+ window.resize(800, 600)
+ window.show()
+
+ # Execute application
+ sys.exit(app.exec_())
diff --git a/sources/pyside6/doc/tutorials/index.rst b/sources/pyside6/doc/tutorials/index.rst
new file mode 100644
index 000000000..a159725a7
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/index.rst
@@ -0,0 +1,42 @@
+|project| Tutorials
+====================
+
+A collection of tutorials with "walkthrough" guides are
+provided with |project| to help new users get started. These
+documents were ported from C++ to Python and cover a range of topics,
+from basic use of widgets to step-by-step tutorials that show how an
+application is put together.
+
+Basic tutorials
+---------------
+
+.. toctree::
+ :maxdepth: 1
+
+ basictutorial/widgets.rst
+ basictutorial/qml.rst
+ basictutorial/clickablebutton.rst
+ basictutorial/dialog.rst
+ basictutorial/uifiles.rst
+ basictutorial/qrcfiles.rst
+ basictutorial/widgetstyling.rst
+
+Real use-cases applications
+---------------------------
+
+.. toctree::
+ :maxdepth: 1
+
+ datavisualize/index.rst
+ expenses/expenses.rst
+ qmlapp/qmlapplication.rst
+ qmlintegration/qmlintegration.rst
+ qmlsqlintegration/qmlsqlintegration.rst
+
+C++ and Python
+--------------
+
+.. toctree::
+ :maxdepth: 1
+
+ portingguide/index.rst
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter1/chapter1.rst b/sources/pyside6/doc/tutorials/portingguide/chapter1/chapter1.rst
new file mode 100644
index 000000000..20b11065a
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter1/chapter1.rst
@@ -0,0 +1,89 @@
+Chapter 1: ``initDb.h`` to ``createDb.py``
+*******************************************
+
+To begin with, port the C++ code that creates an SQLite
+database and tables, and adds data to them. In this case,
+all C++ code related to this lives in ``initdb.h``. The
+code in this header file is divided into following parts:
+
+* ``initDb`` - Creates a db and the necessary tables
+* ``addBooks`` - Adds data to the **books** table.
+* ``addAuthor`` - Adds data to the **authors** table.
+* ``addGenre`` - Adds data to the **genres** table.
+
+To start with, add these following ``import`` statements at
+the beginning of ``createdb.py``:
+
+.. literalinclude:: createdb.py
+ :language: python
+ :linenos:
+ :lines: 40-44
+
+The ``initDb`` function does most of the work needed to
+set up the database, but it depends on the ``addAuthor``,
+``addGenre``, and ``addBook`` helper functions to populate
+the tables. Port these helper functions first. Here is how
+the C++ and Python versions of these functions look like:
+
+C++ version
+------------
+
+.. literalinclude:: initdb.h
+ :language: c++
+ :linenos:
+ :lines: 55-81
+
+Python version
+---------------
+
+.. literalinclude:: createdb.py
+ :language: python
+ :linenos:
+ :lines: 44-65
+
+Now that the helper functions are in place, port ``initDb``.
+Here is how the C++ and Python versions of this function
+looks like:
+
+C++ version
+------------
+
+.. literalinclude:: initdb.h
+ :language: c++
+ :linenos:
+ :lines: 81-159
+
+Python version
+---------------
+
+.. literalinclude:: createdb.py
+ :language: python
+ :linenos:
+ :lines: 65-
+
+.. note:: The Python version uses the ``check`` function to
+ execute the SQL statements instead of the ``if...else``
+ block like in the C++ version. Although both are valid
+ approaches, the earlier one produces code that looks
+ cleaner and shorter.
+
+Your Python code to set up the database is ready now. To
+test it, add the following code to ``main.py`` and run it:
+
+.. literalinclude:: main.py
+ :language: python
+ :linenos:
+ :lines: 40-
+
+Use the following command from the prompt to run:
+
+.. code-block::
+
+ python main.py
+
+Your table will look like this:
+
+.. image:: images/chapter1_books.png
+
+Try modifying the SQL statment in ``main.py`` to get data
+from the ``genres`` or ``authors`` table.
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter1/createdb.py b/sources/pyside6/doc/tutorials/portingguide/chapter1/createdb.py
new file mode 100644
index 000000000..c3f27162d
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter1/createdb.py
@@ -0,0 +1,131 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+from PySide6.QtSql import QSqlDatabase, QSqlError, QSqlQuery
+from datetime import date
+
+
+def add_book(q, title, year, authorId, genreId, rating):
+ q.addBindValue(title)
+ q.addBindValue(year)
+ q.addBindValue(authorId)
+ q.addBindValue(genreId)
+ q.addBindValue(rating)
+ q.exec_()
+
+
+def add_genre(q, name):
+ q.addBindValue(name)
+ q.exec_()
+ return q.lastInsertId()
+
+
+def add_author(q, name, birthdate):
+ q.addBindValue(name)
+ q.addBindValue(str(birthdate))
+ q.exec_()
+ return q.lastInsertId()
+
+BOOKS_SQL = """
+ create table books(id integer primary key, title varchar, author integer,
+ genre integer, year integer, rating integer)
+ """
+AUTHORS_SQL = """
+ create table authors(id integer primary key, name varchar, birthdate text)
+ """
+GENRES_SQL = """
+ create table genres(id integer primary key, name varchar)
+ """
+INSERT_AUTHOR_SQL = """
+ insert into authors(name, birthdate) values(?, ?)
+ """
+INSERT_GENRE_SQL = """
+ insert into genres(name) values(?)
+ """
+INSERT_BOOK_SQL = """
+ insert into books(title, year, author, genre, rating)
+ values(?, ?, ?, ?, ?)
+ """
+
+def init_db():
+ """
+ init_db()
+ Initializes the database.
+ If tables "books" and "authors" are already in the database, do nothing.
+ Return value: None or raises ValueError
+ The error value is the QtSql error instance.
+ """
+ def check(func, *args):
+ if not func(*args):
+ raise ValueError(func.__self__.lastError())
+ db = QSqlDatabase.addDatabase("QSQLITE")
+ db.setDatabaseName(":memory:")
+
+ check(db.open)
+
+ q = QSqlQuery()
+ check(q.exec_, BOOKS_SQL)
+ check(q.exec_, AUTHORS_SQL)
+ check(q.exec_, GENRES_SQL)
+ check(q.prepare, INSERT_AUTHOR_SQL)
+
+ asimovId = add_author(q, "Isaac Asimov", date(1920, 2, 1))
+ greeneId = add_author(q, "Graham Greene", date(1904, 10, 2))
+ pratchettId = add_author(q, "Terry Pratchett", date(1948, 4, 28))
+
+ check(q.prepare,INSERT_GENRE_SQL)
+ sfiction = add_genre(q, "Science Fiction")
+ fiction = add_genre(q, "Fiction")
+ fantasy = add_genre(q, "Fantasy")
+
+ check(q.prepare,INSERT_BOOK_SQL)
+ add_book(q, "Foundation", 1951, asimovId, sfiction, 3)
+ add_book(q, "Foundation and Empire", 1952, asimovId, sfiction, 4)
+ add_book(q, "Second Foundation", 1953, asimovId, sfiction, 3)
+ add_book(q, "Foundation's Edge", 1982, asimovId, sfiction, 3)
+ add_book(q, "Foundation and Earth", 1986, asimovId, sfiction, 4)
+ add_book(q, "Prelude to Foundation", 1988, asimovId, sfiction, 3)
+ add_book(q, "Forward the Foundation", 1993, asimovId, sfiction, 3)
+ add_book(q, "The Power and the Glory", 1940, greeneId, fiction, 4)
+ add_book(q, "The Third Man", 1950, greeneId, fiction, 5)
+ add_book(q, "Our Man in Havana", 1958, greeneId, fiction, 4)
+ add_book(q, "Guards! Guards!", 1989, pratchettId, fantasy, 3)
+ add_book(q, "Night Watch", 2002, pratchettId, fantasy, 3)
+ add_book(q, "Going Postal", 2004, pratchettId, fantasy, 3)
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter1/images/chapter1_books.png b/sources/pyside6/doc/tutorials/portingguide/chapter1/images/chapter1_books.png
new file mode 100644
index 000000000..164674220
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter1/images/chapter1_books.png
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter1/initdb.h b/sources/pyside6/doc/tutorials/portingguide/chapter1/initdb.h
new file mode 100644
index 000000000..773e3fb74
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter1/initdb.h
@@ -0,0 +1,160 @@
+/****************************************************************************
+**
+** 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 INITDB_H
+#define INITDB_H
+
+#include <QtSql>
+
+void addBook(QSqlQuery &q, const QString &title, int year, const QVariant &authorId,
+ const QVariant &genreId, int rating)
+{
+ q.addBindValue(title);
+ q.addBindValue(year);
+ q.addBindValue(authorId);
+ q.addBindValue(genreId);
+ q.addBindValue(rating);
+ q.exec();
+}
+
+QVariant addGenre(QSqlQuery &q, const QString &name)
+{
+ q.addBindValue(name);
+ q.exec();
+ return q.lastInsertId();
+}
+
+QVariant addAuthor(QSqlQuery &q, const QString &name, const QDate &birthdate)
+{
+ q.addBindValue(name);
+ q.addBindValue(birthdate);
+ q.exec();
+ return q.lastInsertId();
+}
+
+const auto BOOKS_SQL = QLatin1String(R"(
+ create table books(id integer primary key, title varchar, author integer,
+ genre integer, year integer, rating integer)
+ )");
+
+const auto AUTHORS_SQL = QLatin1String(R"(
+ create table authors(id integer primary key, name varchar, birthdate date)
+ )");
+
+const auto GENRES_SQL = QLatin1String(R"(
+ create table genres(id integer primary key, name varchar)
+ )");
+
+const auto INSERT_AUTHOR_SQL = QLatin1String(R"(
+ insert into authors(name, birthdate) values(?, ?)
+ )");
+
+const auto INSERT_BOOK_SQL = QLatin1String(R"(
+ insert into books(title, year, author, genre, rating)
+ values(?, ?, ?, ?, ?)
+ )");
+
+const auto INSERT_GENRE_SQL = QLatin1String(R"(
+ insert into genres(name) values(?)
+ )");
+
+QSqlError initDb()
+{
+ QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
+ db.setDatabaseName(":memory:");
+
+ if (!db.open())
+ return db.lastError();
+
+ QStringList tables = db.tables();
+ if (tables.contains("books", Qt::CaseInsensitive)
+ && tables.contains("authors", Qt::CaseInsensitive))
+ return QSqlError();
+
+ QSqlQuery q;
+ if (!q.exec(BOOKS_SQL))
+ return q.lastError();
+ if (!q.exec(AUTHORS_SQL))
+ return q.lastError();
+ if (!q.exec(GENRES_SQL))
+ return q.lastError();
+
+ if (!q.prepare(INSERT_AUTHOR_SQL))
+ return q.lastError();
+ QVariant asimovId = addAuthor(q, QLatin1String("Isaac Asimov"), QDate(1920, 2, 1));
+ QVariant greeneId = addAuthor(q, QLatin1String("Graham Greene"), QDate(1904, 10, 2));
+ QVariant pratchettId = addAuthor(q, QLatin1String("Terry Pratchett"), QDate(1948, 4, 28));
+
+ if (!q.prepare(INSERT_GENRE_SQL))
+ return q.lastError();
+ QVariant sfiction = addGenre(q, QLatin1String("Science Fiction"));
+ QVariant fiction = addGenre(q, QLatin1String("Fiction"));
+ QVariant fantasy = addGenre(q, QLatin1String("Fantasy"));
+
+ if (!q.prepare(INSERT_BOOK_SQL))
+ return q.lastError();
+ addBook(q, QLatin1String("Foundation"), 1951, asimovId, sfiction, 3);
+ addBook(q, QLatin1String("Foundation and Empire"), 1952, asimovId, sfiction, 4);
+ addBook(q, QLatin1String("Second Foundation"), 1953, asimovId, sfiction, 3);
+ addBook(q, QLatin1String("Foundation's Edge"), 1982, asimovId, sfiction, 3);
+ addBook(q, QLatin1String("Foundation and Earth"), 1986, asimovId, sfiction, 4);
+ addBook(q, QLatin1String("Prelude to Foundation"), 1988, asimovId, sfiction, 3);
+ addBook(q, QLatin1String("Forward the Foundation"), 1993, asimovId, sfiction, 3);
+ addBook(q, QLatin1String("The Power and the Glory"), 1940, greeneId, fiction, 4);
+ addBook(q, QLatin1String("The Third Man"), 1950, greeneId, fiction, 5);
+ addBook(q, QLatin1String("Our Man in Havana"), 1958, greeneId, fiction, 4);
+ addBook(q, QLatin1String("Guards! Guards!"), 1989, pratchettId, fantasy, 3);
+ addBook(q, QLatin1String("Night Watch"), 2002, pratchettId, fantasy, 3);
+ addBook(q, QLatin1String("Going Postal"), 2004, pratchettId, fantasy, 3);
+
+ return QSqlError();
+}
+
+#endif
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter1/main.py b/sources/pyside6/doc/tutorials/portingguide/chapter1/main.py
new file mode 100644
index 000000000..5b42a61a1
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter1/main.py
@@ -0,0 +1,59 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+import sys
+
+from PySide6.QtSql import QSqlQueryModel
+from PySide6.QtWidgets import QTableView, QApplication
+
+import createdb
+
+if __name__ == "__main__":
+ app = QApplication()
+ createdb.init_db()
+
+ model = QSqlQueryModel()
+ model.setQuery("select * from books")
+
+ table_view = QTableView()
+ table_view.setModel(model)
+ table_view.resize(800, 600)
+ table_view.show()
+ sys.exit(app.exec_())
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter2/bookdelegate.cpp b/sources/pyside6/doc/tutorials/portingguide/chapter2/bookdelegate.cpp
new file mode 100644
index 000000000..4115f80cf
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter2/bookdelegate.cpp
@@ -0,0 +1,143 @@
+/****************************************************************************
+**
+** 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 "bookdelegate.h"
+
+#include <QtWidgets>
+
+BookDelegate::BookDelegate(QObject *parent)
+ : QSqlRelationalDelegate(parent), star(QPixmap(":images/star.png"))
+{
+}
+
+void BookDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
+ const QModelIndex &index) const
+{
+ if (index.column() != 5) {
+ QStyleOptionViewItem opt = option;
+ // Since we draw the grid ourselves:
+ opt.rect.adjust(0, 0, -1, -1);
+ QSqlRelationalDelegate::paint(painter, opt, index);
+ } else {
+ const QAbstractItemModel *model = index.model();
+ QPalette::ColorGroup cg = (option.state & QStyle::State_Enabled) ?
+ (option.state & QStyle::State_Active) ?
+ QPalette::Normal :
+ QPalette::Inactive :
+ QPalette::Disabled;
+
+ if (option.state & QStyle::State_Selected)
+ painter->fillRect(
+ option.rect,
+ option.palette.color(cg, QPalette::Highlight));
+
+ int rating = model->data(index, Qt::DisplayRole).toInt();
+ int width = star.width();
+ int height = star.height();
+ int x = option.rect.x();
+ int y = option.rect.y() + (option.rect.height() / 2) - (height / 2);
+ for (int i = 0; i < rating; ++i) {
+ painter->drawPixmap(x, y, star);
+ x += width;
+ }
+ // Since we draw the grid ourselves:
+ drawFocus(painter, option, option.rect.adjusted(0, 0, -1, -1));
+ }
+
+ QPen pen = painter->pen();
+ painter->setPen(option.palette.color(QPalette::Mid));
+ painter->drawLine(option.rect.bottomLeft(), option.rect.bottomRight());
+ painter->drawLine(option.rect.topRight(), option.rect.bottomRight());
+ painter->setPen(pen);
+}
+
+QSize BookDelegate::sizeHint(const QStyleOptionViewItem &option,
+ const QModelIndex &index) const
+{
+ if (index.column() == 5)
+ return QSize(5 * star.width(), star.height()) + QSize(1, 1);
+ // Since we draw the grid ourselves:
+ return QSqlRelationalDelegate::sizeHint(option, index) + QSize(1, 1);
+}
+
+bool BookDelegate::editorEvent(QEvent *event, QAbstractItemModel *model,
+ const QStyleOptionViewItem &option,
+ const QModelIndex &index)
+{
+ if (index.column() != 5)
+ return QSqlRelationalDelegate::editorEvent(event, model, option, index);
+
+ if (event->type() == QEvent::MouseButtonPress) {
+ QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(event);
+ int stars = qBound(0, int(0.7 + qreal(mouseEvent->pos().x()
+ - option.rect.x()) / star.width()), 5);
+ model->setData(index, QVariant(stars));
+ // So that the selection can change:
+ return false;
+ }
+
+ return true;
+}
+
+QWidget *BookDelegate::createEditor(QWidget *parent,
+ const QStyleOptionViewItem &option,
+ const QModelIndex &index) const
+{
+ if (index.column() != 4)
+ return QSqlRelationalDelegate::createEditor(parent, option, index);
+
+ // For editing the year, return a spinbox with a range from -1000 to 2100.
+ QSpinBox *sb = new QSpinBox(parent);
+ sb->setFrame(false);
+ sb->setMaximum(2100);
+ sb->setMinimum(-1000);
+
+ return sb;
+}
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter2/bookdelegate.h b/sources/pyside6/doc/tutorials/portingguide/chapter2/bookdelegate.h
new file mode 100644
index 000000000..f1b432699
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter2/bookdelegate.h
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** 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 BOOKDELEGATE_H
+#define BOOKDELEGATE_H
+
+#include <QModelIndex>
+#include <QPixmap>
+#include <QSize>
+#include <QSqlRelationalDelegate>
+
+QT_FORWARD_DECLARE_CLASS(QPainter)
+
+class BookDelegate : public QSqlRelationalDelegate
+{
+public:
+ BookDelegate(QObject *parent);
+
+ void paint(QPainter *painter, const QStyleOptionViewItem &option,
+ const QModelIndex &index) const override;
+
+ QSize sizeHint(const QStyleOptionViewItem &option,
+ const QModelIndex &index) const override;
+
+ bool editorEvent(QEvent *event, QAbstractItemModel *model,
+ const QStyleOptionViewItem &option,
+ const QModelIndex &index) override;
+
+ QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
+ const QModelIndex &index) const override;
+
+private:
+ QPixmap star;
+};
+
+#endif
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter2/bookdelegate.py b/sources/pyside6/doc/tutorials/portingguide/chapter2/bookdelegate.py
new file mode 100644
index 000000000..d6c16972b
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter2/bookdelegate.py
@@ -0,0 +1,134 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+import copy, os
+from PySide6.QtSql import QSqlRelationalDelegate
+from PySide6.QtWidgets import (QItemDelegate, QSpinBox, QStyledItemDelegate,
+ QStyle, QStyleOptionViewItem)
+from PySide6.QtGui import QMouseEvent, QPixmap, QPalette, QImage
+from PySide6.QtCore import QEvent, QSize, Qt, QUrl
+
+class BookDelegate(QSqlRelationalDelegate):
+ """Books delegate to rate the books"""
+
+ def __init__(self, parent=None):
+ QSqlRelationalDelegate.__init__(self, parent)
+ star_png = os.path.dirname(__file__) + "\images\star.png"
+ self.star = QPixmap(star_png)
+
+ def paint(self, painter, option, index):
+ """ Paint the items in the table.
+
+ If the item referred to by <index> is a StarRating, we
+ handle the painting ourselves. For the other items, we
+ let the base class handle the painting as usual.
+
+ In a polished application, we'd use a better check than
+ the column number to find out if we needed to paint the
+ stars, but it works for the purposes of this example.
+ """
+ if index.column() != 5:
+ # Since we draw the grid ourselves:
+ opt = copy.copy(option)
+ opt.rect = option.rect.adjusted(0, 0, -1, -1)
+ QSqlRelationalDelegate.paint(self, painter, opt, index)
+ else:
+ model = index.model()
+ if option.state & QStyle.State_Enabled:
+ if option.state & QStyle.State_Active:
+ color_group = QPalette.Normal
+ else:
+ color_group = QPalette.Inactive
+ else:
+ color_group = QPalette.Disabled
+
+ if option.state & QStyle.State_Selected:
+ painter.fillRect(option.rect,
+ option.palette.color(color_group, QPalette.Highlight))
+ rating = model.data(index, Qt.DisplayRole)
+ width = self.star.width()
+ height = self.star.height()
+ x = option.rect.x()
+ y = option.rect.y() + (option.rect.height() / 2) - (height / 2)
+ for i in range(rating):
+ painter.drawPixmap(x, y, self.star)
+ x += width
+
+ # Since we draw the grid ourselves:
+ self.drawFocus(painter, option, option.rect.adjusted(0, 0, -1, -1))
+
+ pen = painter.pen()
+ painter.setPen(option.palette.color(QPalette.Mid))
+ painter.drawLine(option.rect.bottomLeft(), option.rect.bottomRight())
+ painter.drawLine(option.rect.topRight(), option.rect.bottomRight())
+ painter.setPen(pen)
+
+ def sizeHint(self, option, index):
+ """ Returns the size needed to display the item in a QSize object. """
+ if index.column() == 5:
+ size_hint = QSize(5 * self.star.width(), self.star.height()) + QSize(1, 1)
+ return size_hint
+ # Since we draw the grid ourselves:
+ return QSqlRelationalDelegate.sizeHint(self, option, index) + QSize(1, 1)
+
+ def editorEvent(self, event, model, option, index):
+ if index.column() != 5:
+ return False
+
+ if event.type() == QEvent.MouseButtonPress:
+ mouse_pos = event.pos()
+ new_stars = int(0.7 + (mouse_pos.x() - option.rect.x()) / self.star.width())
+ stars = max(0, min(new_stars, 5))
+ model.setData(index, stars)
+ # So that the selection can change
+ return False
+
+ return True
+
+ def createEditor(self, parent, option, index):
+ if index.column() != 4:
+ return QSqlRelationalDelegate.createEditor(self, parent, option, index)
+
+ # For editing the year, return a spinbox with a range from -1000 to 2100.
+ spinbox = QSpinBox(parent)
+ spinbox.setFrame(False)
+ spinbox.setMaximum(2100)
+ spinbox.setMinimum(-1000)
+ return spinbox
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter2/chapter2.rst b/sources/pyside6/doc/tutorials/portingguide/chapter2/chapter2.rst
new file mode 100644
index 000000000..a574218fd
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter2/chapter2.rst
@@ -0,0 +1,93 @@
+Chapter 2: ``bookdelegate.cpp`` to ``bookdelegate.py``
+*******************************************************
+
+Now that your database is in place, port the C++ code for the
+``BookDelegate`` class. This class offers a delegate to present
+and edit the data in a ``QTableView``. It inherits
+``QSqlRelationalDelegate`` interface, which offers features
+specific for handling relational databases, such as a combobox
+editor for foreign key fields. To begin with, create
+``bookdelegate.py`` and add the following imports to it:
+
+.. literalinclude:: bookdelegate.py
+ :language: python
+ :linenos:
+ :lines: 40-47
+
+After the necessary ``import`` statements, port the
+constructor code for the ``BookDelegate`` class. Both
+the C++ and Python versions of this code initialize a
+``QSqlRelationalDelegate`` and ``QPixmap`` instance.
+Here is how they look:
+
+C++ version
+-------------
+
+.. literalinclude:: bookdelegate.cpp
+ :language: c++
+ :linenos:
+ :lines: 54-59
+
+Python version
+---------------
+
+.. literalinclude:: bookdelegate.py
+ :language: python
+ :linenos:
+ :lines: 47-54
+
+.. note:: The Python version loads the ``QPixmap`` using
+ the absolute path of ``star.png`` in the local
+ filesystem.
+
+As the default functionality offered by the
+``QSqlRelationalDelegate`` is not enough to present
+the books data, you must reimplement a few functions.
+For example, painting stars to represent the rating for
+each book in the table. Here is how the reimplemented
+code looks like:
+
+C++ version
+------------
+
+.. literalinclude:: bookdelegate.cpp
+ :language: c++
+ :linenos:
+ :lines: 59-
+
+Python version
+---------------
+
+.. literalinclude:: bookdelegate.py
+ :language: python
+ :linenos:
+ :lines: 55-
+
+Now that the delegate is in place, run the following
+``main.py`` to see how the data is presented:
+
+.. literalinclude:: main.py
+ :language: python
+ :linenos:
+ :lines: 40-
+
+Here is how the application will look when you run it:
+
+.. image:: images/chapter2_books.png
+ :alt: Books table data
+
+The only difference you'll notice now in comparison to
+:doc:`chapter 1 <../chapter1/chapter1>` is that the
+``rating`` column looks different.
+
+Try improving the table even further by adding these
+features:
+
+* Title for each column
+* SQL relation for the ``author_id`` and ``genre_id`` columns
+* Set a title to the window
+
+With these features, this is how your table will look like:
+
+.. image:: images/chapter2_books_with_relation.png
+ :alt: Books table with SQL relation
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter2/createdb.py b/sources/pyside6/doc/tutorials/portingguide/chapter2/createdb.py
new file mode 100644
index 000000000..c3f27162d
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter2/createdb.py
@@ -0,0 +1,131 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+from PySide6.QtSql import QSqlDatabase, QSqlError, QSqlQuery
+from datetime import date
+
+
+def add_book(q, title, year, authorId, genreId, rating):
+ q.addBindValue(title)
+ q.addBindValue(year)
+ q.addBindValue(authorId)
+ q.addBindValue(genreId)
+ q.addBindValue(rating)
+ q.exec_()
+
+
+def add_genre(q, name):
+ q.addBindValue(name)
+ q.exec_()
+ return q.lastInsertId()
+
+
+def add_author(q, name, birthdate):
+ q.addBindValue(name)
+ q.addBindValue(str(birthdate))
+ q.exec_()
+ return q.lastInsertId()
+
+BOOKS_SQL = """
+ create table books(id integer primary key, title varchar, author integer,
+ genre integer, year integer, rating integer)
+ """
+AUTHORS_SQL = """
+ create table authors(id integer primary key, name varchar, birthdate text)
+ """
+GENRES_SQL = """
+ create table genres(id integer primary key, name varchar)
+ """
+INSERT_AUTHOR_SQL = """
+ insert into authors(name, birthdate) values(?, ?)
+ """
+INSERT_GENRE_SQL = """
+ insert into genres(name) values(?)
+ """
+INSERT_BOOK_SQL = """
+ insert into books(title, year, author, genre, rating)
+ values(?, ?, ?, ?, ?)
+ """
+
+def init_db():
+ """
+ init_db()
+ Initializes the database.
+ If tables "books" and "authors" are already in the database, do nothing.
+ Return value: None or raises ValueError
+ The error value is the QtSql error instance.
+ """
+ def check(func, *args):
+ if not func(*args):
+ raise ValueError(func.__self__.lastError())
+ db = QSqlDatabase.addDatabase("QSQLITE")
+ db.setDatabaseName(":memory:")
+
+ check(db.open)
+
+ q = QSqlQuery()
+ check(q.exec_, BOOKS_SQL)
+ check(q.exec_, AUTHORS_SQL)
+ check(q.exec_, GENRES_SQL)
+ check(q.prepare, INSERT_AUTHOR_SQL)
+
+ asimovId = add_author(q, "Isaac Asimov", date(1920, 2, 1))
+ greeneId = add_author(q, "Graham Greene", date(1904, 10, 2))
+ pratchettId = add_author(q, "Terry Pratchett", date(1948, 4, 28))
+
+ check(q.prepare,INSERT_GENRE_SQL)
+ sfiction = add_genre(q, "Science Fiction")
+ fiction = add_genre(q, "Fiction")
+ fantasy = add_genre(q, "Fantasy")
+
+ check(q.prepare,INSERT_BOOK_SQL)
+ add_book(q, "Foundation", 1951, asimovId, sfiction, 3)
+ add_book(q, "Foundation and Empire", 1952, asimovId, sfiction, 4)
+ add_book(q, "Second Foundation", 1953, asimovId, sfiction, 3)
+ add_book(q, "Foundation's Edge", 1982, asimovId, sfiction, 3)
+ add_book(q, "Foundation and Earth", 1986, asimovId, sfiction, 4)
+ add_book(q, "Prelude to Foundation", 1988, asimovId, sfiction, 3)
+ add_book(q, "Forward the Foundation", 1993, asimovId, sfiction, 3)
+ add_book(q, "The Power and the Glory", 1940, greeneId, fiction, 4)
+ add_book(q, "The Third Man", 1950, greeneId, fiction, 5)
+ add_book(q, "Our Man in Havana", 1958, greeneId, fiction, 4)
+ add_book(q, "Guards! Guards!", 1989, pratchettId, fantasy, 3)
+ add_book(q, "Night Watch", 2002, pratchettId, fantasy, 3)
+ add_book(q, "Going Postal", 2004, pratchettId, fantasy, 3)
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter2/images/chapter2_books.png b/sources/pyside6/doc/tutorials/portingguide/chapter2/images/chapter2_books.png
new file mode 100644
index 000000000..e456b7d8f
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter2/images/chapter2_books.png
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter2/images/chapter2_books_with_relation.png b/sources/pyside6/doc/tutorials/portingguide/chapter2/images/chapter2_books_with_relation.png
new file mode 100644
index 000000000..82a5f449c
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter2/images/chapter2_books_with_relation.png
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter2/images/star.png b/sources/pyside6/doc/tutorials/portingguide/chapter2/images/star.png
new file mode 100644
index 000000000..87f4464bd
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter2/images/star.png
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter2/main.py b/sources/pyside6/doc/tutorials/portingguide/chapter2/main.py
new file mode 100644
index 000000000..c9c907f90
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter2/main.py
@@ -0,0 +1,63 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+import sys
+
+from PySide6.QtCore import Qt
+from PySide6.QtSql import QSqlQueryModel
+from PySide6.QtWidgets import QTableView, QApplication
+
+import createdb
+from bookdelegate import BookDelegate
+
+if __name__ == "__main__":
+ app = QApplication()
+ createdb.init_db()
+
+ model = QSqlQueryModel()
+ model.setQuery("select title, author, genre, year, rating from books")
+
+ table = QTableView()
+ table.setModel(model)
+ table.setItemDelegate(BookDelegate())
+ table.resize(800, 600)
+ table.show()
+
+ sys.exit(app.exec_())
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter3/bookdelegate-old.py b/sources/pyside6/doc/tutorials/portingguide/chapter3/bookdelegate-old.py
new file mode 100644
index 000000000..0c0f1ee69
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter3/bookdelegate-old.py
@@ -0,0 +1,134 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+import copy, os
+from PySide6.QtSql import QSqlRelationalDelegate
+from PySide6.QtWidgets import (QItemDelegate, QSpinBox, QStyledItemDelegate,
+ QStyle, QStyleOptionViewItem)
+from PySide6.QtGui import QMouseEvent, QPixmap, QPalette, QImage
+from PySide6.QtCore import QEvent, QSize, Qt, QUrl
+
+class BookDelegate(QSqlRelationalDelegate):
+ """Books delegate to rate the books"""
+
+ def __init__(self, star_png, parent=None):
+ QSqlRelationalDelegate.__init__(self, parent)
+ star_png = os.path.dirname(__file__) + "\images\star.png"
+ self.star = QPixmap(star_png)
+
+ def paint(self, painter, option, index):
+ """ Paint the items in the table.
+
+ If the item referred to by <index> is a StarRating, we
+ handle the painting ourselves. For the other items, we
+ let the base class handle the painting as usual.
+
+ In a polished application, we'd use a better check than
+ the column number to find out if we needed to paint the
+ stars, but it works for the purposes of this example.
+ """
+ if index.column() != 5:
+ # Since we draw the grid ourselves:
+ opt = copy.copy(option)
+ opt.rect = option.rect.adjusted(0, 0, -1, -1)
+ QSqlRelationalDelegate.paint(self, painter, opt, index)
+ else:
+ model = index.model()
+ if option.state & QStyle.State_Enabled:
+ if option.state & QStyle.State_Active:
+ color_group = QPalette.Normal
+ else:
+ color_group = QPalette.Inactive
+ else:
+ color_group = QPalette.Disabled
+
+ if option.state & QStyle.State_Selected:
+ painter.fillRect(option.rect,
+ option.palette.color(color_group, QPalette.Highlight))
+ rating = model.data(index, Qt.DisplayRole)
+ width = self.star.width()
+ height = self.star.height()
+ x = option.rect.x()
+ y = option.rect.y() + (option.rect.height() / 2) - (height / 2)
+ for i in range(rating):
+ painter.drawPixmap(x, y, self.star)
+ x += width
+
+ # Since we draw the grid ourselves:
+ self.drawFocus(painter, option, option.rect.adjusted(0, 0, -1, -1))
+
+ pen = painter.pen()
+ painter.setPen(option.palette.color(QPalette.Mid))
+ painter.drawLine(option.rect.bottomLeft(), option.rect.bottomRight())
+ painter.drawLine(option.rect.topRight(), option.rect.bottomRight())
+ painter.setPen(pen)
+
+ def sizeHint(self, option, index):
+ """ Returns the size needed to display the item in a QSize object. """
+ if index.column() == 5:
+ size_hint = QSize(5 * self.star.width(), self.star.height()) + QSize(1, 1)
+ return size_hint
+ # Since we draw the grid ourselves:
+ return QSqlRelationalDelegate.sizeHint(self, option, index) + QSize(1, 1)
+
+ def editorEvent(self, event, model, option, index):
+ if index.column() != 5:
+ return False
+
+ if event.type() == QEvent.MouseButtonPress:
+ mouse_pos = event.pos()
+ new_stars = int(0.7 + (mouse_pos.x() - option.rect.x()) / self.star.width())
+ stars = max(0, min(new_stars, 5))
+ model.setData(index, stars)
+ # So that the selection can change
+ return False
+
+ return True
+
+ def createEditor(self, parent, option, index):
+ if index.column() != 4:
+ return QSqlRelationalDelegate.createEditor(self, parent, option, index)
+
+ # For editing the year, return a spinbox with a range from -1000 to 2100.
+ spinbox = QSpinBox(parent)
+ spinbox.setFrame(False)
+ spinbox.setMaximum(2100)
+ spinbox.setMinimum(-1000)
+ return spinbox
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter3/bookdelegate.py b/sources/pyside6/doc/tutorials/portingguide/chapter3/bookdelegate.py
new file mode 100644
index 000000000..4594508d5
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter3/bookdelegate.py
@@ -0,0 +1,133 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+import copy, os
+from PySide6.QtSql import QSqlRelationalDelegate
+from PySide6.QtWidgets import (QItemDelegate, QSpinBox, QStyledItemDelegate,
+ QStyle, QStyleOptionViewItem)
+from PySide6.QtGui import QMouseEvent, QPixmap, QPalette, QImage
+from PySide6.QtCore import QEvent, QSize, Qt, QUrl
+
+class BookDelegate(QSqlRelationalDelegate):
+ """Books delegate to rate the books"""
+
+ def __init__(self, star_png, parent=None):
+ QSqlRelationalDelegate.__init__(self, parent)
+ self.star = QPixmap(":/images/star.png")
+
+ def paint(self, painter, option, index):
+ """ Paint the items in the table.
+
+ If the item referred to by <index> is a StarRating, we
+ handle the painting ourselves. For the other items, we
+ let the base class handle the painting as usual.
+
+ In a polished application, we'd use a better check than
+ the column number to find out if we needed to paint the
+ stars, but it works for the purposes of this example.
+ """
+ if index.column() != 5:
+ # Since we draw the grid ourselves:
+ opt = copy.copy(option)
+ opt.rect = option.rect.adjusted(0, 0, -1, -1)
+ QSqlRelationalDelegate.paint(self, painter, opt, index)
+ else:
+ model = index.model()
+ if option.state & QStyle.State_Enabled:
+ if option.state & QStyle.State_Active:
+ color_group = QPalette.Normal
+ else:
+ color_group = QPalette.Inactive
+ else:
+ color_group = QPalette.Disabled
+
+ if option.state & QStyle.State_Selected:
+ painter.fillRect(option.rect,
+ option.palette.color(color_group, QPalette.Highlight))
+ rating = model.data(index, Qt.DisplayRole)
+ width = self.star.width()
+ height = self.star.height()
+ x = option.rect.x()
+ y = option.rect.y() + (option.rect.height() / 2) - (height / 2)
+ for i in range(rating):
+ painter.drawPixmap(x, y, self.star)
+ x += width
+
+ # Since we draw the grid ourselves:
+ self.drawFocus(painter, option, option.rect.adjusted(0, 0, -1, -1))
+
+ pen = painter.pen()
+ painter.setPen(option.palette.color(QPalette.Mid))
+ painter.drawLine(option.rect.bottomLeft(), option.rect.bottomRight())
+ painter.drawLine(option.rect.topRight(), option.rect.bottomRight())
+ painter.setPen(pen)
+
+ def sizeHint(self, option, index):
+ """ Returns the size needed to display the item in a QSize object. """
+ if index.column() == 5:
+ size_hint = QSize(5 * self.star.width(), self.star.height()) + QSize(1, 1)
+ return size_hint
+ # Since we draw the grid ourselves:
+ return QSqlRelationalDelegate.sizeHint(self, option, index) + QSize(1, 1)
+
+ def editorEvent(self, event, model, option, index):
+ if index.column() != 5:
+ return False
+
+ if event.type() == QEvent.MouseButtonPress:
+ mouse_pos = event.pos()
+ new_stars = int(0.7 + (mouse_pos.x() - option.rect.x()) / self.star.width())
+ stars = max(0, min(new_stars, 5))
+ model.setData(index, stars)
+ # So that the selection can change
+ return False
+
+ return True
+
+ def createEditor(self, parent, option, index):
+ if index.column() != 4:
+ return QSqlRelationalDelegate.createEditor(self, parent, option, index)
+
+ # For editing the year, return a spinbox with a range from -1000 to 2100.
+ spinbox = QSpinBox(parent)
+ spinbox.setFrame(False)
+ spinbox.setMaximum(2100)
+ spinbox.setMinimum(-1000)
+ return spinbox
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter3/books.qrc b/sources/pyside6/doc/tutorials/portingguide/chapter3/books.qrc
new file mode 100644
index 000000000..d6ad21337
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter3/books.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>images/star.png</file>
+</qresource>
+</RCC>
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter3/bookwindow.cpp b/sources/pyside6/doc/tutorials/portingguide/chapter3/bookwindow.cpp
new file mode 100644
index 000000000..76f3c9da8
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter3/bookwindow.cpp
@@ -0,0 +1,171 @@
+/****************************************************************************
+**
+** 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 "bookwindow.h"
+#include "bookdelegate.h"
+#include "initdb.h"
+
+#include <QtSql>
+
+BookWindow::BookWindow()
+{
+ ui.setupUi(this);
+
+ if (!QSqlDatabase::drivers().contains("QSQLITE"))
+ QMessageBox::critical(
+ this,
+ "Unable to load database",
+ "This demo needs the SQLITE driver"
+ );
+
+ // Initialize the database:
+ QSqlError err = initDb();
+ if (err.type() != QSqlError::NoError) {
+ showError(err);
+ return;
+ }
+
+ // Create the data model:
+ model = new QSqlRelationalTableModel(ui.bookTable);
+ model->setEditStrategy(QSqlTableModel::OnManualSubmit);
+ model->setTable("books");
+
+ // Remember the indexes of the columns:
+ authorIdx = model->fieldIndex("author");
+ genreIdx = model->fieldIndex("genre");
+
+ // Set the relations to the other database tables:
+ model->setRelation(authorIdx, QSqlRelation("authors", "id", "name"));
+ model->setRelation(genreIdx, QSqlRelation("genres", "id", "name"));
+
+ // Set the localized header captions:
+ model->setHeaderData(authorIdx, Qt::Horizontal, tr("Author Name"));
+ model->setHeaderData(genreIdx, Qt::Horizontal, tr("Genre"));
+ model->setHeaderData(model->fieldIndex("title"),
+ Qt::Horizontal, tr("Title"));
+ model->setHeaderData(model->fieldIndex("year"), Qt::Horizontal, tr("Year"));
+ model->setHeaderData(model->fieldIndex("rating"),
+ Qt::Horizontal, tr("Rating"));
+
+ // Populate the model:
+ if (!model->select()) {
+ showError(model->lastError());
+ return;
+ }
+
+ // Set the model and hide the ID column:
+ ui.bookTable->setModel(model);
+ ui.bookTable->setItemDelegate(new BookDelegate(ui.bookTable));
+ ui.bookTable->setColumnHidden(model->fieldIndex("id"), true);
+ ui.bookTable->setSelectionMode(QAbstractItemView::SingleSelection);
+
+ // Initialize the Author combo box:
+ ui.authorEdit->setModel(model->relationModel(authorIdx));
+ ui.authorEdit->setModelColumn(
+ model->relationModel(authorIdx)->fieldIndex("name"));
+
+ ui.genreEdit->setModel(model->relationModel(genreIdx));
+ ui.genreEdit->setModelColumn(
+ model->relationModel(genreIdx)->fieldIndex("name"));
+
+ // Lock and prohibit resizing of the width of the rating column:
+ ui.bookTable->horizontalHeader()->setSectionResizeMode(
+ model->fieldIndex("rating"),
+ QHeaderView::ResizeToContents);
+
+ QDataWidgetMapper *mapper = new QDataWidgetMapper(this);
+ mapper->setModel(model);
+ mapper->setItemDelegate(new BookDelegate(this));
+ mapper->addMapping(ui.titleEdit, model->fieldIndex("title"));
+ mapper->addMapping(ui.yearEdit, model->fieldIndex("year"));
+ mapper->addMapping(ui.authorEdit, authorIdx);
+ mapper->addMapping(ui.genreEdit, genreIdx);
+ mapper->addMapping(ui.ratingEdit, model->fieldIndex("rating"));
+
+ connect(ui.bookTable->selectionModel(),
+ &QItemSelectionModel::currentRowChanged,
+ mapper,
+ &QDataWidgetMapper::setCurrentModelIndex
+ );
+
+ ui.bookTable->setCurrentIndex(model->index(0, 0));
+ createMenuBar();
+}
+
+void BookWindow::showError(const QSqlError &err)
+{
+ QMessageBox::critical(this, "Unable to initialize Database",
+ "Error initializing database: " + err.text());
+}
+
+void BookWindow::createMenuBar()
+{
+ QAction *quitAction = new QAction(tr("&Quit"), this);
+ QAction *aboutAction = new QAction(tr("&About"), this);
+ QAction *aboutQtAction = new QAction(tr("&About Qt"), this);
+
+ QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
+ fileMenu->addAction(quitAction);
+
+ QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
+ helpMenu->addAction(aboutAction);
+ helpMenu->addAction(aboutQtAction);
+
+ connect(quitAction, &QAction::triggered, this, &BookWindow::close);
+ connect(aboutAction, &QAction::triggered, this, &BookWindow::about);
+ connect(aboutQtAction, &QAction::triggered, qApp, &QApplication::aboutQt);
+}
+
+void BookWindow::about()
+{
+ QMessageBox::about(this, tr("About Books"),
+ tr("<p>The <b>Books</b> example shows how to use Qt SQL classes "
+ "with a model/view framework."));
+}
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter3/bookwindow.py b/sources/pyside6/doc/tutorials/portingguide/chapter3/bookwindow.py
new file mode 100644
index 000000000..0b20e8ad5
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter3/bookwindow.py
@@ -0,0 +1,138 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+from __future__ import print_function, absolute_import
+
+from PySide6.QtGui import QAction
+from PySide6.QtWidgets import (QAbstractItemView, QDataWidgetMapper,
+ QHeaderView, QMainWindow, QMessageBox)
+from PySide6.QtGui import QKeySequence
+from PySide6.QtSql import (QSqlRelation, QSqlRelationalTableModel, QSqlTableModel,
+ QSqlError)
+from PySide6.QtCore import QAbstractItemModel, QObject, QSize, Qt, Slot
+import createdb
+from ui_bookwindow import Ui_BookWindow
+from bookdelegate import BookDelegate
+
+
+class BookWindow(QMainWindow, Ui_BookWindow):
+ # """A window to show the books available"""
+
+ def __init__(self):
+ QMainWindow.__init__(self)
+ self.setupUi(self)
+
+ #Initialize db
+ createdb.init_db()
+
+ model = QSqlRelationalTableModel(self.bookTable)
+ model.setEditStrategy(QSqlTableModel.OnManualSubmit)
+ model.setTable("books")
+
+ # Remember the indexes of the columns:
+ author_idx = model.fieldIndex("author")
+ genre_idx = model.fieldIndex("genre")
+
+ # Set the relations to the other database tables:
+ model.setRelation(author_idx, QSqlRelation("authors", "id", "name"))
+ model.setRelation(genre_idx, QSqlRelation("genres", "id", "name"))
+
+ # Set the localized header captions:
+ model.setHeaderData(author_idx, Qt.Horizontal, self.tr("Author Name"))
+ model.setHeaderData(genre_idx, Qt.Horizontal, self.tr("Genre"))
+ model.setHeaderData(model.fieldIndex("title"), Qt.Horizontal, self.tr("Title"))
+ model.setHeaderData(model.fieldIndex("year"), Qt.Horizontal, self.tr("Year"))
+ model.setHeaderData(model.fieldIndex("rating"), Qt.Horizontal, self.tr("Rating"))
+
+ if not model.select():
+ print(model.lastError())
+
+ # Set the model and hide the ID column:
+ self.bookTable.setModel(model)
+ self.bookTable.setItemDelegate(BookDelegate(self.bookTable))
+ self.bookTable.setColumnHidden(model.fieldIndex("id"), True)
+ self.bookTable.setSelectionMode(QAbstractItemView.SingleSelection)
+
+ # Initialize the Author combo box:
+ self.authorEdit.setModel(model.relationModel(author_idx))
+ self.authorEdit.setModelColumn(model.relationModel(author_idx).fieldIndex("name"))
+
+ self.genreEdit.setModel(model.relationModel(genre_idx))
+ self.genreEdit.setModelColumn(model.relationModel(genre_idx).fieldIndex("name"))
+
+ # Lock and prohibit resizing of the width of the rating column:
+ self.bookTable.horizontalHeader().setSectionResizeMode(model.fieldIndex("rating"),
+ QHeaderView.ResizeToContents)
+
+ mapper = QDataWidgetMapper(self)
+ mapper.setModel(model)
+ mapper.setItemDelegate(BookDelegate(self))
+ mapper.addMapping(self.titleEdit, model.fieldIndex("title"))
+ mapper.addMapping(self.yearEdit, model.fieldIndex("year"))
+ mapper.addMapping(self.authorEdit, author_idx)
+ mapper.addMapping(self.genreEdit, genre_idx)
+ mapper.addMapping(self.ratingEdit, model.fieldIndex("rating"))
+
+ selection_model = self.bookTable.selectionModel()
+ selection_model.currentRowChanged.connect(mapper.setCurrentModelIndex)
+
+ self.bookTable.setCurrentIndex(model.index(0, 0))
+ self.create_menubar()
+
+ def showError(err):
+ QMessageBox.critical(self, "Unable to initialize Database",
+ "Error initializing database: " + err.text())
+
+ def create_menubar(self):
+ file_menu = self.menuBar().addMenu(self.tr("&File"))
+ quit_action = file_menu.addAction(self.tr("&Quit"))
+ quit_action.triggered.connect(qApp.quit)
+
+ help_menu = self.menuBar().addMenu(self.tr("&Help"))
+ about_action = help_menu.addAction(self.tr("&About"))
+ about_action.setShortcut(QKeySequence.HelpContents)
+ about_action.triggered.connect(self.about)
+ aboutQt_action = help_menu.addAction("&About Qt")
+ aboutQt_action.triggered.connect(qApp.aboutQt)
+
+ def about(self):
+ QMessageBox.about(self, self.tr("About Books"),
+ self.tr("<p>The <b>Books</b> example shows how to use Qt SQL classes "
+ "with a model/view framework."))
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter3/bookwindow.ui b/sources/pyside6/doc/tutorials/portingguide/chapter3/bookwindow.ui
new file mode 100644
index 000000000..e1668288f
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter3/bookwindow.ui
@@ -0,0 +1,149 @@
+<ui version="4.0" >
+ <author></author>
+ <comment></comment>
+ <exportmacro></exportmacro>
+ <class>BookWindow</class>
+ <widget class="QMainWindow" name="BookWindow" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>601</width>
+ <height>420</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Books</string>
+ </property>
+ <widget class="QWidget" name="centralWidget" >
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>Books</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QTableView" name="bookTable" >
+ <property name="selectionBehavior" >
+ <enum>QAbstractItemView::SelectRows</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_2" >
+ <property name="title" >
+ <string>Details</string>
+ </property>
+ <layout class="QFormLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="label_5" >
+ <property name="text" >
+ <string>&lt;b>Title:&lt;/b></string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="titleEdit" >
+ <property name="enabled" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="label_2_2_2_2" >
+ <property name="text" >
+ <string>&lt;b>Author: &lt;/b></string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QComboBox" name="authorEdit" >
+ <property name="enabled" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="label_3" >
+ <property name="text" >
+ <string>&lt;b>Genre:&lt;/b></string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QComboBox" name="genreEdit" >
+ <property name="enabled" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="label_4" >
+ <property name="text" >
+ <string>&lt;b>Year:&lt;/b></string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QSpinBox" name="yearEdit" >
+ <property name="enabled" >
+ <bool>true</bool>
+ </property>
+ <property name="prefix" >
+ <string/>
+ </property>
+ <property name="maximum" >
+ <number>2100</number>
+ </property>
+ <property name="minimum" >
+ <number>-1000</number>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0" >
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string>&lt;b>Rating:&lt;/b></string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1" >
+ <widget class="QSpinBox" name="ratingEdit" >
+ <property name="maximum" >
+ <number>5</number>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ <pixmapfunction></pixmapfunction>
+ <tabstops>
+ <tabstop>bookTable</tabstop>
+ <tabstop>titleEdit</tabstop>
+ <tabstop>authorEdit</tabstop>
+ <tabstop>genreEdit</tabstop>
+ <tabstop>yearEdit</tabstop>
+ </tabstops>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter3/chapter3.rst b/sources/pyside6/doc/tutorials/portingguide/chapter3/chapter3.rst
new file mode 100644
index 000000000..b2e06b144
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter3/chapter3.rst
@@ -0,0 +1,121 @@
+Chapter 3: Port ``bookdwindow.cpp`` to ``bookwindow.py``
+*********************************************************
+
+After the bookdelegate, port the C++ code for the
+``BookWindow`` class. It offers a QMainWindow, containing a
+``QTableView`` to present the books data, and a **Details**
+section with a set of input fields to edit the selected row
+in the table. To begin with, create the ``bookwindow.py``
+and add the following imports to it:
+
+.. literalinclude:: bookwindow.py
+ :language: python
+ :linenos:
+ :lines: 40-53
+
+.. note:: The imports include the ``BookDelegate`` you
+ ported earlier and the ``Ui_BookWindow``. The pyside-uic
+ tool generates the ``ui_bookwindow`` Python code based
+ on the ``bookwindow.ui`` XML file.
+
+To generate this Python code, run the following command on the
+prompt:
+
+.. code-block::
+
+ pyside6-uic bookwindow.ui > ui_bookwindow.py
+
+Try porting the remaining code now. To begin with, here is
+how both the versions of the constructor code looks:
+
+C++ version
+------------
+
+.. literalinclude:: bookwindow.cpp
+ :language: c++
+ :linenos:
+ :lines: 57-140
+
+Python version
+---------------
+
+.. literalinclude:: bookwindow.py
+ :language: python
+ :linenos:
+ :lines: 53-116
+
+.. note:: The Python version of the ``BookWindow`` class
+ definition inherits from both ``QMainWindow`` and
+ ``Ui_BookWindow``, which is defined in the
+ ``ui_bookwindow.py`` file that you generated earlier.
+
+Here is how the rest of the code looks like:
+
+C++ version
+------------
+
+.. literalinclude:: bookwindow.cpp
+ :language: c++
+ :linenos:
+ :lines: 115-
+
+Python version
+---------------
+
+.. literalinclude:: bookwindow.py
+ :language: python
+ :linenos:
+ :lines: 117-
+
+Now that all the necessary pieces are in place, try to put
+them together in ``main.py``.
+
+.. literalinclude:: main.py
+ :language: python
+ :linenos:
+ :lines: 40-
+
+Try running this to see if you get the following output:
+
+.. image:: images/chapter3-books.png
+ :alt: BookWindow with a QTableView and a few input fields
+
+Now, if you look back at :doc:`chapter2 <../chapter2/chapter2>`,
+you'll notice that the ``bookdelegate.py`` loads the
+``star.png`` from the filesytem. Instead, you could add it
+to a ``qrc`` file, and load from it. The later approach is
+rececommended if your application is targeted for
+different platforms, as most of the popular platforms
+employ stricter file access policy these days.
+
+To add the ``star.png`` to a ``.qrc``, create a file called
+``books.qrc`` and the following XML content to it:
+
+.. literalinclude:: books.qrc
+ :linenos:
+
+This is a simple XML file defining a list all resources that
+your application needs. In this case, it is the ``star.png``
+image only.
+
+Now, run the ``pyside6-rcc`` tool on the ``books.qrc`` file
+to generate ``rc_books.py``.
+
+.. code-block::
+
+ pyside6-rcc books.qrc > rc_books.py
+
+Once you have the Python script generated, make the
+following changes to ``bookdelegate.py`` and ``main.py``:
+
+.. literalinclude:: bookdelegate.py
+ :diff: ../chapter2/bookdelegate.py
+
+.. literalinclude:: main.py
+ :diff: main-old.py
+
+Although there will be no noticeable difference in the UI
+after these changes, using a ``.qrc`` is a better approach.
+
+Now that you have successfully ported the SQL Books example,
+you know how easy it is. Try porting another C++ application.
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter3/createdb.py b/sources/pyside6/doc/tutorials/portingguide/chapter3/createdb.py
new file mode 100644
index 000000000..c3f27162d
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter3/createdb.py
@@ -0,0 +1,131 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+from PySide6.QtSql import QSqlDatabase, QSqlError, QSqlQuery
+from datetime import date
+
+
+def add_book(q, title, year, authorId, genreId, rating):
+ q.addBindValue(title)
+ q.addBindValue(year)
+ q.addBindValue(authorId)
+ q.addBindValue(genreId)
+ q.addBindValue(rating)
+ q.exec_()
+
+
+def add_genre(q, name):
+ q.addBindValue(name)
+ q.exec_()
+ return q.lastInsertId()
+
+
+def add_author(q, name, birthdate):
+ q.addBindValue(name)
+ q.addBindValue(str(birthdate))
+ q.exec_()
+ return q.lastInsertId()
+
+BOOKS_SQL = """
+ create table books(id integer primary key, title varchar, author integer,
+ genre integer, year integer, rating integer)
+ """
+AUTHORS_SQL = """
+ create table authors(id integer primary key, name varchar, birthdate text)
+ """
+GENRES_SQL = """
+ create table genres(id integer primary key, name varchar)
+ """
+INSERT_AUTHOR_SQL = """
+ insert into authors(name, birthdate) values(?, ?)
+ """
+INSERT_GENRE_SQL = """
+ insert into genres(name) values(?)
+ """
+INSERT_BOOK_SQL = """
+ insert into books(title, year, author, genre, rating)
+ values(?, ?, ?, ?, ?)
+ """
+
+def init_db():
+ """
+ init_db()
+ Initializes the database.
+ If tables "books" and "authors" are already in the database, do nothing.
+ Return value: None or raises ValueError
+ The error value is the QtSql error instance.
+ """
+ def check(func, *args):
+ if not func(*args):
+ raise ValueError(func.__self__.lastError())
+ db = QSqlDatabase.addDatabase("QSQLITE")
+ db.setDatabaseName(":memory:")
+
+ check(db.open)
+
+ q = QSqlQuery()
+ check(q.exec_, BOOKS_SQL)
+ check(q.exec_, AUTHORS_SQL)
+ check(q.exec_, GENRES_SQL)
+ check(q.prepare, INSERT_AUTHOR_SQL)
+
+ asimovId = add_author(q, "Isaac Asimov", date(1920, 2, 1))
+ greeneId = add_author(q, "Graham Greene", date(1904, 10, 2))
+ pratchettId = add_author(q, "Terry Pratchett", date(1948, 4, 28))
+
+ check(q.prepare,INSERT_GENRE_SQL)
+ sfiction = add_genre(q, "Science Fiction")
+ fiction = add_genre(q, "Fiction")
+ fantasy = add_genre(q, "Fantasy")
+
+ check(q.prepare,INSERT_BOOK_SQL)
+ add_book(q, "Foundation", 1951, asimovId, sfiction, 3)
+ add_book(q, "Foundation and Empire", 1952, asimovId, sfiction, 4)
+ add_book(q, "Second Foundation", 1953, asimovId, sfiction, 3)
+ add_book(q, "Foundation's Edge", 1982, asimovId, sfiction, 3)
+ add_book(q, "Foundation and Earth", 1986, asimovId, sfiction, 4)
+ add_book(q, "Prelude to Foundation", 1988, asimovId, sfiction, 3)
+ add_book(q, "Forward the Foundation", 1993, asimovId, sfiction, 3)
+ add_book(q, "The Power and the Glory", 1940, greeneId, fiction, 4)
+ add_book(q, "The Third Man", 1950, greeneId, fiction, 5)
+ add_book(q, "Our Man in Havana", 1958, greeneId, fiction, 4)
+ add_book(q, "Guards! Guards!", 1989, pratchettId, fantasy, 3)
+ add_book(q, "Night Watch", 2002, pratchettId, fantasy, 3)
+ add_book(q, "Going Postal", 2004, pratchettId, fantasy, 3)
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter3/images/chapter3-books.png b/sources/pyside6/doc/tutorials/portingguide/chapter3/images/chapter3-books.png
new file mode 100644
index 000000000..952cb14e8
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter3/images/chapter3-books.png
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter3/images/star.png b/sources/pyside6/doc/tutorials/portingguide/chapter3/images/star.png
new file mode 100644
index 000000000..87f4464bd
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter3/images/star.png
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter3/main-old.py b/sources/pyside6/doc/tutorials/portingguide/chapter3/main-old.py
new file mode 100644
index 000000000..675f8032b
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter3/main-old.py
@@ -0,0 +1,52 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+import sys
+from PySide6.QtWidgets import QApplication
+from bookwindow import BookWindow
+
+if __name__ == "__main__":
+ app = QApplication([])
+
+ window = BookWindow()
+ window.resize(800, 600)
+ window.show()
+
+ sys.exit(app.exec_())
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter3/main.py b/sources/pyside6/doc/tutorials/portingguide/chapter3/main.py
new file mode 100644
index 000000000..e957869ac
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter3/main.py
@@ -0,0 +1,53 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+import sys
+from PySide6.QtWidgets import QApplication
+from bookwindow import BookWindow
+import rc_books
+
+if __name__ == "__main__":
+ app = QApplication([])
+
+ window = BookWindow()
+ window.resize(800, 600)
+ window.show()
+
+ sys.exit(app.exec_())
diff --git a/sources/pyside6/doc/tutorials/portingguide/hello_world_ex.py b/sources/pyside6/doc/tutorials/portingguide/hello_world_ex.py
new file mode 100644
index 000000000..81b63b7ea
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/portingguide/hello_world_ex.py
@@ -0,0 +1,76 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+import sys
+import random
+
+from PySide6.QtWidgets import (QApplication, QLabel,
+ QPushButton, QVBoxLayout, QWidget)
+from PySide6.QtCore import Qt, Slot
+
+class MyWidget(QWidget):
+ def __init__(self):
+ super().__init__()
+
+ self.hello = ["Hallo Welt", "Hei maailma", "Hola Mundo", "Привет мир"]
+
+ self.button = QPushButton("Click me!")
+ self.text = QLabel("Hello World")
+ self.text.setAlignment(Qt.AlignCenter)
+
+ self.layout = QVBoxLayout()
+ self.layout.addWidget(self.text)
+ self.layout.addWidget(self.button)
+ self.setLayout(self.layout)
+
+ self.button.clicked.connect(self.magic)
+
+ @Slot()
+ def magic(self):
+ self.text.setText(random.choice(self.hello))
+
+if __name__ == "__main__":
+ app = QApplication(sys.argv)
+
+ widget = MyWidget()
+ widget.resize(800, 600)
+ widget.show()
+
+ sys.exit(app.exec_())
diff --git a/sources/pyside6/doc/tutorials/portingguide/index.rst b/sources/pyside6/doc/tutorials/portingguide/index.rst
new file mode 100644
index 000000000..12f76d3fc
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/portingguide/index.rst
@@ -0,0 +1,194 @@
+Porting a C++ Application to Python
+*************************************
+
+Qt for Python lets you use Qt APIs in a Python application.
+So the next question is: What does it take to port an
+existing C++ application? Try porting a Qt C++ application
+to Python to understand this.
+
+Before you start, ensure that all the prerequisites for
+Qt for Python are met. See
+:doc:`Getting Started <../../gettingstarted>` for more
+information. In addition, familiarize yourself with the
+basic differences between Qt in C++ and in Python.
+
+Basic differences
+==================
+
+This section highlights some of the basic differences
+between C++ and Python, and how Qt differs between these
+two contexts.
+
+C++ vs Python
+--------------
+
+* In the interest of code reuse, both C++ and Python
+ provide ways for one file of code to use facilities
+ provided by another. In C++, this is done using the
+ ``#include`` directive to access the API definition of
+ the reused code. The Python equivalent is an ``import``
+ statement.
+* The constructor of a C++ class shares the name of its
+ class and automatically calls the constructor of any
+ base-classes (in a predefined order) before it runs.
+ In Python, the ``__init__()`` method is the constructor
+ of the class, and it can explicitly call base-class
+ constructors in any order.
+* C++ uses the keyword, ``this``, to implicitly refer to
+ the current object. In python, you need to explicitly
+ mention the current object as the first parameter
+ to each instance method of the class; it is conventionally
+ named ``self``.
+* And more importantly, forget about curly braces, {}, and
+ semi-colon, ;.
+* Precede variable definitions with the ``global`` keyword,
+ only if they need global scope.
+
+.. code:: python
+
+ var = None
+ def func(key, value = None):
+ """Does stuff with a key and an optional value.
+
+ If value is omitted or None, the value from func()'s
+ last call is reused.
+ """
+ global var
+ if value is None:
+ if var is None:
+ raise ValueError("Must pass a value on first call", key, value)
+ value = var
+ else:
+ var = value
+ doStuff(key, value)
+
+In this example, ``func()`` would treat ``var`` as a local
+name without the ``global`` statement. This would lead to
+a ``NameError`` in the ``value is None`` handling, on
+accessing ``var``. For more information about this, see
+`Python refernce documentation <python refdoc>`_.
+
+.. _python refdoc: https://docs.python.org/3/reference/simple_stmts.html#the-global-statement
+
+.. tip:: Python being an interpreted language, most often
+ the easiest way is to try your idea in the interperter.
+ You could call the ``help()`` function in the
+ interpreter on any built-in function or keyword in
+ Python. For example, a call to ``help(import)`` should
+ provide documentation about the ``import`` statment
+
+Last but not the least, try out a few examples to
+familiarize yourself with the Python coding style and
+follow the guidelines outlined in the
+`PEP8 - Style Guide <pep8>`_.
+
+.. _pep8: <https://www.python.org/dev/peps/pep-0008/#naming-conventions>
+
+.. code-block:: python
+
+ import sys
+
+ from PySide6.QtWidgets import QApplication, QLabel
+
+ app = QApplication(sys.argv)
+ label = QLabel("Hello World")
+ label.show()
+ sys.exit(app.exec_())
+
+.. note:: Qt provides classes that are meant to manage
+ the application-specific requirements depending on
+ whether the application is console-only
+ (QCoreApplication), GUI with QtWidgets (QApplication),
+ or GUI without QtWidgets (QGuiApplication). These
+ classes load necessary plugins, such as the GUI
+ libraries required by an application. In this case, it is
+ QApplication that is initialized first as the application
+ has a GUI with QtWidgets.
+
+Qt in the C++ and Python context
+---------------------------------
+
+Qt behaves the same irrespective of whether it is used
+in a C++ or a Python application. Considering that C++
+and Python use different language semantics, some
+differences between the two variants of Qt are inevitable.
+Here are a few important ones that you must be aware of:
+
+* **Qt Properties**: ``Q_PROPERTY`` macros are used in C++ to add a
+ public member variable with getter and setter functions. Python's
+ alternative for this is the ``@property`` decorator before the
+ getter and setter function definitions.
+* **Qt Signals and Slots**: Qt offers a unique callback mechanism,
+ where a signal is emitted to notify the occurrence of an event, so
+ that slots connected to this signal can react to it. In C++,
+ the class definition must define the slots under the
+ ``public Q_SLOTS:`` and signals under ``Q_SIGNALS:``
+ access specifier. You connect these two using one of the
+ several variants of the QObject::connect() function. Python's
+ equivalent for this is the `@Slot`` decorator just before the
+ function definition. This is necessary to register the slots
+ with the QtMetaObject.
+* **QString, QVariant, and other types**
+
+ - Qt for Python does not provide access to QString and
+ QVariant. You must use Python's native types instead.
+ - QChar and QStringRef are represented as Python strings,
+ and QStringList is converted to a list of strings.
+ - QDate, QDateTime, QTime, and QUrl's __hash__() methods
+ return a string representation so that identical dates
+ (and identical date/times or times or URLs) have
+ identical hash values.
+ - QTextStream's bin(), hex(), and oct() functions are
+ renamed to bin_(), hex_(), and oct_() respectively. This
+ should avoid name conflicts with Python's built-in
+ functions.
+
+* **QByteArray**: A QByteArray is treated as a list of
+ bytes without encoding. Python 3 uses
+ "bytes". QString is represented as an encoded human readable string,
+ which means it is a "str".
+
+Here is the improved version of the Hello World example,
+demonstrating some of these differences:
+
+.. literalinclude:: hello_world_ex.py
+ :linenos:
+ :lines: 40-
+
+.. note:: The ``if`` block is just a good practice when
+ developing a Python application. It lets the Python file
+ behave differently depending on whether it is imported
+ as a module in another file or run directly. The
+ ``__name__`` variable will have different values in
+ these two scenarios. It is ``__main__`` when the file is
+ run directly, and the module's file name
+ (``hello_world_ex`` in this case) when imported as a
+ module. In the later case, everything defined in the
+ module except the ``if`` block is available to the
+ importing file.
+
+Notice that the QPushButton's ``clicked`` signal is
+connected to the ``magic`` function to randomly change the
+QLabel's ``text`` property. The `@Slot`` decorator marks
+the methods that are slots and informs the QtMetaObject about
+them.
+
+Porting a Qt C++ example
+=========================
+
+Qt offers several C++ examples to showcase its features and help
+beginners learn. You can try porting one of these C++ examples to
+Python. The
+`books SQL example <https://code.qt.io/cgit/qt/qtbase.git/tree/examples/sql/books>`_
+is a good starting point as it does not require you to write UI-specific code in
+Python, but can use its ``.ui`` file instead.
+
+The following chapters guides you through the porting process:
+
+.. toctree::
+ :glob:
+ :titlesonly:
+
+ chapter1/chapter1
+ chapter2/chapter2
+ chapter3/chapter3
diff --git a/sources/pyside6/doc/tutorials/qmlapp/logo.png b/sources/pyside6/doc/tutorials/qmlapp/logo.png
new file mode 100644
index 000000000..30c621c9c
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/qmlapp/logo.png
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/qmlapp/main.py b/sources/pyside6/doc/tutorials/qmlapp/main.py
new file mode 100644
index 000000000..5946538d9
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/qmlapp/main.py
@@ -0,0 +1,82 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+#!/usr/bin/env python
+# -*- conding: utf-8 -*-
+
+import os, sys, urllib.request, json
+import PySide6.QtQml
+from PySide6.QtQuick import QQuickView
+from PySide6.QtCore import QStringListModel, Qt, QUrl
+from PySide6.QtGui import QGuiApplication
+
+if __name__ == '__main__':
+
+ #get our data
+ url = "http://country.io/names.json"
+ response = urllib.request.urlopen(url)
+ data = json.loads(response.read().decode('utf-8'))
+
+ #Format and sort the data
+ data_list = list(data.values())
+ data_list.sort()
+
+ #Set up the application window
+ app = QGuiApplication(sys.argv)
+ view = QQuickView()
+ view.setResizeMode(QQuickView.SizeRootObjectToView)
+
+ #Expose the list to the Qml code
+ my_model = QStringListModel()
+ my_model.setStringList(data_list)
+ view.rootContext().setContextProperty("myModel",my_model)
+
+ #Load the QML file
+ qml_file = os.path.join(os.path.dirname(__file__),"view.qml")
+ view.setSource(QUrl.fromLocalFile(os.path.abspath(qml_file)))
+
+ #Show the window
+ if view.status() == QQuickView.Error:
+ sys.exit(-1)
+ view.show()
+
+ #execute and cleanup
+ app.exec_()
+ del view
diff --git a/sources/pyside6/doc/tutorials/qmlapp/newpyproject.png b/sources/pyside6/doc/tutorials/qmlapp/newpyproject.png
new file mode 100644
index 000000000..93968a52d
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/qmlapp/newpyproject.png
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/qmlapp/projectsmode.png b/sources/pyside6/doc/tutorials/qmlapp/projectsmode.png
new file mode 100644
index 000000000..c66d88723
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/qmlapp/projectsmode.png
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/qmlapp/pyprojname.png b/sources/pyside6/doc/tutorials/qmlapp/pyprojname.png
new file mode 100644
index 000000000..98328074d
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/qmlapp/pyprojname.png
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/qmlapp/pyprojxplor.png b/sources/pyside6/doc/tutorials/qmlapp/pyprojxplor.png
new file mode 100644
index 000000000..e01e2ebeb
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/qmlapp/pyprojxplor.png
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/qmlapp/qmlapplication.png b/sources/pyside6/doc/tutorials/qmlapp/qmlapplication.png
new file mode 100644
index 000000000..ec0ad3dea
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/qmlapp/qmlapplication.png
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/qmlapp/qmlapplication.rst b/sources/pyside6/doc/tutorials/qmlapp/qmlapplication.rst
new file mode 100644
index 000000000..082490f4b
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/qmlapp/qmlapplication.rst
@@ -0,0 +1,132 @@
+#########################
+QML Application Tutorial
+#########################
+
+This tutorial provides a quick walk-through of a python application
+that loads a QML file. QML is a declarative language that lets you
+design UIs faster than a traditional language, such as C++. The
+QtQml and QtQuick modules provides the necessary infrastructure for
+QML-based UIs.
+
+In this tutorial, you'll also learn how to provide data from Python
+as a QML context property, which is then consumed by the ListView
+defined in the QML file.
+
+Before you begin, install the following prerequisites:
+
+* The `PySide6 <https://pypi.org/project/PySide6/>`_ Python packages.
+* Qt Creator v4.9 beta1 or later from
+ `http://download.qt.io
+ <http://download.qt.io/snapshots/qtcreator/4.9/4.9.0-beta1/>`_.
+
+
+The following step-by-step instructions guide you through application
+development process using Qt Creator:
+
+#. Open Qt Creator and select **File > New File or Project..** menu item
+ to open following dialog:
+
+ .. image:: newpyproject.png
+
+#. Select **Qt for Python - Empty** from the list of application templates
+ and select **Choose**.
+
+ .. image:: pyprojname.png
+
+#. Give a **Name** to your project, choose its location in the
+ filesystem, and select **Finish** to create an empty ``main.py``
+ and ``main.pyproject``.
+
+ .. image:: pyprojxplor.png
+
+ This should create a ``main.py`` and ```main.pyproject`` files
+ for the project.
+
+#. Download :download:`view.qml<view.qml>` and :download:`logo.png <logo.png>`
+ and move them to your project folder.
+
+#. Double-click on ``main.pyproject`` to open it in edit mode, and append
+ ``view.qml`` and ``logo.png`` to the **files** list. This is how your
+ project file should look after this change:
+
+ .. code::
+
+ {
+ "files": ["main.py", "view.qml", "logo.png"]
+ }
+
+#. Now that you have the necessary bits for the application, import the
+ Python modules in your ``main.py``, and download country data and
+ format it:
+
+ .. literalinclude:: main.py
+ :linenos:
+ :lines: 40-60
+ :emphasize-lines: 12-20
+
+#. Now, set up the application window using
+ :ref:`PySide6.QtGui.QGuiApplication<qguiapplication>`, which manages the application-wide
+ settings.
+
+ .. literalinclude:: main.py
+ :linenos:
+ :lines: 40-65
+ :emphasize-lines: 23-25
+
+ .. note:: Setting the resize policy is important if you want the
+ root item to resize itself to fit the window or vice-a-versa.
+ Otherwise, the root item will retain its original size on
+ resizing the window.
+
+#. You can now expose the ``data_list`` variable as a QML context
+ property, which will be consumed by the QML ListView item in ``view.qml``.
+
+ .. literalinclude:: main.py
+ :linenos:
+ :lines: 40-70
+ :emphasize-lines: 27-30
+
+#. Load the ``view.qml`` to the ``QQuickView`` and call ``show()`` to
+ display the application window.
+
+ .. literalinclude:: main.py
+ :linenos:
+ :lines: 40-79
+ :emphasize-lines: 33-39
+
+#. Finally, execute the application to start the event loop and clean up.
+
+ .. literalinclude:: main.py
+ :linenos:
+ :lines: 40-
+ :emphasize-lines: 41-43
+
+#. Your application is ready to be run now. Select **Projects** mode to
+ choose the Python version to run it.
+
+ .. image:: projectsmode.png
+
+Run the application by using the ``CTRL+R`` keyboard shortcut to see if it
+looks like this:
+
+.. image:: qmlapplication.png
+
+You could also watch the following video tutorial for guidance to develop
+this application:
+
+.. raw:: html
+
+ <div style="position: relative; padding-bottom: 56.25%; height: 0;
+ overflow: hidden; max-width: 100%; height: auto;">
+ <iframe src="https://www.youtube.com/embed/JxfiUx60Mbg" frameborder="0"
+ allowfullscreen style="position: absolute; top: 0; left: 0;
+ width: 100%; height: 100%;">
+ </iframe>
+ </div>
+
+********************
+Related information
+********************
+
+* `QML Reference <https://doc.qt.io/qt-5/qmlreference.html>`_
+* :doc:`../qmlintegration/qmlintegration`
diff --git a/sources/pyside6/doc/tutorials/qmlapp/view.qml b/sources/pyside6/doc/tutorials/qmlapp/view.qml
new file mode 100644
index 000000000..c75052b29
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/qmlapp/view.qml
@@ -0,0 +1,102 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+
+import QtQuick 2.12
+import QtQuick.Controls 2.12
+
+Page {
+ width: 640
+ height: 480
+
+ header: Label {
+ color: "#15af15"
+ text: qsTr("Where do people use Qt?")
+ font.pointSize: 17
+ font.bold: true
+ font.family: "Arial"
+ renderType: Text.NativeRendering
+ horizontalAlignment: Text.AlignHCenter
+ padding: 10
+ }
+ Rectangle {
+ id: root
+ width: parent.width
+ height: parent.height
+
+ Image {
+ id: image
+ fillMode: Image.PreserveAspectFit
+ anchors.centerIn: root
+ source: "./logo.png"
+ opacity: 0.5
+
+ }
+
+ ListView {
+ id: view
+ anchors.fill: root
+ anchors.margins: 25
+ model: myModel
+ delegate: Text {
+ anchors.leftMargin: 50
+ font.pointSize: 15
+ horizontalAlignment: Text.AlignHCenter
+ text: display
+ }
+ }
+ }
+ NumberAnimation {
+ id: anim
+ running: true
+ target: view
+ property: "contentY"
+ duration: 500
+ }
+}
diff --git a/sources/pyside6/doc/tutorials/qmlintegration/main.py b/sources/pyside6/doc/tutorials/qmlintegration/main.py
new file mode 100644
index 000000000..884d239b3
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/qmlintegration/main.py
@@ -0,0 +1,113 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python examples of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:BSD$
+## You may use this file under the terms of the BSD license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+import sys
+from os.path import abspath, dirname, join
+
+from PySide6.QtCore import QObject, Slot
+from PySide6.QtGui import QGuiApplication
+from PySide6.QtQml import QQmlApplicationEngine
+
+from style_rc import *
+
+
+class Bridge(QObject):
+
+ @Slot(str, result=str)
+ def getColor(self, color_name):
+ if color_name.lower() == "red":
+ return "#ef9a9a"
+ elif color_name.lower() == "green":
+ return "#a5d6a7"
+ elif color_name.lower() == "blue":
+ return "#90caf9"
+ else:
+ return "white"
+
+ @Slot(float, result=int)
+ def getSize(self, s):
+ size = int(s * 42) # Maximum font size
+ if size <= 0:
+ return 1
+ else:
+ return size
+
+ @Slot(str, result=bool)
+ def getItalic(self, s):
+ if s.lower() == "italic":
+ return True
+ else:
+ return False
+
+ @Slot(str, result=bool)
+ def getBold(self, s):
+ if s.lower() == "bold":
+ return True
+ else:
+ return False
+
+ @Slot(str, result=bool)
+ def getUnderline(self, s):
+ if s.lower() == "underline":
+ return True
+ else:
+ return False
+
+
+if __name__ == '__main__':
+ app = QGuiApplication(sys.argv)
+ engine = QQmlApplicationEngine()
+
+ # Instance of the Python object
+ bridge = Bridge()
+
+ # Expose the Python object to QML
+ context = engine.rootContext()
+ context.setContextProperty("con", bridge)
+
+ # Get the path of the current directory, and then add the name
+ # of the QML file, to load it.
+ qmlFile = join(dirname(__file__), 'view.qml')
+ engine.load(abspath(qmlFile))
+
+ if not engine.rootObjects():
+ sys.exit(-1)
+
+ sys.exit(app.exec_())
diff --git a/sources/pyside6/doc/tutorials/qmlintegration/qmlintegration.rst b/sources/pyside6/doc/tutorials/qmlintegration/qmlintegration.rst
new file mode 100644
index 000000000..5bbb89609
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/qmlintegration/qmlintegration.rst
@@ -0,0 +1,111 @@
+########################
+QML Integration Tutorial
+########################
+
+This tutorial provides a quick walk-through of a python application that loads, and interacts with
+a QML file. QML is a declarative language that lets you design UIs faster than a traditional
+language, such as C++. The QtQml and QtQuick modules provides the necessary infrastructure for
+QML-based UIs.
+
+In this tutorial, you will learn how to integrate Python with a QML application through a context
+property. This mechanism will help us to understand how to use Python as a backend for certain
+signals from the UI elements in the QML interface. Additionally, you will learn how to provide
+a modern look to your QML application using one of the features from Qt Quick Controls 2.
+
+The tutorial is based on an application that allow you to set many text properties, like increasing
+the font size, changing the color, changing the style, and so on. Before you begin, install the
+`PySide6 <https://pypi.org/project/PySide6/>`_ Python packages.
+
+The following step-by-step process will guide you through the key elements of the QML based
+application and PySide6 integration:
+
+#. First, let's start with the following QML-based UI:
+
+ .. image:: textproperties_default.png
+
+ The design is based on a `GridLayout`, containing two `ColumnLayout`.
+ Inside the UI you will find many `RadioButton`, `Button`, and a `Slider`.
+
+#. With the QML file in place, you can load it from Python:
+
+ .. literalinclude:: main.py
+ :linenos:
+ :lines: 98-108
+ :emphasize-lines: 6,9
+
+ Notice that we specify the name of the context property, **con**,
+ and also we explicitly load our QML file.
+
+#. Define the `Bridge` class, containing all the logic for the context property:
+
+ .. literalinclude:: main.py
+ :linenos:
+ :lines: 51-91
+
+#. Now, go back to the QML file and connect the signals to the slots defined in the `Bridge` class:
+
+ .. literalinclude:: view.qml
+ :linenos:
+ :lines: 85-93
+ :emphasize-lines: 5-7
+
+ The properties *Italic*, *Bold*, and *Underline* are mutually
+ exclusive, this means only one can be active at any time.
+ To achieve this each time we select one of these options, we
+ check the three properties via the context property as you can
+ see in the above snippet.
+ Only one of the three will return *True*, while the other two
+ will return *False*, that is how we make sure only one is being
+ applied to the text.
+
+#. Each slot verifies if the selected option contains the text associated
+ to the property:
+
+ .. literalinclude:: main.py
+ :linenos:
+ :lines: 79-84
+ :emphasize-lines: 4,6
+
+ Returning *True* or *False* allows you to activate and deactivate
+ the properties of the QML UI elements.
+
+ It is also possible to return other values that are not *Boolean*,
+ like the slot in charge of returning the font size:
+
+ .. literalinclude:: main.py
+ :linenos:
+ :lines: 64-70
+
+#. Now, for changing the look of our application, you have two options:
+
+ 1. Use the command line: execute the python file adding the option, `--style`::
+
+ python main.py --style material
+
+ 2. Use a `qtquickcontrols2.conf` file:
+
+ .. literalinclude:: qtquickcontrols2.conf
+ :linenos:
+
+ Then add it to your `.qrc` file:
+
+ .. literalinclude:: style.qrc
+ :linenos:
+
+ Generate the *rc* file running, `pyside6-rcc style.qrc > style_rc.py`
+ And finally import it from your `main.py` script.
+
+ .. literalinclude:: main.py
+ :linenos:
+ :lines: 41-48
+ :emphasize-lines: 8
+
+ You can read more about this configuration file
+ `here <https://doc.qt.io/qt-5/qtquickcontrols2-configuration.html>`_.
+
+ The final look of your application will be:
+
+ .. image:: textproperties_material.png
+
+You can :download:`view.qml <view.qml>` and
+:download:`main.py <main.py>` to try this example.
diff --git a/sources/pyside6/doc/tutorials/qmlintegration/qtquickcontrols2.conf b/sources/pyside6/doc/tutorials/qmlintegration/qtquickcontrols2.conf
new file mode 100644
index 000000000..850646021
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/qmlintegration/qtquickcontrols2.conf
@@ -0,0 +1,10 @@
+[Controls]
+Style=Material
+
+[Universal]
+Theme=System
+Accent=Red
+
+[Material]
+Theme=Dark
+Accent=Red
diff --git a/sources/pyside6/doc/tutorials/qmlintegration/style.qrc b/sources/pyside6/doc/tutorials/qmlintegration/style.qrc
new file mode 100644
index 000000000..e313f5ed6
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/qmlintegration/style.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/">
+ <file>qtquickcontrols2.conf</file>
+</qresource>
+</RCC>
diff --git a/sources/pyside6/doc/tutorials/qmlintegration/textproperties_default.png b/sources/pyside6/doc/tutorials/qmlintegration/textproperties_default.png
new file mode 100644
index 000000000..cfeac9368
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/qmlintegration/textproperties_default.png
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/qmlintegration/textproperties_material.png b/sources/pyside6/doc/tutorials/qmlintegration/textproperties_material.png
new file mode 100644
index 000000000..47866c10e
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/qmlintegration/textproperties_material.png
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/qmlintegration/view.qml b/sources/pyside6/doc/tutorials/qmlintegration/view.qml
new file mode 100644
index 000000000..97968d691
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/qmlintegration/view.qml
@@ -0,0 +1,183 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt for Python examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+import QtQuick 2.0
+import QtQuick.Layouts 1.12
+import QtQuick.Controls 2.12
+import QtQuick.Window 2.12
+import QtQuick.Controls.Material 2.12
+
+ApplicationWindow {
+ id: page
+ width: 800
+ height: 400
+ visible: true
+
+ GridLayout {
+ id: grid
+ columns: 2
+ rows: 3
+
+ ColumnLayout {
+ spacing: 2
+ Layout.preferredWidth: 400
+
+ Text {
+ id: leftlabel
+ Layout.alignment: Qt.AlignHCenter
+ color: "white"
+ font.pointSize: 16
+ text: "Qt for Python"
+ Layout.preferredHeight: 100
+ Material.accent: Material.Green
+ }
+
+ RadioButton {
+ id: italic
+ text: "Italic"
+ onToggled: {
+ leftlabel.font.italic = con.getItalic(italic.text)
+ leftlabel.font.bold = con.getBold(italic.text)
+ leftlabel.font.underline = con.getUnderline(italic.text)
+
+ }
+ }
+ RadioButton {
+ id: bold
+ text: "Bold"
+ onToggled: {
+ leftlabel.font.italic = con.getItalic(bold.text)
+ leftlabel.font.bold = con.getBold(bold.text)
+ leftlabel.font.underline = con.getUnderline(bold.text)
+ }
+ }
+ RadioButton {
+ id: underline
+ text: "Underline"
+ onToggled: {
+ leftlabel.font.italic = con.getItalic(underline.text)
+ leftlabel.font.bold = con.getBold(underline.text)
+ leftlabel.font.underline = con.getUnderline(underline.text)
+ }
+ }
+ RadioButton {
+ id: noneradio
+ text: "None"
+ checked: true
+ onToggled: {
+ leftlabel.font.italic = con.getItalic(noneradio.text)
+ leftlabel.font.bold = con.getBold(noneradio.text)
+ leftlabel.font.underline = con.getUnderline(noneradio.text)
+ }
+ }
+ }
+
+ ColumnLayout {
+ id: rightcolumn
+ spacing: 2
+ Layout.columnSpan: 1
+ Layout.preferredWidth: 400
+ Layout.preferredHeight: 400
+ Layout.fillWidth: true
+
+ RowLayout {
+ Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
+
+
+ Button {
+ id: red
+ text: "Red"
+ highlighted: true
+ Material.accent: Material.Red
+ onClicked: {
+ leftlabel.color = con.getColor(red.text)
+ }
+ }
+ Button {
+ id: green
+ text: "Green"
+ highlighted: true
+ Material.accent: Material.Green
+ onClicked: {
+ leftlabel.color = con.getColor(green.text)
+ }
+ }
+ Button {
+ id: blue
+ text: "Blue"
+ highlighted: true
+ Material.accent: Material.Blue
+ onClicked: {
+ leftlabel.color = con.getColor(blue.text)
+ }
+ }
+ Button {
+ id: nonebutton
+ text: "None"
+ highlighted: true
+ Material.accent: Material.BlueGrey
+ onClicked: {
+ leftlabel.color = con.getColor(nonebutton.text)
+ }
+ }
+ }
+ RowLayout {
+ Layout.fillWidth: true
+ Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
+ Text {
+ id: rightlabel
+ color: "white"
+ text: "Font size"
+ Material.accent: Material.White
+ }
+ Slider {
+ width: rightcolumn.width*0.6
+ Layout.alignment: Qt.AlignRight
+ id: slider
+ value: 0.5
+ onValueChanged: {
+ leftlabel.font.pointSize = con.getSize(value)
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/sources/pyside6/doc/tutorials/qmlsqlintegration/chat.qml b/sources/pyside6/doc/tutorials/qmlsqlintegration/chat.qml
new file mode 100644
index 000000000..487f5b36c
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/qmlsqlintegration/chat.qml
@@ -0,0 +1,127 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Python.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** 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.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.12
+import QtQuick.Layouts 1.12
+import QtQuick.Controls 2.12
+
+ApplicationWindow {
+ id: window
+ title: qsTr("Chat")
+ width: 640
+ height: 960
+ visible: true
+ ColumnLayout {
+ anchors.fill: parent
+
+ ListView {
+ id: listView
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ Layout.margins: pane.leftPadding + messageField.leftPadding
+ displayMarginBeginning: 40
+ displayMarginEnd: 40
+ verticalLayoutDirection: ListView.BottomToTop
+ spacing: 12
+ model: chat_model
+ delegate: Column {
+ readonly property bool sentByMe: model.recipient !== "Me"
+ anchors.right: sentByMe ? parent.right : undefined
+ spacing: 6
+
+ Row {
+ id: messageRow
+ spacing: 6
+ anchors.right: sentByMe ? parent.right : undefined
+
+ Rectangle {
+ width: Math.min(messageText.implicitWidth + 24, listView.width - messageRow.spacing)
+ height: messageText.implicitHeight + 24
+ radius: 15
+ color: sentByMe ? "lightgrey" : "#ff627c"
+
+ Label {
+ id: messageText
+ text: model.message
+ color: sentByMe ? "black" : "white"
+ anchors.fill: parent
+ anchors.margins: 12
+ wrapMode: Label.Wrap
+ }
+ }
+ }
+
+ Label {
+ id: timestampText
+ text: Qt.formatDateTime(model.timestamp, "d MMM hh:mm")
+ color: "lightgrey"
+ anchors.right: sentByMe ? parent.right : undefined
+ }
+ }
+
+ ScrollBar.vertical: ScrollBar {}
+ }
+
+ Pane {
+ id: pane
+ Layout.fillWidth: true
+
+ RowLayout {
+ width: parent.width
+
+ TextArea {
+ id: messageField
+ Layout.fillWidth: true
+ placeholderText: qsTr("Compose message")
+ wrapMode: TextArea.Wrap
+ }
+
+ Button {
+ id: sendButton
+ text: qsTr("Send")
+ enabled: messageField.length > 0
+ onClicked: {
+ chat_model.send_message("machine", messageField.text, "Me");
+ messageField.text = "";
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/sources/pyside6/doc/tutorials/qmlsqlintegration/example_list_view.png b/sources/pyside6/doc/tutorials/qmlsqlintegration/example_list_view.png
new file mode 100644
index 000000000..a0c189665
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/qmlsqlintegration/example_list_view.png
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/qmlsqlintegration/main.py b/sources/pyside6/doc/tutorials/qmlsqlintegration/main.py
new file mode 100644
index 000000000..50a3d43fe
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/qmlsqlintegration/main.py
@@ -0,0 +1,85 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python project.
+##
+## $QT_BEGIN_LICENSE:LGPL$
+## 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.
+##
+## GNU Lesser General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU Lesser
+## General Public License version 3 as published by the Free Software
+## Foundation and appearing in the file LICENSE.LGPL3 included in the
+## packaging of this file. Please review the following information to
+## ensure the GNU Lesser General Public License version 3 requirements
+## will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+##
+## GNU General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU
+## General Public License version 2.0 or (at your option) the GNU General
+## Public license version 3 or any later version approved by the KDE Free
+## Qt Foundation. The licenses are as published by the Free Software
+## Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+## included in the packaging of this file. Please review the following
+## information to ensure the GNU General Public License requirements will
+## be met: https://www.gnu.org/licenses/gpl-2.0.html and
+## https://www.gnu.org/licenses/gpl-3.0.html.
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+import logging
+
+from PySide6.QtCore import QDir, QFile, QUrl
+from PySide6.QtGui import QGuiApplication
+from PySide6.QtQml import QQmlApplicationEngine
+from PySide6.QtSql import QSqlDatabase
+
+from sqlDialog import SqlConversationModel
+
+logging.basicConfig(filename="chat.log", level=logging.DEBUG)
+logger = logging.getLogger("logger")
+
+
+def connectToDatabase():
+ database = QSqlDatabase.database()
+ if not database.isValid():
+ database = QSqlDatabase.addDatabase("QSQLITE")
+ if not database.isValid():
+ logger.error("Cannot add database")
+
+ write_dir = QDir()
+ if not write_dir.mkpath("."):
+ logger.error("Failed to create writable directory")
+
+ # Ensure that we have a writable location on all devices.
+ filename = "{}/chat-database.sqlite3".format(write_dir.absolutePath())
+
+ # When using the SQLite driver, open() will create the SQLite
+ # database if it doesn't exist.
+ database.setDatabaseName(filename)
+ if not database.open():
+ logger.error("Cannot open database")
+ QFile.remove(filename)
+
+
+if __name__ == "__main__":
+ app = QGuiApplication()
+ connectToDatabase()
+ sql_conversation_model = SqlConversationModel()
+
+ engine = QQmlApplicationEngine()
+ # Export pertinent objects to QML
+ engine.rootContext().setContextProperty("chat_model", sql_conversation_model)
+ engine.load(QUrl("chat.qml"))
+
+ app.exec_()
diff --git a/sources/pyside6/doc/tutorials/qmlsqlintegration/qmlsqlintegration.rst b/sources/pyside6/doc/tutorials/qmlsqlintegration/qmlsqlintegration.rst
new file mode 100644
index 000000000..0df6dd30c
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/qmlsqlintegration/qmlsqlintegration.rst
@@ -0,0 +1,225 @@
+QML, SQL and PySide Integration Tutorial
+########################################
+
+This tutorial is very similar to the `Qt Chat Tutorial`_ one but it focuses on explaining how to
+integrate a SQL database into a PySide6 application using QML for its UI.
+
+.. _`Qt Chat Tutorial`: https://doc.qt.io/qt-5/qtquickcontrols-chattutorial-example.html
+
+sqlDialog.py
+------------
+
+We import the pertinent libraries to our program, define a global variable that hold the
+name of our table, and define the global function ``createTable()`` that creates a new table if it
+doesn't already exist.
+The database contains a single line to mock the beginning of a conversation.
+
+ .. literalinclude:: sqlDialog.py
+ :linenos:
+ :lines: 40-77
+
+The ``SqlConversationModel`` class offers the read-only data model required for the non-editable
+contacts list. It derives from the :ref:`QSqlQueryModel` class, which is the logical choice for
+this use case.
+Then, we proceed to create the table, set its name to the one defined previously with the
+:meth:`~.QSqlTableModel.setTable` method.
+We add the necessary attributes to the table, to have a program that reflects the idea
+of a chat application.
+
+ .. literalinclude:: sqlDialog.py
+ :linenos:
+ :lines: 80-91
+
+In ``setRecipient()``, you set a filter over the returned results from the database, and
+emit a signal every time the recipient of the message changes.
+
+ .. literalinclude:: sqlDialog.py
+ :linenos:
+ :lines: 93-103
+
+The ``data()`` function falls back to ``QSqlTableModel``'s implementation if the role is not a
+custom user role.
+If you get a user role, we can subtract :meth:`~.QtCore.Qt.UserRole` from it to get the index of
+that field, and then use that index to find the value to be returned.
+
+ .. literalinclude:: sqlDialog.py
+ :linenos:
+ :lines: 105-112
+
+
+In ``roleNames()``, we return a Python dictionary with our custom role and role names as key-values
+pairs, so we can use these roles in QML.
+Alternatively, it can be useful to declare an Enum to hold all of the role values.
+Note that ``names`` has to be a hash to be used as a dictionary key,
+and that's why we're using the ``hash`` function.
+
+ .. literalinclude:: sqlDialog.py
+ :linenos:
+ :lines: 114-128
+
+The ``send_message()`` function uses the given recipient and message to insert a new record into
+the database.
+Using :meth:`~.QSqlTableModel.OnManualSubmit` requires you to also call ``submitAll()``,
+since all the changes will be cached in the model until you do so.
+
+ .. literalinclude:: sqlDialog.py
+ :linenos:
+ :lines: 130-146
+
+chat.qml
+--------
+
+Let's look at the ``chat.qml`` file.
+
+ .. literalinclude:: chat.qml
+ :linenos:
+ :lines: 40-42
+
+First, import the Qt Quick module.
+This gives us access to graphical primitives such as Item, Rectangle, Text, and so on.
+For a full list of types, see the `Qt Quick QML Types`_ documentation.
+We then add QtQuick.Layouts import, which we'll cover shortly.
+
+Next, import the Qt Quick Controls module.
+Among other things, this provides access to ``ApplicationWindow``, which replaces the existing
+root type, Window:
+
+Let's step through the ``chat.qml`` file.
+
+ .. literalinclude:: chat.qml
+ :linenos:
+ :lines: 44-49
+
+``ApplicationWindow`` is a Window with some added convenience for creating a header and a footer.
+It also provides the foundation for popups and supports some basic styling, such as the background
+color.
+
+There are three properties that are almost always set when using ApplicationWindow: ``width``,
+``height``, and ``visible``.
+Once we've set these, we have a properly sized, empty window ready to be filled with content.
+
+There are two ways of laying out items in QML: `Item Positioners`_ and `Qt Quick Layouts`_.
+
+- Item positioners (`Row`_, `Column`_, and so on) are useful for situations where the size of items
+ is known or fixed, and all that is required is to neatly position them in a certain formation.
+- The layouts in Qt Quick Layouts can both position and resize items, making them well suited for
+ resizable user interfaces.
+ Below, we use `ColumnLayout`_ to vertically lay out a `ListView`_ and a `Pane`_.
+
+ .. literalinclude:: chat.qml
+ :linenos:
+ :lines: 50-53
+
+Pane is basically a rectangle whose color comes from the application's style.
+It's similar to `Frame`_, but it has no stroke around its border.
+
+Items that are direct children of a layout have various `attached properties`_ available to them.
+We use `Layout.fillWidth`_ and `Layout.fillHeight`_ on the `ListView`_ to ensure that it takes as
+much space within the `ColumnLayout`_ as it can, and the same is done for the Pane.
+As `ColumnLayout`_ is a vertical layout, there aren't any items to the left or right of each child,
+so this results in each item consuming the entire width of the layout.
+
+On the other hand, the `Layout.fillHeight`_ statement in the `ListView`_ enables it to occupy the
+remaining space that is left after accommodating the Pane.
+
+.. _Item Positioners: https://doc.qt.io/qt-5/qtquick-positioning-layouts.html
+.. _Qt Quick Layouts: https://doc.qt.io/qt-5/qtquicklayouts-index.html
+.. _Row: https://doc.qt.io/qt-5/qml-qtquick-row.html
+.. _Column: https://doc.qt.io/qt-5/qml-qtquick-column.html
+.. _ColumnLayout: https://doc.qt.io/qt-5/qml-qtquick-layouts-columnlayout.html
+.. _ListView: https://doc.qt.io/qt-5/qml-qtquick-listview.html
+.. _Pane: https://doc.qt.io/qt-5/qml-qtquick-controls2-pane.html
+.. _Frame: https://doc.qt.io/qt-5/qml-qtquick-controls2-frame.html
+.. _attached properties: https://doc.qt.io/qt-5/qml-qtquick-layouts-layout.html
+.. _Layout.fillWidth: https://doc.qt.io/qt-5/qml-qtquick-layouts-layout.html#fillWidth-attached-prop
+.. _Layout.fillHeight: https://doc.qt.io/qt-5/qml-qtquick-layouts-layout.html#fillHeight-attached-prop
+.. _ListView: https://doc.qt.io/qt-5/qml-qtquick-listview.html
+.. _Qt Quick QML Types: https://doc.qt.io/qt-5/qtquick-qmlmodule.html
+
+Let's look at the ``Listview`` in detail:
+
+ .. literalinclude:: chat.qml
+ :linenos:
+ :lines: 53-99
+
+After filling the ``width`` and ``height`` of its parent, we also set some margins on the view.
+
+
+Next, we set `displayMarginBeginning`_ and `displayMarginEnd`_.
+These properties ensure that the delegates outside the view don't disappear when you
+scroll at the edges of the view.
+To get a better understanding, consider commenting out the properties and then rerun your code.
+Now watch what happens when you scroll the view.
+
+We then flip the vertical direction of the view, so that first items are at the bottom.
+
+Additionally, messages sent by the contact should be distinguished from those sent by a contact.
+For now, when a message is sent by you, we set a ``sentByMe`` property, to alternate between
+different contacts.
+Using this property, we distinguish between different contacts in two ways:
+
+* Messages sent by the contact are aligned to the right side of the screen by setting
+ ``anchors.right`` to ``parent.right``.
+* We change the color of the rectangle depending on the contact.
+ Since we don't want to display dark text on a dark background, and vice versa, we also set the
+ text color depending on who the contact is.
+
+At the bottom of the screen, we place a `TextArea`_ item to allow multi-line text input, and a
+button to send the message.
+We use Pane to cover the area under these two items:
+
+ .. literalinclude:: chat.qml
+ :linenos:
+ :lines: 101-125
+
+The `TextArea`_ should fill the available width of the screen.
+We assign some placeholder text to provide a visual cue to the contact as to where they should begin
+typing.
+The text within the input area is wrapped to ensure that it does not go outside of the screen.
+
+Lastly, we have a button that allows us to call the ``send_message`` method we defined on
+``sqlDialog.py``, since we're just having a mock up example here and there is only one possible
+recipient and one possible sender for this conversation we're just using strings here.
+
+.. _displayMarginBeginning: https://doc.qt.io/qt-5/qml-qtquick-listview.html#displayMarginBeginning-prop
+.. _displayMarginEnd: https://doc.qt.io/qt-5/qml-qtquick-listview.html#displayMarginEnd-prop
+.. _TextArea: https://doc.qt.io/qt-5/qml-qtquick-controls2-textarea.html
+
+
+main.py
+-------
+
+We use ``logging`` instead of Python's ``print()``, because it provides a better way to control the
+messages levels that our application will generate (errors, warnings, and information messages).
+
+ .. literalinclude:: main.py
+ :linenos:
+ :lines: 40-50
+
+``connectToDatabase()`` creates a connection with the SQLite database, creating the actual file
+if it doesn't already exist.
+
+ .. literalinclude:: main.py
+ :linenos:
+ :lines: 53-72
+
+
+
+A few interesting things happen in the ``main`` function:
+
+- Declaring a :ref:`QGuiApplication`.
+ You should use a :ref:`QGuiApplication` instead of :ref:`QApplication` because we're not
+ using the **QtWidgets** module.
+- Connecting to the database,
+- Declaring a :ref:`QQmlApplicationEngine`.
+ This allows you to access the QML context property to connect Python
+ and QML from the conversation model we built on ``sqlDialog.py``.
+- Loading the ``.qml`` file that defines the UI.
+
+Finally, the Qt application runs, and your program starts.
+
+ .. literalinclude:: main.py
+ :linenos:
+ :lines: 75-85
+
+.. image:: example_list_view.png
diff --git a/sources/pyside6/doc/tutorials/qmlsqlintegration/sqlDialog.py b/sources/pyside6/doc/tutorials/qmlsqlintegration/sqlDialog.py
new file mode 100644
index 000000000..a9745051b
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/qmlsqlintegration/sqlDialog.py
@@ -0,0 +1,146 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the Qt for Python project.
+##
+## $QT_BEGIN_LICENSE:LGPL$
+## 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.
+##
+## GNU Lesser General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU Lesser
+## General Public License version 3 as published by the Free Software
+## Foundation and appearing in the file LICENSE.LGPL3 included in the
+## packaging of this file. Please review the following information to
+## ensure the GNU Lesser General Public License version 3 requirements
+## will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+##
+## GNU General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU
+## General Public License version 2.0 or (at your option) the GNU General
+## Public license version 3 or any later version approved by the KDE Free
+## Qt Foundation. The licenses are as published by the Free Software
+## Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+## included in the packaging of this file. Please review the following
+## information to ensure the GNU General Public License requirements will
+## be met: https://www.gnu.org/licenses/gpl-2.0.html and
+## https://www.gnu.org/licenses/gpl-3.0.html.
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+import datetime
+import logging
+
+from PySide6.QtCore import Qt, Slot
+from PySide6.QtSql import QSqlDatabase, QSqlQuery, QSqlRecord, QSqlTableModel
+
+table_name = "Conversations"
+
+
+def createTable():
+ if table_name in QSqlDatabase.database().tables():
+ return
+
+ query = QSqlQuery()
+ if not query.exec_(
+ """
+ CREATE TABLE IF NOT EXISTS 'Conversations' (
+ 'author' TEXT NOT NULL,
+ 'recipient' TEXT NOT NULL,
+ 'timestamp' TEXT NOT NULL,
+ 'message' TEXT NOT NULL,
+ FOREIGN KEY('author') REFERENCES Contacts ( name ),
+ FOREIGN KEY('recipient') REFERENCES Contacts ( name )
+ )
+ """
+ ):
+ logging.error("Failed to query database")
+
+ # This adds the first message from the Bot
+ # and further development is required to make it interactive.
+ query.exec_(
+ """
+ INSERT INTO Conversations VALUES(
+ 'machine', 'Me', '2019-01-07T14:36:06', 'Hello!'
+ )
+ """
+ )
+ logging.info(query)
+
+
+class SqlConversationModel(QSqlTableModel):
+ def __init__(self, parent=None):
+ super(SqlConversationModel, self).__init__(parent)
+
+ createTable()
+ self.setTable(table_name)
+ self.setSort(2, Qt.DescendingOrder)
+ self.setEditStrategy(QSqlTableModel.OnManualSubmit)
+ self.recipient = ""
+
+ self.select()
+ logging.debug("Table was loaded successfully.")
+
+ def setRecipient(self, recipient):
+ if recipient == self.recipient:
+ pass
+
+ self.recipient = recipient
+
+ filter_str = (
+ "(recipient = '{}' AND author = 'Me') OR " "(recipient = 'Me' AND author='{}')"
+ ).format(self.recipient)
+ self.setFilter(filter_str)
+ self.select()
+
+ def data(self, index, role):
+ if role < Qt.UserRole:
+ return QSqlTableModel.data(self, index, role)
+
+ sql_record = QSqlRecord()
+ sql_record = self.record(index.row())
+
+ return sql_record.value(role - Qt.UserRole)
+
+ def roleNames(self):
+ """Converts dict to hash because that's the result expected
+ by QSqlTableModel"""
+ names = {}
+ author = "author".encode()
+ recipient = "recipient".encode()
+ timestamp = "timestamp".encode()
+ message = "message".encode()
+
+ names[hash(Qt.UserRole)] = author
+ names[hash(Qt.UserRole + 1)] = recipient
+ names[hash(Qt.UserRole + 2)] = timestamp
+ names[hash(Qt.UserRole + 3)] = message
+
+ return names
+
+ def send_message(self, recipient, message, author):
+ timestamp = datetime.datetime.now()
+
+ new_record = self.record()
+ new_record.setValue("author", author)
+ new_record.setValue("recipient", recipient)
+ new_record.setValue("timestamp", str(timestamp))
+ new_record.setValue("message", message)
+
+ logging.debug('Message: "{}" \n Received by: "{}"'.format(message, recipient))
+
+ if not self.insertRecord(self.rowCount(), new_record):
+ logging.error("Failed to send message: {}".format(self.lastError().text()))
+ return
+
+ self.submitAll()
+ self.select()
diff --git a/sources/pyside6/doc/typesystem_doc.xml.in b/sources/pyside6/doc/typesystem_doc.xml.in
new file mode 100644
index 000000000..94260fea0
--- /dev/null
+++ b/sources/pyside6/doc/typesystem_doc.xml.in
@@ -0,0 +1,63 @@
+<?xml version="1.0" ?>
+<!--
+/****************************************************************************
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $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$
+**
+****************************************************************************/
+-->
+<typesystem package="PySide">
+ <suppress-warning text="File containing conversion code for *" />
+ <suppress-warning text="File for inject code not exist: *" />
+ <suppress-warning text="Can't find qdoc3 file for class QMatrix4x3, tried: /home/hugo/src/pyside/build/doc/qdoc3-output/qmatrix4x3.xml" />
+ <suppress-warning text="Can't find qdoc3 file for class QMatrix3x4, tried: /home/hugo/src/pyside/build/doc/qdoc3-output/qmatrix3x4.xml" />
+ <suppress-warning text="Can't find qdoc3 file for class QMatrix2x3, tried: /home/hugo/src/pyside/build/doc/qdoc3-output/qmatrix2x3.xml" />
+ <suppress-warning text="Can't find qdoc3 file for class QMatrix4x2, tried: /home/hugo/src/pyside/build/doc/qdoc3-output/qmatrix4x2.xml" />
+ <suppress-warning text="Can't find qdoc3 file for class QMatrix3x3, tried: /home/hugo/src/pyside/build/doc/qdoc3-output/qmatrix3x3.xml" />
+ <suppress-warning text="Can't find qdoc3 file for class QMatrix2x2, tried: /home/hugo/src/pyside/build/doc/qdoc3-output/qmatrix2x2.xml" />
+ <suppress-warning text="Can't find qdoc3 file for class QMatrix3x2, tried: /home/hugo/src/pyside/build/doc/qdoc3-output/qmatrix3x2.xml" />
+ <suppress-warning text="Can't find qdoc3 file for class QMatrix2x4, tried: /home/hugo/src/pyside/build/doc/qdoc3-output/qmatrix2x4.xml" />
+<!-- Modules to be appended -->
diff --git a/sources/pyside6/doc/videos.rst b/sources/pyside6/doc/videos.rst
new file mode 100644
index 000000000..5c72c90df
--- /dev/null
+++ b/sources/pyside6/doc/videos.rst
@@ -0,0 +1,96 @@
+|project| Videos
+================
+
+.. raw:: html
+
+ <style>
+ .embed-container {
+ margin-top: 10px;
+ position: relative;
+ padding-bottom: 56.25%;
+ height: 0;
+ overflow: hidden;
+ max-width: 100%;
+ }
+ .embed-container iframe, .embed-container object, .embed-container embed {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ }
+ .video-title {
+ font-weight: bold;
+ text-align: center;
+ }
+ </style>
+ <table>
+ <tr>
+ <td style="width: 30%;">
+ <p class="video-title">QtVirtualTechCon2020: From Prototypes to Hybrid Applications</p>
+ <div class="embed-container">
+ <iframe src="https://www.youtube.com/embed/Vb1dbLQafyM" frameborder="0" allowfullscreen>
+ </iframe>
+ </div>
+ </td>
+ <td style="width: 30%;">
+ <p class="video-title">QtWS2019: Utilizing Shiboken to Enhance your Application</p>
+ <div class='embed-container'>
+ <iframe src="https://www.youtube.com/embed/mAfEVPgHRt8" frameborder="0" allowfullscreen>
+ </iframe>
+ </div>
+ </td>
+ <td style="width: 30%;">
+ <p class="video-title">QtWS2019: Introduction to Qt for Python</p>
+ <div class='embed-container'>
+ <iframe src="https://www.youtube.com/embed/214TWASZVgA" frameborder="0" allowfullscreen>
+ </iframe>
+ </div>
+ </td>
+ </tr>
+ </tr>
+ <td style="width: 30%;">
+ <p class="video-title">Webinar: Python and C++ interoperability with Shiboken</p>
+ <div class='embed-container'>
+ <iframe src="https://www.youtube.com/embed/wOMlDutOWXI" frameborder="0" allowfullscreen>
+ </iframe>
+ </div>
+ </td>
+ <td style="width: 30%;">
+ <p class="video-title">QtWS2019: How to bring your C++ project to Python land</p>
+ <div class='embed-container'>
+ <iframe src="https://www.youtube.com/embed/XmY-tWTi9gY" frameborder="0" allowfullscreen>
+ </iframe>
+ </div>
+ </td>
+ <td style="width: 30%;">
+ <p class="video-title">QtWS2018: Mastering Qt for Python in 20 min</p>
+ <div class='embed-container'>
+ <iframe src="https://www.youtube.com/embed/IhxZ99usPqY" frameborder="0" allowfullscreen>
+ </iframe>
+ </td>
+ </tr>
+ </tr>
+ <td style="width: 30%;">
+ <p class="video-title">Webinar: Develop your first Qt for Python application</p>
+ <div class='embed-container'>
+ <iframe src="https://www.youtube.com/embed/HDBjmSiOBxY" frameborder="0" allowfullscreen>
+ </iframe>
+ </div>
+ </td>
+ <td style="width: 30%;">
+ <p class="video-title">Webinar: Creating user interfaces with Qt for Python</p>
+ <div class='embed-container'>
+ <iframe src="https://www.youtube.com/embed/wKqLaNqxgas" frameborder="0" allowfullscreen>
+ </iframe>
+ </div>
+ </td>
+ <td style="width: 30%;">
+ <p class="video-title">QtWS2017: Take a walk on the PySide</p>
+ <div class="embed-container">
+ <iframe src="https://www.youtube.com/embed/Sb4FV6SdHHQ" frameborder="0" allowfullscreen>
+ </iframe>
+ </div>
+ </td>
+ </tr>
+ </table>