From 9a4fb2eb72040aeadf6124ec1cad083859ac0787 Mon Sep 17 00:00:00 2001 From: Cristian Maureira-Fredes Date: Wed, 24 Mar 2021 22:33:35 +0100 Subject: doc: enable snippets translate tool Create snippets directories in case they don't exist. Add "-q" option as the examples directory to keep the "--quiet" option from the build. Something to consider with this patch: Removing all the previous old snippets, which include not only 'cpp' files, but also '.h', '.qdoc', '.qrc', '.png', and '.qml', which might be used in the snippets, but will need to be updated in the generation tool, to not translate, and copy them over. Pick-to: 6.0 Change-Id: Icbef9e1c93a12b90dbcfa990ef055ca6f8868407 Reviewed-by: Friedemann Kleint --- sources/pyside6/doc/CMakeLists.txt | 18 + .../src/snippets/accessibilityslidersnippet.cpp | 271 ----------- .../codesnippets/doc/src/snippets/alphachannel.cpp | 64 --- .../codesnippets/doc/src/snippets/audio/main.cpp | 104 ----- .../doc/src/snippets/brushstyles/qt-logo.png | Bin 15518 -> 0 bytes .../doc/src/snippets/brushstyles/renderarea.h | 71 --- .../doc/src/snippets/brushstyles/stylewidget.h | 108 ----- .../doc/src/snippets/clipboard/clipwindow.h | 82 ---- .../doc/src/snippets/clipboard/clipwindow.py | 105 ----- .../doc/src/snippets/code/doc_src_qnamespace.qdoc | 67 --- .../doc/src/snippets/code/doc_src_qtcore.py | 53 --- .../doc/src/snippets/code/doc_src_qtnetwork.py | 53 --- .../doc/src/snippets/code/doc_src_qtopengl.py | 53 --- .../src/snippets/code/doc_src_qtprintsupport.py | 53 --- .../doc/src/snippets/code/doc_src_qtqml.py | 53 --- .../doc/src/snippets/code/doc_src_qtquick.py | 53 --- .../doc/src/snippets/code/doc_src_qtsql.py | 52 --- .../doc/src/snippets/code/doc_src_qttest.py | 53 --- .../doc/src/snippets/code/doc_src_qtwidgets.py | 53 --- .../doc/src/snippets/code/doc_src_qtxml.py | 53 --- .../code/src.gui.text.qtextdocumentwriter.cpp | 55 --- .../snippets/code/src.qdbus.qdbuspendingcall.cpp | 74 --- .../snippets/code/src.qdbus.qdbuspendingreply.cpp | 73 --- .../code/src.scripttools.qscriptenginedebugger.cpp | 59 --- .../code/src_corelib_codecs_qtextcodec.cpp | 82 ---- .../code/src_corelib_codecs_qtextcodecplugin.cpp | 62 --- .../code/src_corelib_concurrent_qfuture.cpp | 74 --- .../src_corelib_concurrent_qfuturesynchronizer.cpp | 63 --- .../code/src_corelib_concurrent_qfuturewatcher.cpp | 60 --- ...rc_corelib_concurrent_qtconcurrentexception.cpp | 85 ---- .../src_corelib_concurrent_qtconcurrentfilter.cpp | 181 ------- .../src_corelib_concurrent_qtconcurrentmap.cpp | 194 -------- .../src_corelib_concurrent_qtconcurrentrun.cpp | 110 ----- .../code/src_corelib_concurrent_qthreadpool.cpp | 59 --- .../code/src_corelib_io_qabstractfileengine.cpp | 112 ----- .../snippets/code/src_corelib_io_qdatastream.cpp | 135 ------ .../doc/src/snippets/code/src_corelib_io_qdir.cpp | 179 ------- .../snippets/code/src_corelib_io_qdiriterator.cpp | 62 --- .../doc/src/snippets/code/src_corelib_io_qfile.cpp | 82 ---- .../src/snippets/code/src_corelib_io_qfileinfo.cpp | 148 ------ .../src/snippets/code/src_corelib_io_qiodevice.cpp | 98 ---- .../src/snippets/code/src_corelib_io_qprocess.cpp | 132 ------ .../src/snippets/code/src_corelib_io_qsettings.cpp | 327 ------------- .../code/src_corelib_io_qtemporaryfile.cpp | 62 --- .../snippets/code/src_corelib_io_qtextstream.cpp | 140 ------ .../doc/src/snippets/code/src_corelib_io_qurl.cpp | 96 ---- ...src_corelib_kernel_qabstracteventdispatcher.cpp | 3 - .../code/src_corelib_kernel_qabstractitemmodel.cpp | 98 ---- .../code/src_corelib_kernel_qcoreapplication.cpp | 128 ----- .../code/src_corelib_kernel_qmetaobject.cpp | 132 ------ .../snippets/code/src_corelib_kernel_qmetatype.cpp | 119 ----- .../snippets/code/src_corelib_kernel_qmimedata.cpp | 107 ----- .../snippets/code/src_corelib_kernel_qobject.py | 374 --------------- .../code/src_corelib_kernel_qsystemsemaphore.cpp | 71 --- .../snippets/code/src_corelib_kernel_qtimer.cpp | 60 --- .../snippets/code/src_corelib_plugin_qlibrary.cpp | 94 ---- .../src/snippets/code/src_corelib_plugin_quuid.cpp | 54 --- .../src_corelib_statemachine_qstatemachine.cpp | 65 --- .../snippets/code/src_corelib_thread_qatomic.cpp | 108 ----- .../snippets/code/src_corelib_thread_qmutex.cpp | 165 ------- .../code/src_corelib_thread_qmutexpool.cpp | 62 --- .../code/src_corelib_thread_qreadwritelock.cpp | 111 ----- .../code/src_corelib_thread_qsemaphore.cpp | 83 ---- .../snippets/code/src_corelib_thread_qthread.cpp | 59 --- .../src_corelib_thread_qwaitcondition_unix.cpp | 95 ---- .../snippets/code/src_corelib_tools_qbitarray.cpp | 239 ---------- .../snippets/code/src_corelib_tools_qbytearray.cpp | 402 ---------------- .../snippets/code/src_corelib_tools_qdatetime.cpp | 156 ------- .../src/snippets/code/src_corelib_tools_qhash.cpp | 309 ------------ .../code/src_corelib_tools_qlinkedlist.cpp | 214 --------- .../snippets/code/src_corelib_tools_qlistdata.cpp | 277 ----------- .../snippets/code/src_corelib_tools_qlocale.cpp | 101 ---- .../src/snippets/code/src_corelib_tools_qmap.cpp | 323 ------------- .../src/snippets/code/src_corelib_tools_qpoint.cpp | 161 ------- .../src/snippets/code/src_corelib_tools_qqueue.cpp | 58 --- .../src/snippets/code/src_corelib_tools_qrect.cpp | 60 --- .../snippets/code/src_corelib_tools_qregexp.cpp | 225 --------- .../src/snippets/code/src_corelib_tools_qsize.cpp | 146 ------ .../snippets/code/src_corelib_tools_qstring.cpp | 95 ---- .../snippets/code/src_corelib_tools_qtimeline.cpp | 65 --- .../snippets/code/src_corelib_tools_qvector.cpp | 193 -------- .../snippets/code/src_corelib_xml_qxmlstream.cpp | 77 --- .../code/src_gui_accessible_qaccessible.cpp | 57 --- .../code/src_gui_dialogs_qabstractprintdialog.cpp | 55 --- .../snippets/code/src_gui_dialogs_qfiledialog.cpp | 136 ------ .../snippets/code/src_gui_dialogs_qfontdialog.cpp | 90 ---- .../src/snippets/code/src_gui_dialogs_qwizard.cpp | 81 ---- .../code/src_gui_effects_qgraphicseffect.cpp | 87 ---- .../src_gui_graphicsview_qgraphicsgridlayout.cpp | 63 --- .../code/src_gui_graphicsview_qgraphicsitem.cpp | 249 ---------- .../src_gui_graphicsview_qgraphicslinearlayout.cpp | 63 --- .../src_gui_graphicsview_qgraphicsproxywidget.cpp | 96 ---- .../code/src_gui_graphicsview_qgraphicsscene.cpp | 125 ----- .../src_gui_graphicsview_qgraphicssceneevent.cpp | 55 --- .../code/src_gui_graphicsview_qgraphicsview.cpp | 136 ------ .../code/src_gui_graphicsview_qgraphicswidget.cpp | 75 --- .../src/snippets/code/src_gui_image_qbitmap.cpp | 54 --- .../doc/src/snippets/code/src_gui_image_qicon.cpp | 82 ---- .../doc/src/snippets/code/src_gui_image_qimage.cpp | 86 ---- .../snippets/code/src_gui_image_qimagereader.cpp | 75 --- .../snippets/code/src_gui_image_qimagewriter.cpp | 69 --- .../doc/src/snippets/code/src_gui_image_qmovie.cpp | 63 --- .../src/snippets/code/src_gui_image_qpixmap.cpp | 68 --- .../snippets/code/src_gui_image_qpixmapcache.cpp | 66 --- .../snippets/code/src_gui_image_qpixmapfilter.cpp | 72 --- .../code/src_gui_itemviews_qabstractitemview.cpp | 67 --- .../code/src_gui_itemviews_qdatawidgetmapper.cpp | 73 --- .../code/src_gui_itemviews_qitemeditorfactory.cpp | 73 --- .../code/src_gui_itemviews_qitemselectionmodel.cpp | 60 --- .../code/src_gui_itemviews_qstandarditemmodel.cpp | 86 ---- .../code/src_gui_itemviews_qtablewidget.cpp | 55 --- .../code/src_gui_itemviews_qtreewidget.cpp | 58 --- .../src/snippets/code/src_gui_kernel_qaction.cpp | 59 --- .../snippets/code/src_gui_kernel_qapplication.cpp | 167 ------- .../code/src_gui_kernel_qapplication_x11.cpp | 55 --- .../snippets/code/src_gui_kernel_qclipboard.cpp | 63 --- .../src/snippets/code/src_gui_kernel_qevent.cpp | 61 --- .../snippets/code/src_gui_kernel_qformlayout.cpp | 86 ---- .../snippets/code/src_gui_kernel_qkeysequence.cpp | 69 --- .../src/snippets/code/src_gui_kernel_qlayout.cpp | 75 --- .../snippets/code/src_gui_kernel_qlayoutitem.cpp | 58 --- .../src/snippets/code/src_gui_kernel_qshortcut.cpp | 65 --- .../snippets/code/src_gui_kernel_qshortcutmap.cpp | 3 - .../src/snippets/code/src_gui_kernel_qsound.cpp | 59 --- .../src/snippets/code/src_gui_kernel_qwidget.cpp | 150 ------ .../src/snippets/code/src_gui_painting_qbrush.cpp | 61 --- .../src/snippets/code/src_gui_painting_qcolor.cpp | 59 --- .../snippets/code/src_gui_painting_qdrawutil.cpp | 108 ----- .../src/snippets/code/src_gui_painting_qmatrix.cpp | 72 --- .../snippets/code/src_gui_painting_qpainter.cpp | 261 ----------- .../code/src_gui_painting_qpainterpath.cpp | 160 ------- .../src/snippets/code/src_gui_painting_qpen.cpp | 85 ---- .../src/snippets/code/src_gui_painting_qregion.cpp | 63 --- .../code/src_gui_painting_qregion_unix.cpp | 68 --- .../snippets/code/src_gui_painting_qtransform.cpp | 88 ---- .../src/snippets/code/src_gui_styles_qstyle.cpp | 58 --- .../snippets/code/src_gui_styles_qstyleoption.cpp | 57 --- .../doc/src/snippets/code/src_gui_text_qfont.cpp | 77 --- .../snippets/code/src_gui_text_qfontmetrics.cpp | 64 --- .../code/src_gui_text_qsyntaxhighlighter.cpp | 124 ----- .../src/snippets/code/src_gui_text_qtextcursor.cpp | 90 ---- .../src/snippets/code/src_gui_text_qtextlayout.cpp | 73 --- .../src/snippets/code/src_gui_util_qcompleter.cpp | 74 --- .../code/src_gui_util_qdesktopservices.cpp | 65 --- .../src/snippets/code/src_gui_util_qundostack.cpp | 120 ----- .../src/snippets/code/src_gui_util_qvalidator.cpp | 155 ------ .../code/src_gui_widgets_qabstractbutton.cpp | 69 --- .../code/src_gui_widgets_qabstractspinbox.cpp | 58 --- .../code/src_gui_widgets_qcalendarwidget.cpp | 83 ---- .../snippets/code/src_gui_widgets_qcheckbox.cpp | 3 - .../code/src_gui_widgets_qdatetimeedit.cpp | 89 ---- .../snippets/code/src_gui_widgets_qdockwidget.cpp | 57 --- .../src/snippets/code/src_gui_widgets_qframe.cpp | 58 --- .../snippets/code/src_gui_widgets_qgroupbox.cpp | 3 - .../src/snippets/code/src_gui_widgets_qlabel.cpp | 74 --- .../snippets/code/src_gui_widgets_qlineedit.cpp | 57 --- .../snippets/code/src_gui_widgets_qmainwindow.cpp | 65 --- .../src/snippets/code/src_gui_widgets_qmenu.cpp | 87 ---- .../src/snippets/code/src_gui_widgets_qmenubar.cpp | 58 --- .../code/src_gui_widgets_qplaintextedit.cpp | 64 --- .../snippets/code/src_gui_widgets_qpushbutton.cpp | 3 - .../snippets/code/src_gui_widgets_qradiobutton.cpp | 3 - .../snippets/code/src_gui_widgets_qrubberband.cpp | 67 --- .../snippets/code/src_gui_widgets_qscrollarea.cpp | 59 --- .../src/snippets/code/src_gui_widgets_qspinbox.cpp | 90 ---- .../code/src_gui_widgets_qsplashscreen.cpp | 65 --- .../snippets/code/src_gui_widgets_qsplitter.cpp | 57 --- .../snippets/code/src_gui_widgets_qstatusbar.cpp | 3 - .../snippets/code/src_gui_widgets_qtextbrowser.cpp | 54 --- .../snippets/code/src_gui_widgets_qtextedit.cpp | 69 --- .../snippets/code/src_gui_widgets_qworkspace.cpp | 57 --- .../src/snippets/code/src_network_access_qftp.cpp | 109 ----- .../src/snippets/code/src_network_access_qhttp.cpp | 132 ------ .../src_network_access_qnetworkaccessmanager.cpp | 86 ---- .../code/src_network_access_qnetworkdiskcache.cpp | 74 --- .../code/src_network_access_qnetworkrequest.cpp | 3 - .../src_network_bearer_qnetworkconfigmanager.cpp | 58 --- .../code/src_network_kernel_qhostaddress.cpp | 57 --- .../snippets/code/src_network_kernel_qhostinfo.cpp | 92 ---- .../code/src_network_kernel_qnetworkproxy.cpp | 64 --- .../code/src_network_socket_qabstractsocket.cpp | 78 ---- .../code/src_network_socket_qlocalsocket_unix.cpp | 62 --- .../src_network_socket_qnativesocketengine.cpp | 71 --- .../code/src_network_socket_qtcpserver.cpp | 3 - .../code/src_network_socket_qudpsocket.cpp | 67 --- .../code/src_network_ssl_qsslcertificate.cpp | 54 --- .../code/src_network_ssl_qsslconfiguration.cpp | 55 --- .../snippets/code/src_network_ssl_qsslsocket.cpp | 100 ---- .../doc/src/snippets/code/src_opengl_qgl.cpp | 168 ------- .../src/snippets/code/src_opengl_qglcolormap.cpp | 74 --- .../snippets/code/src_opengl_qglpixelbuffer.cpp | 69 --- .../snippets/code/src_opengl_qglshaderprogram.cpp | 103 ---- .../src/snippets/code/src_qtestlib_qtestcase.cpp | 237 ---------- .../src/snippets/code/src_script_qscriptable.cpp | 69 --- .../src/snippets/code/src_script_qscriptclass.cpp | 59 --- .../snippets/code/src_script_qscriptcontext.cpp | 73 --- .../src/snippets/code/src_script_qscriptengine.cpp | 320 ------------- .../code/src_script_qscriptengineagent.cpp | 62 --- .../src/snippets/code/src_script_qscriptvalue.cpp | 91 ---- .../code/src_script_qscriptvalueiterator.cpp | 78 ---- .../snippets/code/src_sql_kernel_qsqldriver.cpp | 73 --- .../src/snippets/code/src_sql_kernel_qsqlerror.cpp | 56 --- .../src/snippets/code/src_sql_kernel_qsqlindex.cpp | 55 --- .../src/snippets/code/src_sql_kernel_qsqlquery.cpp | 88 ---- .../snippets/code/src_sql_kernel_qsqlresult.cpp | 88 ---- .../code/src_sql_models_qsqlquerymodel.cpp | 62 --- .../doc/src/snippets/code/src_xml_dom_qdom.cpp | 230 --------- .../doc/src/snippets/code/src_xml_sax_qxml.cpp | 3 - .../src_xmlpatterns_api_qabstracturiresolver.cpp | 3 - ...xmlpatterns_api_qabstractxmlforwarditerator.cpp | 3 - .../src_xmlpatterns_api_qabstractxmlnodemodel.cpp | 72 --- .../src_xmlpatterns_api_qabstractxmlreceiver.cpp | 57 --- .../src_xmlpatterns_api_qsimplexmlnodemodel.cpp | 69 --- .../code/src_xmlpatterns_api_qxmlformatter.cpp | 58 --- .../snippets/code/src_xmlpatterns_api_qxmlname.cpp | 58 --- .../code/src_xmlpatterns_api_qxmlquery.cpp | 202 -------- .../code/src_xmlpatterns_api_qxmlresultitems.cpp | 66 --- .../code/src_xmlpatterns_api_qxmlserializer.cpp | 57 --- ...tools_assistant_compat_lib_qassistantclient.cpp | 75 --- ..._src_lib_extension_default_extensionfactory.cpp | 85 ---- .../tools_designer_src_lib_extension_extension.cpp | 65 --- ...esigner_src_lib_extension_qextensionmanager.cpp | 67 --- ...ols_designer_src_lib_sdk_abstractformeditor.cpp | 61 --- ...ools_designer_src_lib_sdk_abstractformwindow.py | 74 --- ...signer_src_lib_sdk_abstractformwindowcursor.cpp | 58 --- ...igner_src_lib_sdk_abstractformwindowmanager.cpp | 61 --- ...esigner_src_lib_sdk_abstractobjectinspector.cpp | 61 --- ..._designer_src_lib_sdk_abstractpropertyeditor.py | 71 --- ...ools_designer_src_lib_sdk_abstractwidgetbox.cpp | 80 ---- ..._designer_src_lib_uilib_abstractformbuilder.cpp | 67 --- .../tools_designer_src_lib_uilib_formbuilder.cpp | 76 --- ...tools_patternist_qapplicationargumentparser.cpp | 55 --- ...ls_shared_qtgradienteditor_qtgradientdialog.cpp | 94 ---- ..._shared_qtpropertybrowser_qtpropertybrowser.cpp | 97 ---- ..._shared_qtpropertybrowser_qtvariantproperty.cpp | 66 --- ...ools_shared_qttoolbardialog_qttoolbardialog.cpp | 62 --- .../doc/src/snippets/console/dbus_pingpong.txt | 3 - .../doc/src/snippets/customstyle/customstyle.h | 69 --- .../snippets/designer/autoconnection/imagedialog.h | 69 --- .../designer/autoconnection/imagedialog.ui | 389 --------------- .../snippets/designer/imagedialog/imagedialog.ui | 389 --------------- .../designer/multipleinheritance/imagedialog.h | 64 --- .../designer/multipleinheritance/imagedialog.ui | 389 --------------- .../designer/noautoconnection/imagedialog.h | 69 --- .../designer/noautoconnection/imagedialog.ui | 389 --------------- .../designer/singleinheritance/imagedialog.h | 67 --- .../designer/singleinheritance/imagedialog.ui | 389 --------------- .../doc/src/snippets/dialogs/dialogs.py | 123 ----- .../doc/src/snippets/doc_src_qtcharts.py | 43 -- .../codesnippets/doc/src/snippets/doc_src_qtgui.py | 53 --- .../doc/src/snippets/doc_src_qtmultimedia.py | 53 --- .../doc/src/snippets/doc_src_qtxmlpatterns.py | 54 --- .../snippets/dockwidgets/Resources/modules.html | 28 -- .../src/snippets/dockwidgets/Resources/qtcore.html | 122 ----- .../src/snippets/dockwidgets/Resources/qtgui.html | 276 ----------- .../snippets/dockwidgets/Resources/qtnetwork.html | 35 -- .../snippets/dockwidgets/Resources/qtopengl.html | 27 -- .../src/snippets/dockwidgets/Resources/qtsql.html | 39 -- .../src/snippets/dockwidgets/Resources/qtxml.html | 53 --- .../src/snippets/dockwidgets/Resources/titles.txt | 7 - .../doc/src/snippets/dockwidgets/dockwidgets.qrc | 12 - .../doc/src/snippets/dockwidgets/mainwindow.h | 80 ---- .../doc/src/snippets/draganddrop/dragwidget.h | 89 ---- .../doc/src/snippets/draganddrop/mainwindow.h | 81 ---- .../doc/src/snippets/dragging/images.qrc | 5 - .../doc/src/snippets/dragging/images/file.png | Bin 313 -> 0 bytes .../doc/src/snippets/dragging/mainwindow.cpp | 72 --- .../doc/src/snippets/dragging/mainwindow.h | 81 ---- .../doc/src/snippets/dropactions/window.h | 81 ---- .../doc/codesnippets/doc/src/snippets/droparea.cpp | 147 ------ .../doc/src/snippets/dropevents/window.py | 65 --- .../doc/src/snippets/droprectangle/window.h | 81 ---- .../doc/src/snippets/eventfilters/filterobject.h | 69 --- .../snippets/explicitlysharedemployee/employee.h | 84 ---- .../doc/src/snippets/i18n-non-qt-class/myclass.h | 69 --- .../doc/src/snippets/i18n-non-qt-class/myclass.ts | 12 - .../src/snippets/i18n-non-qt-class/resources.qrc | 6 - .../translations/i18n-non-qt-class_en.ts | 12 - .../translations/i18n-non-qt-class_fr.ts | 13 - .../codesnippets/doc/src/snippets/image/image.cpp | 69 --- .../doc/src/snippets/image/supportedformat.cpp | 56 --- .../doc/src/snippets/inherited-slot/button.h | 69 --- .../doc/src/snippets/itemselection/model.h | 84 ---- .../doc/src/snippets/layouts/layouts.cpp | 126 ----- .../doc/src/snippets/mainwindowsnippet.cpp | 58 --- .../doc/src/snippets/matrix/matrix.cpp | 112 ----- .../doc/src/snippets/mdiareasnippets.cpp | 66 --- .../codesnippets/doc/src/snippets/moc/myclass1.h | 75 --- .../codesnippets/doc/src/snippets/moc/myclass2.h | 76 --- .../codesnippets/doc/src/snippets/moc/myclass3.h | 69 --- .../doc/src/snippets/modelview-subclasses/model.h | 80 ---- .../doc/src/snippets/modelview-subclasses/view.h | 100 ---- .../doc/src/snippets/modelview-subclasses/window.h | 78 ---- .../codesnippets/doc/src/snippets/myscrollarea.cpp | 112 ----- .../doc/src/snippets/network/tcpwait.cpp | 71 --- .../doc/codesnippets/doc/src/snippets/ntfsp.cpp | 60 --- .../doc/src/snippets/patternist/anyHTMLElement.xq | 1 - .../src/snippets/patternist/anyXLinkAttribute.xq | 2 - .../doc/src/snippets/patternist/bracesIncluded.xq | 1 - .../snippets/patternist/bracesIncludedResult.xml | 1 - .../doc/src/snippets/patternist/bracesOmitted.xq | 1 - .../snippets/patternist/bracesOmittedResult.xml | 2 - .../snippets/patternist/computedTreeFragment.xq | 14 - .../doc/src/snippets/patternist/copyAttribute.xq | 9 - .../doc/src/snippets/patternist/copyID.xq | 3 - .../src/snippets/patternist/directTreeFragment.xq | 7 - .../doc/src/snippets/patternist/doc.txt | 35 -- .../doc/src/snippets/patternist/docPlainHTML.xq | 1 - .../doc/src/snippets/patternist/docPlainHTML2.xq | 1 - .../src/snippets/patternist/embedDataInXHTML.xq | 10 - .../src/snippets/patternist/embedDataInXHTML2.xq | 10 - .../doc/src/snippets/patternist/emptyParagraphs.xq | 1 - .../src/snippets/patternist/escapeCurlyBraces.xq | 4 - .../snippets/patternist/escapeStringLiterals.xml | 2 - .../snippets/patternist/escapeStringLiterals.xq | 7 - .../patternist/expressionInsideAttribute.xq | 2 - .../doc/src/snippets/patternist/filterOnPath.xq | 2 - .../doc/src/snippets/patternist/filterOnStep.xq | 2 - .../doc/src/snippets/patternist/firstParagraph.xq | 1 - .../src/snippets/patternist/fnStringOnAttribute.xq | 9 - .../doc/src/snippets/patternist/forClause.xq | 3 - .../doc/src/snippets/patternist/forClause2.xq | 3 - .../doc/src/snippets/patternist/forClauseOnFeed.xq | 6 - .../doc/src/snippets/patternist/indented.xml | 5 - .../src/snippets/patternist/introAcneRemover.xq | 8 - .../doc/src/snippets/patternist/introExample2.xq | 5 - .../src/snippets/patternist/introFileHierarchy.xml | 14 - .../doc/src/snippets/patternist/introNavigateFS.xq | 12 - .../src/snippets/patternist/introductionExample.xq | 3 - .../src/snippets/patternist/invalidLetOrderBy.xq | 3 - .../doc/src/snippets/patternist/items.xq | 5 - .../doc/src/snippets/patternist/letOrderBy.xq | 4 - .../snippets/patternist/literalsAndOperators.xq | 2 - .../doc/src/snippets/patternist/mobeyDick.xml | 4 - .../src/snippets/patternist/nextLastParagraph.xq | 1 - .../patternist/nodeConstructorsAreExpressions.xq | 4 - .../snippets/patternist/nodeConstructorsInPaths.xq | 1 - .../snippets/patternist/nodeTestChildElement.xq | 1 - .../doc/src/snippets/patternist/notIndented.xml | 1 - .../snippets/patternist/oneElementConstructor.xq | 1 - .../patternist/paragraphsExceptTheFiveFirst.xq | 1 - .../snippets/patternist/paragraphsWithTables.xq | 1 - .../doc/src/snippets/patternist/pathAB.xq | 1 - .../src/snippets/patternist/pathsAllParagraphs.xq | 1 - .../doc/src/snippets/patternist/simpleHTML.xq | 1 - .../doc/src/snippets/patternist/simpleXHTML.xq | 2 - .../src/snippets/patternist/svgDocumentElement.xml | 1 - .../src/snippets/patternist/tablesInParagraphs.xq | 1 - .../doc/src/snippets/patternist/twoSVGElements.xq | 5 - .../doc/src/snippets/patternist/xmlStylesheet.xq | 1 - .../doc/src/snippets/patternist/xsBooleanTrue.xq | 1 - .../snippets/patternist/xsvgDocumentElement.xml | 1 - .../src/snippets/persistentindexes/mainwindow.h | 80 ---- .../doc/src/snippets/persistentindexes/model.h | 81 ---- .../doc/src/snippets/picture/picture.cpp | 121 ----- .../doc/src/snippets/plaintextlayout/window.h | 71 --- .../doc/src/snippets/polygon/polygon.cpp | 96 ---- .../doc/src/snippets/porting4-dropevents/window.h | 82 ---- .../doc/src/snippets/printing-qprinter/errors.cpp | 68 --- .../doc/src/snippets/printing-qprinter/object.h | 62 --- .../doc/src/snippets/qabstractsliderisnippet.cpp | 519 --------------------- .../doc/src/snippets/qdir-listfiles/main.cpp | 64 --- .../doc/src/snippets/qdir-namefilters/main.cpp | 68 --- .../doc/src/snippets/qfontdatabase/main.cpp | 74 --- .../doc/src/snippets/qlineargradient/paintwidget.h | 69 --- .../doc/src/snippets/qlistview-dnd/mainwindow.h | 71 --- .../doc/src/snippets/qlistview-dnd/model.h | 73 --- .../doc/src/snippets/qlistview-using/mainwindow.h | 82 ---- .../doc/src/snippets/qlistview-using/model.h | 82 ---- .../doc/src/snippets/qlistwidget-dnd/mainwindow.h | 72 --- .../src/snippets/qlistwidget-using/mainwindow.h | 82 ---- .../doc/src/snippets/qmacnativewidget/main.mm | 144 ------ .../codesnippets/doc/src/snippets/qmake/delegate.h | 50 -- .../codesnippets/doc/src/snippets/qmake/main.cpp | 50 -- .../codesnippets/doc/src/snippets/qmake/model.cpp | 50 -- .../codesnippets/doc/src/snippets/qmake/model.h | 50 -- .../doc/src/snippets/qmake/paintwidget_unix.cpp | 54 --- .../doc/codesnippets/doc/src/snippets/qmake/view.h | 50 -- .../src/snippets/qmetaobject-invokable/window.h | 68 --- .../doc/src/snippets/qquickview-ex.cpp | 67 --- .../doc/src/snippets/qsignalmapper/buttonwidget.h | 70 --- .../doc/src/snippets/qsignalmapper/mainwindow.h | 69 --- .../qsortfilterproxymodel-details/main.cpp | 79 ---- .../doc/src/snippets/qsplashscreen/main.cpp | 66 --- .../doc/src/snippets/qsplashscreen/mainwindow.h | 64 --- .../src/snippets/qsplashscreen/qsplashscreen.qrc | 5 - .../doc/src/snippets/qsplashscreen/splash.png | Bin 27926 -> 0 bytes .../doc/src/snippets/qstackedlayout/main.py | 87 ---- .../doc/src/snippets/qstackedwidget/main.py | 77 --- .../doc/src/snippets/qstatustipevent/main.cpp | 74 --- .../doc/src/snippets/qstyleoption/main.cpp | 105 ----- .../doc/src/snippets/qsvgwidget/qsvgwidget.qrc | 5 - .../doc/src/snippets/qsvgwidget/spheres.svg | 79 ---- .../doc/src/snippets/qsvgwidget/sunflower.svg | 188 -------- .../src/snippets/qtablewidget-dnd/Images/cubed.png | Bin 437 -> 0 bytes .../snippets/qtablewidget-dnd/Images/squared.png | Bin 440 -> 0 bytes .../doc/src/snippets/qtablewidget-dnd/images.qrc | 6 - .../doc/src/snippets/qtablewidget-dnd/mainwindow.h | 78 ---- .../snippets/qtablewidget-resizing/mainwindow.h | 77 --- .../snippets/qtablewidget-using/Images/cubed.png | Bin 437 -> 0 bytes .../snippets/qtablewidget-using/Images/squared.png | Bin 440 -> 0 bytes .../doc/src/snippets/qtablewidget-using/images.qrc | 6 - .../src/snippets/qtablewidget-using/mainwindow.h | 80 ---- .../codesnippets/doc/src/snippets/qtcast/qtcast.h | 64 --- .../doc/src/snippets/qtreeview-dnd/dragdropmodel.h | 72 --- .../doc/src/snippets/qtreeview-dnd/mainwindow.h | 71 --- .../doc/src/snippets/qtreeview-dnd/treeitem.h | 81 ---- .../doc/src/snippets/qtreeview-dnd/treemodel.h | 89 ---- .../src/snippets/qtreewidget-using/mainwindow.cpp | 111 ----- .../src/snippets/qtreewidget-using/mainwindow.h | 87 ---- .../qtreewidgetitemiterator-using/mainwindow.cpp | 59 --- .../qtreewidgetitemiterator-using/mainwindow.h | 87 ---- .../qtscript/registeringobjects/myobject.h | 67 --- .../src/snippets/qtscript/scriptedslot/object.js | 18 - .../qtscript/scriptedslot/scriptedslot.qrc | 5 - .../src/snippets/quiloader/doc_src_qtuiloader.py | 53 --- .../doc/src/snippets/quiloader/myform.ui | 130 ------ .../doc/src/snippets/quiloader/mywidget.h | 62 --- .../doc/src/snippets/quiloader/mywidget.qrc | 5 - .../doc/src/snippets/qx11embedwidget/embedwidget.h | 75 --- .../doc/src/snippets/qxmlquery/bindingExample.py | 59 --- .../doc/src/snippets/qxmlschemavalidator/main.cpp | 112 ----- .../doc/src/snippets/reading-selections/model.h | 84 ---- .../doc/src/snippets/reading-selections/window.h | 77 --- .../doc/src/snippets/separations/finalwidget.h | 87 ---- .../doc/src/snippets/separations/screenwidget.h | 96 ---- .../doc/src/snippets/separations/viewer.h | 99 ---- .../doc/src/snippets/shareddirmodel/main.cpp | 90 ---- .../doc/src/snippets/sharedemployee/employee.h | 104 ----- .../doc/src/snippets/sharedtablemodel/model.h | 84 ---- .../doc/src/snippets/signalmapper/accountsfile.txt | 1 - .../doc/src/snippets/signalmapper/filereader.h | 78 ---- .../doc/src/snippets/signalmapper/reportfile.txt | 2 - .../doc/src/snippets/signalmapper/taxfile.txt | 1 - .../doc/src/snippets/signalsandslots/lcdnumber.h | 98 ---- .../src/snippets/signalsandslots/signalsandslots.h | 99 ---- .../doc/src/snippets/simpleparse/handler.h | 77 --- .../doc/src/snippets/splitter/splitter.cpp | 76 --- .../doc/src/snippets/splitterhandle/splitter.h | 61 --- .../doc/src/snippets/sqldatabase/sqldatabase.py | 489 ------------------- .../doc/src/snippets/stringlistmodel/model.cpp | 170 ------- .../doc/src/snippets/stringlistmodel/model.h | 82 ---- .../doc/src/snippets/styles/styles.cpp | 80 ---- .../src/snippets/stylesheet/common-mistakes.cpp | 62 --- .../src/snippets/textblock-fragments/mainwindow.h | 75 --- .../src/snippets/textblock-fragments/xmlwriter.h | 74 --- .../src/snippets/textdocument-blocks/mainwindow.h | 75 --- .../src/snippets/textdocument-blocks/xmlwriter.h | 71 --- .../doc/src/snippets/textdocument-css/main.cpp | 58 --- .../src/snippets/textdocument-frames/mainwindow.h | 74 --- .../src/snippets/textdocument-frames/xmlwriter.h | 74 --- .../src/snippets/textdocument-imagedrop/textedit.h | 66 --- .../snippets/textdocument-imageformat/images.qrc | 6 - .../textdocument-imageformat/images/advert.png | Bin 16291 -> 0 bytes .../textdocument-imageformat/images/newimage.png | Bin 5490 -> 0 bytes .../src/snippets/textdocument-images/images.qrc | 5 - .../snippets/textdocument-images/images/advert.png | Bin 16291 -> 0 bytes .../snippets/textdocument-listitems/mainwindow.h | 85 ---- .../src/snippets/textdocument-lists/mainwindow.h | 89 ---- .../snippets/textdocument-printing/mainwindow.h | 82 ---- .../snippets/textdocument-selections/mainwindow.h | 89 ---- .../snippets/textdocument-tables/mainwindow.cpp | 125 ----- .../src/snippets/textdocument-tables/mainwindow.h | 75 --- .../src/snippets/textdocument-tables/xmlwriter.h | 74 --- .../src/snippets/textdocument-texttable/main.cpp | 56 --- .../doc/src/snippets/threads/threads.h | 61 --- .../doc/src/snippets/timers/timers.cpp | 88 ---- .../doc/src/snippets/transform/main.cpp | 110 ----- .../uitools/calculatorform/calculatorform.ui | 303 ------------ .../doc/src/snippets/updating-selections/model.h | 84 ---- .../doc/src/snippets/updating-selections/window.h | 77 --- .../doc/src/snippets/whatsthis/whatsthis.cpp | 57 --- .../doc/src/snippets/widget-mask/mask.qrc | 5 - .../doc/src/snippets/widget-mask/tux.png | Bin 12191 -> 0 bytes .../doc/src/snippets/widgetdelegate.cpp | 72 --- .../doc/src/snippets/widgets-tutorial/template.py | 66 --- .../doc/src/snippets/xml/rsslisting/handler.h | 84 ---- .../doc/src/snippets/xml/rsslisting/rsslisting.h | 96 ---- .../codesnippets/examples/dbus/example-client.py | 100 ---- .../codesnippets/examples/dbus/example-server.py | 119 ----- .../declarative/cppextensions/plugins/plugin.cpp | 68 --- .../declarative/cppextensions/plugins/plugins.qml | 62 --- .../examples/dialogs/classwizard/classwizard.py | 254 ---------- .../examples/dialogs/classwizard/classwizard.qrc | 11 - .../dialogs/classwizard/images/background.png | Bin 22578 -> 0 bytes .../examples/dialogs/classwizard/images/banner.png | Bin 3947 -> 0 bytes .../examples/dialogs/classwizard/images/logo1.png | Bin 1619 -> 0 bytes .../examples/dialogs/classwizard/images/logo2.png | Bin 1619 -> 0 bytes .../examples/dialogs/classwizard/images/logo3.png | Bin 1619 -> 0 bytes .../dialogs/classwizard/images/watermark1.png | Bin 14516 -> 0 bytes .../dialogs/classwizard/images/watermark2.png | Bin 14912 -> 0 bytes .../examples/dialogs/extension/finddialog.py | 119 ----- .../examples/dialogs/licensewizard/images/logo.png | Bin 1810 -> 0 bytes .../dialogs/licensewizard/images/watermark.png | Bin 34998 -> 0 bytes .../examples/dialogs/licensewizard/licensewizard.h | 173 ------- .../dialogs/licensewizard/licensewizard.qrc | 6 - .../examples/dialogs/standarddialogs/dialog.cpp | 80 ---- .../examples/dialogs/tabdialog/tabdialog.cpp | 193 -------- .../graphicsview/simpleanchorlayout/main.cpp | 72 --- .../imageprovider/imageprovider-example.qml | 59 --- .../examples/imageprovider/imageprovider.cpp | 83 ---- .../mysortfilterproxymodel.cpp | 109 ----- .../examples/itemviews/pixelator/pixeldelegate.cpp | 103 ---- .../examples/mainwindows/application/mainwindow.h | 113 ----- .../examples/mainwindows/application/mainwindow.py | 357 -------------- .../examples/mainwindows/dockwidgets/mainwindow.py | 253 ---------- .../examples/mainwindows/mainwindow.py | 366 --------------- .../examples/mainwindows/mdi/mainwindow.py | 361 -------------- .../examples/mainwindows/menus/mainwindow.py | 366 --------------- .../examples/mainwindows/sdi/mainwindow.cpp | 60 --- .../examples/quick/plugins/plugins.qml | 61 --- .../relationaltablemodel/relationaltablemodel.cpp | 120 ----- .../examples/richtext/textobject/svgtextobject.h | 79 ---- .../examples/widgets/groupbox/window.cpp | 187 -------- .../examples/widgets/icons/iconsizespinbox.cpp | 72 --- .../examples/widgets/spinboxes/window.py | 247 ---------- .../examples/xml/streambookmarks/xbelreader.h | 90 ---- .../doc/codesnippets/snippets/customstyle/main.cpp | 61 --- 518 files changed, 18 insertions(+), 40945 deletions(-) delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/accessibilityslidersnippet.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/alphachannel.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/audio/main.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/brushstyles/qt-logo.png delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/brushstyles/renderarea.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/brushstyles/stylewidget.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/clipboard/clipwindow.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/clipboard/clipwindow.py delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qnamespace.qdoc delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtcore.py delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtnetwork.py delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtopengl.py delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtprintsupport.py delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtqml.py delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtquick.py delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtsql.py delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qttest.py delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtwidgets.py delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtxml.py delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src.gui.text.qtextdocumentwriter.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src.qdbus.qdbuspendingcall.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src.qdbus.qdbuspendingreply.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src.scripttools.qscriptenginedebugger.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_codecs_qtextcodec.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_codecs_qtextcodecplugin.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qfuture.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qfuturesynchronizer.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qfuturewatcher.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentexception.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentfilter.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentmap.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentrun.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qthreadpool.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qabstractfileengine.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qdatastream.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qdir.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qdiriterator.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qfile.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qfileinfo.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qiodevice.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qprocess.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qsettings.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qtemporaryfile.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qtextstream.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qurl.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qabstracteventdispatcher.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qmetaobject.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qmimedata.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qobject.py delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qsystemsemaphore.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qtimer.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_plugin_qlibrary.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_plugin_quuid.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_statemachine_qstatemachine.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qatomic.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qmutex.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qmutexpool.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qreadwritelock.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qsemaphore.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qthread.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qwaitcondition_unix.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qbitarray.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qbytearray.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qdatetime.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qhash.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qlinkedlist.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qlistdata.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qlocale.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qmap.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qpoint.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qqueue.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qrect.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qregexp.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qsize.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qstring.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qtimeline.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qvector.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_xml_qxmlstream.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_accessible_qaccessible.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_dialogs_qabstractprintdialog.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_dialogs_qfontdialog.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_dialogs_qwizard.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_effects_qgraphicseffect.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsgridlayout.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicslinearlayout.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsproxywidget.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsscene.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicssceneevent.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsview.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicswidget.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qbitmap.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qicon.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qimage.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qimagereader.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qimagewriter.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qmovie.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qpixmap.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qpixmapcache.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qpixmapfilter.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qabstractitemview.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qdatawidgetmapper.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qitemeditorfactory.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qitemselectionmodel.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qstandarditemmodel.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qtablewidget.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qtreewidget.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qaction.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qapplication.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qapplication_x11.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qclipboard.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qevent.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qformlayout.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qkeysequence.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qlayout.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qlayoutitem.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qshortcut.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qshortcutmap.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qsound.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qwidget.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qbrush.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qcolor.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qdrawutil.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qmatrix.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qpainter.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qpainterpath.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qpen.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qregion.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qregion_unix.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qtransform.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_styles_qstyle.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_styles_qstyleoption.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_text_qfont.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_text_qfontmetrics.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_text_qsyntaxhighlighter.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_text_qtextcursor.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_text_qtextlayout.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_util_qcompleter.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_util_qdesktopservices.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_util_qundostack.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_util_qvalidator.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qabstractbutton.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qabstractspinbox.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qcalendarwidget.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qcheckbox.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qdatetimeedit.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qdockwidget.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qframe.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qgroupbox.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qlabel.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qlineedit.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qmainwindow.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qmenu.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qmenubar.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qplaintextedit.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qpushbutton.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qradiobutton.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qrubberband.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qscrollarea.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qspinbox.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qsplashscreen.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qsplitter.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qstatusbar.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qtextbrowser.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qtextedit.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qworkspace.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_access_qftp.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_access_qhttp.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_access_qnetworkaccessmanager.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_access_qnetworkdiskcache.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_access_qnetworkrequest.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_bearer_qnetworkconfigmanager.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_kernel_qhostaddress.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_kernel_qhostinfo.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_kernel_qnetworkproxy.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_socket_qabstractsocket.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_socket_qlocalsocket_unix.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_socket_qnativesocketengine.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_socket_qtcpserver.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_socket_qudpsocket.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_ssl_qsslcertificate.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_ssl_qsslconfiguration.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_ssl_qsslsocket.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_opengl_qgl.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_opengl_qglcolormap.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_opengl_qglpixelbuffer.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_opengl_qglshaderprogram.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_qtestlib_qtestcase.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptable.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptclass.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptcontext.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptengine.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptengineagent.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptvalue.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptvalueiterator.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqldriver.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqlerror.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqlindex.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqlquery.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqlresult.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_models_qsqlquerymodel.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xml_dom_qdom.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xml_sax_qxml.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qabstracturiresolver.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qabstractxmlforwarditerator.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qabstractxmlnodemodel.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qabstractxmlreceiver.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qsimplexmlnodemodel.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlformatter.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlname.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlquery.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlresultitems.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlserializer.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_assistant_compat_lib_qassistantclient.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_extension_default_extensionfactory.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_extension_extension.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_extension_qextensionmanager.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformeditor.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformwindow.py delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformwindowcursor.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformwindowmanager.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractobjectinspector.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractpropertyeditor.py delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractwidgetbox.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_uilib_abstractformbuilder.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_uilib_formbuilder.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_patternist_qapplicationargumentparser.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_shared_qtgradienteditor_qtgradientdialog.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_shared_qtpropertybrowser_qtpropertybrowser.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_shared_qtpropertybrowser_qtvariantproperty.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_shared_qttoolbardialog_qttoolbardialog.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/console/dbus_pingpong.txt delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/customstyle/customstyle.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/designer/autoconnection/imagedialog.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/designer/autoconnection/imagedialog.ui delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/designer/imagedialog/imagedialog.ui delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/designer/multipleinheritance/imagedialog.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/designer/multipleinheritance/imagedialog.ui delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/designer/noautoconnection/imagedialog.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/designer/noautoconnection/imagedialog.ui delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/designer/singleinheritance/imagedialog.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/designer/singleinheritance/imagedialog.ui delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/dialogs/dialogs.py delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/doc_src_qtcharts.py delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/doc_src_qtgui.py delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/doc_src_qtmultimedia.py delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/doc_src_qtxmlpatterns.py delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/modules.html delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtcore.html delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtgui.html delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtnetwork.html delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtopengl.html delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtsql.html delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtxml.html delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/titles.txt delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/dockwidgets.qrc delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/mainwindow.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/draganddrop/dragwidget.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/draganddrop/mainwindow.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/dragging/images.qrc delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/dragging/images/file.png delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/dragging/mainwindow.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/dragging/mainwindow.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/dropactions/window.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/droparea.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/dropevents/window.py delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/droprectangle/window.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/eventfilters/filterobject.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/explicitlysharedemployee/employee.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/i18n-non-qt-class/myclass.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/i18n-non-qt-class/myclass.ts delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/i18n-non-qt-class/resources.qrc delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/i18n-non-qt-class/translations/i18n-non-qt-class_en.ts delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/i18n-non-qt-class/translations/i18n-non-qt-class_fr.ts delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/image/image.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/image/supportedformat.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/inherited-slot/button.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/itemselection/model.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/layouts/layouts.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/mainwindowsnippet.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/matrix/matrix.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/mdiareasnippets.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/moc/myclass1.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/moc/myclass2.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/moc/myclass3.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/modelview-subclasses/model.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/modelview-subclasses/view.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/modelview-subclasses/window.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/myscrollarea.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/network/tcpwait.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/ntfsp.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/anyHTMLElement.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/anyXLinkAttribute.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/bracesIncluded.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/bracesIncludedResult.xml delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/bracesOmitted.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/bracesOmittedResult.xml delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/computedTreeFragment.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/copyAttribute.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/copyID.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/directTreeFragment.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/doc.txt delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/docPlainHTML.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/docPlainHTML2.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/embedDataInXHTML.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/embedDataInXHTML2.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/emptyParagraphs.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/escapeCurlyBraces.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/escapeStringLiterals.xml delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/escapeStringLiterals.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/expressionInsideAttribute.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/filterOnPath.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/filterOnStep.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/firstParagraph.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/fnStringOnAttribute.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/forClause.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/forClause2.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/forClauseOnFeed.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/indented.xml delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introAcneRemover.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introExample2.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introFileHierarchy.xml delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introNavigateFS.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introductionExample.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/invalidLetOrderBy.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/items.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/letOrderBy.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/literalsAndOperators.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/mobeyDick.xml delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/nextLastParagraph.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/nodeConstructorsAreExpressions.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/nodeConstructorsInPaths.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/nodeTestChildElement.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/notIndented.xml delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/oneElementConstructor.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/paragraphsExceptTheFiveFirst.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/paragraphsWithTables.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/pathAB.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/pathsAllParagraphs.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/simpleHTML.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/simpleXHTML.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/svgDocumentElement.xml delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/tablesInParagraphs.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/twoSVGElements.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/xmlStylesheet.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/xsBooleanTrue.xq delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/xsvgDocumentElement.xml delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/persistentindexes/mainwindow.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/persistentindexes/model.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/picture/picture.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/plaintextlayout/window.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/polygon/polygon.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/porting4-dropevents/window.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/printing-qprinter/errors.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/printing-qprinter/object.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qabstractsliderisnippet.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qdir-listfiles/main.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qdir-namefilters/main.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qfontdatabase/main.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qlineargradient/paintwidget.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qlistview-dnd/mainwindow.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qlistview-dnd/model.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qlistview-using/mainwindow.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qlistview-using/model.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qlistwidget-dnd/mainwindow.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qlistwidget-using/mainwindow.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qmacnativewidget/main.mm delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/delegate.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/main.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/model.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/model.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/paintwidget_unix.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/view.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qmetaobject-invokable/window.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qquickview-ex.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qsignalmapper/buttonwidget.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qsignalmapper/mainwindow.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qsortfilterproxymodel-details/main.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qsplashscreen/main.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qsplashscreen/mainwindow.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qsplashscreen/qsplashscreen.qrc delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qsplashscreen/splash.png delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qstackedlayout/main.py delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qstackedwidget/main.py delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qstatustipevent/main.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qstyleoption/main.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qsvgwidget/qsvgwidget.qrc delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qsvgwidget/spheres.svg delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qsvgwidget/sunflower.svg delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-dnd/Images/cubed.png delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-dnd/Images/squared.png delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-dnd/images.qrc delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-dnd/mainwindow.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-resizing/mainwindow.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-using/Images/cubed.png delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-using/Images/squared.png delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-using/images.qrc delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-using/mainwindow.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qtcast/qtcast.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qtreeview-dnd/dragdropmodel.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qtreeview-dnd/mainwindow.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qtreeview-dnd/treeitem.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qtreeview-dnd/treemodel.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qtreewidget-using/mainwindow.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qtreewidget-using/mainwindow.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qtreewidgetitemiterator-using/mainwindow.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qtreewidgetitemiterator-using/mainwindow.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qtscript/registeringobjects/myobject.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qtscript/scriptedslot/object.js delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qtscript/scriptedslot/scriptedslot.qrc delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/quiloader/doc_src_qtuiloader.py delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/quiloader/myform.ui delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/quiloader/mywidget.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/quiloader/mywidget.qrc delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qx11embedwidget/embedwidget.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qxmlquery/bindingExample.py delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/qxmlschemavalidator/main.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/reading-selections/model.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/reading-selections/window.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/separations/finalwidget.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/separations/screenwidget.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/separations/viewer.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/shareddirmodel/main.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/sharedemployee/employee.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/sharedtablemodel/model.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/signalmapper/accountsfile.txt delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/signalmapper/filereader.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/signalmapper/reportfile.txt delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/signalmapper/taxfile.txt delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/signalsandslots/lcdnumber.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/signalsandslots/signalsandslots.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/simpleparse/handler.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/splitter/splitter.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/splitterhandle/splitter.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/sqldatabase/sqldatabase.py delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/stringlistmodel/model.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/stringlistmodel/model.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/styles/styles.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/stylesheet/common-mistakes.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/textblock-fragments/mainwindow.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/textblock-fragments/xmlwriter.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-blocks/mainwindow.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-blocks/xmlwriter.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-css/main.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-frames/mainwindow.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-frames/xmlwriter.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-imagedrop/textedit.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-imageformat/images.qrc delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-imageformat/images/advert.png delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-imageformat/images/newimage.png delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-images/images.qrc delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-images/images/advert.png delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-listitems/mainwindow.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-lists/mainwindow.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-printing/mainwindow.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-selections/mainwindow.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-tables/mainwindow.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-tables/mainwindow.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-tables/xmlwriter.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-texttable/main.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/threads/threads.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/timers/timers.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/transform/main.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/uitools/calculatorform/calculatorform.ui delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/updating-selections/model.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/updating-selections/window.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/whatsthis/whatsthis.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/widget-mask/mask.qrc delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/widget-mask/tux.png delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/widgetdelegate.cpp delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/widgets-tutorial/template.py delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/xml/rsslisting/handler.h delete mode 100644 sources/pyside6/doc/codesnippets/doc/src/snippets/xml/rsslisting/rsslisting.h delete mode 100644 sources/pyside6/doc/codesnippets/examples/dbus/example-client.py delete mode 100644 sources/pyside6/doc/codesnippets/examples/dbus/example-server.py delete mode 100644 sources/pyside6/doc/codesnippets/examples/declarative/cppextensions/plugins/plugin.cpp delete mode 100644 sources/pyside6/doc/codesnippets/examples/declarative/cppextensions/plugins/plugins.qml delete mode 100644 sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/classwizard.py delete mode 100644 sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/classwizard.qrc delete mode 100644 sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/background.png delete mode 100644 sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/banner.png delete mode 100644 sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/logo1.png delete mode 100644 sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/logo2.png delete mode 100644 sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/logo3.png delete mode 100644 sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/watermark1.png delete mode 100644 sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/watermark2.png delete mode 100644 sources/pyside6/doc/codesnippets/examples/dialogs/extension/finddialog.py delete mode 100644 sources/pyside6/doc/codesnippets/examples/dialogs/licensewizard/images/logo.png delete mode 100644 sources/pyside6/doc/codesnippets/examples/dialogs/licensewizard/images/watermark.png delete mode 100644 sources/pyside6/doc/codesnippets/examples/dialogs/licensewizard/licensewizard.h delete mode 100644 sources/pyside6/doc/codesnippets/examples/dialogs/licensewizard/licensewizard.qrc delete mode 100644 sources/pyside6/doc/codesnippets/examples/dialogs/standarddialogs/dialog.cpp delete mode 100644 sources/pyside6/doc/codesnippets/examples/dialogs/tabdialog/tabdialog.cpp delete mode 100644 sources/pyside6/doc/codesnippets/examples/graphicsview/simpleanchorlayout/main.cpp delete mode 100644 sources/pyside6/doc/codesnippets/examples/imageprovider/imageprovider-example.qml delete mode 100644 sources/pyside6/doc/codesnippets/examples/imageprovider/imageprovider.cpp delete mode 100644 sources/pyside6/doc/codesnippets/examples/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp delete mode 100644 sources/pyside6/doc/codesnippets/examples/itemviews/pixelator/pixeldelegate.cpp delete mode 100644 sources/pyside6/doc/codesnippets/examples/mainwindows/application/mainwindow.h delete mode 100644 sources/pyside6/doc/codesnippets/examples/mainwindows/application/mainwindow.py delete mode 100644 sources/pyside6/doc/codesnippets/examples/mainwindows/dockwidgets/mainwindow.py delete mode 100644 sources/pyside6/doc/codesnippets/examples/mainwindows/mainwindow.py delete mode 100644 sources/pyside6/doc/codesnippets/examples/mainwindows/mdi/mainwindow.py delete mode 100644 sources/pyside6/doc/codesnippets/examples/mainwindows/menus/mainwindow.py delete mode 100644 sources/pyside6/doc/codesnippets/examples/mainwindows/sdi/mainwindow.cpp delete mode 100644 sources/pyside6/doc/codesnippets/examples/quick/plugins/plugins.qml delete mode 100644 sources/pyside6/doc/codesnippets/examples/relationaltablemodel/relationaltablemodel.cpp delete mode 100644 sources/pyside6/doc/codesnippets/examples/richtext/textobject/svgtextobject.h delete mode 100644 sources/pyside6/doc/codesnippets/examples/widgets/groupbox/window.cpp delete mode 100644 sources/pyside6/doc/codesnippets/examples/widgets/icons/iconsizespinbox.cpp delete mode 100644 sources/pyside6/doc/codesnippets/examples/widgets/spinboxes/window.py delete mode 100644 sources/pyside6/doc/codesnippets/examples/xml/streambookmarks/xbelreader.h delete mode 100644 sources/pyside6/doc/codesnippets/snippets/customstyle/main.cpp (limited to 'sources') diff --git a/sources/pyside6/doc/CMakeLists.txt b/sources/pyside6/doc/CMakeLists.txt index 2d1116871..af750bcd0 100644 --- a/sources/pyside6/doc/CMakeLists.txt +++ b/sources/pyside6/doc/CMakeLists.txt @@ -23,6 +23,24 @@ if (NOT FULLDOCSBUILD) set(PYTHON_EXECUTABLE ${Python_EXECUTABLE}) endif() +if (FULLDOCSBUILD) + # Fetch and transform the snippets from Qt + message(STATUS "Fetching and converting snippets") + if ("${QT_SRC_DIR}" STREQUAL "") + message(FATAL_ERROR "There is no value set on QT_SRC_DIR, the snippet conversion will fail") + endif() + set(PYSIDE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../../../") + if (QUIET_BUILD) + set(SNIPPETS_QUIET_OPTION "-q") + endif() + set(SNIPPETS_TOOL "${CMAKE_CURRENT_SOURCE_DIR}/../../../tools/snippets_translate/main.py") + # Note QT_SRC_DIR points to 'qtbase', + # so we use the general SRC directory to copy all the other snippets + execute_process(COMMAND ${PYTHON_EXECUTABLE} ${SNIPPETS_TOOL} + --qt ${QT_SRC_DIR}/.. --pyside ${PYSIDE_ROOT} -w ${SNIPPETS_QUIET_OPTION} + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) +endif() + # Generate example gallery message(STATUS "Generating example gallery") if (QUIET_BUILD) diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/accessibilityslidersnippet.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/accessibilityslidersnippet.cpp deleted file mode 100644 index 6c479cd3f..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/accessibilityslidersnippet.cpp +++ /dev/null @@ -1,271 +0,0 @@ -/**************************************************************************** -** -** 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(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(w)); -} - -QVariant QAccessibleAbstractSlider::invokeMethodEx(Method method, int child, const QVariantList ¶ms) -{ - switch (method) { - case ListSupportedMethods: { - QSet set; - set << ListSupportedMethods; - return qVariantFromValue(set | qvariant_cast >( - 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(object()); -} diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/alphachannel.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/alphachannel.cpp deleted file mode 100644 index 78c2c54db..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/alphachannel.cpp +++ /dev/null @@ -1,64 +0,0 @@ -############################################################################ -## -## 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 deleted file mode 100644 index 09d1aa420..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/audio/main.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index d609c1e1e..000000000 Binary files a/sources/pyside6/doc/codesnippets/doc/src/snippets/brushstyles/qt-logo.png and /dev/null 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 deleted file mode 100644 index 82356e2dd..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/brushstyles/renderarea.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 - -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 deleted file mode 100644 index 57223cbb4..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/brushstyles/stylewidget.h +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** -** -** 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 -#include -#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 deleted file mode 100644 index a06b59b20..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/clipboard/clipwindow.h +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 - -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 deleted file mode 100644 index e5e156e69..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/clipboard/clipwindow.py +++ /dev/null @@ -1,105 +0,0 @@ -############################################################################ -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the examples of Qt for Python. -## -## $QT_BEGIN_LICENSE:BSD$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## BSD License Usage -## Alternatively, you may use this file under the terms of the BSD license -## as follows: -## -## "Redistribution and use in source and binary forms, with or without -## modification, are permitted provided that the following conditions are -## met: -## * Redistributions of source code must retain the above copyright -## notice, this list of conditions and the following disclaimer. -## * Redistributions in binary form must reproduce the above copyright -## notice, this list of conditions and the following disclaimer in -## the documentation and/or other materials provided with the -## distribution. -## * Neither the name of The Qt Company Ltd nor the names of its -## contributors may be used to endorse or promote products derived -## from this software without specific prior written permission. -## -## -## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -## (INCLUDING NEGLIGENCE OR 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 deleted file mode 100644 index b63810f97..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qnamespace.qdoc +++ /dev/null @@ -1,67 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index a9c70fa93..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtcore.py +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index d49a623b2..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtnetwork.py +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 37fba2534..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtopengl.py +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 4426e7628..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtprintsupport.py +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 0216cab3d..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtqml.py +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 42801d9d9..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtquick.py +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 6ffc52b57..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtsql.py +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index b6efed395..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qttest.py +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index c4e161e73..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtwidgets.py +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index e2ebf0d74..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/doc_src_qtxml.py +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index bfe7b30e3..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src.gui.text.qtextdocumentwriter.cpp +++ /dev/null @@ -1,55 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 549d7a6f8..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src.qdbus.qdbuspendingcall.cpp +++ /dev/null @@ -1,74 +0,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$ -** -****************************************************************************/ - -{ -//! [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 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 deleted file mode 100644 index 5029d3aca..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src.qdbus.qdbuspendingreply.cpp +++ /dev/null @@ -1,73 +0,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$ -** -****************************************************************************/ - -{ -//! [0] - QDBusPendingReply 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 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 deleted file mode 100644 index 53c4a9efe..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src.scripttools.qscriptenginedebugger.cpp +++ /dev/null @@ -1,59 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 7cbfc4e30..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_codecs_qtextcodec.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index 3538b6574..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_codecs_qtextcodecplugin.cpp +++ /dev/null @@ -1,62 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 7dcc7052d..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qfuture.cpp +++ /dev/null @@ -1,74 +0,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$ -** -****************************************************************************/ - -//! [0] -QFuture future = ...; - -QFuture::const_iterator i; -for (i = future.constBegin(); i != future.constEnd(); ++i) - cout << *i << endl; -//! [0] - - -//! [1] -QFuture future; -... -QFutureIterator i(future); -while (i.hasNext()) - qDebug() << i.next(); -//! [1] - - -//! [2] -QFutureIterator 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 deleted file mode 100644 index 014c5b167..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qfuturesynchronizer.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 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 deleted file mode 100644 index 9c536b822..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qfuturewatcher.cpp +++ /dev/null @@ -1,60 +0,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$ -** -****************************************************************************/ - -//! [0] -// Instantiate the objects and connect to the finished signal. -MyClass myObject; -QFutureWatcher watcher; -connect(&watcher, SIGNAL(finished()), &myObject, SLOT(handleFinished())); - -// Start the computation. -QFuture 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 deleted file mode 100644 index da4254a76..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentexception.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index a0f6778b6..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentfilter.cpp +++ /dev/null @@ -1,181 +0,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$ -** -****************************************************************************/ - -//! [0] -bool function(const T &t); -//! [0] - - -//! [1] -bool allLowerCase(const QString &string) -{ - return string.lowered() == string; -} - -QStringList strings = ...; -QFuture lowerCaseStrings = QtConcurrent::filtered(strings, allLowerCase); -//! [1] - - -//! [2] -QStringList strings = ...; -QFuture future = QtConcurrent::filter(strings, allLowerCase); -//! [2] - - -//! [3] -V function(T &result, const U &intermediate) -//! [3] - - -//! [4] -void addToDictionary(QSet &dictionary, const QString &string) -{ - dictionary.insert(string); -} - -QStringList strings = ...; -QFuture > dictionary = QtConcurrent::filteredReduced(strings, allLowerCase, addToDictionary); -//! [4] - - -//! [5] -QStringList strings = ...; -QFuture lowerCaseStrings = QtConcurrent::filtered(strings.constBegin(), strings.constEnd(), allLowerCase); - -// filter in-place only works on non-const iterators -QFuture future = QtConcurrent::filter(strings.begin(), strings.end(), allLowerCase); - -QFuture > 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 dictionary = QtConcurrent::blockingFilteredReduced(strings, allLowerCase, addToDictionary); -//! [6] - - -//! [7] -// keep only images with an alpha channel -QList images = ...; -QFuture alphaImages = QtConcurrent::filter(strings, &QImage::hasAlphaChannel); - -// keep only gray scale images -QList images = ...; -QFuture grayscaleImages = QtConcurrent::filtered(images, &QImage::isGrayscale); - -// create a set of all printable characters -QList characters = ...; -QFuture > set = QtConcurrent::filteredReduced(characters, &QChar::isPrint, &QSet::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 > averageWordLength = QtConcurrent::filteredReduced(strings, allLowerCase, QSet::insert); - -// create a collage of all gray scale images -extern void addToCollage(QImage &collage, const QImage &grayscaleImage); -QList images = ...; -QFuture collage = QtConcurrent::filteredReduced(images, &QImage::isGrayscale, addToCollage); -//! [8] - - -//! [9] -bool QString::contains(const QRegExp ®exp) 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( &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 strings = ...; -QFuture 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 deleted file mode 100644 index e61b73613..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentmap.cpp +++ /dev/null @@ -1,194 +0,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$ -** -****************************************************************************/ - -//! [0] -U function(const T &t); -//! [0] - - -//! [1] -QImage scaled(const QImage &image) -{ - return image.scaled(100, 100); -} - -QList images = ...; -QFuture thumbnails = QtConcurrent::mapped(images, scaled); -//! [1] - - -//! [2] -U function(T &t); -//! [2] - - -//! [3] -void scale(QImage &image) -{ - image = image.scaled(100, 100); -} - -QList images = ...; -QFuture 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 images = ...; -QFuture collage = QtConcurrent::mappedReduced(images, scaled, addToCollage); -//! [5] - - -//! [6] -QList images = ...; - -QFuture thumbnails = QtConcurrent::mapped(images.constBegin(), images.constEnd(), scaled); - -// map in-place only works on non-const iterators -QFuture future = QtConcurrent::map(images.begin(), images.end(), scale); - -QFuture collage = QtConcurrent::mappedReduced(images.constBegin(), images.constEnd(), scaled, addToCollage); -//! [6] - - -//! [7] -QList images = ...; - -// each call blocks until the entire operation is finished -QList 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 squeezedStrings = QtConcurrent::map(strings, &QString::squeeze); - -// swap the rgb values of all pixels on a list of images -QList images = ...; -QFuture bgrImages = QtConcurrent::mapped(images, &QImage::rgbSwapped); - -// create a set of the lengths of all strings in a list -QStringList strings = ...; -QFuture > wordLengths = QtConcurrent::mappedReduced(string, &QString::length, &QSet::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 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 images = ...; -QFuture > totalColorDistribution = QtConcurrent::mappedReduced(images, colorDistribution, QSet::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 images = ...; -QFuture 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 images = ...; -QFuture 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 deleted file mode 100644 index 3c55ef77e..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentrun.cpp +++ /dev/null @@ -1,110 +0,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$ -** -****************************************************************************/ - -//! [0] -extern void aFunction(); -QFuture future = QtConcurrent::run(aFunction); -//! [0] - - -//! [1] -extern void aFunctionWithArguments(int arg1, double arg2, const QString &string); - -int integer = ...; -double floatingPoint = ...; -QString string = ...; - -QFuture future = QtConcurrent::run(aFunctionWithArguments, integer, floatingPoint, string); -//! [1] - - -//! [2] -extern QString functionReturningAString(); -QFuture future = QtConcurrent::run(functionReturningAString); -... -QString result = future.result(); -//! [2] - - -//! [3] -extern QString someFunction(const QByteArray &input); - -QByteArray bytearray = ...; - -QFuture 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 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 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 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 deleted file mode 100644 index 3492943a0..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qthreadpool.cpp +++ /dev/null @@ -1,59 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 878259f62..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qabstractfileengine.cpp +++ /dev/null @@ -1,112 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 79e64d4a3..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qdatastream.cpp +++ /dev/null @@ -1,135 +0,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$ -** -****************************************************************************/ - -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 deleted file mode 100644 index 101ebbb44..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qdir.cpp +++ /dev/null @@ -1,179 +0,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$ -** -****************************************************************************/ - -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 not file.open(QIODevice.ReadWrite): - print(f"Cannot create the file {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", [f"{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 deleted file mode 100644 index 3cc4ae63e..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qdiriterator.cpp +++ /dev/null @@ -1,62 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 1e9d102c8..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qfile.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index 32f9205b9..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qfileinfo.cpp +++ /dev/null @@ -1,148 +0,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$ -** -****************************************************************************/ - -//![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(QFileDevice.WriteUser | QFileDevice.ReadGroup): - print("I can change the file; my group can read the file") -if fi.permission(QFileDevice.WriteGroup | QFileDevice.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 deleted file mode 100644 index d8f155c38..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qiodevice.cpp +++ /dev/null @@ -1,98 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index a4b74ae97..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qprocess.cpp +++ /dev/null @@ -1,132 +0,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$ -** -****************************************************************************/ - -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 deleted file mode 100644 index 11bb9af48..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qsettings.cpp +++ /dev/null @@ -1,327 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 7244c22c8..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qtemporaryfile.cpp +++ /dev/null @@ -1,62 +0,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$ -** -****************************************************************************/ - -{ -//! [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 deleted file mode 100644 index cf67a61fb..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qtextstream.cpp +++ /dev/null @@ -1,140 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 7c0d70fee..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_io_qurl.cpp +++ /dev/null @@ -1,96 +0,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$ -** -****************************************************************************/ - -//! [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(f"Invalid URL: {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 deleted file mode 100644 index a531f22fc..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qabstracteventdispatcher.cpp +++ /dev/null @@ -1,3 +0,0 @@ -//! [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 deleted file mode 100644 index f2a9e8222..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp +++ /dev/null @@ -1,98 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 115c76671..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp +++ /dev/null @@ -1,128 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 79fe7f09f..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qmetaobject.cpp +++ /dev/null @@ -1,132 +0,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$ -** -****************************************************************************/ - -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 deleted file mode 100644 index 14f07a139..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp +++ /dev/null @@ -1,119 +0,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$ -** -****************************************************************************/ - -//! [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(); -//! [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"); -//! [4] - - -//! [5] -qRegisterMetaTypeStreamOperators("MyClass"); -//! [5] - - -//! [6] -QDataStream &operator<<(QDataStream &out, const MyClass &myObj); -QDataStream &operator>>(QDataStream &in, MyClass &myObj); -//! [6] - - -//! [7] -int id = qRegisterMetaType(); -//! [7] - - -//! [8] -int id = qMetaTypeId(); // id is now QMetaType::QString -id = qMetaTypeId(); // 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 deleted file mode 100644 index 46c7e31de..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qmimedata.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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="" -//! [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 deleted file mode 100644 index f14573f7a..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qobject.py +++ /dev/null @@ -1,374 +0,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$ -## -############################################################################ - -//! [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(f"MyClass.setPrecision(): ({qPrintable(objectName())}) invalid precision {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__() -//! [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 deleted file mode 100644 index 2a9385269..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qsystemsemaphore.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index 7436ac5a8..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qtimer.cpp +++ /dev/null @@ -1,60 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 310cf5df4..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_plugin_qlibrary.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index 90eafb980..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_plugin_quuid.cpp +++ /dev/null @@ -1,54 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 6a78e19f1..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_statemachine_qstatemachine.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 7c999e55c..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qatomic.cpp +++ /dev/null @@ -1,108 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index e799cbb64..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qmutex.cpp +++ /dev/null @@ -1,165 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 622cb18fd..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qmutexpool.cpp +++ /dev/null @@ -1,62 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index d441042c8..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qreadwritelock.cpp +++ /dev/null @@ -1,111 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 086b105dd..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qsemaphore.cpp +++ /dev/null @@ -1,83 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 5470e8a6c..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qthread.cpp +++ /dev/null @@ -1,59 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index f652e5fcb..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qwaitcondition_unix.cpp +++ /dev/null @@ -1,95 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 2edd35b0a..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qbitarray.cpp +++ /dev/null @@ -1,239 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index cd38e2c86..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qbytearray.cpp +++ /dev/null @@ -1,402 +0,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$ -** -****************************************************************************/ - -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 bold, very bold") -j = 0 -while (j = ba.indexOf("", j)) != -1: - print(f"Found tag at index position {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 deleted file mode 100644 index c0b7b3a67..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qdatetime.cpp +++ /dev/null @@ -1,156 +0,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$ -** -****************************************************************************/ - -//! [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 = QElapsedTimer() -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 deleted file mode 100644 index 985c7daf1..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qhash.cpp +++ /dev/null @@ -1,309 +0,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$ -** -****************************************************************************/ - -//! [0] -QHash 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 hash; -... -for (int i = 0; i < 1000; ++i) { - if (hash[i] == okButton) - cout << "Found button at index " << i << endl; -} -//! [6] - - -//! [7] -QHashIterator i(hash); -while (i.hasNext()) { - i.next(); - cout << i.key() << ": " << i.value() << endl; -} -//! [7] - - -//! [8] -QHash::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 values = hash.values("plenty"); -for (int i = 0; i < values.size(); ++i) - cout << values.at(i) << endl; -//! [10] - - -//! [11] -QHash::iterator i = hash.find("plenty"); -while (i != hash.end() && i.key() == "plenty") { - cout << i.value() << endl; - ++i; -} -//! [11] - - -//! [12] -QHash 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 hash; -hash.reserve(20000); -for (int i = 0; i < 20000; ++i) - hash.insert(keys[i], values[i]); -//! [14] - - -//! [15] -QHash objectHash; -... -QHash::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 hash; -... -QHash::const_iterator i = hash.find("HDR"); -while (i != hash.end() && i.key() == "HDR") { - cout << i.value() << endl; - ++i; -} -//! [16] - - -//! [17] -QHash hash; -hash.insert("January", 1); -hash.insert("February", 2); -... -hash.insert("December", 12); - -QHash::iterator i; -for (i = hash.begin(); i != hash.end(); ++i) - cout << i.key() << ": " << i.value() << endl; -//! [17] - - -//! [18] -QHash::iterator i; -for (i = hash.begin(); i != hash.end(); ++i) - i.value() += 2; -//! [18] - - -//! [19] -QHash::iterator i = hash.begin(); -while (i != hash.end()) { - if (i.key().startsWith("_")) - i = hash.erase(i); - else - ++i; -} -//! [19] - - -//! [20] -QHash::iterator i = hash.begin(); -while (i != hash.end()) { - QHash::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 hash; -hash.insert("January", 1); -hash.insert("February", 2); -... -hash.insert("December", 12); - -QHash::const_iterator i; -for (i = hash.constBegin(); i != hash.constEnd(); ++i) - cout << i.key() << ": " << i.value() << endl; -//! [23] - - -//! [24] -QMultiHash 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 values = hash.values("plenty"); -for (int i = 0; i < values.size(); ++i) - cout << values.at(i) << endl; -//! [25] - - -//! [26] -QMultiHash::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 deleted file mode 100644 index 947594ae5..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qlinkedlist.cpp +++ /dev/null @@ -1,214 +0,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$ -** -****************************************************************************/ - -//! [0] -QLinkedList integerList; -QLinkedList timeList; -//! [0] - - -//! [1] -QLinkedList list; -list << "one" << "two" << "three"; -// list: ["one", "two", "three"] -//! [1] - - -//! [2] -QLinkedList list; -... -while (!list.isEmpty()) - delete list.takeFirst(); -//! [2] - - -//! [3] -QLinkedList list; -list.append("one"); -list.append("two"); -list.append("three"); -// list: ["one", "two", "three"] -//! [3] - - -//! [4] -QLinkedList list; -list.prepend("one"); -list.prepend("two"); -list.prepend("three"); -// list: ["three", "two", "one"] -//! [4] - - -//! [5] -QList list; -list << "sun" << "cloud" << "sun" << "rain"; -list.removeAll("sun"); -// list: ["cloud", "rain"] -//! [5] - - -//! [6] -QList list; -list << "sun" << "cloud" << "sun" << "rain"; -list.removeOne("sun"); -// list: ["cloud", "sun", "rain"] -//! [6] - - -//! [7] -QLinkedList list; -list.append("January"); -list.append("February"); -... -list.append("December"); - -QLinkedList::iterator i; -for (i = list.begin(); i != list.end(); ++i) - cout << *i << endl; -//! [7] - - -//! [8] -QLinkedList list; -... -QLinkedList::iterator it = qFind(list.begin(), - list.end(), "Joel"); -if (it != list.end()) - cout << "Found Joel" << endl; -//! [8] - - -//! [9] -QLinkedList::iterator i; -for (i = list.begin(); i != list.end(); ++i) - *i += 2; -//! [9] - - -//! [10] -QLinkedList list; -... -QLinkedList::iterator i = list.begin(); -while (i != list.end()) { - if ((*i).startsWith("_")) - i = list.erase(i); - else - ++i; -} -//! [10] - - -//! [11] -QLinkedList::iterator i = list.begin(); -while (i != list.end()) { - QLinkedList::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 list; -list.append("January"); -list.append("February"); -... -list.append("December"); - -QLinkedList::const_iterator i; -for (i = list.constBegin(); i != list.constEnd(); ++i) - cout << *i << endl; -//! [14] - - -//! [15] -QLinkedList list; -... -QLinkedList::iterator it = qFind(list.constBegin(), - list.constEnd(), "Joel"); -if (it != list.constEnd()) - cout << "Found Joel" << endl; -//! [15] - - -//! [16] -std::list stdlist; -list.push_back(1.2); -list.push_back(0.5); -list.push_back(3.14); - -QLinkedList list = QLinkedList::fromStdList(stdlist); -//! [16] - - -//! [17] -QLinkedList list; -list << 1.2 << 0.5 << 3.14; - -std::list 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 deleted file mode 100644 index d90d932e9..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qlistdata.cpp +++ /dev/null @@ -1,277 +0,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$ -** -****************************************************************************/ - -//! [0] -QList integerList; -QList dateList; -//! [0] - - -//! [1] -QList 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 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 list; -list.append("one"); -list.append("two"); -list.append("three"); -// list: ["one", "two", "three"] -//! [6] - - -//! [7] -QList list; -list.prepend("one"); -list.prepend("two"); -list.prepend("three"); -// list: ["three", "two", "one"] -//! [7] - - -//! [8] -QList list; -list << "alpha" << "beta" << "delta"; -list.insert(2, "gamma"); -// list: ["alpha", "beta", "gamma", "delta"] -//! [8] - - -//! [9] -QList list; -list << "sun" << "cloud" << "sun" << "rain"; -list.removeAll("sun"); -// list: ["cloud", "rain"] -//! [9] - - -//! [10] -QList list; -list << "sun" << "cloud" << "sun" << "rain"; -list.removeOne("sun"); -// list: ["cloud", ,"sun", "rain"] -//! [10] - - -//! [11] -QList list; -list << "A" << "B" << "C" << "D" << "E" << "F"; -list.move(1, 4); -// list: ["A", "C", "D", "E", "B", "F"] -//! [11] - - -//! [12] -QList list; -list << "A" << "B" << "C" << "D" << "E" << "F"; -list.swap(1, 4); -// list: ["A", "E", "C", "D", "B", "F"] -//! [12] - - -//! [13] -QList 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 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 list; -list.append("January"); -list.append("February"); -... -list.append("December"); - -QList::iterator i; -for (i = list.begin(); i != list.end(); ++i) - cout << *i << endl; -//! [15] - - -//! [16] -QList::iterator i; -for (i = list.begin(); i != list.end(); ++i) - *i += 2; -//! [16] - - -//! [17] -QList list; -... -qDeleteAll(list.begin(), list.end()); -//! [17] - - -//! [18] -if (*it == "Hello") - *it = "Bonjour"; -//! [18] - - -//! [19] -QList list; -list.append("January"); -list.append("February"); -... -list.append("December"); - -QList::const_iterator i; -for (i = list.constBegin(); i != list.constEnd(); ++i) - cout << *i << endl; -//! [19] - - -//! [20] -QList list; -... -qDeleteAll(list.constBegin(), list.constEnd()); -//! [20] - - -//! [21] -QVector vect; -vect << 20.0 << 30.0 << 40.0 << 50.0; - -QList list = QVector::fromVector(vect); -// list: [20.0, 30.0, 40.0, 50.0] -//! [21] - - -//! [22] -QStringList list; -list << "Sven" << "Kim" << "Ola"; - -QVector vect = list.toVector(); -// vect: ["Sven", "Kim", "Ola"] -//! [22] - - -//! [23] -QSet set; -set << 20.0 << 30.0 << 40.0 << ... << 70.0; - -QList list = QList::fromSet(set); -qSort(list); -//! [23] - - -//! [24] -QStringList list; -list << "Julia" << "Mike" << "Mike" << "Julia" << "Julia"; - -QSet set = list.toSet(); -set.contains("Julia"); // returns true -set.contains("Mike"); // returns true -set.size(); // returns 2 -//! [24] - - -//! [25] -std::list stdlist; -list.push_back(1.2); -list.push_back(0.5); -list.push_back(3.14); - -QList list = QList::fromStdList(stdlist); -//! [25] - - -//! [26] -QList list; -list << 1.2 << 0.5 << 3.14; - -std::list 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 deleted file mode 100644 index 4be07da07..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qlocale.cpp +++ /dev/null @@ -1,101 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 5bd7dc621..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qmap.cpp +++ /dev/null @@ -1,323 +0,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$ -** -****************************************************************************/ - -//! [0] -QMap 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 map; -... -for (int i = 0; i < 1000; ++i) { - if (map[i] == okButton) - cout << "Found button at index " << i << endl; -} -//! [6] - - -//! [7] -QMapIterator i(map); -while (i.hasNext()) { - i.next(); - cout << i.key() << ": " << i.value() << endl; -} -//! [7] - - -//! [8] -QMap::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 values = map.values("plenty"); -for (int i = 0; i < values.size(); ++i) - cout << values.at(i) << endl; -//! [10] - - -//! [11] -QMap::iterator i = map.find("plenty"); -while (i != map.end() && i.key() == "plenty") { - cout << i.value() << endl; - ++i; -} -//! [11] - - -//! [12] -QMap 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 map; -... -QMap::const_iterator i = map.find("HDR"); -while (i != map.end() && i.key() == "HDR") { - cout << i.value() << endl; - ++i; -} -//! [14] - - -//! [15] -QMap 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 map; -... -QMap::const_iterator i = map.lowerBound("HDR"); -QMap::const_iterator upperBound = map.upperBound("HDR"); -while (i != upperBound) { - cout << i.value() << endl; - ++i; -} -//! [16] - - -//! [17] -QMap 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 map; -map.insert("January", 1); -map.insert("February", 2); -... -map.insert("December", 12); - -QMap::iterator i; -for (i = map.begin(); i != map.end(); ++i) - cout << i.key() << ": " << i.value() << endl; -//! [18] - - -//! [19] -QMap::iterator i; -for (i = map.begin(); i != map.end(); ++i) - i.value() += 2; -//! [19] - - -//! [20] -QMap::iterator i = map.begin(); -while (i != map.end()) { - if (i.key().startsWith("_")) - i = map.erase(i); - else - ++i; -} -//! [20] - - -//! [21] -QMap::iterator i = map.begin(); -while (i != map.end()) { - QMap::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 map; -map.insert("January", 1); -map.insert("February", 2); -... -map.insert("December", 12); - -QMap::const_iterator i; -for (i = map.constBegin(); i != map.constEnd(); ++i) - cout << i.key() << ": " << i.value() << endl; -//! [24] - - -//! [25] -QMultiMap 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 values = map.values("plenty"); -for (int i = 0; i < values.size(); ++i) - cout << values.at(i) << endl; -//! [26] - - -//! [27] -QMultiMap::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 deleted file mode 100644 index e6a5e0cac..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qpoint.cpp +++ /dev/null @@ -1,161 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index a0ea40541..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qqueue.cpp +++ /dev/null @@ -1,58 +0,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$ -** -****************************************************************************/ - -//! [0] -QQueue 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 deleted file mode 100644 index a3882750b..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qrect.cpp +++ /dev/null @@ -1,60 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index d3f45bbea..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qregexp.cpp +++ /dev/null @@ -1,225 +0,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$ -** -****************************************************************************/ - -//! [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 & -line1 = QString("This & that") -line1.replace(rx, "&") # line1 == "This & that" -line2 = QString("His & hers & theirs") -line2.replace(rx, "&") # line2 == "His & hers & 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 deleted file mode 100644 index ef8b29776..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qsize.cpp +++ /dev/null @@ -1,146 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 8225d16f2..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qstring.cpp +++ /dev/null @@ -1,95 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 480731a18..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qtimeline.cpp +++ /dev/null @@ -1,65 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 57ffcae01..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qvector.cpp +++ /dev/null @@ -1,193 +0,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$ -** -****************************************************************************/ - -//! [0] -QVector integerVector; -QVector stringVector; -//! [0] - - -//! [1] -QVector vector(200); -//! [1] - - -//! [2] -QVector 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 vector(10); -int *data = vector.data(); -for (int i = 0; i < 10; ++i) - data[i] = 2 * i; -//! [6] - - -//! [7] -QVector vector(0); -vector.append("one"); -vector.append("two"); -vector.append("three"); -// vector: ["one", "two", "three"] -//! [7] - - -//! [8] -QVector vector; -vector.prepend("one"); -vector.prepend("two"); -vector.prepend("three"); -// vector: ["three", "two", "one"] -//! [8] - - -//! [9] -QVector vector; -vector << "alpha" << "beta" << "delta"; -vector.insert(2, "gamma"); -// vector: ["alpha", "beta", "gamma", "delta"] -//! [9] - - -//! [10] -QVector 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 vector(3); -vector.fill("Yes"); -// vector: ["Yes", "Yes", "Yes"] - -vector.fill("oh", 5); -// vector: ["oh", "oh", "oh", "oh", "oh"] -//! [11] - - -//! [12] -QVector 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 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 vect; -vect << "red" << "green" << "blue" << "black"; - -QList list = vect.toList(); -// list: ["red", "green", "blue", "black"] -//! [14] - - -//! [15] -QStringList list; -list << "Sven" << "Kim" << "Ola"; - -QVector vect = QVector::fromList(list); -// vect: ["Sven", "Kim", "Ola"] -//! [15] - - -//! [16] -std::vector stdvector; -vector.push_back(1.2); -vector.push_back(0.5); -vector.push_back(3.14); - -QVector vector = QVector::fromStdVector(stdvector); -//! [16] - - -//! [17] -QVector vector; -vector << 1.2 << 0.5 << 3.14; - -std::vector 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 deleted file mode 100644 index f03a90643..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_corelib_xml_qxmlstream.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index 9971983df..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_accessible_qaccessible.cpp +++ /dev/null @@ -1,57 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index db6a8a85c..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_dialogs_qabstractprintdialog.cpp +++ /dev/null @@ -1,55 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index dd5f81bd2..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp +++ /dev/null @@ -1,136 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 6c91d213f..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_dialogs_qfontdialog.cpp +++ /dev/null @@ -1,90 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 9db90a72c..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_dialogs_qwizard.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index d4b47fa57..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_effects_qgraphicseffect.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index 4d138db3c..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsgridlayout.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index 59f26c729..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp +++ /dev/null @@ -1,249 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 8e7dcc432..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicslinearlayout.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index d0d21a64d..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsproxywidget.cpp +++ /dev/null @@ -1,96 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 1f1316bec..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsscene.cpp +++ /dev/null @@ -1,125 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index afb5f9f3a..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicssceneevent.cpp +++ /dev/null @@ -1,55 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 4ee2391d7..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsview.cpp +++ /dev/null @@ -1,136 +0,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$ -** -****************************************************************************/ - -//! [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->position()).size(), "items at position", mapToScene(event->position())) -//! [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 deleted file mode 100644 index ffba7a181..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicswidget.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index aab995f33..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qbitmap.cpp +++ /dev/null @@ -1,54 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index d40f485a4..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qicon.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index e100624d8..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qimage.cpp +++ /dev/null @@ -1,86 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index e058c3a15..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qimagereader.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index b65681718..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qimagewriter.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index 050213e80..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qmovie.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index 76d359a84..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qpixmap.cpp +++ /dev/null @@ -1,68 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 611203116..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qpixmapcache.cpp +++ /dev/null @@ -1,66 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 4fa6e7901..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_image_qpixmapfilter.cpp +++ /dev/null @@ -1,72 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 0d89ff73b..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qabstractitemview.cpp +++ /dev/null @@ -1,67 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 54687e749..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qdatawidgetmapper.cpp +++ /dev/null @@ -1,73 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 44d0594e4..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qitemeditorfactory.cpp +++ /dev/null @@ -1,73 +0,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$ -** -****************************************************************************/ - -//! [0] -Q_PROPERTY(QColor color READ color WRITE setColor USER true) -//! [0] - - -//! [1] -QItemEditorCreator *itemCreator = - new QItemEditorCreator("myProperty"); - -QItemEditorFactory *factory = new QItemEditorFactory; -//! [1] - - -//! [2] -QItemEditorFactory *editorFactory = new QItemEditorFactory; -QItemEditorCreatorBase *creator = new QStandardItemEditorCreator(); -editorFactory->registerEditor(QVariant::DateType, creator); -//! [2] - - -//! [3] -Q_PROPERTY(QColor color READ color WRITE setColor USER true) -//! [3] diff --git a/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 deleted file mode 100644 index 62861d9d3..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qitemselectionmodel.cpp +++ /dev/null @@ -1,60 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 42a64fbab..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qstandarditemmodel.cpp +++ /dev/null @@ -1,86 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index ca7c0dbfc..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qtablewidget.cpp +++ /dev/null @@ -1,55 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index ecdb7941b..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qtreewidget.cpp +++ /dev/null @@ -1,58 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 31a83e215..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qaction.cpp +++ /dev/null @@ -1,59 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index fe02c93e5..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qapplication.cpp +++ /dev/null @@ -1,167 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 5c90b998f..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qapplication_x11.cpp +++ /dev/null @@ -1,55 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 014835171..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qclipboard.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index 38d18d030..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qevent.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index 1b3e58080..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qformlayout.cpp +++ /dev/null @@ -1,86 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 25d5ee290..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qkeysequence.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index 867e73b5e..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qlayout.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index 8749f530b..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qlayoutitem.cpp +++ /dev/null @@ -1,58 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index baaf60571..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qshortcut.cpp +++ /dev/null @@ -1,65 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 48f63f6e9..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qshortcutmap.cpp +++ /dev/null @@ -1,3 +0,0 @@ -//! [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 deleted file mode 100644 index 6ad7ef4f8..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qsound.cpp +++ /dev/null @@ -1,59 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index efa0f0589..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qwidget.cpp +++ /dev/null @@ -1,150 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 55fa8a784..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qbrush.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index cac026aa1..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qcolor.cpp +++ /dev/null @@ -1,59 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 1f76792e4..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qdrawutil.cpp +++ /dev/null @@ -1,108 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 73ce084f7..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qmatrix.cpp +++ /dev/null @@ -1,72 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index e295f6638..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qpainter.cpp +++ /dev/null @@ -1,261 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index cbf1aab54..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qpainterpath.cpp +++ /dev/null @@ -1,160 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 871935c49..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qpen.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index 08e9c22be..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qregion.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index b347fb392..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qregion_unix.cpp +++ /dev/null @@ -1,68 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 71ff40645..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qtransform.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index be555b41a..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_styles_qstyle.cpp +++ /dev/null @@ -1,58 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index c46066a34..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_styles_qstyleoption.cpp +++ /dev/null @@ -1,57 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 43537f9d3..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_text_qfont.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index a184a0072..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_text_qfontmetrics.cpp +++ /dev/null @@ -1,64 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 2188be0a8..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_text_qsyntaxhighlighter.cpp +++ /dev/null @@ -1,124 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 12189bf2a..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_text_qtextcursor.cpp +++ /dev/null @@ -1,90 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 33cde13e7..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_text_qtextlayout.cpp +++ /dev/null @@ -1,73 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 9963b6679..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_util_qcompleter.cpp +++ /dev/null @@ -1,74 +0,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$ -** -****************************************************************************/ - -//! [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(f"{completer.currentCompletion()} is match number {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 deleted file mode 100644 index f79f1ed24..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_util_qdesktopservices.cpp +++ /dev/null @@ -1,65 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 9875747e7..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_util_qundostack.cpp +++ /dev/null @@ -1,120 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index df55131b3..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_util_qvalidator.cpp +++ /dev/null @@ -1,155 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index c4219b3d7..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qabstractbutton.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index c8d60d015..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qabstractspinbox.cpp +++ /dev/null @@ -1,58 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 9d83f0bc1..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qcalendarwidget.cpp +++ /dev/null @@ -1,83 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index c8aa50aa2..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qcheckbox.cpp +++ /dev/null @@ -1,3 +0,0 @@ -//! [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 deleted file mode 100644 index 1dd6947c4..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qdatetimeedit.cpp +++ /dev/null @@ -1,89 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index c9da19b47..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qdockwidget.cpp +++ /dev/null @@ -1,57 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index a41f1c478..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qframe.cpp +++ /dev/null @@ -1,58 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index d236d91dd..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qgroupbox.cpp +++ /dev/null @@ -1,3 +0,0 @@ -//! [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 deleted file mode 100644 index 4a73a181d..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qlabel.cpp +++ /dev/null @@ -1,74 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index bf093ba50..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qlineedit.cpp +++ /dev/null @@ -1,57 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index a5104708d..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qmainwindow.cpp +++ /dev/null @@ -1,65 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 6bf1bf8f2..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qmenu.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index fa5bb3b11..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qmenubar.cpp +++ /dev/null @@ -1,58 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 674f78662..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qplaintextedit.cpp +++ /dev/null @@ -1,64 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 74b4cf884..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qpushbutton.cpp +++ /dev/null @@ -1,3 +0,0 @@ -//! [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 deleted file mode 100644 index dbee86850..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qradiobutton.cpp +++ /dev/null @@ -1,3 +0,0 @@ -//! [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 deleted file mode 100644 index 61f784a3a..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qrubberband.cpp +++ /dev/null @@ -1,67 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 7172efd56..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qscrollarea.cpp +++ /dev/null @@ -1,59 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 77273e260..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qspinbox.cpp +++ /dev/null @@ -1,90 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 2bddb83a9..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qsplashscreen.cpp +++ /dev/null @@ -1,65 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index c5dfcd859..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qsplitter.cpp +++ /dev/null @@ -1,57 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 8b972b6f2..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qstatusbar.cpp +++ /dev/null @@ -1,3 +0,0 @@ -//! [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 deleted file mode 100644 index e35b40c38..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qtextbrowser.cpp +++ /dev/null @@ -1,54 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index fad9f6be1..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qtextedit.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index 1c7773310..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qworkspace.cpp +++ /dev/null @@ -1,57 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index d0426fd89..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_access_qftp.cpp +++ /dev/null @@ -1,109 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 333ea2bdd..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_access_qhttp.cpp +++ /dev/null @@ -1,132 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 478472530..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_access_qnetworkaccessmanager.cpp +++ /dev/null @@ -1,86 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 1847e36d4..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_access_qnetworkdiskcache.cpp +++ /dev/null @@ -1,74 +0,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$ -** -****************************************************************************/ - -//! [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(f"page from cache? {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 deleted file mode 100644 index 9156597b1..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_access_qnetworkrequest.cpp +++ /dev/null @@ -1,3 +0,0 @@ -//! [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 deleted file mode 100644 index d30aca2ab..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_bearer_qnetworkconfigmanager.cpp +++ /dev/null @@ -1,58 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index e45b6d57a..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_kernel_qhostaddress.cpp +++ /dev/null @@ -1,57 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index e6a1946c2..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_kernel_qhostinfo.cpp +++ /dev/null @@ -1,92 +0,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$ -** -****************************************************************************/ - -//! [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(f"Lookup failed: {host.errorString()}") - return - - for address in host.addresses(): - print(f"Found address: {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 deleted file mode 100644 index 29c6a8efd..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_kernel_qnetworkproxy.cpp +++ /dev/null @@ -1,64 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 1da214530..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_socket_qabstractsocket.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index 1687fe69b..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_socket_qlocalsocket_unix.cpp +++ /dev/null @@ -1,62 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 9fda752ef..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_socket_qnativesocketengine.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index b685462bc..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_socket_qtcpserver.cpp +++ /dev/null @@ -1,3 +0,0 @@ -//! [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 deleted file mode 100644 index cbeb0be68..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_socket_qudpsocket.cpp +++ /dev/null @@ -1,67 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index a1e342a90..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_ssl_qsslcertificate.cpp +++ /dev/null @@ -1,54 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 1ba2170d1..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_ssl_qsslconfiguration.cpp +++ /dev/null @@ -1,55 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 3b0d2a31e..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_network_ssl_qsslsocket.cpp +++ /dev/null @@ -1,100 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index f7564638e..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_opengl_qgl.cpp +++ /dev/null @@ -1,168 +0,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$ -** -****************************************************************************/ - -//! [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 not myWidget.format().stereo(): - # ok, goggles off - if not 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 not format().stencil(): - print("Could not get stencil buffer results will be suboptimal") - if not 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 not cx.create(): - exit() # no OpenGL support, or cannot render on the specified paintdevice -if not 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 deleted file mode 100644 index c95874e22..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_opengl_qglcolormap.cpp +++ /dev/null @@ -1,74 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index fd8c50499..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_opengl_qglpixelbuffer.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index 102867f43..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_opengl_qglshaderprogram.cpp +++ /dev/null @@ -1,103 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 8ff2a6ee4..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_qtestlib_qtestcase.cpp +++ /dev/null @@ -1,237 +0,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$ -** -****************************************************************************/ - -//! [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("aString") - QTest.addColumn("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("aString") - QTest.newRow("just hello") << QString("hello") - QTest.newRow("a null string") << QString() -} -//! [20] - - -//! [21] -void myTestFunction_data() { - QTest.addColumn("intval") - QTest.addColumn("str") - QTest.addColumn("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 deleted file mode 100644 index ac181e70c..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptable.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index 94601aa9b..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptclass.cpp +++ /dev/null @@ -1,59 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 632283d82..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptcontext.cpp +++ /dev/null @@ -1,73 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index a41a08739..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptengine.cpp +++ /dev/null @@ -1,320 +0,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$ -** -****************************************************************************/ - -//! [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) - -... - -qScriptRegisterSequenceMetaType >(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 deleted file mode 100644 index 91541f539..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptengineagent.cpp +++ /dev/null @@ -1,62 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index aec1ccdcf..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptvalue.cpp +++ /dev/null @@ -1,91 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 51b0cea20..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_script_qscriptvalueiterator.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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(f"{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(f"found enumerated property: {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 deleted file mode 100644 index cedc675ff..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqldriver.cpp +++ /dev/null @@ -1,73 +0,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$ -** -****************************************************************************/ - -//! [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(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(v.data()) - if (handle != 0) ... -} - -if (v.typeName() == "MYSQL*") { - MYSQL *handle = *static_cast(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 deleted file mode 100644 index 1aa9e2772..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqlerror.cpp +++ /dev/null @@ -1,56 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 3af6ef49d..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqlindex.cpp +++ /dev/null @@ -1,55 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index ff02e287e..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqlquery.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index 7f770a241..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqlresult.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index f4b836118..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_sql_models_qsqlquerymodel.cpp +++ /dev/null @@ -1,62 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index de173fc7c..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xml_dom_qdom.cpp +++ /dev/null @@ -1,230 +0,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$ -** -****************************************************************************/ - -//! [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(f"Element name: {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] - -

Heading

-

Hello you

- -//! [4] - - -//! [5] -

Heading

-

The text...

-

Next heading

-//! [5] - - -//! [6] -

Heading

-

The text...

-

Next heading

-//! [6] - - -//! [7] - -//! [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] - -//! [12] - - -//! [13] -

Hello Qt ]]>

-//! [13] - - -//! [14] -Hello Qt -//! [14] - - -//! [15] - -//! [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 deleted file mode 100644 index 9df91ab39..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xml_sax_qxml.cpp +++ /dev/null @@ -1,3 +0,0 @@ -//! [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 deleted file mode 100644 index 990a84968..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qabstracturiresolver.cpp +++ /dev/null @@ -1,3 +0,0 @@ -//! [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 deleted file mode 100644 index f31ea3f5c..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qabstractxmlforwarditerator.cpp +++ /dev/null @@ -1,3 +0,0 @@ -//! [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 deleted file mode 100644 index 0ba6de235..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qabstractxmlnodemodel.cpp +++ /dev/null @@ -1,72 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 32397e331..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qabstractxmlreceiver.cpp +++ /dev/null @@ -1,57 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 80147c840..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qsimplexmlnodemodel.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index 3695d41d1..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlformatter.cpp +++ /dev/null @@ -1,58 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 033757068..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlname.cpp +++ /dev/null @@ -1,58 +0,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$ -** -****************************************************************************/ - -// Fills the bits from begin to end with 1s and leaves the rest as 0. - -template -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 deleted file mode 100644 index a5a2706a7..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlquery.cpp +++ /dev/null @@ -1,202 +0,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$ -** -****************************************************************************/ - -//! [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 n = qVariantValue(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 deleted file mode 100644 index 62bb47105..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlresultitems.cpp +++ /dev/null @@ -1,66 +0,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$ -** -****************************************************************************/ - -//! [0] -QXmlQuery query; -query.setQuery(", 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 deleted file mode 100644 index 32397e331..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlserializer.cpp +++ /dev/null @@ -1,57 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index c0baf89ef..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_assistant_compat_lib_qassistantclient.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index 4f6de9e0d..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_extension_default_extensionfactory.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 - (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(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 deleted file mode 100644 index 14fe3764d..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_extension_extension.cpp +++ /dev/null @@ -1,65 +0,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$ -** -****************************************************************************/ - -//! [0] - QDesignerPropertySheetExtension *propertySheet; - QExtensionManager manager = formEditor->extensionManager(); - - propertySheet = qt_extension(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 deleted file mode 100644 index dabd9f737..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_extension_qextensionmanager.cpp +++ /dev/null @@ -1,67 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 2fe32e672..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformeditor.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index 6cf5dd21c..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformwindow.py +++ /dev/null @@ -1,74 +0,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$ -## -############################################################################ - -//! [0] - formWindow = QDesignerFormWindowInterface() - formWindow = QDesignerFormWindowInterface.findFormWindow(myWidget) -//! [0] - - -//! [1] - forms = [] # QList - 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 deleted file mode 100644 index 79b98f0ce..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformwindowcursor.cpp +++ /dev/null @@ -1,58 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index d6654b3eb..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformwindowmanager.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index 2fe32e672..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractobjectinspector.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index 1e2ac506f..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractpropertyeditor.py +++ /dev/null @@ -1,71 +0,0 @@ -############################################################################ -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the 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 deleted file mode 100644 index 7c0a4150a..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractwidgetbox.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index 781ce7542..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_uilib_abstractformbuilder.cpp +++ /dev/null @@ -1,67 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index fc58aa505..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_uilib_formbuilder.cpp +++ /dev/null @@ -1,76 +0,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$ -** -****************************************************************************/ - -//! [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] - - - mywidget.ui - - -//! [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 deleted file mode 100644 index 91bd24bc3..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_patternist_qapplicationargumentparser.cpp +++ /dev/null @@ -1,55 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index a9c6a26c9..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_shared_qtgradienteditor_qtgradientdialog.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index 64bdb67f5..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_shared_qtpropertybrowser_qtpropertybrowser.cpp +++ /dev/null @@ -1,97 +0,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$ -** -****************************************************************************/ - -//! [0] - QtSpinBoxFactory *factory; - QSet managers = factory->propertyManagers(); -//! [0] - - -//! [1] - QtBrowserItem *item; - QList childrenItems = item->children(); - - QList 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 deleted file mode 100644 index 95de10d4d..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_shared_qtpropertybrowser_qtvariantproperty.cpp +++ /dev/null @@ -1,66 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 93a9b53c1..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/code/tools_shared_qttoolbardialog_qttoolbardialog.cpp +++ /dev/null @@ -1,62 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 3c700db5c..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/console/dbus_pingpong.txt +++ /dev/null @@ -1,3 +0,0 @@ -[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 deleted file mode 100644 index 8aead8e9c..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/customstyle/customstyle.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef CUSTOMSTYLE_H -#define CUSTOMSTYLE_H - -#include - -//! [0] -class CustomStyle(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 deleted file mode 100644 index d5852c9c3..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/autoconnection/imagedialog.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 deleted file mode 100644 index 1c5e546f2..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/autoconnection/imagedialog.ui +++ /dev/null @@ -1,389 +0,0 @@ - - - ImageDialog - - - ImageDialog - - - - 0 - 0 - 320 - 180 - - - - Create Image - - - - - - - 9 - - - 6 - - - - - - - - 1 - - - 6 - - - - - widthLabel - - - - 1 - 27 - 67 - 22 - - - - QFrame::NoFrame - - - QFrame::Plain - - - Width: - - - Qt::AutoText - - - - - - - heightLabel - - - - 1 - 55 - 67 - 22 - - - - QFrame::NoFrame - - - QFrame::Plain - - - Height: - - - Qt::AutoText - - - - - - - colorDepthCombo - - - - 74 - 83 - 227 - 22 - - - - - 5 - 0 - 0 - 0 - - - - QComboBox::InsertAtBottom - - - - - - - nameLineEdit - - - - 74 - 83 - 227 - 22 - - - - - 5 - 0 - 1 - 0 - - - - Untitled image - - - QLineEdit::Normal - - - - - - - spinBox - - - - 74 - 1 - 227 - 20 - - - - - 5 - 0 - 0 - 0 - - - - QAbstractSpinBox::UpDownArrows - - - 32 - - - 1024 - - - 1 - - - - - - - spinBox_2 - - - - 74 - 27 - 227 - 22 - - - - - 5 - 0 - 0 - 0 - - - - QAbstractSpinBox::UpDownArrows - - - 32 - - - 1024 - - - 1 - - - - - - - nameLabel - - - - 1 - 1 - 67 - 20 - - - - QFrame::NoFrame - - - QFrame::Plain - - - Name: - - - Qt::AutoText - - - - - - - colorDepthLabel - - - - 1 - 83 - 67 - 22 - - - - QFrame::NoFrame - - - QFrame::Plain - - - Color depth: - - - Qt::AutoText - - - - - - - - - - - - - 9 - 121 - 302 - 18 - - - - Qt::Vertical - - - - - - - - - - 1 - - - 6 - - - - - - - - - 1 - 1 - 128 - 24 - - - - Qt::Horizontal - - - - - - - okButton - - - - 135 - 1 - 80 - 24 - - - - OK - - - - - - - cancelButton - - - - 221 - 1 - 80 - 24 - - - - Cancel - - - - - - - - - - nameLineEdit - spinBox - spinBox_2 - colorDepthCombo - okButton - cancelButton - - - - nameLineEdit - returnPressed() - okButton - animateClick() - - - -1 - 7 - - - -1 - 7 - - - - - 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 deleted file mode 100644 index 1c5e546f2..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/imagedialog/imagedialog.ui +++ /dev/null @@ -1,389 +0,0 @@ - - - ImageDialog - - - ImageDialog - - - - 0 - 0 - 320 - 180 - - - - Create Image - - - - - - - 9 - - - 6 - - - - - - - - 1 - - - 6 - - - - - widthLabel - - - - 1 - 27 - 67 - 22 - - - - QFrame::NoFrame - - - QFrame::Plain - - - Width: - - - Qt::AutoText - - - - - - - heightLabel - - - - 1 - 55 - 67 - 22 - - - - QFrame::NoFrame - - - QFrame::Plain - - - Height: - - - Qt::AutoText - - - - - - - colorDepthCombo - - - - 74 - 83 - 227 - 22 - - - - - 5 - 0 - 0 - 0 - - - - QComboBox::InsertAtBottom - - - - - - - nameLineEdit - - - - 74 - 83 - 227 - 22 - - - - - 5 - 0 - 1 - 0 - - - - Untitled image - - - QLineEdit::Normal - - - - - - - spinBox - - - - 74 - 1 - 227 - 20 - - - - - 5 - 0 - 0 - 0 - - - - QAbstractSpinBox::UpDownArrows - - - 32 - - - 1024 - - - 1 - - - - - - - spinBox_2 - - - - 74 - 27 - 227 - 22 - - - - - 5 - 0 - 0 - 0 - - - - QAbstractSpinBox::UpDownArrows - - - 32 - - - 1024 - - - 1 - - - - - - - nameLabel - - - - 1 - 1 - 67 - 20 - - - - QFrame::NoFrame - - - QFrame::Plain - - - Name: - - - Qt::AutoText - - - - - - - colorDepthLabel - - - - 1 - 83 - 67 - 22 - - - - QFrame::NoFrame - - - QFrame::Plain - - - Color depth: - - - Qt::AutoText - - - - - - - - - - - - - 9 - 121 - 302 - 18 - - - - Qt::Vertical - - - - - - - - - - 1 - - - 6 - - - - - - - - - 1 - 1 - 128 - 24 - - - - Qt::Horizontal - - - - - - - okButton - - - - 135 - 1 - 80 - 24 - - - - OK - - - - - - - cancelButton - - - - 221 - 1 - 80 - 24 - - - - Cancel - - - - - - - - - - nameLineEdit - spinBox - spinBox_2 - colorDepthCombo - okButton - cancelButton - - - - nameLineEdit - returnPressed() - okButton - animateClick() - - - -1 - 7 - - - -1 - 7 - - - - - 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 deleted file mode 100644 index 1b95cb310..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/multipleinheritance/imagedialog.h +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 1c5e546f2..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/multipleinheritance/imagedialog.ui +++ /dev/null @@ -1,389 +0,0 @@ - - - ImageDialog - - - ImageDialog - - - - 0 - 0 - 320 - 180 - - - - Create Image - - - - - - - 9 - - - 6 - - - - - - - - 1 - - - 6 - - - - - widthLabel - - - - 1 - 27 - 67 - 22 - - - - QFrame::NoFrame - - - QFrame::Plain - - - Width: - - - Qt::AutoText - - - - - - - heightLabel - - - - 1 - 55 - 67 - 22 - - - - QFrame::NoFrame - - - QFrame::Plain - - - Height: - - - Qt::AutoText - - - - - - - colorDepthCombo - - - - 74 - 83 - 227 - 22 - - - - - 5 - 0 - 0 - 0 - - - - QComboBox::InsertAtBottom - - - - - - - nameLineEdit - - - - 74 - 83 - 227 - 22 - - - - - 5 - 0 - 1 - 0 - - - - Untitled image - - - QLineEdit::Normal - - - - - - - spinBox - - - - 74 - 1 - 227 - 20 - - - - - 5 - 0 - 0 - 0 - - - - QAbstractSpinBox::UpDownArrows - - - 32 - - - 1024 - - - 1 - - - - - - - spinBox_2 - - - - 74 - 27 - 227 - 22 - - - - - 5 - 0 - 0 - 0 - - - - QAbstractSpinBox::UpDownArrows - - - 32 - - - 1024 - - - 1 - - - - - - - nameLabel - - - - 1 - 1 - 67 - 20 - - - - QFrame::NoFrame - - - QFrame::Plain - - - Name: - - - Qt::AutoText - - - - - - - colorDepthLabel - - - - 1 - 83 - 67 - 22 - - - - QFrame::NoFrame - - - QFrame::Plain - - - Color depth: - - - Qt::AutoText - - - - - - - - - - - - - 9 - 121 - 302 - 18 - - - - Qt::Vertical - - - - - - - - - - 1 - - - 6 - - - - - - - - - 1 - 1 - 128 - 24 - - - - Qt::Horizontal - - - - - - - okButton - - - - 135 - 1 - 80 - 24 - - - - OK - - - - - - - cancelButton - - - - 221 - 1 - 80 - 24 - - - - Cancel - - - - - - - - - - nameLineEdit - spinBox - spinBox_2 - colorDepthCombo - okButton - cancelButton - - - - nameLineEdit - returnPressed() - okButton - animateClick() - - - -1 - 7 - - - -1 - 7 - - - - - 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 deleted file mode 100644 index 16ff0ec18..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/noautoconnection/imagedialog.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 deleted file mode 100644 index 1c5e546f2..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/noautoconnection/imagedialog.ui +++ /dev/null @@ -1,389 +0,0 @@ - - - ImageDialog - - - ImageDialog - - - - 0 - 0 - 320 - 180 - - - - Create Image - - - - - - - 9 - - - 6 - - - - - - - - 1 - - - 6 - - - - - widthLabel - - - - 1 - 27 - 67 - 22 - - - - QFrame::NoFrame - - - QFrame::Plain - - - Width: - - - Qt::AutoText - - - - - - - heightLabel - - - - 1 - 55 - 67 - 22 - - - - QFrame::NoFrame - - - QFrame::Plain - - - Height: - - - Qt::AutoText - - - - - - - colorDepthCombo - - - - 74 - 83 - 227 - 22 - - - - - 5 - 0 - 0 - 0 - - - - QComboBox::InsertAtBottom - - - - - - - nameLineEdit - - - - 74 - 83 - 227 - 22 - - - - - 5 - 0 - 1 - 0 - - - - Untitled image - - - QLineEdit::Normal - - - - - - - spinBox - - - - 74 - 1 - 227 - 20 - - - - - 5 - 0 - 0 - 0 - - - - QAbstractSpinBox::UpDownArrows - - - 32 - - - 1024 - - - 1 - - - - - - - spinBox_2 - - - - 74 - 27 - 227 - 22 - - - - - 5 - 0 - 0 - 0 - - - - QAbstractSpinBox::UpDownArrows - - - 32 - - - 1024 - - - 1 - - - - - - - nameLabel - - - - 1 - 1 - 67 - 20 - - - - QFrame::NoFrame - - - QFrame::Plain - - - Name: - - - Qt::AutoText - - - - - - - colorDepthLabel - - - - 1 - 83 - 67 - 22 - - - - QFrame::NoFrame - - - QFrame::Plain - - - Color depth: - - - Qt::AutoText - - - - - - - - - - - - - 9 - 121 - 302 - 18 - - - - Qt::Vertical - - - - - - - - - - 1 - - - 6 - - - - - - - - - 1 - 1 - 128 - 24 - - - - Qt::Horizontal - - - - - - - okButton - - - - 135 - 1 - 80 - 24 - - - - OK - - - - - - - cancelButton - - - - 221 - 1 - 80 - 24 - - - - Cancel - - - - - - - - - - nameLineEdit - spinBox - spinBox_2 - colorDepthCombo - okButton - cancelButton - - - - nameLineEdit - returnPressed() - okButton - animateClick() - - - -1 - 7 - - - -1 - 7 - - - - - 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 deleted file mode 100644 index a14a628f2..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/singleinheritance/imagedialog.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 1c5e546f2..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/designer/singleinheritance/imagedialog.ui +++ /dev/null @@ -1,389 +0,0 @@ - - - ImageDialog - - - ImageDialog - - - - 0 - 0 - 320 - 180 - - - - Create Image - - - - - - - 9 - - - 6 - - - - - - - - 1 - - - 6 - - - - - widthLabel - - - - 1 - 27 - 67 - 22 - - - - QFrame::NoFrame - - - QFrame::Plain - - - Width: - - - Qt::AutoText - - - - - - - heightLabel - - - - 1 - 55 - 67 - 22 - - - - QFrame::NoFrame - - - QFrame::Plain - - - Height: - - - Qt::AutoText - - - - - - - colorDepthCombo - - - - 74 - 83 - 227 - 22 - - - - - 5 - 0 - 0 - 0 - - - - QComboBox::InsertAtBottom - - - - - - - nameLineEdit - - - - 74 - 83 - 227 - 22 - - - - - 5 - 0 - 1 - 0 - - - - Untitled image - - - QLineEdit::Normal - - - - - - - spinBox - - - - 74 - 1 - 227 - 20 - - - - - 5 - 0 - 0 - 0 - - - - QAbstractSpinBox::UpDownArrows - - - 32 - - - 1024 - - - 1 - - - - - - - spinBox_2 - - - - 74 - 27 - 227 - 22 - - - - - 5 - 0 - 0 - 0 - - - - QAbstractSpinBox::UpDownArrows - - - 32 - - - 1024 - - - 1 - - - - - - - nameLabel - - - - 1 - 1 - 67 - 20 - - - - QFrame::NoFrame - - - QFrame::Plain - - - Name: - - - Qt::AutoText - - - - - - - colorDepthLabel - - - - 1 - 83 - 67 - 22 - - - - QFrame::NoFrame - - - QFrame::Plain - - - Color depth: - - - Qt::AutoText - - - - - - - - - - - - - 9 - 121 - 302 - 18 - - - - Qt::Vertical - - - - - - - - - - 1 - - - 6 - - - - - - - - - 1 - 1 - 128 - 24 - - - - Qt::Horizontal - - - - - - - okButton - - - - 135 - 1 - 80 - 24 - - - - OK - - - - - - - cancelButton - - - - 221 - 1 - 80 - 24 - - - - Cancel - - - - - - - - - - nameLineEdit - spinBox - spinBox_2 - colorDepthCombo - okButton - cancelButton - - - - nameLineEdit - returnPressed() - okButton - animateClick() - - - -1 - 7 - - - -1 - 7 - - - - - diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/dialogs/dialogs.py b/sources/pyside6/doc/codesnippets/doc/src/snippets/dialogs/dialogs.py deleted file mode 100644 index 7bdcb0c91..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/dialogs/dialogs.py +++ /dev/null @@ -1,123 +0,0 @@ -############################################################################ -## -## 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 deleted file mode 100644 index e8364cd7c..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/doc_src_qtcharts.py +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 206cea4ad..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/doc_src_qtgui.py +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 7b5945258..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/doc_src_qtmultimedia.py +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 211c25430..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/doc_src_qtxmlpatterns.py +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 9c67393da..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/modules.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - Qt 4.0: Qt Classes by Module - - - - - -

Qt Classes by Module

- - - - - - - -
QtCoreCore classes used by other modules.
QtGuiGraphical User Interface components
QtNetworkClasses for network programming.
QtOpenGLOpenGL support classes.
QtSqlClasses for database integration using SQL.
QtXmlClasses for handling XML.
- - 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 deleted file mode 100644 index 947ad4038..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtcore.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - Qt 4.0: QtCore Classes - - - - - - -

QtCore Classes

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
QAbstractEventDispatcherManages Qt's event queue, excluding GUI-related events
QAbstractItemModelThe abstract interface for item model classes
QAbstractListModelAbstract model that can be subclassed to create one-dimensional list models
QAbstractTableModelAbstract model that can be subclassed to create table models
QBasicTimerTimer events for
QBitArrayArray of bits
QBufferQIODevice interface for a QByteArray
QByteArrayArray of bytes
QByteArrayMatcherHolds a sequence of bytes that can be quickly matched in a byte array
QCacheTemplate class that provides a cache
QChar16-bit Unicode character
QChildEventEvent parameters for child object events
QCoreApplicationEvent loop for Qt applications
QCustomEventSupport for custom events
QDataStreamSerialization of binary data to a QIODevice
QDateDate functions
QDateTimeDate and time functions
QDirAccess to directory structures and their contents
QEventThe base class of all event classes. Event objects contain event parameters
QFileInterface for reading from and writing to files
QFileEngineAbstraction for accessing the filesystem
QFileEngineHandlerAllows custom QFileEngines to be plugged into Qt
QFileInfoSystem-independent file information
QHashTemplate class that provides a hash-table-based dictionary
QIODeviceThe base interface class of all I/O devices in Qt
QLatin1Char8-bit ASCII/Latin-1 character
QLatin1StringThin wrapper around an ASCII/Latin-1 encoded string literal
QLibraryLoads shared libraries at runtime
QLibraryInfoInformation about the Qt library
QLineTwo-dimensional vector that uses integer point coordinates for accuracy
QLineFTwo-dimensional vector that uses floating point coordinates for accuracy
QLinkedListTemplate class that provides linked lists
QListTemplate class that provides lists
QLocaleConverts between numbers and their string representations in various languages
QMapTemplate class that provides a skip-list-based dictionary
QMetaClassInfoAdditional information about a class
QMetaEnumMeta data about an enumerator
QMetaMemberMeta data about a member function
QMetaObjectMeta information about Qt objects
QMetaPropertyMeta data about a property
QMetaTypeManages named types in the meta object system
QMimeDataContainer for data that records information about its MIME type
QModelIndexUsed to locate data in a data model
QMultiHashConvenience QHash subclass that provides multi-valued hashes
QMultiMapConvenience QMap subclass that provides multi-valued maps
QMutexAccess serialization between threads
QMutexLockerConvenience class that simplifies locking and unlocking mutexes
QObjectThe base class of all Qt objects
QObjectCleanupHandlerWatches the lifetime of multiple QObjects
QPairTemplate class that stores a pair of items
QPersistentModelIndexUsed to locate data in a data model
QPluginLoaderLoads a plugin at runtime
QPointDefines a point in the plane
QPointFPoint object that uses floating point coordinates for accuracy
QPointerTemplate class that provides guarded pointers to QObjects
QProcessUsed to start external programs and to communicate with them
QQueueGeneric container that provides a queue
QReadLockerConvenience class that simplifies locking and unlocking read-write locks for read access
QReadWriteLockRead-write locking
QRectDefines a rectangle in the plane
QRectFDefines a rectangle in the plane using floating point coordinates for accuracy
QRegExpPattern matching using regular expressions
QResourceAccess to application resource data
QSemaphoreGeneral counting semaphore
QSetTemplate class that provides a hash-table-based set
QSettingsPersistent platform-independent application settings
QSharedDataBase class for shared data objects
QSharedDataPointerPointer to a shared data object
QSignalCan be used to send signals for classes that do not inherit QObject
QSignalMapperBundles signals from identifiable senders
QSizeDefines the size of a two-dimensional object
QSizeFDefines the size of a two-dimensional object using floating point values for accuracy
QSocketNotifierSupport for monitoring activity on a file descriptor
QStackTemplate class that provides a stack
QStringUnicode character string
QStringListList of strings
QTemporaryFileI/O device that operates on temporary files
QTextCodecConversions between text encodings
QTextCodecPluginAbstract base for custom QTextCodec plugins
QTextDecoderState-based decoder
QTextEncoderState-based encoder
QTextIStreamConvenience class for input streams
QTextOStreamConvenience class for output streams
QTextStreamConvenient interface for reading and writing text
QThreadPlatform-independent threads
QThreadStoragePer-thread data storage
QTimeClock time functions
QTimerRepetitive and single-shot timers
QTimerEventParameters that describe a timer event
QTranslatorInternationalization support for text output
QTranslatorMessageTranslator message and its properties
QTsciiCodecConversion to and from the Tamil TSCII encoding
QUrlConvenient interface for working with URLs
QUuidDefines a Universally Unique Identifier (UUID)
QVarLengthArrayLow-level variable-length array
QVariantActs like a union for the most common Qt data types
QVectorTemplate class that provides a dynamic array
QWaitConditionCondition variable for synchronizing threads
QWriteLockerConvenience class that simplifies locking and unlocking read-write locks for write access

- - 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 deleted file mode 100644 index 9182b4cb4..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtgui.html +++ /dev/null @@ -1,276 +0,0 @@ - - - - - - Qt 4.0: QtGui Classes - - - - - - -

QtGui Classes

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
QAbstractButtonThe abstract base class of button widgets, providing functionality common to buttons
QAbstractItemDelegateUsed to display and edit data items from a model
QAbstractItemViewThe basic functionality for item view classes
QAbstractScrollAreaScrolling area with on-demand scroll bars
QAbstractSliderInteger value within a range
QAbstractSpinBoxSpinwidget and a line edit to display values
QAbstractTextDocumentLayoutAbstract base class used to implement custom layouts for QTextDocuments
QAccessibleEnums and static functions relating to accessibility
QAccessibleInterfaceDefines an interface that exposes information about accessible objects
QAccessibleObjectImplements parts of the QAccessibleInterface for QObjects
QAccessiblePluginAbstract base for accessibility plugins
QAccessibleWidgetImplements the QAccessibleInterface for QWidgets
QActionAbstract user interface action that can be inserted into widgets with QWidget::addAction()
QActionGroupGroups actions together
QApplicationManages the GUI application's control flow and main settings
QBitmapMonochrome (1-bit depth) pixmaps
QBoxLayoutLines up child widgets horizontally or vertically
QBrushDefines the fill pattern of shapes drawn by a QPainter
QButtonGroupContainer to organize groups of button widgets
QCDEStyleCDE look and feel
QCheckBoxCheckbox with a text label
QClipboardAccess to the window system clipboard
QCloseEventParameters that describe a close event
QColorColors based on RGB or HSV values
QColorDialogDialog widget for specifying colors
QColorGroup
QComboBoxCombined button and popup list
QCommonStyleEncapsulates the common Look and Feel of a GUI
QConicalGradientUsed in combination with QBrush to specify a conical gradient brush
QContextMenuEventParameters that describe a context menu event
QCopChannelCommunication capabilities between several clients
QCursorMouse cursor with an arbitrary shape
QDateTimeEditWidget for editing dates and times
QDecorationAllows the appearance of the Qtopia Core Window Manager to be customized
QDecorationFactoryCreates QDecoration objects
QDecorationPluginAbstract base for custom QDecoration plugins
QDesktopWidgetAccess to screen information on multi-head systems
QDialRounded range control (like a speedometer or potentiometer)
QDialogThe base class of dialog windows
QDirModelData model for the local filesystem
QDirectPainterDirect access to the video hardware
QDockWidgetWidget that can be docked inside a QMainWindow or floated as a top-level window on the desktop
QDoubleSpinBoxSpin box widget that takes doubles
QDoubleValidatorRange checking of floating-point numbers
QDragSupport for MIME-based drag and drop data transfer
QDragEnterEventEvent which is sent to a widget when a drag and drop action enters it
QDragLeaveEventEvent that is sent to a widget when a drag and drop action leaves it
QDragMoveEventEvent which is sent while a drag and drop action is in progress
QDropEventEvent which is sent when a drag and drop action is completed
QErrorMessageError message display dialog
QFileDialogDialog that allow users to select files or directories
QFileIconProviderFile icon for the QDirModel class
QFileOpenEventEvent that will be sent when there is a request to open a file
QFocusEventEvent parameters for widget focus events
QFocusFrameFocus frame which can be outside of a widget's normal paintable area
QFontFont used for drawing text
QFontDatabaseInformation about the fonts available in the underlying window system
QFontDialogDialog widget for selecting a font
QFontInfoGeneral information about fonts
QFontMetricsFont metrics information
QFontMetricsFFont metrics information
QFrameThe base class of widgets that can have a frame
QGfxDriverFactoryCreates QScreen objects for Qtopia Core
QGfxDriverPluginAbstract base for Qtopia Core graphics driver plugins
QGradientUsed in combination with QBrush to specify gradient fills
QGridLayoutLays out widgets in a grid
QGridWidgetSimple geometry management of its children
QGroupBoxGroup box frame with a title
QHBoxLayoutLines up widgets horizontally
QHBoxWidgetHorizontal geometry management for its child widgets
QHeaderViewHeader row or header column for item views
QHideEventEvent which is sent after a widget is hidden
QHoverEventParameters that describe a mouse event
QIconScalable icons in different modes and states
QIconDragEventIndicates that a main icon drag has begun
QIconEngineAbstract base class for QIcon renderers
QIconEnginePluginAbstract base for custom QIconEngine plugins
QImageHardware-independent pixmap that allows direct access to the pixel data, and can be used as a paint device
QImageIOHandlerDefines the common image I/O interface for all image formats in Qt
QImageIOHandlerFactoryInterfaceThe factory interface for QImageIOPlugin
QImageIOPluginDefines an interface for writing an image format plugin
QImageReaderFormat independent interface for reading images from files or other devices
QImageWriterFormat independent interface for writing images to files or other devices
QInputContextAbstracts the input method dependent data and composing state
QInputContextPluginAbstract base for custom QInputContext plugins
QInputDialogSimple convenience dialog to get a single value from the user
QInputEventThe base class for events that describe user input
QInputMethodEventParameters for input method events
QIntValidatorValidator that ensures a string contains a valid integer within a specified range
QItemDelegateDisplay and editing facilities for data items from a model
QItemSelectionManages information about selected items in a model
QItemSelectionModelKeeps track of a view's selected items
QItemSelectionRangeManages information about a range of selected items in a model
QKbdDriverFactoryCreates QWSKeyboardHandler objects for Qtopia Core
QKbdDriverPluginAbstract base for Qtopia Core keyboard driver plugins
QKeyEventDescribes a key event
QKeySequenceEncapsulates a key sequence as used by shortcuts
QLCDNumberDisplays a number with LCD-like digits
QLabelText or image display
QLayoutThe base class of geometry managers
QLayoutItemAbstract item that a QLayout manipulates
QLineEditOne-line text editor
QLinearGradientUsed in combination with QBrush to specify a linear gradient brush
QListViewDefault model/view implementation of a list, and of an icon view
QListWidgetItem-based list widget
QListWidgetItemItem for use with the QListWidget item view class
QMacMimeMaps open-standard MIME to Mac flavors
QMacStyleImplements an Appearance Manager style
QMainWindowMain application window
QMatrix2D transformations of a coordinate system
QMenuMenu widget for use in menu bars, context menus, and other popup menus
QMenuBarHorizontal menu bar
QMenuItemRepresents an item in a menu
QMessageBoxModal dialog with a short message, an icon, and some buttons
QMotifPlusStyleMore sophisticated Motif-ish look and feel
QMotifStyleMotif look and feel
QMouseDriverFactoryCreates QWSMouseHandler objects for Qtopia Core
QMouseDriverPluginAbstract base for Qtopia Core mouse driver plugins
QMouseEventParameters that describe a mouse event
QMoveEventEvent parameters for move events
QMovieConvenience class for playing movies with QImageReader
QPaintDeviceThe base class of objects that can be painted
QPaintEngineAbstract definition of how QPainter draws to a given device on a given platform
QPaintEventEvent parameters for paint events
QPainterDoes low-level painting e.g. on widgets
QPainterPathContainer for painting operations, enabling graphical shapes to be constructed and reused
QPaletteColor groups for each widget state
QPenDefines how a QPainter should draw lines and outlines of shapes
QPicturePaint device that records and replays QPainter commands
QPictureFormatPluginAbstract base for custom picture format plugins
QPictureIOParameters for loading and saving pictures
QPixmapOff-screen, pixel-based paint device
QPixmapCacheApplication-wide cache for pixmaps
QPlatinumStyleMac/Platinum look and feel
QPolygonVector of points
QPolygonFVector of points
QPrintEngineDefines an interface for how QPrinter interacts with a given printing subsystem
QPrinterPaint device that paints on a printer
QProgressBarHorizontal progress bar
QProgressDialogFeedback on the progress of a slow operation
QProxyModelSupport for filtering and sorting data that is passed between another model and a view
QPushButtonCommand button
QRadialGradientUsed in combination with QBrush to specify a radial gradient brush
QRadioButtonRadio button with a text label
QRegExpValidatorUsed to check a string against a regular expression
QRegionClip region for a painter
QResizeEventEvent parameters for resize events
QRubberBandRectangle or line that can indicate a selection or a boundary
QSGIStyleSGI/Irix look and feel
QScreenAnd its descendants manage the framebuffer and palette
QScrollAreaScrolling view onto another widget
QScrollBarVertical or horizontal scroll bar
QSessionManagerAccess to the session manager
QShortcutUsed to create keyboard shortcuts
QShowEventEvent that is sent when a widget is shown
QSizeGripCorner-grip for resizing a top-level window
QSizePolicyLayout attribute describing horizontal and vertical resizing policy
QSliderVertical or horizontal slider
QSoundAccess to the platform audio facilities
QSpacerItemBlank space in a layout
QSpinBoxSpin box widget
QSplashScreenSplash screen that can be shown during application startup
QSplitterImplements a splitter widget
QSplitterHandleHandle functionality of the splitter
QStackedLayoutStack of widgets where only one widget is visible at a time
QStackedWidgetStack of widgets where only one widget is visible at a time
QStandardItemModel
QStatusBarHorizontal bar suitable for presenting status information
QStyleAbstract base class that encapsulates the look and feel of a GUI
QStyleFactoryCreates QStyle objects
QStyleHintReturn
QStyleOptionStores the parameters used by QStyle functions
QStyleOptionButtonUsed to describe the parameters for drawing buttons
QStyleOptionComboBoxUsed to describe the parameter for drawing a combobox
QStyleOptionComplexUsed to hold parameters that are common to all complex controls
QStyleOptionDockWidgetUsed to describe the parameters for drawing a dock window
QStyleOptionFocusRectUsed to describe the parameters for drawing a focus rectangle with QStyle
QStyleOptionFrameUsed to describe the parameters for drawing a frame
QStyleOptionHeaderUsed to describe the parameters for drawing a header
QStyleOptionMenuItemUsed to describe the parameter necessary for drawing a menu item
QStyleOptionProgressBarUsed to describe the parameters necessary for drawing a progress bar
QStyleOptionQ3DockWindowUsed to describe the parameters for drawing various parts of a
QStyleOptionQ3ListViewUsed to describe the parameters for drawing a Q3ListView
QStyleOptionQ3ListViewItemUsed to describe an item drawn in a Q3ListView
QStyleOptionSliderUsed to describe the parameters needed for drawing a slider
QStyleOptionSpinBoxUsed to describe the parameters necessary for drawing a spin box
QStyleOptionTabUsed to describe the parameters for drawing a tab bar
QStyleOptionTitleBarUsed to describe the parameters for drawing a title bar
QStyleOptionToolBoxUsed to describe the parameters needed for drawing a tool box
QStyleOptionToolButtonUsed to describe the parameters for drawing a tool button
QStyleOptionViewItemUsed to describe the parameters used to draw an item in a view widget
QStylePainterConvenience class for drawing QStyle elements inside a widget
QStylePluginAbstract base for custom QStyle plugins
QTabBarTab bar, e.g. for use in tabbed dialogs
QTabWidgetStack of tabbed widgets
QTableViewDefault model/view implementation of a table view
QTableWidgetItem-based table view with a default model
QTableWidgetItemItem for use with the QTableWidget class
QTableWidgetSelectionRange
QTabletEventParameters that describe a Tablet event
QTextBlockContainer for text fragments in a QTextDocument
QTextBlockFormatFormatting information for blocks of text in a QTextDocument
QTextBlockGroupContainer for text blocks within a QTextDocument
QTextBrowserRich text browser with hypertext navigation
QTextCharFormatFormatting information for characters in a QTextDocument
QTextCursorOffers an API to access and modify QTextDocuments
QTextDocumentHolds formatted text that can be viewed and edited using a QTextEdit
QTextDocumentFragmentRepresents a piece of formatted text from a QTextDocument
QTextEditWidget that is used to edit and display both plain and rich text
QTextFormatFormatting information for a QTextDocument
QTextFragmentHolds a piece of text in a QTextDocument with a single QTextCharFormat
QTextFrameRepresents a frame in a QTextDocument
QTextFrameFormatFormatting information for frames in a QTextDocument
QTextImageFormatFormatting information for images in a QTextDocument
QTextInlineObjectRepresents an inline object in a QTextLayout
QTextLayoutUsed to lay out and paint a single paragraph of text
QTextLengthEncapsulates the different types of length used in a QTextDocument
QTextLineRepresents a line of text inside a QTextLayout
QTextListDecorated list of items in a QTextDocument
QTextListFormatFormatting information for lists in a QTextDocument
QTextObjectBase class for different kinds of objects that can group parts of a QTextDocument together
QTextOptionDescription of general rich text properties
QTextTableRepresents a table in a QTextDocument
QTextTableCellRepresents the properties of a cell in a QTextTable
QTextTableFormatFormatting information for tables in a QTextDocument
QToolBarMovable panel that contains a set of controls
QToolBarChangeEventEvent that is sent whenever a the toolbar button is clicked on Mac OS X
QToolBoxColumn of tabbed widget items
QToolButtonQuick-access button to commands or options, usually used inside a QToolBar
QToolTipTool tips (balloon help) for any widget
QTreeViewDefault model/view implementation of a tree view
QTreeWidgetTree view that uses a predefined tree model
QTreeWidgetItemItem for use with the QTreeWidget convenience class
QVBoxLayoutLines up widgets vertically
QVBoxWidgetVertical geometry management of its child widgets
QValidatorValidation of input text
QWSInputMethodInternational input methods for Qtopia Core
QWSKeyboardHandlerImplements the keyboard driver for Qtopia Core
QWSMouseHandlerMouse driver for Qtopia Core
QWSServerServer-specific functionality in Qtopia Core
QWSWindowServer-specific functionality in Qtopia Core
QWhatsThisSimple description of any widget, i.e. answering the question "What's this?"
QWhatsThisActionReady-made action to invoke "What's This" context help
QWheelEventParameters that describe a wheel event
QWidgetThe base class of all user interface objects
QWidgetContainerPluginAbstract base for complex custom container QWidget plugins
QWidgetItemLayout item that represents a widget
QWidgetPluginAbstract base for custom QWidget plugins
QWindowsMimeMaps open-standard MIME to Window Clipboard formats
QWindowsStyleMicrosoft Windows-like look and feel
QWindowsXPStyleMicrosoft WindowsXP-like look and feel
QWorkspaceWorkspace window that be used in an MDI application
QX11InfoInformation about the X display configuration

- - 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 deleted file mode 100644 index 01e1fa48b..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtnetwork.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - Qt 4.0: QtNetwork Classes - - - - - - -

QtNetwork Classes

-

- - - - - - - - - - - - -
QAbstractSocketThe base functionality common to all socket types
QFtpImplementation of the FTP protocol
QHostAddressIP address
QHostInfoStatic functions for host name lookups
QHttpImplementation of the HTTP protocol
QHttpHeaderHeader information for HTTP
QHttpRequestHeaderRequest header information for HTTP
QHttpResponseHeaderResponse header information for HTTP
QTcpServerTCP-based server
QTcpSocketTCP socket
QUdpSocketUDP socket
QUrlInfoStores information about URLs

- - 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 deleted file mode 100644 index c42c4ae26..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtopengl.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - Qt 4.0: QtOpenGL Classes - - - - - - -

QtOpenGL Classes

-

- - - - -
QGLColormapUsed for installing custom colormaps into QGLWidgets
QGLContextEncapsulates an OpenGL rendering context
QGLFormatThe display format of an OpenGL rendering context
QGLWidgetWidget for rendering OpenGL graphics

- - 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 deleted file mode 100644 index db44d6d36..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtsql.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - Qt 4.0: QtSql Classes - - - - - - -

QtSql Classes

-

- - - - - - - - - - - - - - - - -
QSqlDatabaseRepresents a connection to a database
QSqlDriverAbstract base class for accessing specific SQL databases
QSqlDriverCreatorTemplate class that provides a SQL driver factory for a specific driver type
QSqlDriverCreatorBaseThe base class for SQL driver factories
QSqlDriverPluginAbstract base for custom QSqlDriver plugins
QSqlErrorSQL database error information
QSqlFieldManipulates the fields in SQL database tables and views
QSqlIndexFunctions to manipulate and describe database indexes
QSqlQueryMeans of executing and manipulating SQL statements
QSqlQueryModelRead-only data model for SQL result sets
QSqlRecordEncapsulates a database record
QSqlRelationStores information about an SQL foreign key
QSqlRelationalDelegate
QSqlRelationalTableModelEditable data model for a single database table, with foreign key support
QSqlResultAbstract interface for accessing data from specific SQL databases
QSqlTableModelEditable data model for a single database table

- - 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 deleted file mode 100644 index d10d54237..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtxml.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - Qt 4.0: QtXml Classes - - - - - -

QtXml Classes

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
QDomAttrRepresents one attribute of a QDomElement
QDomCDATASectionRepresents an XML CDATA section
QDomCharacterDataRepresents a generic string in the DOM
QDomCommentRepresents an XML comment
QDomDocumentRepresents an XML document
QDomDocumentFragmentTree of QDomNodes which is not usually a complete QDomDocument
QDomDocumentTypeThe representation of the DTD in the document tree
QDomElementRepresents one element in the DOM tree
QDomEntityRepresents an XML entity
QDomEntityReferenceRepresents an XML entity reference
QDomImplementationInformation about the features of the DOM implementation
QDomNamedNodeMapCollection of nodes that can be accessed by name
QDomNodeThe base class for all the nodes in a DOM tree
QDomNodeListList of QDomNode objects
QDomNotationRepresents an XML notation
QDomProcessingInstructionRepresents an XML processing instruction
QDomTextRepresents text data in the parsed XML document
QXmlAttributesXML attributes
QXmlContentHandlerInterface to report the logical content of XML data
QXmlDTDHandlerInterface to report DTD content of XML data
QXmlDeclHandlerInterface to report declaration content of XML data
QXmlDefaultHandlerDefault implementation of all the XML handler classes
QXmlEntityResolverInterface to resolve external entities contained in XML data
QXmlErrorHandlerInterface to report errors in XML data
QXmlInputSourceThe input data for the QXmlReader subclasses
QXmlLexicalHandlerInterface to report the lexical content of XML data
QXmlLocatorThe XML handler classes with information about the parsing position within a file
QXmlNamespaceSupportHelper class for XML readers which want to include namespace support
QXmlParseExceptionUsed to report errors with the QXmlErrorHandler interface
QXmlReaderInterface for XML readers (i.e. parsers)
QXmlSimpleReaderImplementation of a simple XML parser

- - 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 deleted file mode 100644 index 016825d87..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/Resources/titles.txt +++ /dev/null @@ -1,7 +0,0 @@ -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 deleted file mode 100644 index 8c462a517..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/dockwidgets.qrc +++ /dev/null @@ -1,12 +0,0 @@ - - - Resources/titles.txt - Resources/modules.html - Resources/qtcore.html - Resources/qtgui.html - Resources/qtnetwork.html - Resources/qtopengl.html - Resources/qtsql.html - Resources/qtxml.html - - diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/mainwindow.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/mainwindow.h deleted file mode 100644 index e9891d628..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/dockwidgets/mainwindow.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 - -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 deleted file mode 100644 index 88bff6669..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/draganddrop/dragwidget.h +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -** -** 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 -#include -#include -#include - -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 deleted file mode 100644 index ece2a8190..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/draganddrop/mainwindow.h +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 -#include -#include - -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 deleted file mode 100644 index 30b8a2986..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/dragging/images.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - images/file.png - - 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 deleted file mode 100644 index 9520080ed..000000000 Binary files a/sources/pyside6/doc/codesnippets/doc/src/snippets/dragging/images/file.png and /dev/null 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 deleted file mode 100644 index 6e4073499..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/dragging/mainwindow.cpp +++ /dev/null @@ -1,72 +0,0 @@ -############################################################################ -## -## 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 deleted file mode 100644 index fccb01a0e..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/dragging/mainwindow.h +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 -#include -#include - -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 deleted file mode 100644 index 8607b6953..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/dropactions/window.h +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 -#include -#include - -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 deleted file mode 100644 index 77f97455b..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/droparea.cpp +++ /dev/null @@ -1,147 +0,0 @@ -############################################################################ -## -## 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("")) - 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(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("")) - setBackgroundRole(QPalette.Dark) - - emit changed() -} - -QPixmap DropArea.extractPixmap(const QByteArray &data, const QString &format) -{ - QList 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 deleted file mode 100644 index 9793762ad..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/dropevents/window.py +++ /dev/null @@ -1,65 +0,0 @@ -############################################################################ -## -## 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 deleted file mode 100644 index e7854bcfd..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/droprectangle/window.h +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 -#include -#include - -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 deleted file mode 100644 index 18fd7b8c5..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/eventfilters/filterobject.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 - -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 deleted file mode 100644 index 66ca6b36b..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/explicitlysharedemployee/employee.h +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** 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 -#include - -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 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 deleted file mode 100644 index 0f49fe256..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/i18n-non-qt-class/myclass.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 - -//! [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 deleted file mode 100644 index 9bd90f244..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/i18n-non-qt-class/myclass.ts +++ /dev/null @@ -1,12 +0,0 @@ - - - - MyClass - - - Hello Qt! - - - - - 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 deleted file mode 100644 index 903ac8578..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/i18n-non-qt-class/resources.qrc +++ /dev/null @@ -1,6 +0,0 @@ - - - translations/i18n-non-qt-class_en.qm - translations/i18n-non-qt-class_fr.qm - - 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 deleted file mode 100644 index 54f188694..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/i18n-non-qt-class/translations/i18n-non-qt-class_en.ts +++ /dev/null @@ -1,12 +0,0 @@ - - - - MyClass - - - Hello Qt! - - - - - 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 deleted file mode 100644 index 3f3cebc23..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/i18n-non-qt-class/translations/i18n-non-qt-class_fr.ts +++ /dev/null @@ -1,13 +0,0 @@ - - - - MyClass - - - Hello Qt! - - Bonjour Qt! - - - - diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/image/image.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/image/image.cpp deleted file mode 100644 index a35f95c94..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/image/image.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) 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 deleted file mode 100644 index 969ce5866..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/image/supportedformat.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 855bea055..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/inherited-slot/button.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 - -//! [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 deleted file mode 100644 index 6b4076815..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/itemselection/model.h +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** 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 -#include -#include - -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 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 deleted file mode 100644 index 9bcc5dbe0..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/layouts/layouts.cpp +++ /dev/null @@ -1,126 +0,0 @@ -############################################################################ -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the 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 deleted file mode 100644 index 1b0f94e8e..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/mainwindowsnippet.cpp +++ /dev/null @@ -1,58 +0,0 @@ -############################################################################ -## -## 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 deleted file mode 100644 index 369d25af5..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/matrix/matrix.cpp +++ /dev/null @@ -1,112 +0,0 @@ -############################################################################ -## -## 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 deleted file mode 100644 index f7d07c8f4..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/mdiareasnippets.cpp +++ /dev/null @@ -1,66 +0,0 @@ -############################################################################ -## -## 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 deleted file mode 100644 index 0391b48aa..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/moc/myclass1.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 - -#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 deleted file mode 100644 index e39cb6a58..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/moc/myclass2.h +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** 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 - -#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 deleted file mode 100644 index 5110c6203..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/moc/myclass3.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 - -//! [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 deleted file mode 100644 index e9f85877a..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/modelview-subclasses/model.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 -#include -#include - -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 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 deleted file mode 100644 index f6a5e710c..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/modelview-subclasses/view.h +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************** -** -** 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 -#include -#include -#include -#include -#include -#include - -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 deleted file mode 100644 index ac4988f5e..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/modelview-subclasses/window.h +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 -#include -#include - -#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 deleted file mode 100644 index 375df1b90..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/myscrollarea.cpp +++ /dev/null @@ -1,112 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 426d0f844..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/network/tcpwait.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 deleted file mode 100644 index c50c3cd82..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/ntfsp.cpp +++ /dev/null @@ -1,60 +0,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$ -** -****************************************************************************/ - - -//! [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 deleted file mode 100644 index 9f5ee1275..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/anyHTMLElement.xq +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 059bcc081..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/anyXLinkAttribute.xq +++ /dev/null @@ -1,2 +0,0 @@ -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 deleted file mode 100644 index 3961c2838..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/bracesIncluded.xq +++ /dev/null @@ -1 +0,0 @@ -{sum((1, 2, 3))} diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/bracesIncludedResult.xml b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/bracesIncludedResult.xml deleted file mode 100644 index 0004c7126..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/bracesIncludedResult.xml +++ /dev/null @@ -1 +0,0 @@ -6 diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/bracesOmitted.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/bracesOmitted.xq deleted file mode 100644 index ffbadd077..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/bracesOmitted.xq +++ /dev/null @@ -1 +0,0 @@ -sum({(1, 2, 3)}) diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/bracesOmittedResult.xml b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/bracesOmittedResult.xml deleted file mode 100644 index 744fb8fe6..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/bracesOmittedResult.xml +++ /dev/null @@ -1,2 +0,0 @@ - -sum(1 2 3) \ 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 deleted file mode 100644 index c5b93ada6..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/computedTreeFragment.xq +++ /dev/null @@ -1,14 +0,0 @@ -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 deleted file mode 100644 index 40e44942c..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/copyAttribute.xq +++ /dev/null @@ -1,9 +0,0 @@ - - -

- { - doc('feed.rss')/rss/@version - } -

- - diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/copyID.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/copyID.xq deleted file mode 100644 index 2409cafe6..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/copyID.xq +++ /dev/null @@ -1,3 +0,0 @@ -(: Copy the value of xml:id attribute from other.html. This is a comment by the way! :) - diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/directTreeFragment.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/directTreeFragment.xq deleted file mode 100644 index 96bc963b4..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/directTreeFragment.xq +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - some text - diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/doc.txt b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/doc.txt deleted file mode 100644 index d30b057b2..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/doc.txt +++ /dev/null @@ -1,35 +0,0 @@ - -

- 1 - 2 -

-

- 3 - 4 -

-

- 5 - 6 -

-

- 7 - 8 -

-

- 9 - a -

-

- b - c -

-

- d - e -

-

- f - 0 -

-
- diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/docPlainHTML.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/docPlainHTML.xq deleted file mode 100644 index 622bec891..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/docPlainHTML.xq +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 5e7fbaedc..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/docPlainHTML2.xq +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index b513922a3..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/embedDataInXHTML.xq +++ /dev/null @@ -1,10 +0,0 @@ -declare default element namespace "http://www.w3.org/1999/xhtml"; - - - { - for $i in doc("testResult.xml")/tests/test[@status = "failure"] - order by $i/@name - return

{$i/@name}

- } - - diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/embedDataInXHTML2.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/embedDataInXHTML2.xq deleted file mode 100644 index 754ddba87..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/embedDataInXHTML2.xq +++ /dev/null @@ -1,10 +0,0 @@ -declare namespace x = "http://www.w3.org/1998/xhtml"; - - - { - for $i in doc("testResult.xml")/tests/test[@status = "failure"] - order by $i/@name - return {$i/@name} - } - - diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/emptyParagraphs.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/emptyParagraphs.xq deleted file mode 100644 index 6024d28a8..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/emptyParagraphs.xq +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 669e7c197..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/escapeCurlyBraces.xq +++ /dev/null @@ -1,4 +0,0 @@ - - This is one left followed by one right curly brace: {{ }} - Here they are again, but with character references: { } - diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/escapeStringLiterals.xml b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/escapeStringLiterals.xml deleted file mode 100644 index 425ccb075..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/escapeStringLiterals.xml +++ /dev/null @@ -1,2 +0,0 @@ -

"I hate quotations" -- Ralph Waldo Emerson" - '"I hate quotations"" -- Ralph Waldo Emerson"', appeared above

\ 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 deleted file mode 100644 index 4a6054ba6..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/escapeStringLiterals.xq +++ /dev/null @@ -1,7 +0,0 @@ -

-{ - """I hate quotations"" -- Ralph Waldo Emerson""", - " ", - '''"I hate quotations"" -- Ralph Waldo Emerson"'', appeared above' -} -

diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/expressionInsideAttribute.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/expressionInsideAttribute.xq deleted file mode 100644 index 97f46b1c4..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/expressionInsideAttribute.xq +++ /dev/null @@ -1,2 +0,0 @@ -declare variable $additionalClass := "example"; -

diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/filterOnPath.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/filterOnPath.xq deleted file mode 100644 index d23dfe8c7..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/filterOnPath.xq +++ /dev/null @@ -1,2 +0,0 @@ -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 deleted file mode 100644 index 46b77fa3c..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/filterOnStep.xq +++ /dev/null @@ -1,2 +0,0 @@ -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 deleted file mode 100644 index db5e2c720..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/firstParagraph.xq +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index b26e9f2f4..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/fnStringOnAttribute.xq +++ /dev/null @@ -1,9 +0,0 @@ - - -

- { - string(doc('feed.rss')/rss/@version) - } -

- - diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/forClause.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/forClause.xq deleted file mode 100644 index a412dca47..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/forClause.xq +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 4fa505d53..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/forClause2.xq +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 9ec33397b..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/forClauseOnFeed.xq +++ /dev/null @@ -1,6 +0,0 @@ -for $item in doc('feed.rss')//item -return

- { - $item/description/node() - } -

diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/indented.xml b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/indented.xml deleted file mode 100644 index a312c63f2..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/indented.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - -

Some Text

-
diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introAcneRemover.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introAcneRemover.xq deleted file mode 100644 index 4e6ee8044..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introAcneRemover.xq +++ /dev/null @@ -1,8 +0,0 @@ - - The following skin care products have shipped, ordered by shipping date(oldest first): - { - for $i in doc("myOrders.xml")/orders/order[@product = "Acme Skin Care"] - order by xs:date($i/@shippingDate) descending - return $i - } - diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introExample2.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introExample2.xq deleted file mode 100644 index 411cc171f..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introExample2.xq +++ /dev/null @@ -1,5 +0,0 @@ - -{ - doc($file)/bib/book[publisher = $publisher and @year > $year]/{title} -} - diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introFileHierarchy.xml b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introFileHierarchy.xml deleted file mode 100644 index cfa6151ce..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introFileHierarchy.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - ... - - - ... - - diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introNavigateFS.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introNavigateFS.xq deleted file mode 100644 index 1f5a3a73e..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introNavigateFS.xq +++ /dev/null @@ -1,12 +0,0 @@ -declare variable $myRoot := ; (: This line is a dummy and shouldn't appear in the documentation. :) - - - { - $myRoot//file[@mimetype = 'text/xml' or @mimetype = 'application/xml'] - / - (if(doc-available(@uri)) - then () - else

Failed to parse file {@uri}.

) - } - - diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introductionExample.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introductionExample.xq deleted file mode 100644 index 1a309dd7f..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/introductionExample.xq +++ /dev/null @@ -1,3 +0,0 @@ - -{doc("library.xml")/bib/book[publisher="Addison-Wesley" and @year>1991]/{title}} - diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/invalidLetOrderBy.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/invalidLetOrderBy.xq deleted file mode 100644 index d65f24066..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/invalidLetOrderBy.xq +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 0b46ec14e..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/items.xq +++ /dev/null @@ -1,5 +0,0 @@ -, -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 deleted file mode 100644 index f4106d280..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/letOrderBy.xq +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index ec4af33ba..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/literalsAndOperators.xq +++ /dev/null @@ -1,2 +0,0 @@ -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 deleted file mode 100644 index 32d0b6cae..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/mobeyDick.xml +++ /dev/null @@ -1,4 +0,0 @@ - - Mobey Dick ... - diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/nextLastParagraph.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/nextLastParagraph.xq deleted file mode 100644 index 9424f792b..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/nextLastParagraph.xq +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index ce36e843a..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/nodeConstructorsAreExpressions.xq +++ /dev/null @@ -1,4 +0,0 @@ -let $docURI := 'maybeNotWellformed.xml' -return if(doc-available($docURI)) - then doc($docURI)//p/{./node()} - else Failed to load {$docURI} diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/nodeConstructorsInPaths.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/nodeConstructorsInPaths.xq deleted file mode 100644 index beb294fba..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/nodeConstructorsInPaths.xq +++ /dev/null @@ -1 +0,0 @@ -doc('feed.rss')//item/

{description/node()}

diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/nodeTestChildElement.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/nodeTestChildElement.xq deleted file mode 100644 index 7aa7b3437..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/nodeTestChildElement.xq +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index b3321f286..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/notIndented.xml +++ /dev/null @@ -1 +0,0 @@ -

Some Text

diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/oneElementConstructor.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/oneElementConstructor.xq deleted file mode 100644 index b7eb615f8..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/oneElementConstructor.xq +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/paragraphsExceptTheFiveFirst.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/paragraphsExceptTheFiveFirst.xq deleted file mode 100644 index 16438d188..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/paragraphsExceptTheFiveFirst.xq +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index dbb9fcf94..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/paragraphsWithTables.xq +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 26fd1e5dc..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/pathAB.xq +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index ba47900f9..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/pathsAllParagraphs.xq +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 93ac31ec6..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/simpleHTML.xq +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index fda537167..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/simpleXHTML.xq +++ /dev/null @@ -1,2 +0,0 @@ -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 deleted file mode 100644 index 0c7be4e2d..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/svgDocumentElement.xml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/tablesInParagraphs.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/tablesInParagraphs.xq deleted file mode 100644 index fc92cf003..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/tablesInParagraphs.xq +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index ab4fe3580..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/twoSVGElements.xq +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index 9e022081b..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/xmlStylesheet.xq +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/xsBooleanTrue.xq b/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/xsBooleanTrue.xq deleted file mode 100644 index 897a99e4d..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/xsBooleanTrue.xq +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index fb6a236e7..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/patternist/xsvgDocumentElement.xml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/persistentindexes/mainwindow.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/persistentindexes/mainwindow.h deleted file mode 100644 index 8f8c36f4e..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/persistentindexes/mainwindow.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 -#include - -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 ¤tIndex); - -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 deleted file mode 100644 index 0dbd0b849..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/persistentindexes/model.h +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 -#include -#include - -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 deleted file mode 100644 index 6d4ef567c..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/picture/picture.cpp +++ /dev/null @@ -1,121 +0,0 @@ -############################################################################ -## -## 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 deleted file mode 100644 index 1d14ed044..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/plaintextlayout/window.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 - -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 deleted file mode 100644 index 03c9f40d3..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/polygon/polygon.cpp +++ /dev/null @@ -1,96 +0,0 @@ -############################################################################ -## -## 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 deleted file mode 100644 index 56bab84f0..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/porting4-dropevents/window.h +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 -#include -#include - -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 deleted file mode 100644 index b5618af9d..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/printing-qprinter/errors.cpp +++ /dev/null @@ -1,68 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index a70dcd16d..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/printing-qprinter/object.h +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** 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 - -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 deleted file mode 100644 index db93f8ecb..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qabstractsliderisnippet.cpp +++ /dev/null @@ -1,519 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 3e94053df..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qdir-listfiles/main.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** 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(f"{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 deleted file mode 100644 index 5577ffb14..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qdir-namefilters/main.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** 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("{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 deleted file mode 100644 index bc199b237..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qfontdatabase/main.cpp +++ /dev/null @@ -1,74 +0,0 @@ -############################################################################ -## -## 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 deleted file mode 100644 index d43ff3eae..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qlineargradient/paintwidget.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 - -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 deleted file mode 100644 index 9788231c0..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qlistview-dnd/mainwindow.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 - -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 deleted file mode 100644 index 5ced99cfe..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qlistview-dnd/model.h +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** 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 -#include - -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 deleted file mode 100644 index 848ef6b24..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qlistview-using/mainwindow.h +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 -#include - -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 ¤t); - -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 deleted file mode 100644 index 6451ac281..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qlistview-using/model.h +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 -#include -#include - -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 deleted file mode 100644 index ca6e41cf5..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qlistwidget-dnd/mainwindow.h +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** 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 - -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 deleted file mode 100644 index b03749df2..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qlistwidget-using/mainwindow.h +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 - -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 deleted file mode 100644 index 12794b1d5..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qmacnativewidget/main.mm +++ /dev/null @@ -1,144 +0,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$ -** -****************************************************************************/ - -#include -#include -#ifdef QT_MAC_USE_COCOA -#import -#else -#include -#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(nativeWidget->winId()); - NSView *contentView = [window contentView]; - [contentView setAutoresizesSubviews:YES]; - [nativeWidgetView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; - [nativeWidgetView setAutoresizesSubviews:YES]; - NSView *pushButtonView = reinterpret_cast(pushButton->winId()); - [pushButtonView setAutoresizingMask:NSViewWidthSizable]; - - // Add the nativeWidget to the window. - [contentView addSubview:nativeWidgetView positioned:NSWindowAbove relativeTo:nil]; - nativeWidget->show(); - pushButton->show(); - - // Show the window. - [window makeKeyAndOrderFront:window]; - [pool release]; -//![0] -#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(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 deleted file mode 100644 index ff07205b9..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/delegate.h +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index ff07205b9..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/main.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index ff07205b9..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/model.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index ff07205b9..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/model.h +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index e4361c673..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/paintwidget_unix.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index ff07205b9..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qmake/view.h +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 7c8711105..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qmetaobject-invokable/window.h +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** 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 - -//! [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 deleted file mode 100644 index 5a19e2eb3..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qquickview-ex.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** 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 = Path(__file__).parent / 'view.qml' - view.setSource(QUrl.fromLocalFile(os.fspath(qmlFile.resolve()))) - 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 deleted file mode 100644 index 6763da00d..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qsignalmapper/buttonwidget.h +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 - -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 deleted file mode 100644 index 18037fadd..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qsignalmapper/mainwindow.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include - -class 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 deleted file mode 100644 index 9b097f3bd..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qsortfilterproxymodel-details/main.cpp +++ /dev/null @@ -1,79 +0,0 @@ -############################################################################ -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the 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 deleted file mode 100644 index 33b48f742..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qsplashscreen/main.cpp +++ /dev/null @@ -1,66 +0,0 @@ -############################################################################ -## -## 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 deleted file mode 100644 index 22132039b..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qsplashscreen/mainwindow.h +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** 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 - -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 deleted file mode 100644 index 330ec7868..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qsplashscreen/qsplashscreen.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - splash.png - - diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qsplashscreen/splash.png b/sources/pyside6/doc/codesnippets/doc/src/snippets/qsplashscreen/splash.png deleted file mode 100644 index d82f6d218..000000000 Binary files a/sources/pyside6/doc/codesnippets/doc/src/snippets/qsplashscreen/splash.png and /dev/null 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 deleted file mode 100644 index c02080ffc..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qstackedlayout/main.py +++ /dev/null @@ -1,87 +0,0 @@ -############################################################################ -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the 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 deleted file mode 100644 index 6f2c49d8e..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qstackedwidget/main.py +++ /dev/null @@ -1,77 +0,0 @@ -############################################################################ -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the examples of Qt for Python. -## -## $QT_BEGIN_LICENSE:BSD$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## BSD License Usage -## Alternatively, you may use this file under the terms of the BSD license -## as follows: -## -## "Redistribution and use in source and binary forms, with or without -## modification, are permitted provided that the following conditions are -## met: -## * Redistributions of source code must retain the above copyright -## notice, this list of conditions and the following disclaimer. -## * Redistributions in binary form must reproduce the above copyright -## notice, this list of conditions and the following disclaimer in -## the documentation and/or other materials provided with the -## distribution. -## * Neither the name of The Qt Company Ltd nor the names of its -## contributors may be used to endorse or promote products derived -## from this software without specific prior written permission. -## -## -## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -## (INCLUDING NEGLIGENCE OR OTHERWISE) 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 deleted file mode 100644 index 0ba3895a1..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qstatustipevent/main.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 12fb026f7..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qstyleoption/main.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) 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 deleted file mode 100644 index 13d8b3612..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qsvgwidget/qsvgwidget.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - spheres.svg - - diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qsvgwidget/spheres.svg b/sources/pyside6/doc/codesnippets/doc/src/snippets/qsvgwidget/spheres.svg deleted file mode 100644 index 9e3819306..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qsvgwidget/spheres.svg +++ /dev/null @@ -1,79 +0,0 @@ - - - Spheres - Gradient filled spheres with different colors. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qsvgwidget/sunflower.svg b/sources/pyside6/doc/codesnippets/doc/src/snippets/qsvgwidget/sunflower.svg deleted file mode 100644 index b60dd11a6..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qsvgwidget/sunflower.svg +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 deleted file mode 100644 index 2cd9048ca..000000000 Binary files a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-dnd/Images/cubed.png and /dev/null 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 deleted file mode 100644 index bfdf99328..000000000 Binary files a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-dnd/Images/squared.png and /dev/null 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 deleted file mode 100644 index 1d49b5286..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-dnd/images.qrc +++ /dev/null @@ -1,6 +0,0 @@ - - - Images/squared.png - Images/cubed.png - - 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 deleted file mode 100644 index 8387de54a..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-dnd/mainwindow.h +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 - -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 deleted file mode 100644 index 8eaaa7e00..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-resizing/mainwindow.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 - -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 deleted file mode 100644 index 2cd9048ca..000000000 Binary files a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-using/Images/cubed.png and /dev/null 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 deleted file mode 100644 index bfdf99328..000000000 Binary files a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-using/Images/squared.png and /dev/null 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 deleted file mode 100644 index 1d49b5286..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-using/images.qrc +++ /dev/null @@ -1,6 +0,0 @@ - - - Images/squared.png - Images/cubed.png - - 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 deleted file mode 100644 index 9571090ca..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtablewidget-using/mainwindow.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 - -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 deleted file mode 100644 index eb0278fa8..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtcast/qtcast.h +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** 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 - -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 deleted file mode 100644 index 6c89f166b..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreeview-dnd/dragdropmodel.h +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index d526dce12..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreeview-dnd/mainwindow.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 - -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 deleted file mode 100644 index 4f3a1679f..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreeview-dnd/treeitem.h +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 -#include - -class TreeItem -{ -public: - TreeItem(const QList &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 childItems; - QList 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 deleted file mode 100644 index faf970ee9..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreeview-dnd/treemodel.h +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -** -** 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 -#include -#include - -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 deleted file mode 100644 index c7b355c5e..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreewidget-using/mainwindow.cpp +++ /dev/null @@ -1,111 +0,0 @@ -############################################################################ -## -## 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 deleted file mode 100644 index 876ceba07..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreewidget-using/mainwindow.h +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 - -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 deleted file mode 100644 index 3cbe3e65d..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreewidgetitemiterator-using/mainwindow.cpp +++ /dev/null @@ -1,59 +0,0 @@ -############################################################################ -## -## 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 deleted file mode 100644 index 876ceba07..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtreewidgetitemiterator-using/mainwindow.h +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 - -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 deleted file mode 100644 index fa86f16d3..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtscript/registeringobjects/myobject.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** 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 - -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 deleted file mode 100644 index 44ad0e657..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtscript/scriptedslot/object.js +++ /dev/null @@ -1,18 +0,0 @@ -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 deleted file mode 100644 index fc7ff67b9..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qtscript/scriptedslot/scriptedslot.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - object.js - - 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 deleted file mode 100644 index efac0ab6d..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/quiloader/doc_src_qtuiloader.py +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 00702e860..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/quiloader/myform.ui +++ /dev/null @@ -1,130 +0,0 @@ - - - - - Form - - - - 0 - 0 - 258 - 224 - - - - Export Document - - - - 8 - - - 6 - - - - - Export Options - - - - 8 - - - 6 - - - - - &DocBook - - - - - - - &LaTeX - - - true - - - - - - - Include p&ictures - - - true - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - &Compress - - - - - - - &HTML - - - - - - - &PostScript - - - - - - - PD&F - - - - - - - Include &metadata - - - - - - - Create inde&x - - - true - - - - - - - - - - - - diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/quiloader/mywidget.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/quiloader/mywidget.h deleted file mode 100644 index 66e9235f6..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/quiloader/mywidget.h +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** 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 - -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 deleted file mode 100644 index 47684d68b..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/quiloader/mywidget.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - -myform.ui - - diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/qx11embedwidget/embedwidget.h b/sources/pyside6/doc/codesnippets/doc/src/snippets/qx11embedwidget/embedwidget.h deleted file mode 100644 index 1d54f7088..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qx11embedwidget/embedwidget.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 -#include -#include - -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 deleted file mode 100644 index 16c12b7bc..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qxmlquery/bindingExample.py +++ /dev/null @@ -1,59 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 9e57186b9..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/qxmlschemavalidator/main.cpp +++ /dev/null @@ -1,112 +0,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$ -** -****************************************************************************/ - -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("") - - 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 deleted file mode 100644 index 6b4076815..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/reading-selections/model.h +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** 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 -#include -#include - -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 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 deleted file mode 100644 index 7bebf72a4..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/reading-selections/window.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 -#include -#include -#include -#include - -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 deleted file mode 100644 index 2b40e760f..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/separations/finalwidget.h +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 -#include -#include -#include - -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 deleted file mode 100644 index 2991e759e..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/separations/screenwidget.h +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** -** -** 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 -#include -#include -#include - -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 deleted file mode 100644 index 3713c27cf..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/separations/viewer.h +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 -#include -#include - -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 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 deleted file mode 100644 index b1adec9d0..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/shareddirmodel/main.cpp +++ /dev/null @@ -1,90 +0,0 @@ -############################################################################ -## -## 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 deleted file mode 100644 index 23ffcddc7..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/sharedemployee/employee.h +++ /dev/null @@ -1,104 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 -#include - -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 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 deleted file mode 100644 index 6b4076815..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/sharedtablemodel/model.h +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** 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 -#include -#include - -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 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 deleted file mode 100644 index 2ec5ffbc1..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/signalmapper/accountsfile.txt +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 6509951ba..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/signalmapper/filereader.h +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 -#include -#include - -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 deleted file mode 100644 index 30123cc60..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/signalmapper/reportfile.txt +++ /dev/null @@ -1,2 +0,0 @@ -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 deleted file mode 100644 index a682e0aaa..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/signalmapper/taxfile.txt +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 68563e05c..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/signalsandslots/lcdnumber.h +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** -** -** 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 -//! [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 deleted file mode 100644 index c89e83d37..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/signalsandslots/signalsandslots.h +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 -//! [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 deleted file mode 100644 index ea1b8b392..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/simpleparse/handler.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 -#include - -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& indentations(); - -private: - int indentationLevel; - QStringList elementName; - QList 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 deleted file mode 100644 index 90fd928fd..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/splitter/splitter.cpp +++ /dev/null @@ -1,76 +0,0 @@ -############################################################################ -## -## 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 deleted file mode 100644 index 5ecaafcdf..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/splitterhandle/splitter.h +++ /dev/null @@ -1,61 +0,0 @@ -############################################################################ -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the examples of Qt for Python. -## -## $QT_BEGIN_LICENSE:BSD$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## BSD License Usage -## Alternatively, you may use this file under the terms of the BSD license -## as follows: -## -## "Redistribution and use in source and binary forms, with or without -## modification, are permitted provided that the following conditions are -## met: -## * Redistributions of source code must retain the above copyright -## notice, this list of conditions and the following disclaimer. -## * Redistributions in binary form must reproduce the above copyright -## notice, this list of conditions and the following disclaimer in -## the documentation and/or other materials provided with the -## distribution. -## * Neither the name of The Qt Company Ltd nor the names of its -## contributors may be used to endorse or promote products derived -## from this software without specific prior written permission. -## -## -## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -## (INCLUDING NEGLIGENCE OR OTHERWISE) 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 deleted file mode 100644 index 1156e6541..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/sqldatabase/sqldatabase.py +++ /dev/null @@ -1,489 +0,0 @@ -############################################################################ -## -## 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(f"{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(f"{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 deleted file mode 100644 index 79c449d79..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/stringlistmodel/model.cpp +++ /dev/null @@ -1,170 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index 5868952d5..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/stringlistmodel/model.h +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) 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 deleted file mode 100644 index b17445179..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/styles/styles.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index a8dfe2514..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/stylesheet/common-mistakes.cpp +++ /dev/null @@ -1,62 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 4b691b543..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/textblock-fragments/mainwindow.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 - -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 deleted file mode 100644 index 56ce14089..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/textblock-fragments/xmlwriter.h +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** 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 - -class QTextDocument; - -class XmlWriter -{ -public: - XmlWriter(QTextDocument *document) : textDocument(document) {} - QDomDocument *toXml(); - -private: - void readFragment(const QTextBlock ¤tBlock, QDomElement blockElement, - QDomDocument *document); - void processBlock(const QTextBlock ¤tBlock); - void processFragment(const QTextFragment ¤tFragment); - - 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 deleted file mode 100644 index 4b691b543..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-blocks/mainwindow.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 - -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 deleted file mode 100644 index 562ce5dd0..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-blocks/xmlwriter.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 - -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 deleted file mode 100644 index 987489d4b..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-css/main.cpp +++ /dev/null @@ -1,58 +0,0 @@ -############################################################################ -## -## 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 deleted file mode 100644 index 9aad859dc..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-frames/mainwindow.h +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** 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 - -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 deleted file mode 100644 index 707af5152..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-frames/xmlwriter.h +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** 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 - -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 deleted file mode 100644 index a80481a4d..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-imagedrop/textedit.h +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** 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 - -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 deleted file mode 100644 index 6473daf34..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-imageformat/images.qrc +++ /dev/null @@ -1,6 +0,0 @@ - - - images/advert.png - images/newimage.png - - 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 deleted file mode 100644 index 40e10d522..000000000 Binary files a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-imageformat/images/advert.png and /dev/null 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 deleted file mode 100644 index 0eec048a7..000000000 Binary files a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-imageformat/images/newimage.png and /dev/null 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 deleted file mode 100644 index 09e305e8f..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-images/images.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - images/advert.png - - 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 deleted file mode 100644 index 40e10d522..000000000 Binary files a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-images/images/advert.png and /dev/null 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 deleted file mode 100644 index deeeab85a..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-listitems/mainwindow.h +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 -#include -#include - -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 listStructures; - QList previousItems; - QList 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 deleted file mode 100644 index a52fa764f..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-lists/mainwindow.h +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -** -** 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 -#include - -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 deleted file mode 100644 index c80d42bb0..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-printing/mainwindow.h +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 -#include -#include - -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 deleted file mode 100644 index ba889195e..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-selections/mainwindow.h +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -** -** 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 -#include - -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 deleted file mode 100644 index cf43b08c9..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-tables/mainwindow.cpp +++ /dev/null @@ -1,125 +0,0 @@ -############################################################################ -## -## 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 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 deleted file mode 100644 index 36fd19709..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-tables/mainwindow.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 - -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 deleted file mode 100644 index ebfbc826f..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-tables/xmlwriter.h +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** 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 - -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 deleted file mode 100644 index b6622636c..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/textdocument-texttable/main.cpp +++ /dev/null @@ -1,56 +0,0 @@ -############################################################################ -## -## 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 deleted file mode 100644 index 2c4894315..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/threads/threads.h +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 - -//! [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 deleted file mode 100644 index f1d70446b..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/timers/timers.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index 325ea1c7e..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/transform/main.cpp +++ /dev/null @@ -1,110 +0,0 @@ -############################################################################ -## -## 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 deleted file mode 100644 index dda0e62dd..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/uitools/calculatorform/calculatorform.ui +++ /dev/null @@ -1,303 +0,0 @@ - - - - - CalculatorForm - - - CalculatorForm - - - - 0 - 0 - 276 - 98 - - - - - 5 - 5 - 0 - 0 - - - - Calculator Builder - - - - - - - 9 - - - 6 - - - - - - - - 1 - - - 6 - - - - - - - - 1 - - - 6 - - - - - label - - - - 1 - 1 - 45 - 19 - - - - Input 1 - - - - - - - inputSpinBox1 - - - - 1 - 26 - 45 - 25 - - - - true - - - - - - - - - label_3 - - - - 54 - 1 - 7 - 52 - - - - + - - - Qt::AlignCenter - - - - - - - - - - 1 - - - 6 - - - - - label_2 - - - - 1 - 1 - 45 - 19 - - - - Input 2 - - - - - - - inputSpinBox2 - - - - 1 - 26 - 45 - 25 - - - - true - - - - - - - - - label_3_2 - - - - 120 - 1 - 7 - 52 - - - - = - - - Qt::AlignCenter - - - - - - - - - - 1 - - - 6 - - - - - label_2_2_2 - - - - 1 - 1 - 37 - 17 - - - - Output - - - - - - - outputWidget - - - - 1 - 24 - 37 - 27 - - - - QFrame::Box - - - QFrame::Sunken - - - 0 - - - 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 - - - - - - - - - - - verticalSpacer - - - - 85 - 69 - 20 - 20 - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - horizontalSpacer - - - - 188 - 26 - 79 - 20 - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - 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 deleted file mode 100644 index 6b4076815..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/updating-selections/model.h +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** 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 -#include -#include - -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 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 deleted file mode 100644 index ba4a36a03..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/updating-selections/window.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Python. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR 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 -#include -#include -#include -#include - -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 ¤t, 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 deleted file mode 100644 index ea97d1e35..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/whatsthis/whatsthis.cpp +++ /dev/null @@ -1,57 +0,0 @@ -############################################################################ -## -## 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 deleted file mode 100644 index 92f227253..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/widget-mask/mask.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - tux.png - - 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 deleted file mode 100644 index a95527f3f..000000000 Binary files a/sources/pyside6/doc/codesnippets/doc/src/snippets/widget-mask/tux.png and /dev/null differ diff --git a/sources/pyside6/doc/codesnippets/doc/src/snippets/widgetdelegate.cpp b/sources/pyside6/doc/codesnippets/doc/src/snippets/widgetdelegate.cpp deleted file mode 100644 index 960d50158..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/widgetdelegate.cpp +++ /dev/null @@ -1,72 +0,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$ -** -****************************************************************************/ - -//![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 deleted file mode 100644 index 6f8f2ed39..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/widgets-tutorial/template.py +++ /dev/null @@ -1,66 +0,0 @@ -############################################################################ -## -## 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 deleted file mode 100644 index 89acb5d36..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/xml/rsslisting/handler.h +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** 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 -#include -#include - -/* 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 deleted file mode 100644 index c7d75528b..000000000 --- a/sources/pyside6/doc/codesnippets/doc/src/snippets/xml/rsslisting/rsslisting.h +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** -** -** 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 -#include -#include -#include - -#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 deleted file mode 100644 index 9f978482d..000000000 --- a/sources/pyside6/doc/codesnippets/examples/dbus/example-client.py +++ /dev/null @@ -1,100 +0,0 @@ -#!/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 deleted file mode 100644 index d18c4a578..000000000 --- a/sources/pyside6/doc/codesnippets/examples/dbus/example-server.py +++ /dev/null @@ -1,119 +0,0 @@ -#!/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 deleted file mode 100644 index 4b8b9234f..000000000 --- a/sources/pyside6/doc/codesnippets/examples/declarative/cppextensions/plugins/plugin.cpp +++ /dev/null @@ -1,68 +0,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$ -** -****************************************************************************/ - -//![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 deleted file mode 100644 index 415531885..000000000 --- a/sources/pyside6/doc/codesnippets/examples/declarative/cppextensions/plugins/plugins.qml +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 08032cf2a..000000000 --- a/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/classwizard.py +++ /dev/null @@ -1,254 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//! [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 ¯o")) - -//! [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 deleted file mode 100644 index 41a5ddc7d..000000000 --- a/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/classwizard.qrc +++ /dev/null @@ -1,11 +0,0 @@ - - - images/background.png - images/banner.png - images/logo1.png - images/logo2.png - images/logo3.png - images/watermark1.png - images/watermark2.png - - diff --git a/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/background.png b/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/background.png deleted file mode 100644 index 44c7badb8..000000000 Binary files a/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/background.png and /dev/null 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 deleted file mode 100644 index 3169152b8..000000000 Binary files a/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/banner.png and /dev/null 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 deleted file mode 100644 index f9b594aaf..000000000 Binary files a/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/logo1.png and /dev/null 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 deleted file mode 100644 index 5dcbd4669..000000000 Binary files a/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/logo2.png and /dev/null 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 deleted file mode 100644 index 9fd3ea235..000000000 Binary files a/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/logo3.png and /dev/null 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 deleted file mode 100644 index 0091f5c17..000000000 Binary files a/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/watermark1.png and /dev/null 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 deleted file mode 100644 index 3b88f2e36..000000000 Binary files a/sources/pyside6/doc/codesnippets/examples/dialogs/classwizard/images/watermark2.png and /dev/null differ diff --git a/sources/pyside6/doc/codesnippets/examples/dialogs/extension/finddialog.py b/sources/pyside6/doc/codesnippets/examples/dialogs/extension/finddialog.py deleted file mode 100644 index fc007ab85..000000000 --- a/sources/pyside6/doc/codesnippets/examples/dialogs/extension/finddialog.py +++ /dev/null @@ -1,119 +0,0 @@ -############################################################################ -## -## 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 deleted file mode 100644 index 56f17a3e5..000000000 Binary files a/sources/pyside6/doc/codesnippets/examples/dialogs/licensewizard/images/logo.png and /dev/null 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 deleted file mode 100644 index 124a05068..000000000 Binary files a/sources/pyside6/doc/codesnippets/examples/dialogs/licensewizard/images/watermark.png and /dev/null differ diff --git a/sources/pyside6/doc/codesnippets/examples/dialogs/licensewizard/licensewizard.h b/sources/pyside6/doc/codesnippets/examples/dialogs/licensewizard/licensewizard.h deleted file mode 100644 index f0be5fa60..000000000 --- a/sources/pyside6/doc/codesnippets/examples/dialogs/licensewizard/licensewizard.h +++ /dev/null @@ -1,173 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef LICENSEWIZARD_H -#define LICENSEWIZARD_H - -#include - -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 deleted file mode 100644 index b06993851..000000000 --- a/sources/pyside6/doc/codesnippets/examples/dialogs/licensewizard/licensewizard.qrc +++ /dev/null @@ -1,6 +0,0 @@ - - - images/logo.png - images/watermark.png - - diff --git a/sources/pyside6/doc/codesnippets/examples/dialogs/standarddialogs/dialog.cpp b/sources/pyside6/doc/codesnippets/examples/dialogs/standarddialogs/dialog.cpp deleted file mode 100644 index 3132bec55..000000000 --- a/sources/pyside6/doc/codesnippets/examples/dialogs/standarddialogs/dialog.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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(f"{i}%") -//! [0] - -//! [1] - d, ok = QInputDialog().getDouble(self, "QInputDialog().getDouble()", - "Amount:", 37.56, -10000, 10000, 2) - if ok: - doubleLabel.setText(f"${d}") -//! [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 deleted file mode 100644 index 4fff4d631..000000000 --- a/sources/pyside6/doc/codesnippets/examples/dialogs/tabdialog/tabdialog.cpp +++ /dev/null @@ -1,193 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 818d865e3..000000000 --- a/sources/pyside6/doc/codesnippets/examples/graphicsview/simpleanchorlayout/main.cpp +++ /dev/null @@ -1,72 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index 58f2599dc..000000000 --- a/sources/pyside6/doc/codesnippets/examples/imageprovider/imageprovider-example.qml +++ /dev/null @@ -1,59 +0,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$ -** -****************************************************************************/ - -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 deleted file mode 100644 index b3890114b..000000000 --- a/sources/pyside6/doc/codesnippets/examples/imageprovider/imageprovider.cpp +++ /dev/null @@ -1,83 +0,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$ -** -****************************************************************************/ - -//![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 deleted file mode 100644 index f99b7e18e..000000000 --- a/sources/pyside6/doc/codesnippets/examples/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp +++ /dev/null @@ -1,109 +0,0 @@ -############################################################################ -## -## 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 deleted file mode 100644 index 7c207d19c..000000000 --- a/sources/pyside6/doc/codesnippets/examples/itemviews/pixelator/pixeldelegate.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index ce3eafb89..000000000 --- a/sources/pyside6/doc/codesnippets/examples/mainwindows/application/mainwindow.h +++ /dev/null @@ -1,113 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -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 deleted file mode 100644 index fb58f05a8..000000000 --- a/sources/pyside6/doc/codesnippets/examples/mainwindows/application/mainwindow.py +++ /dev/null @@ -1,357 +0,0 @@ -############################################################################ -## -## 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 Application 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 " - f"{fileName}:\n{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 deleted file mode 100644 index b8ff9d5bc..000000000 --- a/sources/pyside6/doc/codesnippets/examples/mainwindows/dockwidgets/mainwindow.py +++ /dev/null @@ -1,253 +0,0 @@ -############################################################################ -## -## 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 deleted file mode 100644 index d39604b6c..000000000 --- a/sources/pyside6/doc/codesnippets/examples/mainwindows/mainwindow.py +++ /dev/null @@ -1,366 +0,0 @@ -############################################################################ -## -## 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("Choose a menu option, or right-click to " - "invoke a context menu")) - 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 File|New")) - - -def open(self): - infoLabel.setText(tr("Invoked File|Open")) - - -def save(self): - infoLabel.setText(tr("Invoked File|Save")) - -def print_(self): - infoLabel.setText(tr("Invoked File|Print")) - -def undo(self): - infoLabel.setText(tr("Invoked Edit|Undo")) - -def redo(self): - infoLabel.setText(tr("Invoked Edit|Redo")) - -def cut(self): - - infoLabel.setText(tr("Invoked Edit|Cut")) - - -def copy(self): - - infoLabel.setText(tr("Invoked Edit|Copy")) - - -def paste(self): - - infoLabel.setText(tr("Invoked Edit|Paste")) - - -def bold(self): - - infoLabel.setText(tr("Invoked Edit|Format|Bold")) - - -def italic(self): - - infoLabel.setText(tr("Invoked Edit|Format|Italic")) - - -def leftAlign(self): - - infoLabel.setText(tr("Invoked Edit|Format|Left Align")) - - -def rightAlign(self): - - infoLabel.setText(tr("Invoked Edit|Format|Right Align")) - - -def justify(self): - - infoLabel.setText(tr("Invoked Edit|Format|Justify")) - - -def center(self): - - infoLabel.setText(tr("Invoked Edit|Format|Center")) - - -def setLineSpacing(self): - - infoLabel.setText(tr("Invoked Edit|Format|Set Line Spacing")) - - -def setParagraphSpacing(self): - - infoLabel.setText(tr("Invoked Edit|Format|Set Paragraph Spacing")) - - -def about(self): - - infoLabel.setText(tr("Invoked Help|About")) - QMessageBox.about(self, tr("About Menu"), - tr("The Menu example shows how to create " - "menu-bar menus and context menus.")) - - -def aboutQt(self): - - infoLabel.setText(tr("Invoked Help|About Qt")) - - -//! [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 deleted file mode 100644 index 984210189..000000000 --- a/sources/pyside6/doc/codesnippets/examples/mainwindows/mdi/mainwindow.py +++ /dev/null @@ -1,361 +0,0 @@ -############################################################################ -## -## 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 MDI 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 = "" - child_file = child.userFriendlyCurrentFile() - if i < 9: - text = f"&{i + 1} {child_file}" - else: - text = f"{i + 1} {child_file}" - - 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 deleted file mode 100644 index 71586723e..000000000 --- a/sources/pyside6/doc/codesnippets/examples/mainwindows/menus/mainwindow.py +++ /dev/null @@ -1,366 +0,0 @@ -############################################################################ -## -## 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("Choose a menu option, or right-click to " - "invoke a context menu")) - 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 File|New")) - - -def open(self): - infoLabel.setText(tr("Invoked File|Open")) - - -def save(self): - infoLabel.setText(tr("Invoked File|Save")) - -def print_(self): - infoLabel.setText(tr("Invoked File|Print")) - -def undo(self): - infoLabel.setText(tr("Invoked Edit|Undo")) - -def redo(self): - infoLabel.setText(tr("Invoked Edit|Redo")) - -def cut(self): - - infoLabel.setText(tr("Invoked Edit|Cut")) - - -def copy(self): - - infoLabel.setText(tr("Invoked Edit|Copy")) - - -def paste(self): - - infoLabel.setText(tr("Invoked Edit|Paste")) - - -def bold(self): - - infoLabel.setText(tr("Invoked Edit|Format|Bold")) - - -def italic(self): - - infoLabel.setText(tr("Invoked Edit|Format|Italic")) - - -def leftAlign(self): - - infoLabel.setText(tr("Invoked Edit|Format|Left Align")) - - -def rightAlign(self): - - infoLabel.setText(tr("Invoked Edit|Format|Right Align")) - - -def justify(self): - - infoLabel.setText(tr("Invoked Edit|Format|Justify")) - - -def center(self): - - infoLabel.setText(tr("Invoked Edit|Format|Center")) - - -def setLineSpacing(self): - - infoLabel.setText(tr("Invoked Edit|Format|Set Line Spacing")) - - -def setParagraphSpacing(self): - - infoLabel.setText(tr("Invoked Edit|Format|Set Paragraph Spacing")) - - -def about(self): - - infoLabel.setText(tr("Invoked Help|About")) - QMessageBox.about(self, tr("About Menu"), - tr("The Menu example shows how to create " - "menu-bar menus and context menus.")) - - -def aboutQt(self): - - infoLabel.setText(tr("Invoked Help|About Qt")) - - -//! [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 deleted file mode 100644 index de169b20d..000000000 --- a/sources/pyside6/doc/codesnippets/examples/mainwindows/sdi/mainwindow.cpp +++ /dev/null @@ -1,60 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index f1b5c2354..000000000 --- a/sources/pyside6/doc/codesnippets/examples/quick/plugins/plugins.qml +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 deleted file mode 100644 index 822b66c76..000000000 --- a/sources/pyside6/doc/codesnippets/examples/relationaltablemodel/relationaltablemodel.cpp +++ /dev/null @@ -1,120 +0,0 @@ -############################################################################ -## -## 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 deleted file mode 100644 index d0b9abf40..000000000 --- a/sources/pyside6/doc/codesnippets/examples/richtext/textobject/svgtextobject.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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 - -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 deleted file mode 100644 index a24e3536f..000000000 --- a/sources/pyside6/doc/codesnippets/examples/widgets/groupbox/window.cpp +++ /dev/null @@ -1,187 +0,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$ -** -****************************************************************************/ - -//! [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 deleted file mode 100644 index a289c5cea..000000000 --- a/sources/pyside6/doc/codesnippets/examples/widgets/icons/iconsizespinbox.cpp +++ /dev/null @@ -1,72 +0,0 @@ -############################################################################ -## -## 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 deleted file mode 100644 index f54e40bca..000000000 --- a/sources/pyside6/doc/codesnippets/examples/widgets/spinboxes/window.py +++ /dev/null @@ -1,247 +0,0 @@ -############################################################################ -## -## 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 deleted file mode 100644 index cb7207333..000000000 --- a/sources/pyside6/doc/codesnippets/examples/xml/streambookmarks/xbelreader.h +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef XBELREADER_H -#define XBELREADER_H - -#include -#include - -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 deleted file mode 100644 index a656ed708..000000000 --- a/sources/pyside6/doc/codesnippets/snippets/customstyle/main.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the 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] -- cgit v1.2.3