├── CMakeLists.txt ├── COPYING ├── PySide ├── CMakeLists.txt ├── QtCore │ ├── CMakeLists.txt │ ├── glue │ │ ├── qbytearray_bufferprotocol.cpp │ │ ├── qcoreapplication_init.cpp │ │ ├── qeasingcurve_glue.cpp │ │ ├── qeasingcurve_glue.h │ │ ├── qobject_connect.cpp │ │ └── qobject_findchild.cpp │ ├── typesystem_core.xml.in │ ├── typesystem_core_common.xml │ ├── typesystem_core_mac.xml │ ├── typesystem_core_maemo.xml │ ├── typesystem_core_win.xml │ └── typesystem_core_x11.xml ├── QtDeclarative │ ├── CMakeLists.txt │ ├── pysideqmlregistertype.cpp │ ├── pysideqmlregistertype.h │ └── typesystem_declarative.xml ├── QtGui │ ├── CMakeLists.txt │ ├── glue │ │ ├── qapplication_init.cpp │ │ ├── qlayout_help_functions.cpp │ │ ├── qmenu_glue.cpp │ │ ├── qmenubar_glue.cpp │ │ ├── qtgui_qapp.cpp │ │ └── qwidget_glue.cpp │ ├── typesystem_gui.xml.in │ ├── typesystem_gui_common.xml │ ├── typesystem_gui_mac.xml │ ├── typesystem_gui_maemo.xml │ ├── typesystem_gui_simulator.xml │ ├── typesystem_gui_win.xml │ └── typesystem_gui_x11.xml ├── QtHelp │ ├── CMakeLists.txt │ └── typesystem_help.xml ├── QtMaemo5 │ ├── CMakeLists.txt │ └── typesystem_maemo5.xml ├── QtMultimedia │ ├── CMakeLists.txt │ └── typesystem_multimedia.xml ├── QtNetwork │ ├── CMakeLists.txt │ └── typesystem_network.xml ├── QtOpenGL │ ├── CMakeLists.txt │ └── typesystem_opengl.xml ├── QtScript │ ├── CMakeLists.txt │ └── typesystem_script.xml ├── QtScriptTools │ ├── CMakeLists.txt │ └── typesystem_scripttools.xml ├── QtSql │ ├── CMakeLists.txt │ └── typesystem_sql.xml ├── QtSvg │ ├── CMakeLists.txt │ └── typesystem_svg.xml ├── QtTest │ ├── CMakeLists.txt │ └── typesystem_test.xml ├── QtUiTools │ ├── CMakeLists.txt │ ├── glue │ │ ├── plugins.h │ │ └── uitools_loadui.cpp │ └── typesystem_uitools.xml ├── QtWebKit │ ├── CMakeLists.txt │ ├── typesystem_webkit.xml │ └── typesystem_webkit_simulator.xml ├── QtXml │ ├── CMakeLists.txt │ └── typesystem_xml.xml ├── QtXmlPatterns │ ├── CMakeLists.txt │ └── typesystem_xmlpatterns.xml ├── __init__.py.in ├── _utils.py.in ├── global.h.in ├── licensecomment.txt ├── phonon │ ├── CMakeLists.txt │ ├── pyside_phonon.h │ └── typesystem_phonon.xml ├── pysideqtesttouch.h ├── pysidewtypes.h ├── qpytextobject.cpp ├── qpytextobject.h └── typesystem_templates.xml ├── cmake └── Macros │ ├── FindQt4Extra.cmake │ ├── PySideModules.cmake │ └── icecc.cmake ├── cmake_uninstall.cmake ├── doc ├── CMakeLists.txt ├── _templates │ ├── index.html │ └── layout.html ├── _themes │ └── pysidedocs │ │ ├── domainindex.html │ │ ├── searchbox.html │ │ ├── static │ │ ├── bg_header.png │ │ ├── bg_topo.jpg │ │ ├── fakebar.png │ │ ├── logo_indt.jpg │ │ ├── logo_openbossa.png │ │ ├── logo_python.jpg │ │ ├── logo_qt.png │ │ ├── minus.png │ │ ├── plus.png │ │ ├── pysidedocs.css │ │ ├── pysidelogo.png │ │ └── relbar_bg.png │ │ └── theme.conf ├── codesnippets │ ├── doc │ │ └── src │ │ │ └── snippets │ │ │ ├── accessibilityfactorysnippet.cpp │ │ │ ├── accessibilitypluginsnippet.cpp │ │ │ ├── accessibilityslidersnippet.cpp │ │ │ ├── alphachannel.cpp │ │ │ ├── audio │ │ │ └── main.cpp │ │ │ ├── audioeffects.cpp │ │ │ ├── brush │ │ │ ├── brush.cpp │ │ │ └── gradientcreationsnippet.cpp │ │ │ ├── brushstyles │ │ │ ├── main.cpp │ │ │ ├── qt-logo.png │ │ │ ├── renderarea.cpp │ │ │ ├── renderarea.h │ │ │ ├── stylewidget.cpp │ │ │ └── stylewidget.h │ │ │ ├── buffer │ │ │ └── buffer.cpp │ │ │ ├── clipboard │ │ │ ├── clipwindow.cpp │ │ │ ├── clipwindow.h │ │ │ └── main.cpp │ │ │ ├── code │ │ │ ├── doc_src_phonon-api.qdoc │ │ │ ├── doc_src_qnamespace.qdoc │ │ │ ├── src.gui.text.qtextdocumentwriter.cpp │ │ │ ├── src.qdbus.qdbuspendingcall.cpp │ │ │ ├── src.qdbus.qdbuspendingreply.cpp │ │ │ ├── src.scripttools.qscriptenginedebugger.cpp │ │ │ ├── src_corelib_codecs_qtextcodec.cpp │ │ │ ├── src_corelib_codecs_qtextcodecplugin.cpp │ │ │ ├── src_corelib_concurrent_qfuture.cpp │ │ │ ├── src_corelib_concurrent_qfuturesynchronizer.cpp │ │ │ ├── src_corelib_concurrent_qfuturewatcher.cpp │ │ │ ├── src_corelib_concurrent_qtconcurrentexception.cpp │ │ │ ├── src_corelib_concurrent_qtconcurrentfilter.cpp │ │ │ ├── src_corelib_concurrent_qtconcurrentmap.cpp │ │ │ ├── src_corelib_concurrent_qtconcurrentrun.cpp │ │ │ ├── src_corelib_concurrent_qthreadpool.cpp │ │ │ ├── src_corelib_global_qglobal.cpp │ │ │ ├── src_corelib_io_qabstractfileengine.cpp │ │ │ ├── src_corelib_io_qdatastream.cpp │ │ │ ├── src_corelib_io_qdir.cpp │ │ │ ├── src_corelib_io_qdiriterator.cpp │ │ │ ├── src_corelib_io_qfile.cpp │ │ │ ├── src_corelib_io_qfileinfo.cpp │ │ │ ├── src_corelib_io_qiodevice.cpp │ │ │ ├── src_corelib_io_qprocess.cpp │ │ │ ├── src_corelib_io_qsettings.cpp │ │ │ ├── src_corelib_io_qtemporaryfile.cpp │ │ │ ├── src_corelib_io_qtextstream.cpp │ │ │ ├── src_corelib_io_qurl.cpp │ │ │ ├── src_corelib_kernel_qabstracteventdispatcher.cpp │ │ │ ├── src_corelib_kernel_qabstractitemmodel.cpp │ │ │ ├── src_corelib_kernel_qcoreapplication.cpp │ │ │ ├── src_corelib_kernel_qmetaobject.cpp │ │ │ ├── src_corelib_kernel_qmetatype.cpp │ │ │ ├── src_corelib_kernel_qmimedata.cpp │ │ │ ├── src_corelib_kernel_qobject.cpp │ │ │ ├── src_corelib_kernel_qsystemsemaphore.cpp │ │ │ ├── src_corelib_kernel_qtimer.cpp │ │ │ ├── src_corelib_plugin_qlibrary.cpp │ │ │ ├── src_corelib_plugin_quuid.cpp │ │ │ ├── src_corelib_statemachine_qstatemachine.cpp │ │ │ ├── src_corelib_thread_qatomic.cpp │ │ │ ├── src_corelib_thread_qmutex.cpp │ │ │ ├── src_corelib_thread_qmutexpool.cpp │ │ │ ├── src_corelib_thread_qreadwritelock.cpp │ │ │ ├── src_corelib_thread_qsemaphore.cpp │ │ │ ├── src_corelib_thread_qthread.cpp │ │ │ ├── src_corelib_thread_qwaitcondition_unix.cpp │ │ │ ├── src_corelib_tools_qbitarray.cpp │ │ │ ├── src_corelib_tools_qbytearray.cpp │ │ │ ├── src_corelib_tools_qdatetime.cpp │ │ │ ├── src_corelib_tools_qhash.cpp │ │ │ ├── src_corelib_tools_qlinkedlist.cpp │ │ │ ├── src_corelib_tools_qlistdata.cpp │ │ │ ├── src_corelib_tools_qlocale.cpp │ │ │ ├── src_corelib_tools_qmap.cpp │ │ │ ├── src_corelib_tools_qpoint.cpp │ │ │ ├── src_corelib_tools_qqueue.cpp │ │ │ ├── src_corelib_tools_qrect.cpp │ │ │ ├── src_corelib_tools_qregexp.cpp │ │ │ ├── src_corelib_tools_qsize.cpp │ │ │ ├── src_corelib_tools_qstring.cpp │ │ │ ├── src_corelib_tools_qtimeline.cpp │ │ │ ├── src_corelib_tools_qvector.cpp │ │ │ ├── src_corelib_xml_qxmlstream.cpp │ │ │ ├── src_gui_accessible_qaccessible.cpp │ │ │ ├── src_gui_dialogs_qabstractprintdialog.cpp │ │ │ ├── src_gui_dialogs_qfiledialog.cpp │ │ │ ├── src_gui_dialogs_qfontdialog.cpp │ │ │ ├── src_gui_dialogs_qmessagebox.cpp │ │ │ ├── src_gui_dialogs_qwizard.cpp │ │ │ ├── src_gui_effects_qgraphicseffect.cpp │ │ │ ├── src_gui_graphicsview_qgraphicsgridlayout.cpp │ │ │ ├── src_gui_graphicsview_qgraphicsitem.cpp │ │ │ ├── src_gui_graphicsview_qgraphicslinearlayout.cpp │ │ │ ├── src_gui_graphicsview_qgraphicsproxywidget.cpp │ │ │ ├── src_gui_graphicsview_qgraphicsscene.cpp │ │ │ ├── src_gui_graphicsview_qgraphicssceneevent.cpp │ │ │ ├── src_gui_graphicsview_qgraphicsview.cpp │ │ │ ├── src_gui_graphicsview_qgraphicswidget.cpp │ │ │ ├── src_gui_image_qbitmap.cpp │ │ │ ├── src_gui_image_qicon.cpp │ │ │ ├── src_gui_image_qimage.cpp │ │ │ ├── src_gui_image_qimagereader.cpp │ │ │ ├── src_gui_image_qimagewriter.cpp │ │ │ ├── src_gui_image_qmovie.cpp │ │ │ ├── src_gui_image_qpixmap.cpp │ │ │ ├── src_gui_image_qpixmapcache.cpp │ │ │ ├── src_gui_image_qpixmapfilter.cpp │ │ │ ├── src_gui_itemviews_qabstractitemview.cpp │ │ │ ├── src_gui_itemviews_qdatawidgetmapper.cpp │ │ │ ├── src_gui_itemviews_qitemeditorfactory.cpp │ │ │ ├── src_gui_itemviews_qitemselectionmodel.cpp │ │ │ ├── src_gui_itemviews_qstandarditemmodel.cpp │ │ │ ├── src_gui_itemviews_qtablewidget.cpp │ │ │ ├── src_gui_itemviews_qtreewidget.cpp │ │ │ ├── src_gui_kernel_qaction.cpp │ │ │ ├── src_gui_kernel_qapplication.cpp │ │ │ ├── src_gui_kernel_qapplication_x11.cpp │ │ │ ├── src_gui_kernel_qclipboard.cpp │ │ │ ├── src_gui_kernel_qevent.cpp │ │ │ ├── src_gui_kernel_qformlayout.cpp │ │ │ ├── src_gui_kernel_qkeysequence.cpp │ │ │ ├── src_gui_kernel_qlayout.cpp │ │ │ ├── src_gui_kernel_qlayoutitem.cpp │ │ │ ├── src_gui_kernel_qshortcut.cpp │ │ │ ├── src_gui_kernel_qshortcutmap.cpp │ │ │ ├── src_gui_kernel_qsound.cpp │ │ │ ├── src_gui_kernel_qwidget.cpp │ │ │ ├── src_gui_painting_qbrush.cpp │ │ │ ├── src_gui_painting_qcolor.cpp │ │ │ ├── src_gui_painting_qdrawutil.cpp │ │ │ ├── src_gui_painting_qmatrix.cpp │ │ │ ├── src_gui_painting_qpainter.cpp │ │ │ ├── src_gui_painting_qpainterpath.cpp │ │ │ ├── src_gui_painting_qpen.cpp │ │ │ ├── src_gui_painting_qregion.cpp │ │ │ ├── src_gui_painting_qregion_unix.cpp │ │ │ ├── src_gui_painting_qtransform.cpp │ │ │ ├── src_gui_styles_qstyle.cpp │ │ │ ├── src_gui_styles_qstyleoption.cpp │ │ │ ├── src_gui_text_qfont.cpp │ │ │ ├── src_gui_text_qfontmetrics.cpp │ │ │ ├── src_gui_text_qsyntaxhighlighter.cpp │ │ │ ├── src_gui_text_qtextcursor.cpp │ │ │ ├── src_gui_text_qtextdocument.cpp │ │ │ ├── src_gui_text_qtextlayout.cpp │ │ │ ├── src_gui_util_qcompleter.cpp │ │ │ ├── src_gui_util_qdesktopservices.cpp │ │ │ ├── src_gui_util_qundostack.cpp │ │ │ ├── src_gui_widgets_qabstractbutton.cpp │ │ │ ├── src_gui_widgets_qabstractspinbox.cpp │ │ │ ├── src_gui_widgets_qcalendarwidget.cpp │ │ │ ├── src_gui_widgets_qcheckbox.cpp │ │ │ ├── src_gui_widgets_qdatetimeedit.cpp │ │ │ ├── src_gui_widgets_qdockwidget.cpp │ │ │ ├── src_gui_widgets_qframe.cpp │ │ │ ├── src_gui_widgets_qgroupbox.cpp │ │ │ ├── src_gui_widgets_qlabel.cpp │ │ │ ├── src_gui_widgets_qlineedit.cpp │ │ │ ├── src_gui_widgets_qmainwindow.cpp │ │ │ ├── src_gui_widgets_qmenu.cpp │ │ │ ├── src_gui_widgets_qmenubar.cpp │ │ │ ├── src_gui_widgets_qplaintextedit.cpp │ │ │ ├── src_gui_widgets_qpushbutton.cpp │ │ │ ├── src_gui_widgets_qradiobutton.cpp │ │ │ ├── src_gui_widgets_qrubberband.cpp │ │ │ ├── src_gui_widgets_qscrollarea.cpp │ │ │ ├── src_gui_widgets_qspinbox.cpp │ │ │ ├── src_gui_widgets_qsplashscreen.cpp │ │ │ ├── src_gui_widgets_qsplitter.cpp │ │ │ ├── src_gui_widgets_qstatusbar.cpp │ │ │ ├── src_gui_widgets_qtextbrowser.cpp │ │ │ ├── src_gui_widgets_qtextedit.cpp │ │ │ ├── src_gui_widgets_qvalidator.cpp │ │ │ ├── src_gui_widgets_qworkspace.cpp │ │ │ ├── src_network_access_qftp.cpp │ │ │ ├── src_network_access_qhttp.cpp │ │ │ ├── src_network_access_qnetworkaccessmanager.cpp │ │ │ ├── src_network_access_qnetworkdiskcache.cpp │ │ │ ├── src_network_access_qnetworkrequest.cpp │ │ │ ├── src_network_bearer_qnetworkconfigmanager.cpp │ │ │ ├── src_network_kernel_qhostaddress.cpp │ │ │ ├── src_network_kernel_qhostinfo.cpp │ │ │ ├── src_network_kernel_qnetworkproxy.cpp │ │ │ ├── src_network_socket_qabstractsocket.cpp │ │ │ ├── src_network_socket_qlocalsocket_unix.cpp │ │ │ ├── src_network_socket_qnativesocketengine.cpp │ │ │ ├── src_network_socket_qtcpserver.cpp │ │ │ ├── src_network_socket_qudpsocket.cpp │ │ │ ├── src_network_ssl_qsslcertificate.cpp │ │ │ ├── src_network_ssl_qsslconfiguration.cpp │ │ │ ├── src_network_ssl_qsslsocket.cpp │ │ │ ├── src_opengl_qgl.cpp │ │ │ ├── src_opengl_qglcolormap.cpp │ │ │ ├── src_opengl_qglpixelbuffer.cpp │ │ │ ├── src_opengl_qglshaderprogram.cpp │ │ │ ├── src_qtestlib_qtestcase.cpp │ │ │ ├── src_script_qscriptable.cpp │ │ │ ├── src_script_qscriptclass.cpp │ │ │ ├── src_script_qscriptcontext.cpp │ │ │ ├── src_script_qscriptengine.cpp │ │ │ ├── src_script_qscriptengineagent.cpp │ │ │ ├── src_script_qscriptvalue.cpp │ │ │ ├── src_script_qscriptvalueiterator.cpp │ │ │ ├── src_sql_kernel_qsqldatabase.cpp │ │ │ ├── src_sql_kernel_qsqldriver.cpp │ │ │ ├── src_sql_kernel_qsqlerror.cpp │ │ │ ├── src_sql_kernel_qsqlindex.cpp │ │ │ ├── src_sql_kernel_qsqlquery.cpp │ │ │ ├── src_sql_kernel_qsqlresult.cpp │ │ │ ├── src_sql_models_qsqlquerymodel.cpp │ │ │ ├── src_svg_qgraphicssvgitem.cpp │ │ │ ├── src_xml_dom_qdom.cpp │ │ │ ├── src_xml_sax_qxml.cpp │ │ │ ├── src_xmlpatterns_api_qabstracturiresolver.cpp │ │ │ ├── src_xmlpatterns_api_qabstractxmlforwarditerator.cpp │ │ │ ├── src_xmlpatterns_api_qabstractxmlnodemodel.cpp │ │ │ ├── src_xmlpatterns_api_qabstractxmlreceiver.cpp │ │ │ ├── src_xmlpatterns_api_qsimplexmlnodemodel.cpp │ │ │ ├── src_xmlpatterns_api_qxmlformatter.cpp │ │ │ ├── src_xmlpatterns_api_qxmlname.cpp │ │ │ ├── src_xmlpatterns_api_qxmlquery.cpp │ │ │ ├── src_xmlpatterns_api_qxmlresultitems.cpp │ │ │ ├── src_xmlpatterns_api_qxmlserializer.cpp │ │ │ ├── tools_assistant_compat_lib_qassistantclient.cpp │ │ │ ├── tools_designer_src_lib_extension_default_extensionfactory.cpp │ │ │ ├── tools_designer_src_lib_extension_extension.cpp │ │ │ ├── tools_designer_src_lib_extension_qextensionmanager.cpp │ │ │ ├── tools_designer_src_lib_sdk_abstractformeditor.cpp │ │ │ ├── tools_designer_src_lib_sdk_abstractformwindow.cpp │ │ │ ├── tools_designer_src_lib_sdk_abstractformwindowcursor.cpp │ │ │ ├── tools_designer_src_lib_sdk_abstractformwindowmanager.cpp │ │ │ ├── tools_designer_src_lib_sdk_abstractobjectinspector.cpp │ │ │ ├── tools_designer_src_lib_sdk_abstractpropertyeditor.cpp │ │ │ ├── tools_designer_src_lib_sdk_abstractwidgetbox.cpp │ │ │ ├── tools_designer_src_lib_uilib_abstractformbuilder.cpp │ │ │ ├── tools_designer_src_lib_uilib_formbuilder.cpp │ │ │ ├── tools_patternist_qapplicationargumentparser.cpp │ │ │ ├── tools_shared_qtgradienteditor_qtgradientdialog.cpp │ │ │ ├── tools_shared_qtpropertybrowser_qtpropertybrowser.cpp │ │ │ ├── tools_shared_qtpropertybrowser_qtvariantproperty.cpp │ │ │ └── tools_shared_qttoolbardialog_qttoolbardialog.cpp │ │ │ ├── console │ │ │ └── dbus_pingpong.txt │ │ │ ├── coordsys │ │ │ └── coordsys.cpp │ │ │ ├── customstyle │ │ │ ├── customstyle.cpp │ │ │ ├── customstyle.h │ │ │ └── main.cpp │ │ │ ├── customviewstyle.cpp │ │ │ ├── designer │ │ │ ├── autoconnection │ │ │ │ ├── imagedialog.cpp │ │ │ │ ├── imagedialog.h │ │ │ │ ├── imagedialog.ui │ │ │ │ └── main.cpp │ │ │ ├── imagedialog │ │ │ │ ├── imagedialog.ui │ │ │ │ └── main.cpp │ │ │ ├── multipleinheritance │ │ │ │ ├── imagedialog.cpp │ │ │ │ ├── imagedialog.h │ │ │ │ ├── imagedialog.ui │ │ │ │ └── main.cpp │ │ │ ├── noautoconnection │ │ │ │ ├── imagedialog.cpp │ │ │ │ ├── imagedialog.h │ │ │ │ ├── imagedialog.ui │ │ │ │ └── main.cpp │ │ │ └── singleinheritance │ │ │ │ ├── imagedialog.cpp │ │ │ │ ├── imagedialog.h │ │ │ │ ├── imagedialog.ui │ │ │ │ └── main.cpp │ │ │ ├── dialogs │ │ │ └── dialogs.cpp │ │ │ ├── dockwidgets │ │ │ ├── Resources │ │ │ │ ├── modules.html │ │ │ │ ├── qtcore.html │ │ │ │ ├── qtgui.html │ │ │ │ ├── qtnetwork.html │ │ │ │ ├── qtopengl.html │ │ │ │ ├── qtsql.html │ │ │ │ ├── qtxml.html │ │ │ │ └── titles.txt │ │ │ ├── dockwidgets.qrc │ │ │ ├── main.cpp │ │ │ ├── mainwindow.cpp │ │ │ └── mainwindow.h │ │ │ ├── draganddrop │ │ │ ├── dragwidget.cpp │ │ │ ├── dragwidget.h │ │ │ ├── main.cpp │ │ │ ├── mainwindow.cpp │ │ │ └── mainwindow.h │ │ │ ├── dragging │ │ │ ├── images.qrc │ │ │ ├── images │ │ │ │ └── file.png │ │ │ ├── main.cpp │ │ │ ├── mainwindow.cpp │ │ │ └── mainwindow.h │ │ │ ├── dropactions │ │ │ ├── main.cpp │ │ │ ├── window.cpp │ │ │ └── window.h │ │ │ ├── droparea.cpp │ │ │ ├── dropevents │ │ │ ├── main.cpp │ │ │ ├── window.cpp │ │ │ └── window.h │ │ │ ├── droprectangle │ │ │ ├── main.cpp │ │ │ ├── window.cpp │ │ │ └── window.h │ │ │ ├── eventfilters │ │ │ ├── filterobject.cpp │ │ │ ├── filterobject.h │ │ │ └── main.cpp │ │ │ ├── events │ │ │ └── events.cpp │ │ │ ├── explicitlysharedemployee │ │ │ ├── employee.cpp │ │ │ ├── employee.h │ │ │ └── main.cpp │ │ │ ├── file │ │ │ └── file.cpp │ │ │ ├── filedialogurls.cpp │ │ │ ├── fileinfo │ │ │ └── main.cpp │ │ │ ├── graphicssceneadditemsnippet.cpp │ │ │ ├── i18n-non-qt-class │ │ │ ├── main.cpp │ │ │ ├── myclass.cpp │ │ │ ├── myclass.h │ │ │ ├── myclass.ts │ │ │ ├── resources.qrc │ │ │ └── translations │ │ │ │ ├── i18n-non-qt-class_en.ts │ │ │ │ └── i18n-non-qt-class_fr.ts │ │ │ ├── image │ │ │ ├── image.cpp │ │ │ └── supportedformat.cpp │ │ │ ├── inherited-slot │ │ │ ├── button.cpp │ │ │ ├── button.h │ │ │ └── main.cpp │ │ │ ├── itemselection │ │ │ ├── main.cpp │ │ │ └── model.h │ │ │ ├── javastyle.cpp │ │ │ ├── layouts │ │ │ └── layouts.cpp │ │ │ ├── mainwindowsnippet.cpp │ │ │ ├── matrix │ │ │ └── matrix.cpp │ │ │ ├── mdiareasnippets.cpp │ │ │ ├── medianodesnippet.cpp │ │ │ ├── moc │ │ │ ├── main.cpp │ │ │ ├── myclass1.h │ │ │ ├── myclass2.h │ │ │ └── myclass3.h │ │ │ ├── modelview-subclasses │ │ │ ├── main.cpp │ │ │ ├── model.cpp │ │ │ ├── model.h │ │ │ ├── view.cpp │ │ │ ├── view.h │ │ │ ├── window.cpp │ │ │ └── window.h │ │ │ ├── myscrollarea.cpp │ │ │ ├── network │ │ │ └── tcpwait.cpp │ │ │ ├── ntfsp.cpp │ │ │ ├── painterpath │ │ │ └── painterpath.cpp │ │ │ ├── patternist │ │ │ ├── anyHTMLElement.xq │ │ │ ├── anyXLinkAttribute.xq │ │ │ ├── bracesIncluded.xq │ │ │ ├── bracesIncludedResult.xml │ │ │ ├── bracesOmitted.xq │ │ │ ├── bracesOmittedResult.xml │ │ │ ├── computedTreeFragment.xq │ │ │ ├── copyAttribute.xq │ │ │ ├── copyID.xq │ │ │ ├── directTreeFragment.xq │ │ │ ├── doc.txt │ │ │ ├── docPlainHTML.xq │ │ │ ├── docPlainHTML2.xq │ │ │ ├── embedDataInXHTML.xq │ │ │ ├── embedDataInXHTML2.xq │ │ │ ├── emptyParagraphs.xq │ │ │ ├── escapeCurlyBraces.xq │ │ │ ├── escapeStringLiterals.xml │ │ │ ├── escapeStringLiterals.xq │ │ │ ├── expressionInsideAttribute.xq │ │ │ ├── filterOnPath.xq │ │ │ ├── filterOnStep.xq │ │ │ ├── firstParagraph.xq │ │ │ ├── fnStringOnAttribute.xq │ │ │ ├── forClause.xq │ │ │ ├── forClause2.xq │ │ │ ├── forClauseOnFeed.xq │ │ │ ├── indented.xml │ │ │ ├── introAcneRemover.xq │ │ │ ├── introExample2.xq │ │ │ ├── introFileHierarchy.xml │ │ │ ├── introNavigateFS.xq │ │ │ ├── introductionExample.xq │ │ │ ├── invalidLetOrderBy.xq │ │ │ ├── items.xq │ │ │ ├── letOrderBy.xq │ │ │ ├── literalsAndOperators.xq │ │ │ ├── mobeyDick.xml │ │ │ ├── nextLastParagraph.xq │ │ │ ├── nodeConstructorsAreExpressions.xq │ │ │ ├── nodeConstructorsInPaths.xq │ │ │ ├── nodeTestChildElement.xq │ │ │ ├── notIndented.xml │ │ │ ├── oneElementConstructor.xq │ │ │ ├── paragraphsExceptTheFiveFirst.xq │ │ │ ├── paragraphsWithTables.xq │ │ │ ├── pathAB.xq │ │ │ ├── pathsAllParagraphs.xq │ │ │ ├── simpleHTML.xq │ │ │ ├── simpleXHTML.xq │ │ │ ├── svgDocumentElement.xml │ │ │ ├── tablesInParagraphs.xq │ │ │ ├── twoSVGElements.xq │ │ │ ├── xmlStylesheet.xq │ │ │ ├── xsBooleanTrue.xq │ │ │ └── xsvgDocumentElement.xml │ │ │ ├── persistentindexes │ │ │ ├── main.cpp │ │ │ ├── mainwindow.cpp │ │ │ ├── mainwindow.h │ │ │ └── model.h │ │ │ ├── phonon.cpp │ │ │ ├── phonon │ │ │ └── samplebackend │ │ │ │ └── main.cpp │ │ │ ├── phononeffectparameter.cpp │ │ │ ├── phononobjectdescription.cpp │ │ │ ├── picture │ │ │ └── picture.cpp │ │ │ ├── plaintextlayout │ │ │ ├── main.cpp │ │ │ ├── window.cpp │ │ │ └── window.h │ │ │ ├── pointer │ │ │ └── pointer.cpp │ │ │ ├── polygon │ │ │ └── polygon.cpp │ │ │ ├── porting4-dropevents │ │ │ ├── main.cpp │ │ │ ├── window.cpp │ │ │ └── window.h │ │ │ ├── printing-qprinter │ │ │ ├── errors.cpp │ │ │ ├── main.cpp │ │ │ ├── object.cpp │ │ │ └── object.h │ │ │ ├── process │ │ │ └── process.cpp │ │ │ ├── qabstractsliderisnippet.cpp │ │ │ ├── qcalendarwidget │ │ │ └── main.cpp │ │ │ ├── qcolumnview │ │ │ └── main.cpp │ │ │ ├── qdebug │ │ │ └── qdebugsnippet.cpp │ │ │ ├── qdir-filepaths │ │ │ └── main.cpp │ │ │ ├── qdir-listfiles │ │ │ └── main.cpp │ │ │ ├── qdir-namefilters │ │ │ └── main.cpp │ │ │ ├── qelapsedtimer │ │ │ └── main.cpp │ │ │ ├── qfontdatabase │ │ │ └── main.cpp │ │ │ ├── qgl-namespace │ │ │ └── main.cpp │ │ │ ├── qlabel │ │ │ └── main.cpp │ │ │ ├── qlineargradient │ │ │ ├── main.cpp │ │ │ ├── paintwidget.cpp │ │ │ └── paintwidget.h │ │ │ ├── qlistview-dnd │ │ │ ├── main.cpp │ │ │ ├── mainwindow.cpp │ │ │ ├── mainwindow.h │ │ │ ├── model.cpp │ │ │ └── model.h │ │ │ ├── qlistview-using │ │ │ ├── main.cpp │ │ │ ├── mainwindow.cpp │ │ │ ├── mainwindow.h │ │ │ └── model.h │ │ │ ├── qlistwidget-dnd │ │ │ ├── main.cpp │ │ │ ├── mainwindow.cpp │ │ │ └── mainwindow.h │ │ │ ├── qlistwidget-using │ │ │ ├── main.cpp │ │ │ ├── mainwindow.cpp │ │ │ └── mainwindow.h │ │ │ ├── qmacnativewidget │ │ │ └── main.mm │ │ │ ├── qmake │ │ │ ├── delegate.h │ │ │ ├── main.cpp │ │ │ ├── model.cpp │ │ │ ├── model.h │ │ │ ├── paintwidget_unix.cpp │ │ │ └── view.h │ │ │ ├── qmetaobject-invokable │ │ │ ├── main.cpp │ │ │ ├── window.cpp │ │ │ └── window.h │ │ │ ├── qprocess-environment │ │ │ └── main.cpp │ │ │ ├── qprocess │ │ │ └── qprocess-simpleexecution.cpp │ │ │ ├── qsignalmapper │ │ │ ├── buttonwidget.cpp │ │ │ ├── buttonwidget.h │ │ │ ├── main.cpp │ │ │ └── mainwindow.h │ │ │ ├── qsortfilterproxymodel-details │ │ │ └── main.cpp │ │ │ ├── qsortfilterproxymodel │ │ │ └── main.cpp │ │ │ ├── qsplashscreen │ │ │ ├── main.cpp │ │ │ ├── mainwindow.cpp │ │ │ ├── mainwindow.h │ │ │ ├── qsplashscreen.qrc │ │ │ └── splash.png │ │ │ ├── qsql-namespace │ │ │ └── main.cpp │ │ │ ├── qstack │ │ │ └── main.cpp │ │ │ ├── qstackedlayout │ │ │ └── main.cpp │ │ │ ├── qstackedwidget │ │ │ └── main.cpp │ │ │ ├── qstandarditemmodel │ │ │ └── main.cpp │ │ │ ├── qstatustipevent │ │ │ └── main.cpp │ │ │ ├── qstringlistmodel │ │ │ └── main.cpp │ │ │ ├── qstyleoption │ │ │ └── main.cpp │ │ │ ├── qstyleplugin │ │ │ └── main.cpp │ │ │ ├── qsvgwidget │ │ │ ├── main.cpp │ │ │ ├── qsvgwidget.qrc │ │ │ ├── spheres.svg │ │ │ └── sunflower.svg │ │ │ ├── qt-namespace │ │ │ └── main.cpp │ │ │ ├── qtablewidget-dnd │ │ │ ├── Images │ │ │ │ ├── cubed.png │ │ │ │ └── squared.png │ │ │ ├── images.qrc │ │ │ ├── main.cpp │ │ │ ├── mainwindow.cpp │ │ │ └── mainwindow.h │ │ │ ├── qtablewidget-resizing │ │ │ ├── main.cpp │ │ │ ├── mainwindow.cpp │ │ │ └── mainwindow.h │ │ │ ├── qtablewidget-using │ │ │ ├── Images │ │ │ │ ├── cubed.png │ │ │ │ └── squared.png │ │ │ ├── images.qrc │ │ │ ├── main.cpp │ │ │ ├── mainwindow.cpp │ │ │ └── mainwindow.h │ │ │ ├── qtcast │ │ │ ├── qtcast.cpp │ │ │ └── qtcast.h │ │ │ ├── qtest-namespace │ │ │ └── main.cpp │ │ │ ├── qtreeview-dnd │ │ │ ├── dragdropmodel.h │ │ │ ├── main.cpp │ │ │ ├── mainwindow.cpp │ │ │ ├── mainwindow.h │ │ │ ├── treeitem.cpp │ │ │ ├── treeitem.h │ │ │ ├── treemodel.cpp │ │ │ └── treemodel.h │ │ │ ├── qtreewidget-using │ │ │ ├── main.cpp │ │ │ ├── mainwindow.cpp │ │ │ └── mainwindow.h │ │ │ ├── qtreewidgetitemiterator-using │ │ │ ├── main.cpp │ │ │ ├── mainwindow.cpp │ │ │ └── mainwindow.h │ │ │ ├── qtscript │ │ │ ├── evaluation │ │ │ │ └── main.cpp │ │ │ ├── registeringobjects │ │ │ │ ├── main.cpp │ │ │ │ ├── myobject.cpp │ │ │ │ └── myobject.h │ │ │ ├── registeringvalues │ │ │ │ └── main.cpp │ │ │ └── scriptedslot │ │ │ │ ├── main.cpp │ │ │ │ ├── object.js │ │ │ │ └── scriptedslot.qrc │ │ │ ├── quiloader │ │ │ ├── main.cpp │ │ │ ├── myform.ui │ │ │ ├── mywidget.cpp │ │ │ ├── mywidget.h │ │ │ └── mywidget.qrc │ │ │ ├── qx11embedcontainer │ │ │ └── main.cpp │ │ │ ├── qx11embedwidget │ │ │ ├── embedwidget.cpp │ │ │ ├── embedwidget.h │ │ │ └── main.cpp │ │ │ ├── qxmlquery │ │ │ └── bindingExample.cpp │ │ │ ├── qxmlschema │ │ │ └── main.cpp │ │ │ ├── qxmlschemavalidator │ │ │ └── main.cpp │ │ │ ├── qxmlstreamwriter │ │ │ └── main.cpp │ │ │ ├── reading-selections │ │ │ ├── main.cpp │ │ │ ├── model.h │ │ │ ├── window.cpp │ │ │ └── window.h │ │ │ ├── scribe-overview │ │ │ └── main.cpp │ │ │ ├── scriptdebugger.cpp │ │ │ ├── seekslider.cpp │ │ │ ├── separations │ │ │ ├── finalwidget.cpp │ │ │ ├── finalwidget.h │ │ │ ├── main.cpp │ │ │ ├── screenwidget.cpp │ │ │ ├── screenwidget.h │ │ │ ├── viewer.cpp │ │ │ └── viewer.h │ │ │ ├── settings │ │ │ └── settings.cpp │ │ │ ├── shareddirmodel │ │ │ └── main.cpp │ │ │ ├── sharedemployee │ │ │ ├── employee.cpp │ │ │ ├── employee.h │ │ │ └── main.cpp │ │ │ ├── sharedtablemodel │ │ │ ├── main.cpp │ │ │ └── model.h │ │ │ ├── signalmapper │ │ │ ├── accountsfile.txt │ │ │ ├── filereader.cpp │ │ │ ├── filereader.h │ │ │ ├── main.cpp │ │ │ ├── reportfile.txt │ │ │ └── taxfile.txt │ │ │ ├── signalsandslots │ │ │ ├── lcdnumber.cpp │ │ │ ├── lcdnumber.h │ │ │ ├── signalsandslots.cpp │ │ │ └── signalsandslots.h │ │ │ ├── simplemodel-use │ │ │ └── main.cpp │ │ │ ├── splitter │ │ │ └── splitter.cpp │ │ │ ├── splitterhandle │ │ │ ├── main.cpp │ │ │ ├── splitter.cpp │ │ │ └── splitter.h │ │ │ ├── sqldatabase │ │ │ └── sqldatabase.cpp │ │ │ ├── streaming │ │ │ └── main.cpp │ │ │ ├── stringlistmodel │ │ │ ├── main.cpp │ │ │ ├── model.cpp │ │ │ └── model.h │ │ │ ├── styles │ │ │ └── styles.cpp │ │ │ ├── stylesheet │ │ │ └── common-mistakes.cpp │ │ │ ├── textblock-formats │ │ │ └── main.cpp │ │ │ ├── textblock-fragments │ │ │ ├── main.cpp │ │ │ ├── mainwindow.cpp │ │ │ ├── mainwindow.h │ │ │ ├── xmlwriter.cpp │ │ │ └── xmlwriter.h │ │ │ ├── textdocument-blocks │ │ │ ├── main.cpp │ │ │ ├── mainwindow.cpp │ │ │ ├── mainwindow.h │ │ │ ├── xmlwriter.cpp │ │ │ └── xmlwriter.h │ │ │ ├── textdocument-charformats │ │ │ └── main.cpp │ │ │ ├── textdocument-css │ │ │ └── main.cpp │ │ │ ├── textdocument-cursors │ │ │ └── main.cpp │ │ │ ├── textdocument-find │ │ │ └── main.cpp │ │ │ ├── textdocument-frames │ │ │ ├── main.cpp │ │ │ ├── mainwindow.cpp │ │ │ ├── mainwindow.h │ │ │ ├── xmlwriter.cpp │ │ │ └── xmlwriter.h │ │ │ ├── textdocument-imagedrop │ │ │ ├── main.cpp │ │ │ ├── textedit.cpp │ │ │ └── textedit.h │ │ │ ├── textdocument-imageformat │ │ │ ├── images.qrc │ │ │ ├── images │ │ │ │ ├── advert.png │ │ │ │ └── newimage.png │ │ │ └── main.cpp │ │ │ ├── textdocument-images │ │ │ ├── images.qrc │ │ │ ├── images │ │ │ │ └── advert.png │ │ │ └── main.cpp │ │ │ ├── textdocument-listitems │ │ │ ├── main.cpp │ │ │ ├── mainwindow.cpp │ │ │ └── mainwindow.h │ │ │ ├── textdocument-lists │ │ │ ├── main.cpp │ │ │ ├── mainwindow.cpp │ │ │ └── mainwindow.h │ │ │ ├── textdocument-printing │ │ │ ├── main.cpp │ │ │ ├── mainwindow.cpp │ │ │ └── mainwindow.h │ │ │ ├── textdocument-selections │ │ │ ├── main.cpp │ │ │ ├── mainwindow.cpp │ │ │ └── mainwindow.h │ │ │ ├── textdocument-tables │ │ │ ├── main.cpp │ │ │ ├── mainwindow.cpp │ │ │ ├── mainwindow.h │ │ │ ├── xmlwriter.cpp │ │ │ └── xmlwriter.h │ │ │ ├── textdocument-texttable │ │ │ └── main.cpp │ │ │ ├── textdocumentendsnippet.cpp │ │ │ ├── threads │ │ │ ├── threads.cpp │ │ │ └── threads.h │ │ │ ├── timeline │ │ │ └── main.cpp │ │ │ ├── timers │ │ │ └── timers.cpp │ │ │ ├── transform │ │ │ └── main.cpp │ │ │ ├── uitools │ │ │ └── calculatorform │ │ │ │ ├── calculatorform.ui │ │ │ │ └── main.cpp │ │ │ ├── updating-selections │ │ │ ├── main.cpp │ │ │ ├── model.h │ │ │ ├── window.cpp │ │ │ └── window.h │ │ │ ├── videomedia.cpp │ │ │ ├── volumeslider.cpp │ │ │ ├── webkit │ │ │ └── webpage │ │ │ │ └── main.cpp │ │ │ ├── whatsthis │ │ │ └── whatsthis.cpp │ │ │ ├── widget-mask │ │ │ ├── main.cpp │ │ │ ├── mask.qrc │ │ │ └── tux.png │ │ │ ├── widgetdelegate.cpp │ │ │ ├── widgets-tutorial │ │ │ ├── childwidget │ │ │ │ └── main.cpp │ │ │ ├── nestedlayouts │ │ │ │ └── main.cpp │ │ │ ├── toplevel │ │ │ │ └── main.cpp │ │ │ └── windowlayout │ │ │ │ └── main.cpp │ │ │ └── xml │ │ │ ├── rsslisting │ │ │ ├── handler.cpp │ │ │ ├── handler.h │ │ │ ├── main.cpp │ │ │ ├── rsslisting.cpp │ │ │ └── rsslisting.h │ │ │ └── simpleparse │ │ │ ├── handler.cpp │ │ │ ├── handler.h │ │ │ └── main.cpp │ ├── examples │ │ ├── dbus │ │ │ ├── example-client.py │ │ │ └── example-server.py │ │ ├── declarative │ │ │ └── cppextensions │ │ │ │ ├── imageprovider │ │ │ │ ├── imageprovider-example.qml │ │ │ │ └── imageprovider.cpp │ │ │ │ └── plugins │ │ │ │ ├── plugin.cpp │ │ │ │ └── plugins.qml │ │ ├── dialogs │ │ │ ├── classwizard │ │ │ │ ├── classwizard.cpp │ │ │ │ ├── classwizard.qrc │ │ │ │ ├── images │ │ │ │ │ ├── background.png │ │ │ │ │ ├── banner.png │ │ │ │ │ ├── logo1.png │ │ │ │ │ ├── logo2.png │ │ │ │ │ ├── logo3.png │ │ │ │ │ ├── watermark1.png │ │ │ │ │ └── watermark2.png │ │ │ │ └── main.cpp │ │ │ ├── extension │ │ │ │ └── finddialog.cpp │ │ │ ├── licensewizard │ │ │ │ ├── images │ │ │ │ │ ├── logo.png │ │ │ │ │ └── watermark.png │ │ │ │ ├── licensewizard.cpp │ │ │ │ ├── licensewizard.h │ │ │ │ ├── licensewizard.qrc │ │ │ │ └── main.cpp │ │ │ ├── standarddialogs │ │ │ │ └── dialog.cpp │ │ │ ├── tabdialog │ │ │ │ └── tabdialog.cpp │ │ │ └── trivialwizard │ │ │ │ └── trivialwizard.cpp │ │ ├── graphicsview │ │ │ └── simpleanchorlayout │ │ │ │ └── main.cpp │ │ ├── itemviews │ │ │ ├── customsortfiltermodel │ │ │ │ └── mysortfilterproxymodel.cpp │ │ │ ├── pixelator │ │ │ │ └── pixeldelegate.cpp │ │ │ └── simpledommodel │ │ │ │ └── dommodel.cpp │ │ ├── linguist │ │ │ └── hellotr │ │ │ │ └── main.cpp │ │ ├── mainwindows │ │ │ ├── application │ │ │ │ └── mainwindow.cpp │ │ │ ├── dockwidgets │ │ │ │ └── mainwindow.cpp │ │ │ ├── mainwindow.cpp │ │ │ ├── mdi │ │ │ │ └── mainwindow.cpp │ │ │ ├── menus │ │ │ │ └── mainwindow.cpp │ │ │ └── sdi │ │ │ │ └── mainwindow.cpp │ │ ├── painting │ │ │ └── svggenerator │ │ │ │ └── window.cpp │ │ ├── richtext │ │ │ └── textobject │ │ │ │ └── svgtextobject.h │ │ ├── sql │ │ │ ├── querymodel │ │ │ │ └── editablesqlmodel.cpp │ │ │ └── relationaltablemodel │ │ │ │ └── relationaltablemodel.cpp │ │ ├── uitools │ │ │ └── textfinder │ │ │ │ └── textfinder.cpp │ │ ├── widgets │ │ │ ├── analogclock │ │ │ │ └── analogclock.cpp │ │ │ ├── groupbox │ │ │ │ └── window.cpp │ │ │ ├── icons │ │ │ │ └── iconsizespinbox.cpp │ │ │ └── spinboxes │ │ │ │ └── window.cpp │ │ └── xml │ │ │ └── streambookmarks │ │ │ ├── xbelreader.cpp │ │ │ ├── xbelreader.h │ │ │ └── xbelwriter.cpp │ ├── snippets │ │ ├── customstyle │ │ │ └── main.cpp │ │ ├── phonon.cpp │ │ ├── phonon │ │ │ └── samplebackend │ │ │ │ └── main.cpp │ │ └── textdocument-resources │ │ │ └── main.cpp │ └── webkitsnippets │ │ ├── qtwebkit_qwebinspector_snippet.cpp │ │ ├── qtwebkit_qwebview_snippet.cpp │ │ ├── simple │ │ └── main.cpp │ │ ├── webelement │ │ └── main.cpp │ │ └── webpage │ │ └── main.cpp ├── conf.py.in ├── contents.rst ├── extras │ ├── PySide.QtCore.ClassInfo.rst │ ├── PySide.QtCore.Signal.rst │ ├── PySide.QtCore.Slot.rst │ ├── PySide.QtCore.rst │ ├── PySide.QtDeclarative.ListProperty.rst │ ├── PySide.QtDeclarative.rst │ ├── PySide.QtGui.rst │ ├── PySide.QtHelp.rst │ ├── PySide.QtMultimedia.rst │ ├── PySide.QtNetwork.rst │ ├── PySide.QtOpenGL.rst │ ├── PySide.QtScript.rst │ ├── PySide.QtScriptTools.rst │ ├── PySide.QtSql.rst │ ├── PySide.QtSvg.rst │ ├── PySide.QtTest.rst │ ├── PySide.QtUiTools.rst │ ├── PySide.QtWebKit.rst │ ├── PySide.QtXml.rst │ ├── PySide.QtXmlPatterns.rst │ └── PySide.phonon.rst ├── inheritance_diagram.py ├── modules.rst ├── pyhtml2devhelp.py ├── pyside.qdocconf.in ├── pysideapi2.rst ├── pysideinclude.py ├── pysideversion.rst ├── tutorials │ ├── index.rst │ ├── qmladvancedtutorial │ │ ├── declarative-adv-tutorial1.png │ │ ├── declarative-adv-tutorial2.png │ │ ├── declarative-adv-tutorial3.png │ │ ├── declarative-adv-tutorial4.gif │ │ ├── declarative-samegame.png │ │ ├── index.rst │ │ ├── samegame.tar.bz2 │ │ ├── samegame │ │ │ ├── samegame1 │ │ │ │ ├── Block.qml │ │ │ │ ├── Button.qml │ │ │ │ ├── samegame.qml │ │ │ │ └── samegame1.qmlproject │ │ │ ├── samegame2 │ │ │ │ ├── Block.qml │ │ │ │ ├── Button.qml │ │ │ │ ├── samegame.js │ │ │ │ ├── samegame.qml │ │ │ │ └── samegame2.qmlproject │ │ │ ├── samegame3 │ │ │ │ ├── Block.qml │ │ │ │ ├── Button.qml │ │ │ │ ├── Dialog.qml │ │ │ │ ├── samegame.js │ │ │ │ ├── samegame.qml │ │ │ │ └── samegame3.qmlproject │ │ │ ├── samegame4 │ │ │ │ ├── content │ │ │ │ │ ├── BoomBlock.qml │ │ │ │ │ ├── Button.qml │ │ │ │ │ ├── Dialog.qml │ │ │ │ │ └── samegame.js │ │ │ │ ├── highscores │ │ │ │ │ ├── README │ │ │ │ │ ├── score_data.xml │ │ │ │ │ ├── score_style.xsl │ │ │ │ │ └── scores.php │ │ │ │ ├── samegame.qml │ │ │ │ └── samegame4.qmlproject │ │ │ └── shared │ │ │ │ └── pics │ │ │ │ ├── background.jpg │ │ │ │ ├── blueStar.png │ │ │ │ ├── blueStone.png │ │ │ │ ├── greenStar.png │ │ │ │ ├── greenStone.png │ │ │ │ ├── redStar.png │ │ │ │ ├── redStone.png │ │ │ │ ├── star.png │ │ │ │ └── yellowStone.png │ │ ├── samegame1.rst │ │ ├── samegame2.rst │ │ ├── samegame3.rst │ │ └── samegame4.rst │ └── qmltutorial │ │ ├── declarative-tutorial1.png │ │ ├── declarative-tutorial2.png │ │ ├── declarative-tutorial3_animation.gif │ │ ├── helloworld.tar.bz2 │ │ ├── helloworld │ │ ├── Cell.qml │ │ ├── tutorial1.qml │ │ ├── tutorial2.qml │ │ └── tutorial3.qml │ │ ├── index.rst │ │ ├── step1.rst │ │ ├── step2.rst │ │ └── step3.rst └── typesystem_doc.xml.in ├── libpyside ├── CMakeLists.txt ├── PySideConfig-spec.cmake.in ├── PySideConfig.cmake.in ├── PySideConfigVersion.cmake.in ├── destroylistener.cpp ├── destroylistener.h ├── dynamicqmetaobject.cpp ├── dynamicqmetaobject.h ├── dynamicqmetaobject_p.h ├── globalreceiver.cpp ├── globalreceiver.h ├── globalreceiverv2.cpp ├── globalreceiverv2.h ├── pyside.cpp ├── pyside.h ├── pyside.pc.in ├── pysideclassinfo.cpp ├── pysideclassinfo.h ├── pysideclassinfo_p.h ├── pysideconversions.h ├── pysidemacros.h ├── pysidemetafunction.cpp ├── pysidemetafunction.h ├── pysidemetafunction_p.h ├── pysideproperty.cpp ├── pysideproperty.h ├── pysideproperty_p.h ├── pysideqflags.cpp ├── pysideqflags.h ├── pysidesignal.cpp ├── pysidesignal.h ├── pysidesignal_p.h ├── pysideslot.cpp ├── pysideslot_p.h ├── pysideweakref.cpp ├── pysideweakref.h ├── signalmanager.cpp └── signalmanager.h ├── plugins ├── CMakeLists.txt ├── customwidget.cpp ├── customwidget.h ├── customwidgets.cpp └── customwidgets.h └── tests ├── CMakeLists.txt ├── QtCore ├── CMakeLists.txt ├── blocking_signals_test.py ├── bug_1019.py ├── bug_1031.py ├── bug_1063.py ├── bug_1069.py ├── bug_278_test.py ├── bug_332.py ├── bug_408.py ├── bug_428.py ├── bug_462.py ├── bug_505.py ├── bug_515.py ├── bug_606.py ├── bug_656.py ├── bug_686.py ├── bug_699.py ├── bug_706.py ├── bug_723.py ├── bug_724.py ├── bug_820.py ├── bug_826.py ├── bug_829.py ├── bug_835.py ├── bug_920.py ├── bug_927.py ├── bug_931.py ├── bug_938.py ├── bug_953.py ├── bug_987.py ├── bug_994.py ├── bug_PYSIDE-164.py ├── bug_PYSIDE-42.py ├── child_event_test.py ├── classinfo_test.py ├── deepcopy_test.py ├── deletelater_test.py ├── destroysignal_test.py ├── duck_punching_test.py ├── hash_test.py ├── inherits_test.py ├── max_signals.py ├── missing_symbols_test.py ├── mockclass_test.py ├── python_conversion.py ├── qabs_test.py ├── qabstractfileengine_test.py ├── qabstractitemmodel_test.py ├── qabstracttransition_test.py ├── qanimationgroup_test.py ├── qbitarray_test.py ├── qbytearray_buffer_protocol_test.py ├── qbytearray_concatenation_operator_test.py ├── qbytearray_operator_iadd_test.py ├── qbytearray_operator_test.py ├── qbytearray_test.py ├── qcoreapplication_instance_test.py ├── qdatastream_test.py ├── qdate_test.py ├── qdatetime_test.py ├── qeasingcurve_test.py ├── qenum_test.py ├── qevent_test.py ├── qfile_test.py ├── qfileinfo_test.py ├── qflags_test.py ├── qhandle_test.py ├── qinstallmsghandler_test.py ├── qlinef_test.py ├── qlocale_test.py ├── qmetaobject_test.py ├── qmodelindex_internalpointer_test.py ├── qobject_children_segfault_test.py ├── qobject_connect_notify_test.py ├── qobject_destructor.py ├── qobject_event_filter_test.py ├── qobject_inherits_test.py ├── qobject_objectproperty_test.py ├── qobject_parent_test.py ├── qobject_property_test.py ├── qobject_protected_methods_test.py ├── qobject_test.py ├── qobject_timer_event_test.py ├── qobject_tr_as_instance_test.py ├── qpoint_test.py ├── qprocess_test.py ├── qproperty_decorator.py ├── qrect_test.py ├── qregexp_test.py ├── qresource_test.py ├── qsize_test.py ├── qslot_object_test.py ├── qsrand_test.py ├── qstate_test.py ├── qstatemachine_test.py ├── qstring_test.py ├── qsysinfo_test.py ├── qtext_codec_test.py ├── qtextstream_test.py ├── qthread_prod_cons_test.py ├── qthread_signal_test.py ├── qthread_test.py ├── qtimer_singleshot_test.py ├── qtimer_timeout_test.py ├── qtnamespace_test.py ├── quoteEnUS.txt ├── qurl_test.py ├── repr_test.py ├── resources.qrc ├── resources_mc.py ├── sample.png ├── setprop_on_ctor_test.py ├── staticMetaObject_test.py ├── static_method_test.py ├── static_protected_methods_test.py ├── thread_signals_test.py ├── tr_noop_test.py ├── translation_test.py ├── translations │ ├── trans_latin.qm │ ├── trans_latin.ts │ ├── trans_russian.qm │ └── trans_russian.ts ├── unaryoperator_test.py ├── unicode_test.py └── versioninfo_test.py ├── QtDeclarative ├── CMakeLists.txt ├── bug_1029.py ├── bug_1029.qml ├── bug_451.py ├── bug_451.qml ├── bug_456.py ├── bug_456.qml ├── bug_557.py ├── bug_726.py ├── bug_726.qml ├── bug_814.py ├── bug_814.qml ├── bug_825.py ├── bug_825.qml ├── bug_847.py ├── bug_847.qml ├── bug_915.py ├── bug_926.py ├── bug_926.qml ├── bug_951.py ├── bug_951.qml ├── bug_995.py ├── bug_995.qml ├── bug_997.py ├── bug_997.qml ├── connect_python_qml.py ├── connect_python_qml.qml ├── hw.qml ├── qdeclarativenetwork_test.py ├── qdeclarativeview_test.py ├── registertype.py ├── registertype.qml ├── view.qml └── viewmodel.qml ├── QtGui ├── CMakeLists.txt ├── action_clear.py ├── add_action_test.py ├── api2_test.py ├── bug_1002.py ├── bug_1006.py ├── bug_1048.py ├── bug_1077.py ├── bug_1091.py ├── bug_172.py ├── bug_243.py ├── bug_300_test.py ├── bug_307.py ├── bug_324.py ├── bug_338.py ├── bug_363.py ├── bug_367.py ├── bug_389.py ├── bug_400.py ├── bug_416.py ├── bug_429.py ├── bug_430.py ├── bug_433.py ├── bug_467.py ├── bug_480.py ├── bug_493.py ├── bug_500.py ├── bug_512.py ├── bug_525.py ├── bug_546.py ├── bug_547.py ├── bug_549.py ├── bug_569.py ├── bug_575.py ├── bug_576.py ├── bug_585.py ├── bug_589.py ├── bug_606.py ├── bug_617.py ├── bug_632.py ├── bug_635.py ├── bug_640.py ├── bug_652.py ├── bug_653.py ├── bug_660.py ├── bug_662.py ├── bug_667.py ├── bug_668.py ├── bug_674.py ├── bug_675.py ├── bug_688.py ├── bug_693.py ├── bug_696.py ├── bug_711.py ├── bug_714.py ├── bug_716.py ├── bug_722.py ├── bug_728.py ├── bug_736.py ├── bug_740.py ├── bug_743.py ├── bug_750.py ├── bug_778.py ├── bug_785.py ├── bug_793.py ├── bug_811.py ├── bug_834.py ├── bug_836.py ├── bug_844.py ├── bug_854.py ├── bug_860.py ├── bug_862.py ├── bug_871.py ├── bug_879.py ├── bug_882.py ├── bug_919.py ├── bug_921.py ├── bug_941.py ├── bug_964.py ├── bug_967.py ├── bug_972.py ├── bug_979.py ├── bug_988.py ├── bug_991.py ├── bug_998.py ├── bug_PYSIDE-41.py ├── customproxywidget_test.py ├── deepcopy_test.py ├── event_filter_test.py ├── float_to_int_implicit_conversion_test.py ├── grandparent_method_test.py ├── hashabletype_test.py ├── import_test.py ├── keep_reference_test.py ├── missing_symbols_test.py ├── paint_event_test.py ├── parent_method_test.py ├── pyside_reload_test.py ├── python_properties_test.py ├── qabstracttextdocumentlayout_test.py ├── qaction_test.py ├── qapp_test.py ├── qapplication_exit_segfault_test.py ├── qapplication_singleton_test.py ├── qbrush_test.py ├── qcolor_reduce_test.py ├── qcolor_test.py ├── qcursor_test.py ├── qdatastream_gui_operators_test.py ├── qdynamic_signal.py ├── qfontdialog_test.py ├── qfontmetrics_test.py ├── qformlayout_test.py ├── qgraphicsitem_isblocked_test.py ├── qgraphicsitem_test.py ├── qgraphicsproxywidget_test.py ├── qgraphicsscene_test.py ├── qicon_test.py ├── qimage_test.py ├── qinputcontext_test.py ├── qinputdialog_get_test.py ├── qitemselection_test.py ├── qkeysequence_test.py ├── qlayout_ref_test.py ├── qlayout_test.py ├── qlcdnumber_test.py ├── qlistwidget_test.py ├── qlistwidgetitem_test.py ├── qmainwindow_test.py ├── qmatrix_test.py ├── qmenu_test.py ├── qmenuadd_test.py ├── qobject_mi_test.py ├── qpainter_test.py ├── qpen_test.py ├── qpicture_test.py ├── qpixmap_constructor.py ├── qpixmap_test.py ├── qpixmapcache_test.py ├── qpolygonf_test.py ├── qpushbutton_test.py ├── qradialgradient_test.py ├── qregion_test.py ├── qshortcut_test.py ├── qsplitter_test.py ├── qstandarditemmodel_test.py ├── qstring_qkeysequence_test.py ├── qstyle_test.py ├── qtableview_test.py ├── qtabwidget_test.py ├── qtextdocument_undoredo_test.py ├── qtextedit_signal_test.py ├── qtextedit_test.py ├── qtextline_test.py ├── qtoolbar_test.py ├── qtoolbox_test.py ├── qtransform_test.py ├── qvalidator_test.py ├── qvariant_test.py ├── qwidget_setlayout_test.py ├── qwidget_test.py ├── reference_count_test.py ├── repr_test.py ├── returnquadruplesofnumbers_test.py ├── sample.png ├── standardpixmap_test.py ├── test_module_template.py ├── timed_app_test.py ├── virtual_protected_inheritance_test.py ├── virtual_pure_override_test.py ├── wrong_return_test.py └── x11_symbols_test.py ├── QtHelp ├── CMakeLists.txt └── help_test.py ├── QtMaemo5 ├── CMakeLists.txt ├── pickselector_test.py └── qmaemo5import_test.py ├── QtMultimedia ├── CMakeLists.txt └── audio_test.py ├── QtNetwork ├── CMakeLists.txt ├── accessManager_test.py ├── basic_auth_test.py ├── bug_1084.py ├── bug_446.py ├── http_test.py ├── qipv6address_test.py ├── tcpserver_test.py └── udpsocket_test.py ├── QtOpenGL ├── CMakeLists.txt ├── qglbuffer_test.py └── qglwidget_test.py ├── QtScript ├── CMakeLists.txt ├── base_test.py ├── bug_1022.py ├── engine_test.py ├── property_test.py └── qscriptvalue_test.py ├── QtScriptTools ├── CMakeLists.txt └── debugger_test.py ├── QtSql ├── CMakeLists.txt ├── bug_1013.py ├── qsqldatabaseandqueries_test.py └── qvarianttype_test.py ├── QtSvg ├── CMakeLists.txt ├── qsvggenerator_test.py ├── qsvgrenderer_test.py ├── qsvgwidget_test.py └── tiger.svg ├── QtTest ├── CMakeLists.txt ├── click_test.py ├── eventfilter_test.py └── touchevent_test.py ├── QtUiTools ├── CMakeLists.txt ├── action.ui ├── bug_1060.py ├── bug_1060.ui ├── bug_360.py ├── bug_376.py ├── bug_392.py ├── bug_426.py ├── bug_426.ui ├── bug_552.py ├── bug_552.ui ├── bug_797.py ├── bug_909.py ├── bug_909.ui ├── bug_913.py ├── bug_913.ui ├── bug_958.py ├── bug_958.ui ├── bug_965.py ├── bug_965.ui ├── minimal.ui ├── pycustomwidget.ui ├── pycustomwidget2.ui ├── test.ui ├── ui_test.py └── uiloader_test.py ├── QtWebKit ├── CMakeLists.txt ├── bug_448.py ├── bug_694.py ├── bug_803.py ├── bug_899.py ├── bug_959.py ├── fox.html ├── qml_plugin_test.py ├── qmlplugin │ ├── dummy.pys │ └── index.html ├── qvariantlist_property_test.py ├── shouldInterruptjavascript_test.py ├── webframe_test.py ├── webpage_test.py └── webview_test.py ├── QtXml ├── CMakeLists.txt ├── qdomdocument_test.py └── qxmlsimplereader_test.py ├── QtXmlPatterns ├── CMakeLists.txt └── import_test.py ├── mac ├── CMakeLists.txt └── qmacstyle_test.py ├── manually ├── README.txt └── bug_841.py ├── phonon ├── CMakeLists.txt ├── basic_playing_test.py ├── bug_328.py ├── bug_786.py ├── capabilities_test.py ├── qobjectdescription_test.py └── tone.wav ├── pysidetest ├── CMakeLists.txt ├── application_test.py ├── bug_1016.py ├── decoratedslot_test.py ├── delegatecreateseditor_test.py ├── enum_test.py ├── hiddenobject.cpp ├── hiddenobject.h ├── homonymoussignalandmethod_test.py ├── list_signal_test.py ├── modelview_test.py ├── pysidetest_global.h ├── qvariant_test.py ├── signalandnamespace_test.py ├── signalemissionfrompython_test.py ├── signalwithdefaultvalue_test.py ├── symbols.filter ├── testobject.cpp ├── testobject.h ├── testview.cpp ├── testview.h ├── typedef_signal_test.py ├── typesystem_pysidetest.xml ├── utils_test.py └── version_test.py ├── run_test.sh ├── signals ├── CMakeLists.txt ├── args_dont_match_test.py ├── bug_311.py ├── bug_312.py ├── bug_319.py ├── decorators_test.py ├── disconnect_test.py ├── invalid_callback_test.py ├── lambda_gui_test.py ├── lambda_test.py ├── leaking_signal_test.py ├── multiple_connections_gui_test.py ├── multiple_connections_test.py ├── pysignal_test.py ├── qobject_destroyed_test.py ├── qobject_receivers_test.py ├── qobject_sender_test.py ├── ref01_test.py ├── ref02_test.py ├── ref03_test.py ├── ref04_test.py ├── ref05_test.py ├── ref06_test.py ├── segfault_proxyparent_test.py ├── self_connect_test.py ├── short_circuit_test.py ├── signal2signal_connect_test.py ├── signal_autoconnect_test.py ├── signal_connectiontype_support_test.py ├── signal_emission_gui_test.py ├── signal_emission_test.py ├── signal_func_test.py ├── signal_manager_refcount_test.py ├── signal_number_limit_test.py ├── signal_object_test.py ├── signal_signature_test.py ├── signal_with_primitive_type_test.py ├── slot_reference_count_test.py └── static_metaobject_test.py ├── tools └── list-class-hierarchy.py └── util ├── color.py ├── helper ├── __init__.py └── docmodifier.py ├── httpd.py ├── module_wrapper └── PySide │ ├── QtAssistant.py │ ├── QtCore.py │ ├── QtDesigner.py │ ├── QtGui.py │ ├── QtHelp.py │ ├── QtNetwork.py │ ├── QtScript.py │ ├── QtSql.py │ ├── QtSvg.py │ ├── QtTest.py │ ├── QtWebKit.py │ ├── QtXml.py │ ├── QtXmlPatterns.py │ ├── __init__.py │ └── phonon.py ├── processtimer.py ├── py2xfunctions.py ├── py3kcompat.py ├── py3xfunctions.py ├── pyqt_diff.py ├── pyqtcheck.py ├── rename_imports.sh ├── test_processtimer.py ├── use_pyqt4.sh ├── use_pyside.sh └── valgrind-python.supp /PySide/QtGui/glue/qmenubar_glue.cpp: -------------------------------------------------------------------------------- 1 | inline PyObject* 2 | addActionWithPyObject(QMenuBar* self, const QString& text, PyObject* callback) 3 | { 4 | QAction* act = new QAction(text, self); 5 | 6 | self->addAction(act); 7 | 8 | PyObject* pyAct = %CONVERTTOPYTHON[QAction*](act); 9 | PyObject* result = PyObject_CallMethod(pyAct, "connect", "OsO", pyAct, 10 | SIGNAL(triggered(bool)), callback); 11 | 12 | if (result == 0 || result == Py_False) { 13 | if (result) 14 | Py_DECREF(result); 15 | Py_DECREF(pyAct); 16 | return 0; 17 | } 18 | 19 | return pyAct; 20 | } 21 | -------------------------------------------------------------------------------- /PySide/QtGui/glue/qtgui_qapp.cpp: -------------------------------------------------------------------------------- 1 | // Init qApp macro to None. 2 | if (qApp) { 3 | PyObject* pyApp = %CONVERTTOPYTHON[QApplication*](qApp); 4 | Py_INCREF(pyApp); 5 | PyModule_AddObject(module, "qApp", pyApp); 6 | } else { 7 | Py_INCREF(Py_None); 8 | PyModule_AddObject(module, "qApp", Py_None); 9 | } 10 | moduleQtGui = module; 11 | -------------------------------------------------------------------------------- /PySide/pysidewtypes.h: -------------------------------------------------------------------------------- 1 | #ifndef __PYSIDEWTYPES__ 2 | #define __PYSIDEWTYPES__ 3 | 4 | typedef struct HWND__ *HWND; 5 | typedef unsigned UINT; 6 | typedef long LONG; 7 | typedef unsigned long DWORD; 8 | typedef UINT WPARAM; 9 | typedef LONG LPARAM; 10 | 11 | struct POINT 12 | { 13 | LONG x; 14 | LONG y; 15 | }; 16 | 17 | struct MSG 18 | { 19 | HWND hwnd; 20 | UINT message; 21 | WPARAM wParam; 22 | LPARAM lParam; 23 | DWORD time; 24 | POINT pt; 25 | }; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /cmake/Macros/icecc.cmake: -------------------------------------------------------------------------------- 1 | include (CMakeForceCompiler) 2 | option(ENABLE_ICECC "Enable icecc checking, for distributed compilation") 3 | if (ENABLE_ICECC) 4 | find_program(ICECC icecc) 5 | if (ICECC) 6 | message(STATUS "icecc found! Distributed compilation for all!! huhuhu.") 7 | cmake_force_cxx_compiler(${ICECC} icecc) 8 | else(ICECC) 9 | message(FATAL_ERROR "icecc NOT found! re-run cmake without -DENABLE_ICECC") 10 | endif(ICECC) 11 | endif(ENABLE_ICECC) 12 | -------------------------------------------------------------------------------- /doc/_themes/pysidedocs/searchbox.html: -------------------------------------------------------------------------------- 1 | {%- if pagename != "search" %} 2 | 11 | 12 | {%- endif %} 13 | -------------------------------------------------------------------------------- /doc/_themes/pysidedocs/static/bg_header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/_themes/pysidedocs/static/bg_header.png -------------------------------------------------------------------------------- /doc/_themes/pysidedocs/static/bg_topo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/_themes/pysidedocs/static/bg_topo.jpg -------------------------------------------------------------------------------- /doc/_themes/pysidedocs/static/fakebar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/_themes/pysidedocs/static/fakebar.png -------------------------------------------------------------------------------- /doc/_themes/pysidedocs/static/logo_indt.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/_themes/pysidedocs/static/logo_indt.jpg -------------------------------------------------------------------------------- /doc/_themes/pysidedocs/static/logo_openbossa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/_themes/pysidedocs/static/logo_openbossa.png -------------------------------------------------------------------------------- /doc/_themes/pysidedocs/static/logo_python.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/_themes/pysidedocs/static/logo_python.jpg -------------------------------------------------------------------------------- /doc/_themes/pysidedocs/static/logo_qt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/_themes/pysidedocs/static/logo_qt.png -------------------------------------------------------------------------------- /doc/_themes/pysidedocs/static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/_themes/pysidedocs/static/minus.png -------------------------------------------------------------------------------- /doc/_themes/pysidedocs/static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/_themes/pysidedocs/static/plus.png -------------------------------------------------------------------------------- /doc/_themes/pysidedocs/static/pysidelogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/_themes/pysidedocs/static/pysidelogo.png -------------------------------------------------------------------------------- /doc/_themes/pysidedocs/static/relbar_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/_themes/pysidedocs/static/relbar_bg.png -------------------------------------------------------------------------------- /doc/_themes/pysidedocs/theme.conf: -------------------------------------------------------------------------------- 1 | [theme] 2 | inherit = default 3 | stylesheet = pysidedocs.css 4 | pygments_style = none 5 | 6 | [options] 7 | nosidebar = false 8 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/brushstyles/qt-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/codesnippets/doc/src/snippets/brushstyles/qt-logo.png -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/doc_src_qnamespace.qdoc: -------------------------------------------------------------------------------- 1 | 2 | //! [0] 3 | QObject::connect: Cannot queue arguments of type 'MyType' 4 | //! [0] 5 | 6 | 7 | //! [1] 8 | # An important event 9 | ImportantEventPriority = Qt.HighEventPriority 10 | # A more important event 11 | MoreImportantEventPriority = ImportantEventPriority + 1 12 | # A critical event 13 | CriticalEventPriority = 100 * MoreImportantEventPriority 14 | # Not that important 15 | StatusEventPriority = Qt.LowEventPriority 16 | # These are less important than Status events 17 | IdleProcessingDoneEventPriority = StatusEventPriority - 1 18 | //! [1] 19 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src.gui.text.qtextdocumentwriter.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | writer = QTextDocumentWriter() 3 | writer.setFormat("odf") # same as writer.setFormat("ODF"); 4 | //! [0] 5 | 6 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src.scripttools.qscriptenginedebugger.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | engine = QScriptEngine() 3 | debugger = QScriptEngineDebugger() 4 | debugger.attachTo(engine) 5 | //! [0] 6 | 7 | //! [1] 8 | engine.evaluate("debugger") 9 | //! [1] 10 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_corelib_codecs_qtextcodecplugin.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | 3 | def names(self): 4 | return list = ["IBM01140", "hp15-tw"] 5 | 6 | def createForName(name): 7 | if (name == "IBM01140"): 8 | return Ibm01140Codec() 9 | else if (name == "hp15-tw"): 10 | return Hp15TwCodec() 11 | return None 12 | //! [0] 13 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qfuture.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | QFuture future = ...; 3 | 4 | QFuture::const_iterator i; 5 | for (i = future.constBegin(); i != future.constEnd(); ++i) 6 | cout << *i << endl; 7 | //! [0] 8 | 9 | 10 | //! [1] 11 | QFuture future; 12 | ... 13 | QFutureIterator i(future); 14 | while (i.hasNext()) 15 | qDebug() << i.next(); 16 | //! [1] 17 | 18 | 19 | //! [2] 20 | QFutureIterator i(future); 21 | i.toBack(); 22 | while (i.hasPrevious()) 23 | qDebug() << i.previous(); 24 | //! [2] 25 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qfuturesynchronizer.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | void someFunction() 3 | { 4 | QFutureSynchronizer synchronizer; 5 | 6 | ... 7 | 8 | synchronizer.addFuture(QtConcurrent::run(anotherFunction)); 9 | synchronizer.addFuture(QtConcurrent::map(list, mapFunction)); 10 | 11 | return; // QFutureSynchronizer waits for all futures to finish 12 | } 13 | //! [0] 14 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qfuturewatcher.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | // Instantiate the objects and connect to the finished signal. 3 | MyClass myObject; 4 | QFutureWatcher watcher; 5 | connect(&watcher, SIGNAL(finished()), &myObject, SLOT(handleFinished())); 6 | 7 | // Start the computation. 8 | QFuture future = QtConcurrent::run(...); 9 | watcher.setFuture(future); 10 | //! [0] 11 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qthreadpool.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | class HelloWorldTask(QRunnable): 3 | def run(self): 4 | print "Hello world from thread", QThread.currentThread() 5 | 6 | hello = HelloWorldTask() 7 | # QThreadPool takes ownership and deletes 'hello' automatically 8 | QThreadPool.globalInstance().start(hello) 9 | //! [0] 10 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_corelib_io_qdiriterator.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | it = QDirIterator("/etc", QDirIterator.Subdirectories) 3 | while it.hasNext(): 4 | print it.next() 5 | 6 | # /etc/. 7 | # /etc/.. 8 | # /etc/X11 9 | # /etc/X11/fs 10 | # ... 11 | 12 | //! [0] 13 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_corelib_io_qtemporaryfile.cpp: -------------------------------------------------------------------------------- 1 | { 2 | //! [0] 3 | # Within a function/method... 4 | 5 | file_ = QTemporaryFile() 6 | if file_.open(): 7 | # file_.fileName() returns the unique file name 8 | 9 | # The QTemporaryFile destructor removes the temporary file 10 | # as it goes out of scope. 11 | //! [0] 12 | } 13 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qabstracteventdispatcher.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | bool myEventFilter(void *message); 3 | //! [0] 4 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qtimer.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | from PySide.QtCore import QApplication, QTimer 3 | 4 | def main(): 5 | 6 | app = QApplication([]) 7 | QTimer.singleShot(600000, app, SLOT('quit()')) 8 | ... 9 | return app.exec_() 10 | //! [0] 11 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_corelib_plugin_quuid.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | # {67C8770B-44F1-410A-AB9A-F9B5446F13EE} 3 | IID_MyInterface = QUuid(0x67c8770b, 0x44f1, 0x410a, 0xab, 0x9a, 0xf9, 0xb5, 0x44, 0x6f, 0x13, 0xee) 4 | //! [0] 5 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qmutexpool.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | class Number: 3 | def __init__(n): 4 | self.num = n 5 | //! [0] 6 | 7 | 8 | //! [1] 9 | def calcSquare(number): 10 | locker = QMutexLocker(mutexpool.get(number)) 11 | number.num = number.num * number.num 12 | //! [1] 13 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qthread.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | class MyThread (QThread): 3 | def run(): 4 | socket = QTcpSocket() 5 | # connect QTcpSocket's signals somewhere meaningful 6 | # ... 7 | socket.connectToHost(hostName, portNumber) 8 | self.exec_() 9 | //! [0] 10 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qqueue.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | QQueue queue; 3 | queue.enqueue(1); 4 | queue.enqueue(2); 5 | queue.enqueue(3); 6 | while (!queue.isEmpty()) 7 | cout << queue.dequeue() << endl; 8 | //! [0] 9 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qrect.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | r1 = QRect(100, 200, 11, 16) 3 | r2 = QRect(QPoint(100, 200), QSize(11, 16)) 4 | //! [0] 5 | 6 | 7 | //! [1] 8 | r1 = QRectF(100, 200, 11, 16) 9 | r2 = QRectF(QPoint(100, 200), QSize(11, 16)) 10 | //! [1] 11 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qtimeline.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | ... 3 | progressBar = QProgressBar(self) 4 | progressBar.setRange(0, 100) 5 | 6 | # Construct a 1-second timeline with a frame range of 0 - 100 7 | timeLine = QTimeLine(1000, self) 8 | timeLine.setFrameRange(0, 100) 9 | timeLine.frameChanged[int].connect(progressBar.setValue) 10 | 11 | # Clicking the push button will start the progress bar animation 12 | pushButton = QPushButton(QObject.tr("Start animation"), self) 13 | pushButton.clicked.connect(timeLine.start) 14 | ... 15 | //! [0] 16 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_corelib_xml_qxmlstream.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | xml = QXmlStreamReader() 3 | ... 4 | while not xml.atEnd(): 5 | xml.readNext(); 6 | ... # do processing 7 | 8 | if xml.hasError(): 9 | ... # do error handling 10 | 11 | //! [0] 12 | 13 | 14 | //! [1] 15 | writeStartElement(qualifiedName) 16 | writeCharacters(text) 17 | writeEndElement() 18 | //! [1] 19 | 20 | 21 | //! [2] 22 | writeStartElement(namespaceUri, name) 23 | writeCharacters(text) 24 | writeEndElement() 25 | //! [2] 26 | 27 | 28 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_accessible_qaccessible.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | child = QAccessibleInterface() 3 | targetChild = object.navigate(Accessible.Child, 1, child) 4 | if child: 5 | # ... 6 | del child 7 | //! [0] 8 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_dialogs_qabstractprintdialog.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | printDialog = QPrintDialog(printer, parent) 3 | if printDialog.exec_() == QDialog.Accepted: 4 | # print ... 5 | //! [0] 6 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsgridlayout.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | scene = QGraphicsScene() 3 | textEdit = scene.addWidget(QTextEdit()) 4 | pushButton = scene.addWidget(QPushButton()) 5 | 6 | layout = QGraphicsGridLayout() 7 | layout.addItem(textEdit, 0, 0) 8 | layout.addItem(pushButton, 0, 1) 9 | 10 | form = QGraphicsWidget() 11 | form.setLayout(layout) 12 | scene.addItem(form) 13 | //! [0] 14 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicslinearlayout.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | scene = QGraphicsScene() 3 | textEdit = scene.addWidget(QTextEdit()) 4 | pushButton = scene.addWidget(QPushButton()) 5 | 6 | layout = QGraphicsLinearLayout() 7 | layout.addItem(textEdit) 8 | layout.addItem(pushButton) 9 | 10 | form = QGraphicsWidget() 11 | form.setLayout(layout) 12 | scene.addItem(form) 13 | //! [0] 14 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicssceneevent.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | 3 | setDropAction(proposedAction()) 4 | 5 | //! [0] 6 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_image_qbitmap.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | uchar arrow_bits[] = { 0x3f, 0x1f, 0x0f, 0x1f, 0x3b, 0x71, 0xe0, 0xc0 }; 3 | QBitmap bm(8, 8, arrow_bits, true); 4 | //! [0] 5 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_image_qimagereader.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | reader = QImageReader() 3 | reader.setFormat("png") # same as reader.setFormat("PNG") 4 | //! [0] 5 | 6 | 7 | //! [1] 8 | reader = QImageReader("image.png") 9 | # reader.format() == "png" 10 | //! [1] 11 | 12 | 13 | //! [2] 14 | icon = QImage(64, 64, QImage.Format_RGB32) 15 | reader = QImageReader("icon_64x64.bmp") 16 | if reader.read(icon): 17 | # Display icon 18 | //! [2] 19 | 20 | 21 | //! [3] 22 | reader = QImageReader(":/image.png") 23 | if reader.supportsOption(QImageIOHandler.Size): 24 | print "Size:", str(reader.size()) 25 | //! [3] 26 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_image_qimagewriter.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | writer = QImageWriter() 3 | writer.setFormat("png") # same as writer.setFormat("PNG") 4 | //! [0] 5 | 6 | 7 | //! [1] 8 | image = QImage("some/image.jpeg") 9 | writer = QImageWriter("images/outimage.png", "png") 10 | writer.setText("Author", "John Smith") 11 | writer.write(image) 12 | //! [1] 13 | 14 | 15 | //! [2] 16 | writer = QImageWriter(fileName) 17 | if writer.supportsOption(QImageIOHandler.Description): 18 | writer.setText("Author", "John Smith") 19 | //! [2] 20 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_image_qmovie.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | label = QLabel() 3 | movie = QMovie("animations/fire.gif") 4 | 5 | label.setMovie(movie) 6 | movie.start() 7 | //! [0] 8 | 9 | 10 | //! [1] 11 | movie = QMovie("racecar.gif") 12 | movie.setSpeed(200) // 2x speed 13 | //! [1] 14 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_image_qpixmap.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | static const char * const start_xpm[]={ 3 | "16 15 8 1", 4 | "a c #cec6bd", 5 | .... 6 | //! [0] 7 | 8 | 9 | //! [1] 10 | myPixmap = QPixmap() 11 | myPixmap.setMask(myPixmap.createHeuristicMask()) 12 | //! [1] 13 | 14 | //! [2] 15 | pixmap = QPixmap("background.png") 16 | exposed = QRegion() 17 | pixmap.scroll(10, 10, pixmap.rect(), exposed) 18 | //! [2] 19 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_image_qpixmapcache.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | pm = QPixmap() 3 | if not QPixmapCache.find("my_big_image", pm): 4 | pm.load("bigimage.png") 5 | QPixmapCache.insert("my_big_image", pm) 6 | painter.drawPixmap(0, 0, pm) 7 | //! [0] 8 | 9 | 10 | //! [1] 11 | pm = QPixmap() 12 | if not QPixmapCache.find("my_big_image", pm): 13 | pm.load("bigimage.png") 14 | QPixmapCache.insert("my_big_image", pm) 15 | painter.drawPixmap(0, 0, pm) 16 | //! [1] 17 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_image_qpixmapfilter.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | myFilter = QPixmapColorFilter() 3 | myFilter.setColor(QColor(128, 0, 0)) 4 | myFilter.draw(painter, QPoint(0, 0), originalPixmap) 5 | //! [0] 6 | 7 | //! [1] 8 | myFilter = QPixmapConvolutionFilter() 9 | kernel = [ 10 | 0.0,-1.0, 0.0, 11 | -1.0, 5.0,-1.0, 12 | 0.0,-1.0, 0.0 13 | ] 14 | myFilter.setConvolutionKernel(kernel, 3, 3) 15 | myFilter.sdraw(painter, QPoint(0, 0), originalPixmap) 16 | //! [1] 17 | 18 | //! [2] 19 | myFilter = QPixmapDropShadowFilter() 20 | myFilter.draw(painter, QPoint(0, 0), originalPixmap) 21 | //! [2] 22 | 23 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qabstractitemview.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | def resizeEvent(self, event): 3 | horizontalScrollBar().setRange(0, realWidth - width()) 4 | ... 5 | //! [0] 6 | 7 | //! [1] 8 | setIndexWidget(index, QLineEdit()) 9 | ... 10 | setIndexWidget(index, QTextEdit()) 11 | //! [1] 12 | 13 | //! [2] 14 | m = view->selectionModel() 15 | view->setModel(model()) 16 | del m 17 | //! [2] 18 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qitemselectionmodel.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | selection = QItemSelection(topLeft, bottomRight) 3 | //! [0] 4 | 5 | 6 | //! [1] 7 | selection = QItemSelection() 8 | ... 9 | selection.select(topLeft, bottomRight) 10 | //! [1] 11 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qtablewidget.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | setCellWidget(index, QLineEdit()) 3 | ... 4 | setCellWidget(index, QTextEdit()) 5 | //! [0] 6 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qtreewidget.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | treeWidget = QTreeWidget() 3 | treeWidget.setColumnCount(1) 4 | items = [] 5 | for i in range(10): 6 | items.append(QTreeWidgetItem(None, QStringList(QString("item: %1").arg(i)))) 7 | treeWidget.insertTopLevelItems(None, items) 8 | //! [0] 9 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qaction.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | app = QApplication(argv) 3 | app.setAttribute(Qt.AA_DontShowIconsInMenus) # Icons are *no longer shown* in menus 4 | // ... 5 | myAction = QAction() 6 | // ... 7 | myAction.setIcon(SomeIcon) 8 | myAction.setIconVisibleInMenu(True) # Icon *will* be shown in menus for *this* action. 9 | //! [0] 10 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qapplication_x11.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) 3 | calculateHugeMandelbrot() # lunch time... 4 | QApplication.restoreOverrideCursor() 5 | //! [0] 6 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qclipboard.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | clipboard = QApplication.clipboard() 3 | originalText = clipboard.text() 4 | ... 5 | clipboard.setText(newText) 6 | //! [0] 7 | 8 | 9 | //! [1] 10 | data = QMimeData() 11 | data.setImageData(image) 12 | clipboard.setMimeData(data, mode) 13 | //! [1] 14 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qevent.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | def wheelEvent(self, event): 3 | numDegrees = event.delta() / 8 4 | numSteps = numDegrees / 15 5 | 6 | if event->orientation() == Qt.Horizontal: 7 | scrollHorizontally(numSteps) 8 | else: 9 | scrollVertically(numSteps) 10 | event.accept() 11 | //! [0] 12 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qkeysequence.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | QKeySequence(QKeySequence.Print) 3 | QKeySequence(tr("Ctrl+P")) 4 | QKeySequence(tr("Ctrl+p")) 5 | QKeySequence(Qt.CTRL + Qt.Key_P) 6 | //! [0] 7 | 8 | 9 | //! [1] 10 | QKeySequence(tr("Ctrl+X, Ctrl+C")) 11 | QKeySequence(Qt.CTRL + Qt.Key_X, Qt.CTRL + Qt.Key_C) 12 | //! [1] 13 | 14 | 15 | //! [2] 16 | file = QMenu(self) 17 | file.addAction(tr("&Open..."), self, SLOT("open()"), 18 | QKeySequence(tr("Ctrl+O", "File|Open"))) 19 | //! [2] 20 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qlayout.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | 3 | def paintLayout(self, painter, item): 4 | layout = item.layout() 5 | 6 | if layout: 7 | for layout_item in layout: 8 | self.paintLayout(painter, layout_item) 9 | 10 | painter.drawRect(item.geometry()) 11 | 12 | def paintEvent(self, event): 13 | painter = QPainter(self) 14 | if self.layout(): 15 | self.paintLayout(painter, self.layout()) 16 | 17 | //! [0] 18 | 19 | 20 | //! [1] 21 | child = layout.takeAt(0) 22 | while child: 23 | ... 24 | del child 25 | //! [1] 26 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qlayoutitem.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | def heightForWidth(self, w): 3 | if cache_dirty or cached_width != w: 4 | h = calculateHeightForWidth(w) 5 | self.cached_hfw = h 6 | return h 7 | return cached_hfw 8 | //! [0] 9 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qshortcut.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | shortcut = QShortcut(QKeySequence(self.tr("Ctrl+O", "File|Open")), 3 | parent) 4 | //! [0] 5 | 6 | 7 | //! [1] 8 | setKey(0) # no signal emitted 9 | setKey(QKeySequence()) # no signal emitted 10 | setKey(0x3b1) # Greek letter alpha 11 | setKey(Qt.Key_D) # 'd', e.g. to delete 12 | setKey('q') # 'q', e.g. to quit 13 | setKey(Qt.CTRL + Qt.Key_P) # Ctrl+P, e.g. to print document 14 | setKey("Ctrl+P") # Ctrl+P, e.g. to print document 15 | //! [1] 16 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qshortcutmap.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | key = QKeySequence() 3 | //! [0] 4 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qsound.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | QSound.play("mysounds/bells.wav") 3 | //! [0] 4 | 5 | 6 | //! [1] 7 | bells = QSound("mysounds/bells.wav") 8 | bells.play() 9 | //! [1] 10 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_painting_qbrush.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | painter = QPainter(self) 3 | 4 | painter.setBrush(Qt.cyan) 5 | painter.setPen(Qt.darkCyan) 6 | painter.drawRect(0, 0, 100,100) 7 | 8 | painter.setBrush(Qt.NoBrush) 9 | painter.setPen(Qt.darkGreen) 10 | painter.drawRect(40, 40, 100, 100) 11 | //! [0] 12 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_painting_qcolor.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | # Specify semi-transparent red 3 | painter.setBrush(QColor(255, 0, 0, 127)) 4 | painter.drawRect(0, 0, self.width()/2, self.height()) 5 | 6 | # Specify semi-transparent blue 7 | painter.setBrush(QColor(0, 0, 255, 127)) 8 | painter.drawRect(0, 0, self.width(), self.height()/2) 9 | //! [0] 10 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_painting_qmatrix.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | x' = m11*x + m21*y + dx 3 | y' = m22*y + m12*x + dy 4 | //! [0] 5 | 6 | 7 | //! [1] 8 | x' = m11*x + m21*y + dx 9 | y' = m22*y + m12*x + dy 10 | //! [1] 11 | 12 | 13 | //! [2] 14 | x' = m11*x + m21*y + dx 15 | y' = m22*y + m12*x + dy 16 | //! [2] 17 | 18 | 19 | //! [3] 20 | x' = m11*x + m21*y + dx 21 | y' = m22*y + m12*x + dy 22 | //! [3] 23 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_painting_qregion.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | class MyWidget (QWidget): 3 | # ... 4 | def paintEvent(self): 5 | r1 = QRegion(QRect(100, 100, 200, 80), QRegion.Ellipse) # r1: elliptic region 6 | ) 7 | r2 = QRect(100, 120, 90, 30) # r2: rectangular region 8 | r3 = r1.intersected(r2) # r3: intersection 9 | 10 | painter = QPainter(self) 11 | painter.setClipRegion(r3) 12 | ... # paint clipped graphics 13 | //! [0] 14 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_painting_qregion_unix.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | r1 = QRegion(10, 10, 20, 20) 3 | r1.isNull() // false 4 | r1.isEmpty() // false 5 | 6 | r2 = QRegion(40, 40, 20, 20) 7 | r3 = QRegion() 8 | r3.isNull() // true 9 | r3.isEmpty() // true 10 | 11 | r3 = r1.intersected(r2) // r3: intersection of r1 and r2 12 | r3.isNull() // false 13 | r3.isEmpty() // true 14 | 15 | r3 = r1.united(r2) // r3: union of r1 and r2 16 | r3.isNull() // false 17 | r3.isEmpty() // false 18 | //! [0] 19 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_styles_qstyle.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | python myapplication.py -style motif 3 | //! [0] 4 | 5 | 6 | //! [1] 7 | python myapplication.py -style custom 8 | //! [1] 9 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_styles_qstyleoption.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | def styleHint(self, stylehint, opt, widget, returnData): 3 | if stylehint == SH_RubberBand_Mask: 4 | if isinstance(QStyleHintReturnMask, hint): 5 | ... 6 | ... 7 | //! [0] 8 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_text_qfont.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | serifFont = QFont("Times", 10, QFont.Bold) 3 | sansFont = QFont("Helvetica [Cronyx]", 12) 4 | //! [0] 5 | 6 | 7 | //! [1] 8 | f = QFont("Helvetica") 9 | //! [1] 10 | 11 | 12 | //! [2] 13 | f = QFont("Helvetica [Cronyx]") 14 | //! [2] 15 | 16 | 17 | //! [3] 18 | info = QFontInfo(f1) 19 | family = info.family() 20 | //! [3] 21 | 22 | 23 | //! [4] 24 | fm = QFontMetrics(f1) 25 | textWidthInPixels = fm.width("How many pixels wide is this text?") 26 | textHeightInPixels = fm.height() 27 | //! [4] 28 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_text_qfontmetrics.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | font = QFont("times", 24) 3 | fm = QFontMetrics(font) 4 | pixelsWide = fm.width("What's the width of this text?") 5 | pixelsHigh = fm.height() 6 | //! [0] 7 | 8 | 9 | //! [1] 10 | font = QFont("times", 24) 11 | fm = QFontMetricsF(font) 12 | pixelsWide = fm.width("What's the width of this text?") 13 | pixelsHigh = fm.height() 14 | //! [1] 15 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_text_qtextdocument.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | plain = QString("#include ") 3 | html = Qt::escape(plain) 4 | # html == "#include <QtCore>" 5 | //! [0] 6 | 7 | 8 | //! [1] 9 | ... 10 | //! [1] 11 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_text_qtextlayout.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | leading = fontMetrics.leading() 3 | height = 0 4 | widthUsed = 0 5 | textLayout.beginLayout() 6 | while True: 7 | line = textLayout.createLine() 8 | if not line.isValid(): 9 | break 10 | 11 | line.setLineWidth(lineWidth) 12 | height += leading 13 | line.setPosition(QPointF(0, height)) 14 | height += line.height() 15 | widthUsed = qMax(widthUsed, line.naturalTextWidth()) 16 | textLayout.endLayout() 17 | //! [0] 18 | 19 | 20 | //! [1] 21 | painter = QPainter(self) 22 | textLayout.draw(painter, QPoint(0, 0)) 23 | //! [1] 24 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_util_qcompleter.cpp: -------------------------------------------------------------------------------- 1 | 2 | //! [0] 3 | wordList = ["alpha", "omega", "omicron", "zeta"] 4 | 5 | lineEdit = QLineEdit(self) 6 | 7 | completer = QCompleter(wordList, self) 8 | completer.setCaseSensitivity(Qt.CaseInsensitive) 9 | lineEdit.setCompleter(completer) 10 | //! [0] 11 | 12 | 13 | //! [1] 14 | completer = QCompleter(self) 15 | completer.setModel(QDirModel(completer)) 16 | lineEdit.setCompleter(completer) 17 | //! [1] 18 | 19 | 20 | //! [2] 21 | i = 0 22 | while completer.setCurrentRow(i): 23 | print "%s is match number %d" % (completer.currentCompletion(), i) 24 | i += 1 25 | //! [2] 26 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_util_qdesktopservices.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | def showHelp(url): 3 | # ... 4 | pass 5 | 6 | QDesktopServices.setUrlHandler("help", showHelp); 7 | //! [0] 8 | 9 | //! [1] 10 | mailto:user@foo.com?subject=Test&body=Just a test 11 | //! [1] 12 | 13 | //! [2] 14 | QDesktopServices.openUrl(QUrl("file:///C:/Documents and Settings/All Users/Desktop", QUrl.TolerantMode)) 15 | //! [2] 16 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qabstractbutton.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | button = QPushButton(QObject.tr("Ro&ck && Roll"), self) 3 | //! [0] 4 | 5 | 6 | //! [1] 7 | button.setIcon(QIcon(":/images/print.png")) 8 | button.setShortcut(tr("Alt+F7")) 9 | //! [1] 10 | 11 | 12 | //! [2] 13 | class MyWidget (QWidget): 14 | #... 15 | def reactToToggle(checked): 16 | if checked: 17 | // Examine the button states. 18 | ... 19 | //! [2] 20 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qabstractspinbox.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | spinBox = QSpinBox(self) 3 | spinBox.setRange(0, 100) 4 | spinBox.setWrapping(True) 5 | spinBox.setValue(100) 6 | spinBox.stepBy(1) 7 | // value is 0 8 | //! [0] 9 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qcalendarwidget.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | calendar.setGridVisible(True) 3 | //! [0] 4 | 5 | 6 | //! [1] 7 | calendar.setGridVisible(True) 8 | calendar.setMinimumDate(QDate(2006, 6, 19)) 9 | //! [1] 10 | 11 | 12 | //! [2] 13 | calendar.setGridVisible(True) 14 | calendar.setMaximumDate(QDate(2006, 7, 3)) 15 | //! [2] 16 | 17 | 18 | //! [3] 19 | 20 | calendar.setDateRange(min, max) 21 | //! [3] 22 | 23 | 24 | //! [4] 25 | 26 | calendar.setMinimumDate(min) 27 | calendar.setMaximumDate(max) 28 | //! [4] 29 | 30 | 31 | //! [5] 32 | calendar.setGridVisible(True) 33 | //! [5] 34 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qcheckbox.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | checkbox = QCheckBox("C&ase sensitive", self) 3 | //! [0] 4 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qdockwidget.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | dockWidget = parentWidget() 3 | if dockWidget.features() & QDockWidget.DockWidgetVerticalTitleBar: 4 | # I need to be vertical 5 | else: 6 | # I need to be horizontal 7 | //! [0] 8 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qframe.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | label = QLabel() 3 | label.setFrameStyle(QFrame.Panel | QFrame.Raised) 4 | label.setLineWidth(2) 5 | 6 | pbar = QProgressBar() 7 | label.setFrameStyle(QFrame.NoFrame) 8 | //! [0] 9 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qgroupbox.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | g.setTitle("&User information") 3 | //! [0] 4 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qlabel.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | label = QLabel(self) 3 | label.setFrameStyle(QFrame.Panel | QFrame.Sunken) 4 | label.setText("first line\nsecond line") 5 | label.setAlignment(Qt.AlignBottom | Qt.AlignRight) 6 | //! [0] 7 | 8 | 9 | //! [1] 10 | phoneEdit = QLineEdit(self) 11 | phoneLabel = QLabel("&Phone:", self) 12 | phoneLabel.setBuddy(phoneEdit) 13 | //! [1] 14 | 15 | 16 | //! [2] 17 | nameEd = QLineEdit(self) 18 | nameLb = QLabel("&Name:", self) 19 | nameLb.setBuddy(nameEd) 20 | phoneEd = QLineEdit(self) 21 | phoneLb = QLabel("&Phone:", self) 22 | phoneLb.setBuddy(phoneEd) 23 | # (layout setup not shown) 24 | //! [2] 25 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qlineedit.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | def contextMenuEvent(event): 3 | menu = createStandardContextMenu() 4 | menu.addAction(QObject.tr("My Menu Item")) 5 | #... 6 | menu.exec_(event.globalPos()) 7 | //! [0] 8 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qmainwindow.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | def closeEvent(self, event): 3 | settings = QSettings("MyCompany", "MyApp") 4 | settings.setValue("geometry", self.saveGeometry()) 5 | settings.setValue("windowState", self.saveState()) 6 | QMainWindow.closeEvent(self, event) 7 | //! [0] 8 | 9 | 10 | //! [1] 11 | def readSettings(self): 12 | settings = QSettings("MyCompany", "MyApp") 13 | restoreGeometry(settings.value("myWidget/geometry")) 14 | restoreState(settings.value("myWidget/windowState")) 15 | //! [1] 16 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qmenu.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | exec_(QCursor.pos()) 3 | //! [0] 4 | 5 | 6 | //! [1] 7 | exec_(somewidget.mapToGlobal(QPoint(0,0))) 8 | //! [1] 9 | 10 | 11 | //! [2] 12 | exec_(e.globalPos()) 13 | //! [2] 14 | 15 | 16 | //! [3] 17 | exec_(QCursor.pos()) 18 | //! [3] 19 | 20 | 21 | //! [4] 22 | exec_(somewidget.mapToGlobal(QPoint(0, 0))) 23 | //! [4] 24 | 25 | 26 | //! [5] 27 | exec_(e.globalPos()) 28 | //! [5] 29 | 30 | 31 | //! [6] 32 | menu = QMenu() 33 | at = actions[0] // Assumes actions is not empty 34 | for a in actions: 35 | menu.addAction(a) 36 | menu.exec_(pos, at) 37 | //! [6] 38 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qmenubar.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | menubar.addMenu(fileMenu) 3 | //! [0] 4 | 5 | 6 | //! [1] 7 | menuBar = QMenuBar() 8 | //! [1] 9 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qplaintextedit.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | class MyQPlainTextEdit(QPlainTextEdit): 3 | def contextMenuEvent(self, event): 4 | menu = createStandardContextMenu() 5 | menu.addAction(tr("My Menu Item")) 6 | # ... 7 | menu.exec_(event.globalPos()) 8 | del menu 9 | //! [0] 10 | 11 | 12 | //! [1] 13 | edit.textCursor().insertText(text) 14 | //! [1] 15 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qpushbutton.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | button = QPushButton("&Download", self) 3 | //! [0] 4 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qradiobutton.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | button = QRadioButton("Search from the &cursor", self) 3 | //! [0] 4 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qscrollarea.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | imageLabel = QLabel() 3 | image = QImage("happyguy.png") 4 | imageLabel.setPixmap(QPixmap.fromImage(image)) 5 | 6 | scrollArea = QScrollArea() 7 | scrollArea.setBackgroundRole(QPalette.Dark) 8 | scrollArea.setWidget(imageLabel) 9 | //! [0] 10 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qspinbox.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | sb.setPrefix("$") 3 | //! [0] 4 | 5 | 6 | //! [1] 7 | sb.setSuffix(" km") 8 | //! [1] 9 | 10 | 11 | //! [2] 12 | setRange(minimum, maximum) 13 | //! [2] 14 | 15 | 16 | //! [3] 17 | setMinimum(minimum) 18 | setMaximum(maximum) 19 | //! [3] 20 | 21 | 22 | //! [4] 23 | spinbox.setPrefix("$") 24 | //! [4] 25 | 26 | 27 | //! [5] 28 | spinbox.setSuffix(" km") 29 | //! [5] 30 | 31 | 32 | //! [6] 33 | setRange(minimum, maximum) 34 | //! [6] 35 | 36 | 37 | //! [7] 38 | setMinimum(minimum) 39 | setMaximum(maximum) 40 | //! [7] 41 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qsplashscreen.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | pixmap = QPixmap(":/splash.png") 3 | splash = QSplashScreen(pixmap) 4 | splash.show() 5 | 6 | ... # Loading some items 7 | splash.showMessage("Loaded modules") 8 | 9 | qApp.processEvents() 10 | 11 | ... # Establishing connections 12 | splash.showMessage("Established connections") 13 | 14 | qApp.processEvents() 15 | //! [0] 16 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qsplitter.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | widget = splitter.widget(index) 3 | policy = widget.sizePolicy() 4 | policy.setHorizontalStretch(stretch) 5 | policy.setVerticalStretch(stretch) 6 | widget.setSizePolicy(policy) 7 | //! [0] 8 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qstatusbar.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | statusBar().addWidget(MyReadWriteIndication()) 3 | //! [0] 4 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qtextbrowser.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | backaction.setToolTip(browser.historyTitle(-1)) 3 | forwardaction.setToolTip(browser.historyTitle(+1)) 4 | //! [0] 5 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qtextedit.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | class MyTextEdit(QTextEdit): 3 | def contextMenuEvent(self, event): 4 | menu = createStandardContextMenu() 5 | menu.addAction(tr("My Menu Item")) 6 | #... 7 | menu.exec_(event->globalPos()) 8 | del menu 9 | //! [0] 10 | 11 | 12 | //! [1] 13 | edit.textCursor().insertText(text) 14 | //! [1] 15 | 16 | 17 | //! [2] 18 | edit.textCursor().insertHtml(fragment) 19 | //! [2] 20 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qworkspace.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | class MainWindow(...): 3 | def __init__(self): 4 | self.workspace = QWorkspace() 5 | self.setCentralWidget(workspace) 6 | ... 7 | //! [0] 8 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_network_access_qnetworkrequest.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | request.setRawHeader("Last-Modified", "Sun, 06 Nov 1994 08:49:37 GMT") 3 | //! [0] 4 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_network_bearer_qnetworkconfigmanager.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | mgr = QNetworkConfigurationManager() 3 | activeConfigs = mgr.allConfigurations(QNetworkConfiguration.Active) 4 | if activeConfigs: 5 | assert(mgr.isOnline()) 6 | else: 7 | assert(not mgr.isOnline()) 8 | //! [0] 9 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_network_kernel_qhostaddress.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | addr = hostAddr.toIPv6Address() 3 | # addr contains 16 unsigned characters 4 | 5 | for i in range(0, 16): 6 | # process addr[i] 7 | //! [0] 8 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_network_kernel_qnetworkproxy.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | proxy = QNetworkProxy() 3 | proxy.setType(QNetworkProxy.Socks5Proxy) 4 | proxy.setHostName("proxy.example.com") 5 | proxy.setPort(1080) 6 | proxy.setUser("username") 7 | proxy.setPassword("password") 8 | QNetworkProxy.setApplicationProxy(proxy) 9 | //! [0] 10 | 11 | 12 | //! [1] 13 | serverSocket.setProxy(QNetworkProxy.NoProxy) 14 | //! [1] 15 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_network_socket_qlocalsocket_unix.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | socket.connectToServer("market") 3 | if (socket.waitForConnected(1000)) 4 | print("Connected!") 5 | //! [0] 6 | 7 | 8 | //! [1] 9 | socket.disconnectFromServer() 10 | if (socket.waitForDisconnected(1000)) 11 | print("Disconnected!") 12 | //! [1] 13 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_network_socket_qtcpserver.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | server.setProxy(QNetworkProxy.NoProxy) 3 | //! [0] 4 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_network_socket_qudpsocket.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | def initSocket(self): 3 | udpSocket = QUdpSocket(self) 4 | udpSocket.bind(QHostAddress.LocalHost, 7755) 5 | 6 | self.connect(udpSocket, SIGNAL('readyRead()'), 7 | self, SLOT('readPendingDatagrams()')) 8 | 9 | def readPendingDatagrams(self): 10 | while udpSocket.hasPendingDatagrams(): 11 | datagram = QByteArray() 12 | datagram.resize(udpSocket.pendingDatagramSize()) 13 | 14 | (sender, senderPort) = udpSocket.readDatagram(datagram.data(), datagram.size()) 15 | 16 | processTheDatagram(datagram) 17 | //! [0] 18 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_network_ssl_qsslcertificate.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | for cert in QSslCertificate.fromPath('C:/ssl/certificate.*.pem', QSsL.Pem, QRegExp.Wildcard): 3 | print cert.issuerInfo(QSslCertificate.Organization) 4 | //! [0] 5 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_network_ssl_qsslconfiguration.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | config = sslSocket.sslConfiguration() 3 | config.setProtocol(QSsl.TlsV1) 4 | sslSocket.setSslConfiguration(config) 5 | //! [0] 6 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_opengl_qglpixelbuffer.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | pbuffer QGLPixelBuffer(...) 3 | ... 4 | pbuffer.makeCurrent() 5 | dynamicTexture = pbuffer.generateDynamicTexture() 6 | pbuffer.bindToDynamicTexture(dynamicTexture) 7 | ... 8 | pbuffer.releaseFromDynamicTexture() 9 | //! [0] 10 | 11 | 12 | //! [1] 13 | pbuffer QGLPixelBuffer(...) 14 | ... 15 | pbuffer.makeCurrent() 16 | dynamicTexture = pbuffer.generateDynamicTexture() 17 | ... 18 | pbuffer.updateDynamicTexture(dynamicTexture) 19 | //! [1] 20 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_script_qscriptable.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | class MyScriptableObject(QObject, QScriptable): 3 | ... 4 | def doSomething(self): 5 | ... 6 | def doSomethingElse(self): 7 | ... 8 | //! [0] 9 | 10 | 11 | //! [1] 12 | 13 | def doSomething(self): 14 | self.context().throwError('Threw an error from a slot') 15 | 16 | def doSomethingElse(self): 17 | return self.thisObject() 18 | 19 | //! [1] 20 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_script_qscriptclass.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | if extension == Callable: 3 | context = argument 4 | engine = context.engine() 5 | sum = 0 6 | for i in range(0, context.argumentCount()): 7 | sum += context.argument(i).toNumber() 8 | return sum 9 | //! [0] 10 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_script_qscriptengineagent.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | var a = Math.random() + 2; 3 | //! [0] 4 | 5 | 6 | //! [1] 7 | function cube(a) { 8 | return a * a * a; 9 | } 10 | 11 | var a = cube(3); 12 | //! [1] 13 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqlerror.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | model = QSqlQueryModel() 3 | model.setQuery("select * from myTable") 4 | if model.lastError().isValid(): 5 | print model.lastError() 6 | //! [0] 7 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqlindex.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | strlist = myIndex.toStringList() 3 | for i in strlist: 4 | myProcessing(i) 5 | //! [0] 6 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_sql_models_qsqlquerymodel.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | while myModel.canFetchMore(): 3 | myModel.fetchMore() 4 | //! [0] 5 | 6 | 7 | //! [1] 8 | model = QSqlQueryModel() 9 | model.setQuery("select * from MyTable") 10 | if model.lastError().isValid(): 11 | print model.lastError() 12 | //! [1] 13 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_svg_qgraphicssvgitem.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | renderer = QSvgRenderer(QLatin1String("SvgCardDeck.svg")) 3 | black = QGraphicsSvgItem() 4 | red = QGraphicsSvgItem() 5 | 6 | black.setSharedRenderer(renderer) 7 | black.setElementId(QLatin1String("black_joker")) 8 | 9 | red.setSharedRenderer(renderer) 10 | red.setElementId(QLatin1String("red_joker")) 11 | //! [0] 12 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_xml_sax_qxml.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", True) 3 | //! [0] 4 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qabstracturiresolver.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | return baseURI.resolved(relative); 3 | //! [0] 4 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qabstractxmlforwarditerator.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | OutputType inputToOutputItem(const InputType &inputType) const; 3 | //! [0] 4 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qabstractxmlreceiver.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | QXmlQuery query; 3 | query.setQuery("doc('index.html')/html/body/p[1]"); 4 | 5 | QXmlSerializer serializer(query, myOutputDevice); 6 | query.evaluateTo(&serializer); 7 | //! [0] 8 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qsimplexmlnodemodel.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | QXmlNodeModelIndex MyTreeModel::nextFromSimpleAxis(SimpleAxis axis, const QXmlNodeModelIndex &ni) const 3 | { 4 | // Convert the QXmlNodeModelIndex to a value that is specific to what we represent. 5 | const MyValue value = toMyValue(ni); 6 | 7 | switch(axis) 8 | { 9 | case Parent: 10 | return toNodeIndex(value.parent()); 11 | case FirstChild: 12 | case PreviousSibling: 13 | case NextSibling: 14 | // and so on 15 | ; 16 | } 17 | return QXmlNodeModelIndex(); 18 | } 19 | //! [0] 20 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlformatter.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | QXmlQuery query; 3 | query.setQuery("doc('index.html')/html/body/p[1]"); 4 | 5 | QXmlFormatter formatter(query, myOutputDevice); 6 | formatter.setIndentationDepth(2); 7 | query.evaluateTo(&formatter); 8 | //! [0] 9 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlname.cpp: -------------------------------------------------------------------------------- 1 | // Fills the bits from begin to end with 1s and leaves the rest as 0. 2 | 3 | template 4 | inline IntegralT bitmask(IntegralT begin, IntegralT end) 5 | { 6 | IntegralT filled_bits = (1 << (end - begin + 1)) - 1; 7 | return filled_bits << begin; 8 | } 9 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlresultitems.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | QXmlQuery query; 3 | query.setQuery(", 1, 'two'"); 4 | QXmlResultItems result; 5 | 6 | if (query.isValid()) { 7 | query.evaluateTo(&result); 8 | QXmlItem item(result.next()); 9 | while (!item.isNull()) { 10 | // use item 11 | item = result.next(); 12 | } 13 | if (result.hasError()) 14 | /* Runtime error! */; 15 | } 16 | //! [0] 17 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlserializer.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | QXmlQuery query; 3 | query.setQuery("doc('index.html')/html/body/p[1]"); 4 | 5 | QXmlSerializer serializer(query, myOutputDevice); 6 | query.evaluateTo(&serializer); 7 | //! [0] 8 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_extension_extension.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | QDesignerPropertySheetExtension *propertySheet; 3 | QExtensionManager manager = formEditor->extensionManager(); 4 | 5 | propertySheet = qt_extension(manager, widget); 6 | 7 | if(propertySheet) {...} 8 | //! [0] 9 | 10 | 11 | //! [1] 12 | Q_DECLARE_EXTENSION_INTERFACE(MyExtension, "com.mycompany.myproduct.myextension") 13 | //! [1] 14 | 15 | 16 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_extension_qextensionmanager.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | void MyPlugin::initialize(QDesignerFormEditorInterface *formEditor) 3 | { 4 | if (initialized) 5 | return; 6 | 7 | QExtensionManager *manager = formEditor->extensionManager(); 8 | Q_ASSERT(manager != 0); 9 | 10 | manager->registerExtensions(new MyExtensionFactory(manager), 11 | Q_TYPEID(QDesignerTaskMenuExtension)); 12 | 13 | initialized = true; 14 | } 15 | //! [0] 16 | 17 | 18 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformeditor.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | QDesignerObjectInspectorInterface *objectInspector = 0; 3 | objectInspector = formEditor->objectInspector(); 4 | 5 | QDesignerFormWindowManagerInterface *manager = 0; 6 | manager = formEditor->formWindowManager(); 7 | 8 | objectInspector->setFormWindow(manager->formWindow(0)); 9 | //! [0] 10 | 11 | 12 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformwindowcursor.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | QDesignerFormWindowInterface *formWindow = 0; 3 | formWindow = QDesignerFormWindowInterface::findFormWindow(myWidget); 4 | 5 | formWindow->cursor()->setProperty(myWidget, myProperty, newValue); 6 | //! [0] 7 | 8 | 9 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformwindowmanager.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | QDesignerFormWindowManagerInterface *manager = 0; 3 | QDesignerFormWindowInterface *formWindow = 0; 4 | 5 | manager = formEditor->formWindowManager(); 6 | formWindow = manager->formWindow(0); 7 | 8 | manager->setActiveFormWindow(formWindow); 9 | //! [0] 10 | 11 | 12 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractobjectinspector.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | QDesignerObjectInspectorInterface *objectInspector = 0; 3 | objectInspector = formEditor->objectInspector(); 4 | 5 | QDesignerFormWindowManagerInterface *manager = 0; 6 | manager = formEditor->formWindowManager(); 7 | 8 | objectInspector->setFormWindow(manager->formWindow(0)); 9 | //! [0] 10 | 11 | 12 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_uilib_abstractformbuilder.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | MyForm::MyForm(QWidget *parent) 3 | : QWidget(parent) 4 | { 5 | QFormBuilder builder; 6 | QFile file(":/forms/myWidget.ui"); 7 | file.open(QFile::ReadOnly); 8 | QWidget *myWidget = builder.load(&file, this); 9 | file.close(); 10 | 11 | QVBoxLayout *layout = new QVBoxLayout; 12 | layout->addWidget(myWidget); 13 | setLayout(layout); 14 | } 15 | //! [0] 16 | 17 | 18 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/tools_patternist_qapplicationargumentparser.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | \include main.cpp 3 | //! [0] 4 | 5 | 6 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/tools_shared_qtpropertybrowser_qtvariantproperty.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | QtVariantPropertyManager *variantPropertyManager; 3 | QtProperty *property; 4 | 5 | variantPropertyManager->setValue(property, 10); 6 | //! [0] 7 | 8 | 9 | //! [1] 10 | QtVariantPropertyManager *variantPropertyManager; 11 | QtVariantProperty *property; 12 | 13 | property->setValue(10); 14 | //! [1] 15 | 16 | 17 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/tools_shared_qttoolbardialog_qttoolbardialog.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | QtToolBarManager *toolBarManager; 3 | 4 | void MyMainWindow::customize() 5 | { 6 | QtToolBarDialog dialog(this); 7 | dialog.setToolBarManager(toolBarManager); 8 | dialog.exec(); 9 | } 10 | //! [0] 11 | 12 | 13 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/console/dbus_pingpong.txt: -------------------------------------------------------------------------------- 1 | [qtuser@workstation:~/dev/qt-4.4/examples/dbus/pingpong]$ ./pong & 2 | [qtuser@workstation:~/dev/qt-4.4/examples/dbus/pingpong]$ ./ping Hello 3 | Reply was: ping("Hello") got called 4 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/dockwidgets/Resources/titles.txt: -------------------------------------------------------------------------------- 1 | Qt Classes by Module :/Resources/modules.html 2 | QtCore :/Resources/qtcore.html 3 | QtGui :/Resources/qtgui.html 4 | QtNetwork :/Resources/qtnetwork.html 5 | QtOpenGL :/Resources/qtopengl.html 6 | QtSql :/Resources/qtsql.html 7 | QtXml :/Resources/qtxml.html 8 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/dockwidgets/dockwidgets.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | Resources/titles.txt 4 | Resources/modules.html 5 | Resources/qtcore.html 6 | Resources/qtgui.html 7 | Resources/qtnetwork.html 8 | Resources/qtopengl.html 9 | Resources/qtsql.html 10 | Resources/qtxml.html 11 | 12 | 13 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/dragging/images.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/file.png 4 | 5 | 6 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/dragging/images/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/codesnippets/doc/src/snippets/dragging/images/file.png -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/filedialogurls.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | int main(int argv, char **args) 5 | { 6 | QApplication app(argv, args); 7 | 8 | //![0] 9 | QList urls; 10 | urls << QUrl::fromLocalFile("/home/gvatteka/dev/qt-45") 11 | << QUrl::fromLocalFile(QDesktopServices::storageLocation(QDesktopServices::MusicLocation)); 12 | 13 | QFileDialog dialog; 14 | dialog.setSidebarUrls(urls); 15 | dialog.setFileMode(QFileDialog::AnyFile); 16 | if(dialog.exec()) { 17 | // ... 18 | } 19 | //![0] 20 | 21 | return app.exec(); 22 | } 23 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/i18n-non-qt-class/myclass.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | MyClass 5 | 6 | 7 | Hello Qt! 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/i18n-non-qt-class/resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | translations/i18n-non-qt-class_en.qm 4 | translations/i18n-non-qt-class_fr.qm 5 | 6 | 7 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/i18n-non-qt-class/translations/i18n-non-qt-class_en.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | MyClass 5 | 6 | 7 | Hello Qt! 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/i18n-non-qt-class/translations/i18n-non-qt-class_fr.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | MyClass 5 | 6 | 7 | Hello Qt! 8 | 9 | Bonjour Qt! 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/ntfsp.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | //! [0] 4 | extern Q_CORE_EXPORT int qt_ntfs_permission_lookup; 5 | //! [0] 6 | 7 | //! [1] 8 | qt_ntfs_permission_lookup += 1 // turn checking on 9 | qt_ntfs_permission_lookup += 1 // turn it off again 10 | //! [1] 11 | 12 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/anyHTMLElement.xq: -------------------------------------------------------------------------------- 1 | doc('data.xml')/*:body 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/anyXLinkAttribute.xq: -------------------------------------------------------------------------------- 1 | declare namespace xlink = "http://www.w3.org/1999/xlink"; 2 | doc('image.svg')//@xlink:* 3 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/bracesIncluded.xq: -------------------------------------------------------------------------------- 1 | {sum((1, 2, 3))} 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/bracesIncludedResult.xml: -------------------------------------------------------------------------------- 1 | 6 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/bracesOmitted.xq: -------------------------------------------------------------------------------- 1 | sum({(1, 2, 3)}) 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/bracesOmittedResult.xml: -------------------------------------------------------------------------------- 1 | 2 | sum(1 2 3) -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/computedTreeFragment.xq: -------------------------------------------------------------------------------- 1 | declare default element namespace "http://example.com/Namespace"; 2 | declare variable $documentElementName := "doc"; 3 | 4 | element {$documentElementName} 5 | { 6 | attribute xml:base {"http://example.com/"}, 7 | element anotherElement 8 | { 9 | comment {" a comment "}, 10 | processing-instruction target {"data"}, 11 | element anotherElement {()}, 12 | text {"some text"} 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/copyAttribute.xq: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 | { 5 | doc('feed.rss')/rss/@version 6 | } 7 |

8 | 9 | 10 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/copyID.xq: -------------------------------------------------------------------------------- 1 | (: Copy the value of xml:id attribute from other.html. This is a comment by the way! :) 2 | 4 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/directTreeFragment.xq: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | some text 7 | 8 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/doc.txt: -------------------------------------------------------------------------------- 1 | 2 |

3 | 1 4 | 2 5 |

6 |

7 | 3 8 | 4 9 |

10 |

11 | 5 12 | 6 13 |

14 |

15 | 7 16 | 8 17 |

18 |

19 | 9 20 | a 21 |

22 |

23 | b 24 | c 25 |

26 |

27 | d 28 | e 29 |

30 |

31 | f 32 | 0 33 |

34 |
35 | 36 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/docPlainHTML.xq: -------------------------------------------------------------------------------- 1 | doc("myPlainHTML.html")/body 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/docPlainHTML2.xq: -------------------------------------------------------------------------------- 1 | doc("myPlainHTML.html")/html/body 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/embedDataInXHTML.xq: -------------------------------------------------------------------------------- 1 | declare default element namespace "http://www.w3.org/1999/xhtml"; 2 | 3 | 4 | { 5 | for $i in doc("testResult.xml")/tests/test[@status = "failure"] 6 | order by $i/@name 7 | return

{$i/@name}

8 | } 9 | 10 | 11 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/embedDataInXHTML2.xq: -------------------------------------------------------------------------------- 1 | declare namespace x = "http://www.w3.org/1998/xhtml"; 2 | 3 | 4 | { 5 | for $i in doc("testResult.xml")/tests/test[@status = "failure"] 6 | order by $i/@name 7 | return {$i/@name} 8 | } 9 | 10 | 11 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/emptyParagraphs.xq: -------------------------------------------------------------------------------- 1 | doc('index.html')//p[string-length(.) = 0] 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/escapeCurlyBraces.xq: -------------------------------------------------------------------------------- 1 | 2 | This is one left followed by one right curly brace: {{ }} 3 | Here they are again, but with character references: { } 4 | 5 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/escapeStringLiterals.xml: -------------------------------------------------------------------------------- 1 |

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

-------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/escapeStringLiterals.xq: -------------------------------------------------------------------------------- 1 |

2 | { 3 | """I hate quotations"" -- Ralph Waldo Emerson""", 4 | " ", 5 | '''"I hate quotations"" -- Ralph Waldo Emerson"'', appeared above' 6 | } 7 |

8 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/expressionInsideAttribute.xq: -------------------------------------------------------------------------------- 1 | declare variable $additionalClass := "example"; 2 |

3 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/filterOnPath.xq: -------------------------------------------------------------------------------- 1 | let $doc := doc('doc.txt') 2 | return ($doc/doc/p/span)[1] 3 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/filterOnStep.xq: -------------------------------------------------------------------------------- 1 | let $doc := doc('doc.txt') 2 | return $doc/doc/p/span[1] -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/firstParagraph.xq: -------------------------------------------------------------------------------- 1 | doc("index.html")/html/body/p[@xml:id = "thatSpecialOne"] 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/fnStringOnAttribute.xq: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 | { 5 | string(doc('feed.rss')/rss/@version) 6 | } 7 |

8 | 9 | 10 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/forClause.xq: -------------------------------------------------------------------------------- 1 | for $i in(reverse(1 to 10)), 2 | $d in xs:integer(doc("numbers.xml")/numbers/number) 3 | return ($i + $d) 4 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/forClause2.xq: -------------------------------------------------------------------------------- 1 | for $i in(reverse(1 to 10)), 2 | $d in xs:integer(doc("numbers.xml")/numbers/number) 3 | return $i + $d 4 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/forClauseOnFeed.xq: -------------------------------------------------------------------------------- 1 | for $item in doc('feed.rss')//item 2 | return

3 | { 4 | $item/description/node() 5 | } 6 |

7 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/indented.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Some Text

5 |
6 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/introAcneRemover.xq: -------------------------------------------------------------------------------- 1 | 2 | The following skin care products have shipped, ordered by shipping date(oldest first): 3 | { 4 | for $i in doc("myOrders.xml")/orders/order[@product = "Acme Skin Care"] 5 | order by xs:date($i/@shippingDate) descending 6 | return $i 7 | } 8 | 9 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/introExample2.xq: -------------------------------------------------------------------------------- 1 | 2 | { 3 | doc($file)/bib/book[publisher = $publisher and @year > $year]/{title} 4 | } 5 | 6 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/introFileHierarchy.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | ... 10 | 11 | 12 | ... 13 | 14 | 15 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/introNavigateFS.xq: -------------------------------------------------------------------------------- 1 | declare variable $myRoot := ; (: This line is a dummy and shouldn't appear in the documentation. :) 2 | 3 | 4 | { 5 | $myRoot//file[@mimetype = 'text/xml' or @mimetype = 'application/xml'] 6 | / 7 | (if(doc-available(@uri)) 8 | then () 9 | else

Failed to parse file {@uri}.

) 10 | } 11 | 12 | 13 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/introductionExample.xq: -------------------------------------------------------------------------------- 1 | 2 | {doc("library.xml")/bib/book[publisher="Addison-Wesley" and @year>1991]/{title}} 3 | 4 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/invalidLetOrderBy.xq: -------------------------------------------------------------------------------- 1 | let $i := (2, 3, 1) 2 | order by $i[1] 3 | return $i 4 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/items.xq: -------------------------------------------------------------------------------- 1 | , 2 | xs:base64Binary("FFFF"), 3 | current-date(), 4 | 3e3, (: A floating point value :) 5 | attribute {"name"} {()} 6 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/letOrderBy.xq: -------------------------------------------------------------------------------- 1 | for $a in (8, -4, 2) 2 | let $b := ($a * -1, $a) 3 | order by $a 4 | return $b 5 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/literalsAndOperators.xq: -------------------------------------------------------------------------------- 1 | declare variable $date := fn:current-date(); (: This line should not be part of the example. It exists in order to make the query valid. :) 2 | fn:current-date() - $date > xs:dayTimeDuration("P365D") 3 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/mobeyDick.xml: -------------------------------------------------------------------------------- 1 | 3 | Mobey Dick ... 4 | 5 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/nextLastParagraph.xq: -------------------------------------------------------------------------------- 1 | doc('index.html')//p[last() - 1] 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/nodeConstructorsAreExpressions.xq: -------------------------------------------------------------------------------- 1 | let $docURI := 'maybeNotWellformed.xml' 2 | return if(doc-available($docURI)) 3 | then doc($docURI)//p/{./node()} 4 | else Failed to load {$docURI} 5 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/nodeConstructorsInPaths.xq: -------------------------------------------------------------------------------- 1 | doc('feed.rss')//item/

{description/node()}

2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/nodeTestChildElement.xq: -------------------------------------------------------------------------------- 1 | doc('index.html')/descendant-or-self::element(p)/child::element(span) 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/notIndented.xml: -------------------------------------------------------------------------------- 1 |

Some Text

2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/oneElementConstructor.xq: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/paragraphsExceptTheFiveFirst.xq: -------------------------------------------------------------------------------- 1 | doc('index.html')//p[position() > 5] 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/paragraphsWithTables.xq: -------------------------------------------------------------------------------- 1 | doc('index.html')/html/body/p[table] 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/pathAB.xq: -------------------------------------------------------------------------------- 1 | doc('index.html')//p/span 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/pathsAllParagraphs.xq: -------------------------------------------------------------------------------- 1 | doc('index.html')//p 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/simpleHTML.xq: -------------------------------------------------------------------------------- 1 | doc("index.html")/html/body/p[@class="example"] 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/simpleXHTML.xq: -------------------------------------------------------------------------------- 1 | declare namespace x = "http://www.w3.org/1999/xhtml/"; 2 | doc("index.html")/x:html/x:body/x:p[@class="example"] 3 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/svgDocumentElement.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/tablesInParagraphs.xq: -------------------------------------------------------------------------------- 1 | doc('index.html')/html/body/p/table 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/twoSVGElements.xq: -------------------------------------------------------------------------------- 1 | declare namespace s = "http://www.w3.org/2000/svg"; 2 | declare default element namespace "http://www.w3.org/2000/svg"; 3 | let $doc := doc('image.svg') 4 | return ($doc/svg, 5 | $doc/s:svg) 6 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/xmlStylesheet.xq: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/xsBooleanTrue.xq: -------------------------------------------------------------------------------- 1 | xs:boolean("true") 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/xsvgDocumentElement.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/printing-qprinter/errors.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | printer = QPrinter() 3 | printer.setOutputFormat(QPrinter.PdfFormat) 4 | printer.setOutputFileName("/foobar/nonwritable.pdf") 5 | QPainter painter 6 | if painter.begin(printer): # failed to open file 7 | print "failed to open file, is it writable?" 8 | return 1 9 | 10 | painter.drawText(10, 10, "Test") 11 | if !printer.Page(): 12 | print "failed in flushing page to disk, disk full?" 13 | return 1 14 | 15 | painter.drawText(10, 10, "Test 2") 16 | painter.end() 17 | //! [0] 18 | 19 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/qsplashscreen/qsplashscreen.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | splash.png 4 | 5 | 6 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/qsplashscreen/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/codesnippets/doc/src/snippets/qsplashscreen/splash.png -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/qsvgwidget/qsvgwidget.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | spheres.svg 4 | 5 | 6 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/qtablewidget-dnd/Images/cubed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/codesnippets/doc/src/snippets/qtablewidget-dnd/Images/cubed.png -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/qtablewidget-dnd/Images/squared.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/codesnippets/doc/src/snippets/qtablewidget-dnd/Images/squared.png -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/qtablewidget-dnd/images.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | Images/squared.png 4 | Images/cubed.png 5 | 6 | 7 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/qtablewidget-using/Images/cubed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/codesnippets/doc/src/snippets/qtablewidget-using/Images/cubed.png -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/qtablewidget-using/Images/squared.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/codesnippets/doc/src/snippets/qtablewidget-using/Images/squared.png -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/qtablewidget-using/images.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | Images/squared.png 4 | Images/cubed.png 5 | 6 | 7 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/qtscript/scriptedslot/object.js: -------------------------------------------------------------------------------- 1 | function Object(timer, editor) 2 | { 3 | this.editor = editor; 4 | this.counter = 0; 5 | timer.timeout.connect(notify); 6 | timer.timeout.connect(this, this.addLine); 7 | } 8 | 9 | Object.prototype.addLine = function() 10 | { 11 | this.editor.append(this.counter); 12 | this.counter += 1; 13 | } 14 | 15 | function notify() 16 | { 17 | print("timeout() received"); 18 | } 19 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/qtscript/scriptedslot/scriptedslot.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | object.js 4 | 5 | 6 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/quiloader/mywidget.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | myform.ui 4 | 5 | 6 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/qxmlquery/bindingExample.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | QBuffer device; 3 | device.setData(myQString.toUtf8()); 4 | device.open(QIODevice::ReadOnly); 5 | 6 | QXmlQuery query; 7 | query.setQuery("doc($inputDocument)/query[theDocument]"); 8 | query.bindVariable("inputDocument", &device); 9 | //! [0] 10 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/signalmapper/accountsfile.txt: -------------------------------------------------------------------------------- 1 | 1 + 1 = 2 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/signalmapper/filereader.h: -------------------------------------------------------------------------------- 1 | #ifndef FILEREADER_H 2 | #define FILEREADER_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class FileReader : public QWidget 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | FileReader(QWidget *parent=0); 14 | void readFromFile(QString filename); 15 | 16 | public slots: 17 | void readFile(const QString &); 18 | 19 | private: 20 | QTextEdit *textEdit; 21 | QPushButton *taxFileButton; 22 | QPushButton *accountFileButton; 23 | QPushButton *reportFileButton; 24 | QSignalMapper *signalMapper; 25 | }; 26 | 27 | #endif 28 | 29 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/signalmapper/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "filereader.h" 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication app(argc, argv); 7 | 8 | FileReader *reader = new FileReader; 9 | reader->show(); 10 | 11 | return app.exec(); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/signalmapper/reportfile.txt: -------------------------------------------------------------------------------- 1 | Tax this year = 50% 2 | Total profit = 2 3 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/signalmapper/taxfile.txt: -------------------------------------------------------------------------------- 1 | Tax this year = 50% 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/stylesheet/common-mistakes.cpp: -------------------------------------------------------------------------------- 1 | //! [1] 2 | QPushButton { 3 | color: grey; 4 | border-image: url(/home/kamlie/code/button.png) 3 10 3 10; 5 | border-top: 3px transparent; 6 | border-bottom: 3px transparent; 7 | border-right: 10px transparent; 8 | border-left: 10px transparent; 9 | } 10 | //! [1] 11 | 12 | 13 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/textdocument-imageformat/images.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/advert.png 4 | images/newimage.png 5 | 6 | 7 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/textdocument-imageformat/images/advert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/codesnippets/doc/src/snippets/textdocument-imageformat/images/advert.png -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/textdocument-imageformat/images/newimage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/codesnippets/doc/src/snippets/textdocument-imageformat/images/newimage.png -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/textdocument-images/images.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/advert.png 4 | 5 | 6 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/textdocument-images/images/advert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/codesnippets/doc/src/snippets/textdocument-images/images/advert.png -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/videomedia.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include 4 | #include 5 | 6 | 7 | int main(int argv, char **args) 8 | { 9 | QApplication app(argv, args); 10 | 11 | Phonon::VideoPlayer *player = new Phonon::VideoPlayer(Phonon::VideoCategory, 0); 12 | 13 | //![0] 14 | player->mediaObject()->isSeekable(); 15 | //![0] 16 | 17 | return app.exec(); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/widget-mask/mask.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | tux.png 4 | 5 | 6 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/widget-mask/tux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/codesnippets/doc/src/snippets/widget-mask/tux.png -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/widgets-tutorial/childwidget/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char *argv[]) 4 | { 5 | QApplication app(argc, argv); 6 | QWidget *window = new QWidget(); 7 | window->resize(320, 240); 8 | window->setWindowTitle(tr("Child widget")); 9 | window->show(); 10 | 11 | //! [create, position and show] 12 | QPushButton *button = new QPushButton(tr("Press me"), window); 13 | button->move(100, 100); 14 | button->show(); 15 | //! [create, position and show] 16 | return app.exec(); 17 | } 18 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/widgets-tutorial/toplevel/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char *argv[]) 4 | { 5 | QApplication app(argc, argv); 6 | //! [create, resize and show] 7 | QWidget *window = new QWidget(); 8 | window->resize(320, 240); 9 | window->show(); 10 | //! [create, resize and show] 11 | window->setWindowTitle(tr("Top-level widget")); 12 | return app.exec(); 13 | } 14 | -------------------------------------------------------------------------------- /doc/codesnippets/examples/declarative/cppextensions/imageprovider/imageprovider-example.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 1.0 2 | import "ImageProviderCore" // import the plugin that registers the color image provider 3 | 4 | //![0] 5 | Column { 6 | Image { source: "image://colors/yellow" } 7 | Image { source: "image://colors/red" } 8 | } 9 | //![0] 10 | -------------------------------------------------------------------------------- /doc/codesnippets/examples/declarative/cppextensions/plugins/plugin.cpp: -------------------------------------------------------------------------------- 1 | 2 | //![0] 3 | class TimeModel (QObject): 4 | hour = Property(int, getHour, notify = timeChanged) 5 | minute = Property(int, getMinute, notify = timeChanged) 6 | //![0] 7 | 8 | //![plugin] 9 | class QExampleQmlPlugin (QDeclarativeExtensionPlugin): 10 | 11 | def registerTypes(self, uri): 12 | assert(uri == "com.nokia.TimeExample") 13 | qmlRegisterType(TimeModel, uri, 1, 0, "Time") 14 | //![plugin] 15 | 16 | //![export] 17 | # This isn't supported by PySide yet. 18 | # Q_EXPORT_PLUGIN2(qmlqtimeexampleplugin, QExampleQmlPlugin); 19 | //![export] 20 | -------------------------------------------------------------------------------- /doc/codesnippets/examples/dialogs/classwizard/classwizard.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/background.png 4 | images/banner.png 5 | images/logo1.png 6 | images/logo2.png 7 | images/logo3.png 8 | images/watermark1.png 9 | images/watermark2.png 10 | 11 | 12 | -------------------------------------------------------------------------------- /doc/codesnippets/examples/dialogs/classwizard/images/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/codesnippets/examples/dialogs/classwizard/images/background.png -------------------------------------------------------------------------------- /doc/codesnippets/examples/dialogs/classwizard/images/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/codesnippets/examples/dialogs/classwizard/images/banner.png -------------------------------------------------------------------------------- /doc/codesnippets/examples/dialogs/classwizard/images/logo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/codesnippets/examples/dialogs/classwizard/images/logo1.png -------------------------------------------------------------------------------- /doc/codesnippets/examples/dialogs/classwizard/images/logo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/codesnippets/examples/dialogs/classwizard/images/logo2.png -------------------------------------------------------------------------------- /doc/codesnippets/examples/dialogs/classwizard/images/logo3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/codesnippets/examples/dialogs/classwizard/images/logo3.png -------------------------------------------------------------------------------- /doc/codesnippets/examples/dialogs/classwizard/images/watermark1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/codesnippets/examples/dialogs/classwizard/images/watermark1.png -------------------------------------------------------------------------------- /doc/codesnippets/examples/dialogs/classwizard/images/watermark2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/codesnippets/examples/dialogs/classwizard/images/watermark2.png -------------------------------------------------------------------------------- /doc/codesnippets/examples/dialogs/licensewizard/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/codesnippets/examples/dialogs/licensewizard/images/logo.png -------------------------------------------------------------------------------- /doc/codesnippets/examples/dialogs/licensewizard/images/watermark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/codesnippets/examples/dialogs/licensewizard/images/watermark.png -------------------------------------------------------------------------------- /doc/codesnippets/examples/dialogs/licensewizard/licensewizard.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/logo.png 4 | images/watermark.png 5 | 6 | 7 | -------------------------------------------------------------------------------- /doc/codesnippets/examples/mainwindows/sdi/mainwindow.cpp: -------------------------------------------------------------------------------- 1 | 2 | //! [implicit tr context] 3 | def createMenus(self): 4 | fileMenu = menuBar().addMenu("&File") 5 | //! [implicit tr context] 6 | 7 | //! [0] 8 | fileToolBar = addToolBar("File") 9 | fileToolBar.addAction(newAct) 10 | fileToolBar.addAction(openAct) 11 | //! [0] 12 | -------------------------------------------------------------------------------- /doc/codesnippets/snippets/customstyle/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | //! [using a custom style] 3 | import sys 4 | from PySide.QtGui import * 5 | 6 | QApplication.setStyle(CustomStyle()) 7 | app = QApplication(sys.argv) 8 | spinBox = QSpinBox() 9 | spinBox.show() 10 | sys.exit(app.exec_()) 11 | 12 | //! [using a custom style] 13 | -------------------------------------------------------------------------------- /doc/codesnippets/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp: -------------------------------------------------------------------------------- 1 | 2 | def wrapInFunction(): 3 | //! [0] 4 | # ... 5 | page = QWebPage() 6 | # ... 7 | 8 | inspector = QWebInspector() 9 | inspector.setPage(page) 10 | //! [0] 11 | 12 | -------------------------------------------------------------------------------- /doc/codesnippets/webkitsnippets/qtwebkit_qwebview_snippet.cpp: -------------------------------------------------------------------------------- 1 | 2 | def wrapInFunction(): 3 | //! [0] 4 | view.page().history() 5 | //! [0] 6 | 7 | 8 | //! [1] 9 | view.page().settings() 10 | //! [1] 11 | 12 | 13 | //! [2] 14 | view.triggerAction(QWebPage.Copy) 15 | //! [2] 16 | 17 | 18 | //! [3] 19 | view.page().triggerPageAction(QWebPage.Stop) 20 | //! [3] 21 | 22 | 23 | //! [4] 24 | view.page().triggerPageAction(QWebPage.GoBack) 25 | //! [4] 26 | 27 | 28 | //! [5] 29 | view.page().triggerPageAction(QWebPage.GoForward) 30 | //! [5] 31 | 32 | -------------------------------------------------------------------------------- /doc/codesnippets/webkitsnippets/simple/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | from PySide.QtCore import * 3 | from PySide.QtGui import * 4 | from PySide.QtWebKit import * 5 | import sys 6 | 7 | app = QApplication(sys.argv) 8 | parent = None 9 | //! [Using QWebView] 10 | view = QWebView(parent) 11 | view.load(QUrl("http://qt.nokia.com/")) 12 | view.show() 13 | //! [Using QWebView] 14 | sys.exit(app.exec_()) 15 | -------------------------------------------------------------------------------- /doc/contents.rst: -------------------------------------------------------------------------------- 1 | PySide Documentation contents 2 | ***************************** 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | 7 | modules.rst 8 | 9 | Tutorials 10 | ========= 11 | 12 | .. toctree:: 13 | :maxdepth: 2 14 | 15 | tutorials/index.rst 16 | 17 | Other stuff 18 | =========== 19 | 20 | .. toctree:: 21 | :maxdepth: 1 22 | 23 | pysideapi2.rst 24 | pysideversion.rst 25 | 26 | Module Index 27 | ============ 28 | 29 | * :ref:`modindex` 30 | 31 | -------------------------------------------------------------------------------- /doc/extras/PySide.QtCore.ClassInfo.rst: -------------------------------------------------------------------------------- 1 | .. module:: PySide.QtCore 2 | .. _ClassInfo: 3 | 4 | ClassInfo 5 | ********* 6 | 7 | This class is used to associates extra information to the class, which is available 8 | using QObject.metaObject(). Qt and PySide doesn't use this information. 9 | 10 | The extra information takes the form of a dictionary with key and value in a literal string. 11 | 12 | .. note:: This Class is a implementation of Q_CLASSINFO macro. 13 | 14 | 15 | Example 16 | ------- 17 | 18 | :: 19 | 20 | @ClassInfo(Author='PySide Team', URL='http://www.pyside.org') 21 | class MyObject(QObject): 22 | ... 23 | 24 | -------------------------------------------------------------------------------- /doc/extras/PySide.QtCore.rst: -------------------------------------------------------------------------------- 1 | All other Qt modules rely on this module. To include the definitions of the module's classes, use the following directive: 2 | 3 | :: 4 | 5 | import PySide.QtCore 6 | -------------------------------------------------------------------------------- /doc/extras/PySide.QtDeclarative.rst: -------------------------------------------------------------------------------- 1 | To include the definitions of the module's classes, use the following directive: 2 | 3 | :: 4 | 5 | import PySide.QtDeclarative 6 | -------------------------------------------------------------------------------- /doc/extras/PySide.QtGui.rst: -------------------------------------------------------------------------------- 1 | To include the definitions of modules classes, use the following directive: 2 | 3 | :: 4 | 5 | import PySide.QtGui 6 | 7 | .. seealso:: :mod:`PySide.QtCore` 8 | -------------------------------------------------------------------------------- /doc/extras/PySide.QtMultimedia.rst: -------------------------------------------------------------------------------- 1 | To include the definitions of the module's classes, use the following directive: 2 | 3 | :: 4 | 5 | import PySide.QtMultimedia 6 | 7 | 8 | -------------------------------------------------------------------------------- /doc/extras/PySide.QtNetwork.rst: -------------------------------------------------------------------------------- 1 | To include the definitions of the module's classes, use the following directive: 2 | 3 | :: 4 | 5 | import PySide.QtNetwork 6 | -------------------------------------------------------------------------------- /doc/extras/PySide.QtScriptTools.rst: -------------------------------------------------------------------------------- 1 | Applications that use the Qt Script Tools classes need to be configured to be built against the QtScriptTools module. To include the definitions of the module's classes, use the following directive: 2 | 3 | :: 4 | 5 | import PySide.QtScriptTools 6 | -------------------------------------------------------------------------------- /doc/extras/PySide.QtSql.rst: -------------------------------------------------------------------------------- 1 | To include the definitions of the module's classes, use the following directive: 2 | 3 | :: 4 | 5 | import PySide.QtSql 6 | -------------------------------------------------------------------------------- /doc/extras/PySide.QtTest.rst: -------------------------------------------------------------------------------- 1 | To include the definitions of the module's classes, use the following directive: 2 | 3 | :: 4 | 5 | import PySide.QtTest 6 | 7 | .. note:: All macros in the C++ version of QtTest were not binded in PySide, this module is useful only for GUI testing and benchmarking, for ordinary unit testing you should use the ``unittest`` Python module. 8 | -------------------------------------------------------------------------------- /doc/extras/PySide.QtXml.rst: -------------------------------------------------------------------------------- 1 | To include the definitions of the module's classes, use the following directive: 2 | 3 | :: 4 | 5 | import PySide.QtXml 6 | -------------------------------------------------------------------------------- /doc/tutorials/index.rst: -------------------------------------------------------------------------------- 1 | PySide tutorials 2 | **************** 3 | 4 | A collection of tutorials and "walkthrough" guides are provided with PySide to help new users get started with PySide development. These documents were ported from C++ to Python and cover a range of topics, from basic use of widgets to step-by-step tutorials that show how an application is put together. 5 | 6 | .. toctree:: 7 | :maxdepth: 2 8 | 9 | qmltutorial/index.rst 10 | qmladvancedtutorial/index.rst 11 | -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/declarative-adv-tutorial1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/tutorials/qmladvancedtutorial/declarative-adv-tutorial1.png -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/declarative-adv-tutorial2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/tutorials/qmladvancedtutorial/declarative-adv-tutorial2.png -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/declarative-adv-tutorial3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/tutorials/qmladvancedtutorial/declarative-adv-tutorial3.png -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/declarative-adv-tutorial4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/tutorials/qmladvancedtutorial/declarative-adv-tutorial4.gif -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/declarative-samegame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/tutorials/qmladvancedtutorial/declarative-samegame.png -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/samegame.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/tutorials/qmladvancedtutorial/samegame.tar.bz2 -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/samegame/samegame1/samegame1.qmlproject: -------------------------------------------------------------------------------- 1 | import QmlProject 1.0 2 | 3 | Project { 4 | /* Include .qml, .js, and image files from current directory and subdirectories */ 5 | QmlFiles { 6 | directory: "." 7 | } 8 | JavaScriptFiles { 9 | directory: "." 10 | } 11 | ImageFiles { 12 | directory: "." 13 | } 14 | /* List of plugin directories passed to QML runtime */ 15 | // importPaths: [ " ../exampleplugin " ] 16 | } 17 | -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/samegame/samegame2/samegame2.qmlproject: -------------------------------------------------------------------------------- 1 | import QmlProject 1.0 2 | 3 | Project { 4 | /* Include .qml, .js, and image files from current directory and subdirectories */ 5 | QmlFiles { 6 | directory: "." 7 | } 8 | JavaScriptFiles { 9 | directory: "." 10 | } 11 | ImageFiles { 12 | directory: "." 13 | } 14 | /* List of plugin directories passed to QML runtime */ 15 | // importPaths: [ " ../exampleplugin " ] 16 | } 17 | -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/samegame/samegame3/samegame3.qmlproject: -------------------------------------------------------------------------------- 1 | import QmlProject 1.0 2 | 3 | Project { 4 | /* Include .qml, .js, and image files from current directory and subdirectories */ 5 | QmlFiles { 6 | directory: "." 7 | } 8 | JavaScriptFiles { 9 | directory: "." 10 | } 11 | ImageFiles { 12 | directory: "." 13 | } 14 | /* List of plugin directories passed to QML runtime */ 15 | // importPaths: [ " ../exampleplugin " ] 16 | } 17 | -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/samegame/samegame4/highscores/README: -------------------------------------------------------------------------------- 1 | The SameGame example can interface with a simple PHP script to store XML high score data on a remote server. We do not have a publically accessible server available for this use, but if you have access to a PHP capable webserver you can copy the files (score_data.xml, score.php, score_style.xsl) to it and alter the highscore_server variable at the top of the samegame.js file to point to it. 2 | -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/samegame/samegame4/highscores/score_data.xml: -------------------------------------------------------------------------------- 1 | 1000000Alan the Tester0x00 2 | 6213Alan12x1751 3 | -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/samegame/samegame4/samegame4.qmlproject: -------------------------------------------------------------------------------- 1 | import QmlProject 1.0 2 | 3 | Project { 4 | /* Include .qml, .js, and image files from current directory and subdirectories */ 5 | QmlFiles { 6 | directory: "." 7 | } 8 | JavaScriptFiles { 9 | directory: "." 10 | } 11 | ImageFiles { 12 | directory: "." 13 | } 14 | /* List of plugin directories passed to QML runtime */ 15 | // importPaths: [ " ../exampleplugin " ] 16 | } 17 | -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/samegame/shared/pics/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/tutorials/qmladvancedtutorial/samegame/shared/pics/background.jpg -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/samegame/shared/pics/blueStar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/tutorials/qmladvancedtutorial/samegame/shared/pics/blueStar.png -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/samegame/shared/pics/blueStone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/tutorials/qmladvancedtutorial/samegame/shared/pics/blueStone.png -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/samegame/shared/pics/greenStar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/tutorials/qmladvancedtutorial/samegame/shared/pics/greenStar.png -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/samegame/shared/pics/greenStone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/tutorials/qmladvancedtutorial/samegame/shared/pics/greenStone.png -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/samegame/shared/pics/redStar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/tutorials/qmladvancedtutorial/samegame/shared/pics/redStar.png -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/samegame/shared/pics/redStone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/tutorials/qmladvancedtutorial/samegame/shared/pics/redStone.png -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/samegame/shared/pics/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/tutorials/qmladvancedtutorial/samegame/shared/pics/star.png -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/samegame/shared/pics/yellowStone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/tutorials/qmladvancedtutorial/samegame/shared/pics/yellowStone.png -------------------------------------------------------------------------------- /doc/tutorials/qmltutorial/declarative-tutorial1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/tutorials/qmltutorial/declarative-tutorial1.png -------------------------------------------------------------------------------- /doc/tutorials/qmltutorial/declarative-tutorial2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/tutorials/qmltutorial/declarative-tutorial2.png -------------------------------------------------------------------------------- /doc/tutorials/qmltutorial/declarative-tutorial3_animation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/tutorials/qmltutorial/declarative-tutorial3_animation.gif -------------------------------------------------------------------------------- /doc/tutorials/qmltutorial/helloworld.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/doc/tutorials/qmltutorial/helloworld.tar.bz2 -------------------------------------------------------------------------------- /libpyside/PySideConfig.cmake.in: -------------------------------------------------------------------------------- 1 | if (NOT PYTHON_BASENAME) 2 | message(STATUS "Using default python: @SHIBOKEN_PYTHON_SUFFIX@") 3 | SET(PYTHON_BASENAME @SHIBOKEN_PYTHON_SUFFIX@) 4 | endif() 5 | include(@LIB_INSTALL_DIR@/cmake/PySide-@BINDING_API_VERSION@/PySideConfig${PYTHON_BASENAME}.cmake) 6 | -------------------------------------------------------------------------------- /libpyside/PySideConfigVersion.cmake.in: -------------------------------------------------------------------------------- 1 | set(PACKAGE_VERSION @BINDING_API_VERSION@) 2 | 3 | if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) 4 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 5 | else("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) 6 | set(PACKAGE_VERSION_COMPATIBLE TRUE) 7 | if( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}") 8 | set(PACKAGE_VERSION_EXACT TRUE) 9 | endif( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}") 10 | endif("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) 11 | -------------------------------------------------------------------------------- /libpyside/pyside.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=@CMAKE_INSTALL_PREFIX@ 3 | libdir=@LIB_INSTALL_DIR@ 4 | includedir=@CMAKE_INSTALL_PREFIX@/include/PySide@pyside_SUFFIX@ 5 | typesystemdir=@CMAKE_INSTALL_PREFIX@/share/PySide@pyside_SUFFIX@/typesystems 6 | pythonpath=@SITE_PACKAGE@ 7 | 8 | Name: PySide@pyside_SUFFIX@ 9 | Description: Support library for Python bindings of Qt-based libraries. 10 | Version: @BINDING_API_VERSION_FULL@ 11 | Libs: -L${libdir} -lpyside@pyside_SUFFIX@@SHIBOKEN_PYTHON_SUFFIX@@LIBRARY_OUTPUT_SUFFIX@ 12 | Cflags: -I${includedir} 13 | Requires: shiboken 14 | 15 | -------------------------------------------------------------------------------- /libpyside/pysideweakref.h: -------------------------------------------------------------------------------- 1 | #ifndef __PYSIDEWEAKREF__ 2 | #define __PYSIDEWEAKREF__ 3 | 4 | #include 5 | #include 6 | 7 | typedef void (*PySideWeakRefFunction)(void* userData); 8 | 9 | namespace PySide { namespace WeakRef { 10 | 11 | PYSIDE_API PyObject* create(PyObject* ob, PySideWeakRefFunction func, void* userData); 12 | 13 | } //PySide 14 | } //WeakRef 15 | 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /tests/QtCore/bug_1031.py: -------------------------------------------------------------------------------- 1 | from PySide.QtCore import QStateMachine, QState 2 | 3 | mach = QStateMachine() 4 | state = QState(mach) 5 | print(state.machine()) 6 | -------------------------------------------------------------------------------- /tests/QtCore/bug_1069.py: -------------------------------------------------------------------------------- 1 | ''' unit test for BUG #1069 ''' 2 | 3 | from PySide import QtCore 4 | import unittest 5 | 6 | class QDataStreamOpOverloadTestCase(unittest.TestCase): 7 | def setUp(self): 8 | self.ba = QtCore.QByteArray() 9 | self.stream = QtCore.QDataStream(self.ba, QtCore.QIODevice.WriteOnly) 10 | 11 | def testIt(self): 12 | self.stream << "hello" 13 | ok = False 14 | for c in self.ba: 15 | if c != b'\x00': 16 | ok = True 17 | break 18 | 19 | self.assertEqual(ok, True) 20 | 21 | if __name__ == "__main__": 22 | unittest.main() 23 | -------------------------------------------------------------------------------- /tests/QtCore/bug_278_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import unittest 4 | 5 | from PySide import QtCore 6 | 7 | def setValue(o): 8 | values = ['Name'] 9 | o.setProperty('test1', values) 10 | 11 | class QQtVersionTest(unittest.TestCase): 12 | '''Tests for QVariant conversion of QStringList''' 13 | 14 | def testGet(self): 15 | o = QtCore.QObject() 16 | setValue(o) 17 | self.assertEqual(o.property('test1'), ['Name']) 18 | 19 | 20 | 21 | if __name__ == '__main__': 22 | unittest.main() 23 | 24 | 25 | -------------------------------------------------------------------------------- /tests/QtCore/bug_332.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import unittest 4 | from PySide import QtCore 5 | 6 | class Lock(QtCore.QMutex): 7 | def tryLock(self,timeoutt=10): 8 | return QtCore.QMutex.tryLock(self,timeoutt) 9 | 10 | class TestBug(unittest.TestCase): 11 | 12 | def testCase(self): 13 | l = Lock() 14 | l.tryLock() # this cause a assertion 15 | 16 | 17 | if __name__ == '__main__': 18 | unittest.main() 19 | -------------------------------------------------------------------------------- /tests/QtCore/bug_428.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | from PySide.QtCore import QObject 4 | 5 | class MyBaseObject(QObject): 6 | def __init__(self, number): 7 | self.myMember = 'myMember' + number 8 | QObject.__init__(self) 9 | 10 | class QObjectConstructorTest(unittest.TestCase): 11 | def testBug(self): 12 | for i in range(10): 13 | number = str(i) 14 | obj = MyBaseObject(number) 15 | self.assertEqual(obj.myMember, 'myMember' + number) 16 | 17 | if __name__ == '__main__': 18 | unittest.main() 19 | -------------------------------------------------------------------------------- /tests/QtCore/bug_505.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | from PySide.QtCore import QObject 4 | 5 | class MyBaseObject(QObject): 6 | def __init__(self, parent=None): 7 | QObject.__init__(self, parent) 8 | self.setObjectName("PySide") 9 | 10 | def __del__(self): 11 | if self.objectName() != "PySide": 12 | raise NameError('Fail') 13 | 14 | class CheckForEventsTypes(unittest.TestCase): 15 | def testDelObject(self): 16 | p = MyBaseObject() 17 | o = MyBaseObject(p) 18 | del o 19 | del p 20 | 21 | if __name__ == '__main__': 22 | unittest.main() 23 | -------------------------------------------------------------------------------- /tests/QtCore/bug_515.py: -------------------------------------------------------------------------------- 1 | """ Unittest for bug #515 """ 2 | """ http://bugs.openbossa.org/show_bug.cgi?id=515 """ 3 | 4 | from PySide import QtCore 5 | 6 | callCleanup = False 7 | def _cleanup(): 8 | global callCleanup 9 | callCleanup = True 10 | 11 | def _checkCleanup(): 12 | global callCleanup 13 | assert(callCleanup) 14 | 15 | app = QtCore.QCoreApplication([]) 16 | QtCore.qAddPostRoutine(_cleanup) 17 | QtCore.qAddPostRoutine(_checkCleanup) 18 | del app 19 | -------------------------------------------------------------------------------- /tests/QtCore/bug_656.py: -------------------------------------------------------------------------------- 1 | from PySide.QtCore import * 2 | 3 | class CoreApp(QCoreApplication): 4 | def __init__(self,*args): 5 | super(CoreApp,self).__init__(*args) 6 | # It shouldn't crash after the __init__ call 7 | 8 | import sys 9 | app = CoreApp(sys.argv) 10 | -------------------------------------------------------------------------------- /tests/QtCore/bug_699.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from PySide.QtCore import * 3 | 4 | class TestBug699 (unittest.TestCase): 5 | 6 | def defClass(self): 7 | class Foo (QObject): 8 | def foo(self): 9 | pass 10 | 11 | prop = Property(foo, foo) 12 | 13 | def testIt(self): 14 | self.assertRaises(TypeError, self.defClass) 15 | 16 | if __name__ == '__main__': 17 | unittest.main() 18 | -------------------------------------------------------------------------------- /tests/QtCore/bug_920.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | import unittest 5 | import PySide.QtCore as QtCore 6 | 7 | class Signaller(QtCore.QObject): 8 | s1 = QtCore.Signal() 9 | s2 = QtCore.Signal() 10 | 11 | class TestBug920(unittest.TestCase): 12 | 13 | def testIt(self): 14 | s = Signaller() 15 | s.s1.connect(self.onSignal) 16 | s.s2.connect(self.onSignal) 17 | self.assertTrue(s.s1.disconnect(self.onSignal)) 18 | self.assertTrue(s.s2.disconnect(self.onSignal)) 19 | 20 | def onSignal(self): 21 | pass 22 | 23 | 24 | if __name__ == "__main__": 25 | unittest.main() 26 | -------------------------------------------------------------------------------- /tests/QtCore/bug_938.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from PySide.QtCore import * 3 | 4 | class TestBug938 (unittest.TestCase): 5 | 6 | def testIt(self): 7 | b = QBuffer() 8 | b.open(QBuffer.WriteOnly) 9 | b.write("\x0023\x005") 10 | b.close() 11 | self.assertEqual(b.buffer().size(), 5) 12 | 13 | if __name__ == '__main__': 14 | unittest.main() 15 | -------------------------------------------------------------------------------- /tests/QtCore/bug_953.py: -------------------------------------------------------------------------------- 1 | from PySide.QtCore import * 2 | 3 | class Dispatcher(QObject): 4 | _me = None 5 | 6 | def __init__(self): 7 | super(Dispatcher, self).__init__() 8 | self._me = self 9 | QTimer.singleShot(0, self._finish) 10 | 11 | def _finish(self): 12 | del self._me # It can't crash here! 13 | QTimer.singleShot(10, QCoreApplication.instance().quit) 14 | 15 | if __name__ == '__main__': 16 | app = QCoreApplication([]) 17 | Dispatcher() 18 | app.exec_() 19 | -------------------------------------------------------------------------------- /tests/QtCore/bug_987.py: -------------------------------------------------------------------------------- 1 | from PySide.QtCore import QObject 2 | 3 | import unittest 4 | 5 | 6 | class TestBug987(unittest.TestCase): 7 | def callback(self): 8 | pass 9 | 10 | def testInvalidDisconnection(self): 11 | o = QObject() 12 | self.assertRaises(RuntimeError, o.destroyed.disconnect, self.callback) 13 | 14 | if __name__ == '__main__': 15 | unittest.main() 16 | -------------------------------------------------------------------------------- /tests/QtCore/bug_PYSIDE-42.py: -------------------------------------------------------------------------------- 1 | from PySide.QtCore import * 2 | from PySide.QtGui import * 3 | import unittest 4 | 5 | class TestBugPYSIDE42 (unittest.TestCase): 6 | 7 | def testIt(self): 8 | obj1 = QFile() 9 | obj2 = QObject() 10 | hash1 = hash(obj1) 11 | hash2 = hash(obj2) 12 | 13 | self.assertNotEqual(hash1, hash2) 14 | self.assertEqual(hash1, hash(obj1)) 15 | 16 | if __name__ == '__main__': 17 | unittest.main() 18 | -------------------------------------------------------------------------------- /tests/QtCore/deletelater_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | '''Test cases for QTimer.singleShot''' 4 | 5 | import unittest 6 | 7 | from PySide.QtCore import QObject, QTimer, QCoreApplication, SIGNAL 8 | from helper import UsesQCoreApplication 9 | 10 | class TestDeleteLater(UsesQCoreApplication): 11 | '''Test case for function DeleteLater''' 12 | 13 | def testCase(self): 14 | o = QObject() 15 | o.deleteLater() 16 | del o 17 | QTimer.singleShot(100, self.app.quit) 18 | self.app.exec_() 19 | 20 | if __name__ == '__main__': 21 | unittest.main() 22 | 23 | -------------------------------------------------------------------------------- /tests/QtCore/inherits_test.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | from PySide.QtCore import QObject 4 | 5 | class MyObject(QObject): 6 | pass 7 | 8 | class MainTest(unittest.TestCase): 9 | def testInherits(self): 10 | o = MyObject() 11 | mo = o.metaObject() 12 | self.assertEqual(mo.className(), 'MyObject') 13 | self.assertTrue(o.inherits('MyObject')) 14 | 15 | if __name__ == '__main__': 16 | unittest.main() 17 | -------------------------------------------------------------------------------- /tests/QtCore/missing_symbols_test.py: -------------------------------------------------------------------------------- 1 | 2 | '''(Very) Simple test case for missing names from QtCore''' 3 | 4 | import unittest 5 | from PySide import QtCore 6 | 7 | class MissingClasses(unittest.TestCase): 8 | 9 | def testQSettings(self): # Bug 232 10 | getattr(QtCore, 'QSettings') 11 | 12 | def testQtTrNoop(self): # Bug 220 13 | getattr(QtCore, 'QT_TR_NOOP') 14 | 15 | if __name__ == '__main__': 16 | unittest.main() 17 | -------------------------------------------------------------------------------- /tests/QtCore/qabs_test.py: -------------------------------------------------------------------------------- 1 | 2 | import unittest 3 | 4 | from PySide import QtCore 5 | 6 | 7 | class QAbsTest(unittest.TestCase): 8 | '''Tests for QtCore.qAbs''' 9 | 10 | def testBasic(self): 11 | def check(x): 12 | self.assertEqual(QtCore.qAbs(x), abs(x)) 13 | 14 | check(0) 15 | check(-10) 16 | check(10) 17 | check(10.5) 18 | check(-10.5) 19 | 20 | if __name__ == '__main__': 21 | unittest.main() 22 | -------------------------------------------------------------------------------- /tests/QtCore/qfileinfo_test.py: -------------------------------------------------------------------------------- 1 | 2 | import unittest 3 | 4 | import os 5 | import tempfile 6 | 7 | from PySide.QtCore import QFile, QFileInfo 8 | 9 | class QFileConstructor(unittest.TestCase): 10 | '''QFileInfo constructor with qfile''' 11 | 12 | def testBasic(self): 13 | '''QFileInfo(QFile)''' 14 | obj = QFileInfo(QFile()) 15 | 16 | if __name__ == '__main__': 17 | unittest.main() 18 | -------------------------------------------------------------------------------- /tests/QtCore/qhandle_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | '''Test cases for QEnum and QFlags''' 3 | 4 | import unittest 5 | 6 | from PySide.QtCore import QThread, Qt 7 | 8 | class TestHANDLE(unittest.TestCase): 9 | def testIntConversion(self): 10 | i = 0 11 | h = QThread.currentThreadId() 12 | i = 0 + int(h) 13 | self.assertEqual(i, int(h)) 14 | 15 | if __name__ == '__main__': 16 | unittest.main() 17 | -------------------------------------------------------------------------------- /tests/QtCore/qlinef_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | '''Test cases for QLineF''' 3 | 4 | import unittest 5 | import os 6 | 7 | from PySide.QtCore import * 8 | 9 | class TestQLineF (unittest.TestCase): 10 | def testIntersect(self): 11 | l1 = QLineF(0, 0, 1, 0) 12 | l2 = QLineF(1, -1, 1, 1) 13 | tuple_ = l1.intersect(l2) 14 | self.assertEquals(tuple, tuple_.__class__) 15 | (value, p) = tuple_ 16 | self.assertEquals(QLineF.BoundedIntersection, value) 17 | self.assertEqual(QPointF(1, 0), p) 18 | 19 | if __name__ == '__main__': 20 | unittest.main() 21 | -------------------------------------------------------------------------------- /tests/QtCore/qobject_destructor.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import unittest 3 | from PySide import QtCore 4 | 5 | class MyObject(QtCore.QObject): 6 | def __init__(self, other=None): 7 | QtCore.QObject.__init__(self, None) 8 | self._o = other 9 | 10 | class TestDestructor(unittest.TestCase): 11 | def testReference(self): 12 | o = QtCore.QObject() 13 | m = MyObject(o) 14 | self.assertEqual(sys.getrefcount(o), 3) 15 | del m 16 | self.assertEqual(sys.getrefcount(o), 2) 17 | 18 | if __name__ == '__main__': 19 | unittest.main() 20 | -------------------------------------------------------------------------------- /tests/QtCore/qpoint_test.py: -------------------------------------------------------------------------------- 1 | 2 | '''Test cases for QPoint and QPointF''' 3 | 4 | import unittest 5 | 6 | from PySide.QtCore import QPoint, QPointF 7 | 8 | 9 | class QPointTest(unittest.TestCase): 10 | 11 | def testQPointCtor(self): 12 | point = QPoint(QPoint(10,20)) 13 | 14 | class QPointFTest(unittest.TestCase): 15 | 16 | def testQPointFCtor(self): 17 | pointf = QPointF(QPoint(10,20)) 18 | 19 | if __name__ == '__main__': 20 | unittest.main() 21 | 22 | -------------------------------------------------------------------------------- /tests/QtCore/qregexp_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import unittest 4 | from PySide.QtCore import QRegExp 5 | 6 | class QRegExpTest(unittest.TestCase): 7 | 8 | def testReplace1(self): 9 | re = QRegExp('a[mn]') 10 | string = re.replace('Banana', 'ox') 11 | self.assertEqual(string, 'Boxoxa') 12 | 13 | def testReplace2(self): 14 | re = QRegExp('([^<]*)') 15 | string = re.replace('A bon mot.', '\\emph{\\1}') 16 | self.assertEqual(string, 'A \\emph{bon mot}.') 17 | 18 | if __name__ == '__main__': 19 | unittest.main() 20 | 21 | -------------------------------------------------------------------------------- /tests/QtCore/qsrand_test.py: -------------------------------------------------------------------------------- 1 | import gc 2 | import unittest 3 | 4 | from PySide.QtCore import qsrand 5 | 6 | class OverflowExceptionCollect(unittest.TestCase): 7 | '''Test case for OverflowError exception during garbage collection. See bug #147''' 8 | 9 | def testOverflow(self): 10 | # NOTE: PyQt4 raises TypeError, but boost.python raises OverflowError 11 | self.assertRaises(OverflowError, qsrand, 42415335332353253) 12 | # should not abort if bug #147 is fixed 13 | gc.collect() 14 | 15 | if __name__ == '__main__': 16 | unittest.main() 17 | -------------------------------------------------------------------------------- /tests/QtCore/qsysinfo_test.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from PySide.QtCore import QSysInfo 3 | 4 | class TestQSysInfo(unittest.TestCase): 5 | def testEnumEndian(self): 6 | self.assertEqual(QSysInfo.BigEndian, 0) 7 | self.assertEqual(QSysInfo.LittleEndian, 1) 8 | self.assert_(QSysInfo.ByteOrder > -1) 9 | 10 | def testEnumSizes(self): 11 | self.assert_(QSysInfo.WordSize > 0) 12 | 13 | if __name__ == '__main__': 14 | unittest.main() 15 | -------------------------------------------------------------------------------- /tests/QtCore/qtext_codec_test.py: -------------------------------------------------------------------------------- 1 | import gc 2 | import unittest 3 | 4 | from PySide.QtCore import QTextCodec 5 | 6 | class TestCodecGetters(unittest.TestCase): 7 | 8 | def testCodecsNames(self): 9 | for codec_name in QTextCodec.availableCodecs(): 10 | codec = QTextCodec.codecForName(codec_name) 11 | self.assert_(type(codec), QTextCodec) 12 | 13 | def testCodecsMibs(self): 14 | for codec_num in QTextCodec.availableMibs(): 15 | codec = QTextCodec.codecForMib(codec_num) 16 | self.assert_(type(codec), QTextCodec) 17 | 18 | 19 | if __name__ == '__main__': 20 | unittest.main() 21 | -------------------------------------------------------------------------------- /tests/QtCore/qtnamespace_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | '''Test suite for QtCore.Qt namespace''' 3 | 4 | import unittest 5 | 6 | from PySide.QtCore import Qt 7 | 8 | class QtNamespace(unittest.TestCase): 9 | '''Test case for accessing attributes from Qt namespace''' 10 | 11 | def testBasic(self): 12 | #Access to Qt namespace 13 | getattr(Qt, 'Horizontal') 14 | getattr(Qt, 'WindowMaximizeButtonHint') 15 | self.assert_(True) 16 | 17 | 18 | if __name__ == '__main__': 19 | unittest.main() 20 | -------------------------------------------------------------------------------- /tests/QtCore/quoteEnUS.txt: -------------------------------------------------------------------------------- 1 | Fine! Dishonor! Dishonor on you, dishonor on ya cow! 2 | -------------------------------------------------------------------------------- /tests/QtCore/resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | quoteEnUS.txt 4 | sample.png 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /tests/QtCore/sample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/tests/QtCore/sample.png -------------------------------------------------------------------------------- /tests/QtCore/setprop_on_ctor_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | import unittest 3 | from PySide.QtCore import * 4 | 5 | 6 | class SetPropOnCtorTest(unittest.TestCase): 7 | def testIt(self): 8 | obj = QEventTransition(targetStates = [QState()]) 9 | self.assertEqual(len(obj.targetStates()), 1); 10 | 11 | if __name__ == '__main__': 12 | unittest.main() 13 | -------------------------------------------------------------------------------- /tests/QtCore/translations/trans_latin.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/tests/QtCore/translations/trans_latin.qm -------------------------------------------------------------------------------- /tests/QtCore/translations/trans_latin.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | QObject 6 | 7 | Hello World! 8 | Orbis, te saluto! 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/QtCore/translations/trans_russian.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/tests/QtCore/translations/trans_russian.qm -------------------------------------------------------------------------------- /tests/QtCore/translations/trans_russian.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | QObject 6 | 7 | Hello World! 8 | привет мир! 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/QtCore/versioninfo_test.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | import PySide 3 | 4 | class TestVersionInfo(unittest.TestCase): 5 | def testIt(self): 6 | 7 | v = PySide.__version_info__ 8 | self.assertEqual(type(v), tuple) 9 | self.assertEqual(len(v), 5) 10 | self.assertEqual(type(v[0]), int) 11 | self.assertEqual(type(v[1]), int) 12 | self.assertEqual(type(v[2]), int) 13 | self.assertEqual(type(v[3]), str) 14 | self.assertEqual(type(v[4]), int) 15 | 16 | self.assertEqual(type(PySide.__version__), str) 17 | 18 | 19 | if __name__ == '__main__': 20 | unittest.main() 21 | -------------------------------------------------------------------------------- /tests/QtDeclarative/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PYSIDE_TEST(bug_451.py) 2 | PYSIDE_TEST(bug_456.py) 3 | PYSIDE_TEST(bug_557.py) 4 | PYSIDE_TEST(bug_726.py) 5 | PYSIDE_TEST(bug_814.py) 6 | PYSIDE_TEST(bug_825.py) 7 | PYSIDE_TEST(bug_847.py) 8 | PYSIDE_TEST(bug_915.py) 9 | PYSIDE_TEST(bug_926.py) 10 | PYSIDE_TEST(bug_951.py) 11 | PYSIDE_TEST(bug_995.py) 12 | PYSIDE_TEST(bug_997.py) 13 | PYSIDE_TEST(bug_1029.py) 14 | PYSIDE_TEST(qdeclarativenetwork_test.py) 15 | PYSIDE_TEST(qdeclarativeview_test.py) 16 | PYSIDE_TEST(connect_python_qml.py) 17 | PYSIDE_TEST(registertype.py) 18 | -------------------------------------------------------------------------------- /tests/QtDeclarative/bug_1029.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 1.0 2 | import UserTypes 1.0 3 | 4 | Rectangle 5 | { 6 | width: 200 7 | height: 200 8 | 9 | color: "#ff0000" 10 | 11 | TestClass 12 | { 13 | 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /tests/QtDeclarative/bug_451.qml: -------------------------------------------------------------------------------- 1 | import Qt 4.7 2 | 3 | Rectangle { 4 | id: page 5 | 6 | function simpleFunction() { 7 | python.called = "simpleFunction" 8 | } 9 | 10 | function oneArgFunction(x) { 11 | python.called = "oneArgFunction" 12 | python.arg1 = x 13 | } 14 | 15 | function twoArgFunction(x, y) { 16 | python.called = "twoArgFunction" 17 | python.arg1 = x 18 | python.arg2 = y 19 | } 20 | 21 | function returnFunction() { 22 | python.called = "returnFunction" 23 | return 42 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /tests/QtDeclarative/bug_557.py: -------------------------------------------------------------------------------- 1 | from PySide.QtCore import * 2 | from PySide.QtGui import * 3 | from PySide.QtDeclarative import * 4 | 5 | import sys 6 | 7 | app = QApplication(sys.argv) 8 | 9 | engine = QDeclarativeEngine() 10 | component = QDeclarativeComponent(engine) 11 | 12 | # This should segfault if the QDeclarativeComponent has not QDeclarativeEngine 13 | component.loadUrl(QUrl.fromLocalFile('foo.qml')) 14 | 15 | -------------------------------------------------------------------------------- /tests/QtDeclarative/bug_814.qml: -------------------------------------------------------------------------------- 1 | 2 | import Qt 4.7 3 | 4 | ListView { 5 | width: 300; height: 300 6 | delegate: Text { text: pysideModelData } 7 | model: 3 8 | } 9 | 10 | -------------------------------------------------------------------------------- /tests/QtDeclarative/bug_825.qml: -------------------------------------------------------------------------------- 1 | import Qt 4.7 2 | import bugs 1.0 3 | 4 | Item { 5 | width: 300; height: 200 6 | 7 | Bug825 { 8 | 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /tests/QtDeclarative/bug_847.qml: -------------------------------------------------------------------------------- 1 | 2 | import Qt 4.7 3 | 4 | Rectangle { 5 | width: 500 6 | height: 500 7 | color: 'red' 8 | 9 | property variant pythonObject: undefined 10 | 11 | Text { 12 | anchors.centerIn: parent 13 | text: 'click me' 14 | color: 'white' 15 | } 16 | 17 | Timer { 18 | interval: 100; running: true; 19 | onTriggered: { 20 | if (pythonObject != undefined) { 21 | pythonObject.blubb(42, 84) 22 | } 23 | } 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /tests/QtDeclarative/bug_926.qml: -------------------------------------------------------------------------------- 1 | import Qt 4.7 2 | import Example 1.0 3 | 4 | Rectangle { 5 | width: 100 6 | height: 62 7 | 8 | MyClass { 9 | id: myClass 10 | urla: "http://www.pyside.org" 11 | } 12 | 13 | Text { 14 | id: name 15 | text: myClass.urla 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tests/QtDeclarative/bug_951.qml: -------------------------------------------------------------------------------- 1 | import Qt 4.7 2 | import my.item 1.0 3 | Rectangle{ 4 | width:10 5 | height:10 6 | MyItem{ } 7 | } 8 | -------------------------------------------------------------------------------- /tests/QtDeclarative/bug_995.py: -------------------------------------------------------------------------------- 1 | from PySide.QtGui import * 2 | from PySide.QtDeclarative import * 3 | from helper import adjust_filename, UsesQApplication 4 | 5 | app = QApplication([]) 6 | view = QDeclarativeView(adjust_filename('bug_995.qml', __file__)) 7 | view.show() 8 | view.resize(200, 200) 9 | item = view.itemAt(100, 100) 10 | 11 | # it CAN NOT crash here 12 | print(item) 13 | 14 | -------------------------------------------------------------------------------- /tests/QtDeclarative/bug_995.qml: -------------------------------------------------------------------------------- 1 | import Qt 4.7 2 | 3 | Rectangle { 4 | width: 100 5 | height: 100 6 | color: "red" 7 | 8 | Text { 9 | text: "Hello World" 10 | anchors.centerIn: parent 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /tests/QtDeclarative/bug_997.qml: -------------------------------------------------------------------------------- 1 | import Qt 4.7 2 | 3 | Text { 4 | text: owner.name + " " + owner.phone 5 | Component.onCompleted: { owner.newName = owner.name } 6 | } 7 | -------------------------------------------------------------------------------- /tests/QtDeclarative/connect_python_qml.qml: -------------------------------------------------------------------------------- 1 | import Qt 4.7 2 | 3 | Rectangle { 4 | id: page 5 | width: 500; height: 200 6 | color: "lightgray" 7 | 8 | Rectangle { 9 | id: button 10 | width: 150; height: 40 11 | color: "darkgray" 12 | anchors.horizontalCenter: page.horizontalCenter 13 | y: 150 14 | MouseArea { 15 | id: buttonMouseArea 16 | objectName: "buttonMouseArea" 17 | anchors.fill: parent 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tests/QtDeclarative/viewmodel.qml: -------------------------------------------------------------------------------- 1 | import Qt 4.7 2 | 3 | ListView { 4 | width: 100; height: 100 5 | anchors.fill: parent 6 | 7 | model: myModel 8 | delegate: Rectangle { 9 | height: 25 10 | width: 100 11 | Text { text: title } 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /tests/QtGui/bug_1002.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | import sys 3 | from PySide.QtGui import QWidget, QPushButton 4 | 5 | from helper import UsesQApplication 6 | 7 | class TestBug1002 (UsesQApplication): 8 | def testReturnWindow(self): 9 | widget = QWidget() 10 | button = QPushButton(widget) 11 | self.assertEqual(sys.getrefcount(widget), 2) 12 | window = button.window() 13 | self.assertEqual(sys.getrefcount(widget), 3) 14 | self.assertEqual(sys.getrefcount(window), 3) 15 | 16 | del widget 17 | 18 | if __name__ == '__main__': 19 | unittest.main() 20 | -------------------------------------------------------------------------------- /tests/QtGui/bug_1048.py: -------------------------------------------------------------------------------- 1 | from PySide import QtGui 2 | 3 | a = QtGui.QApplication([]) 4 | 5 | w = QtGui.QWidget() 6 | l = QtGui.QGridLayout(w) 7 | 8 | l.itemAtPosition(0, 0) 9 | -------------------------------------------------------------------------------- /tests/QtGui/bug_1077.py: -------------------------------------------------------------------------------- 1 | ''' unit test for BUG #1077 ''' 2 | 3 | from PySide import QtCore, QtGui 4 | import time 5 | 6 | class Highlighter(QtGui.QSyntaxHighlighter): 7 | def __init__(self, parent, mode): 8 | QtGui.QSyntaxHighlighter.__init__(self, parent) 9 | self.tstamp = time.time() 10 | 11 | if __name__ == "__main__": 12 | app = QtGui.QApplication([]) 13 | python = QtGui.QTextEdit() 14 | python.setWindowTitle("python") 15 | hl = Highlighter(python.document(), "python") 16 | python.show() 17 | text = hl.document() 18 | -------------------------------------------------------------------------------- /tests/QtGui/bug_1091.py: -------------------------------------------------------------------------------- 1 | ''' unit test for BUG #1091 ''' 2 | 3 | import unittest 4 | from PySide import QtGui 5 | 6 | class QPainterTestCase(unittest.TestCase): 7 | def testIt(self): 8 | self.assertTrue("PixmapFragment" in dir(QtGui.QPainter)) 9 | self.assertTrue("drawPixmapFragments" in dir(QtGui.QPainter)) 10 | 11 | if __name__ == "__main__": 12 | unittest.main() 13 | -------------------------------------------------------------------------------- /tests/QtGui/bug_172.py: -------------------------------------------------------------------------------- 1 | from PySide.QtGui import * 2 | 3 | if __name__ == '__main__': 4 | app = QApplication([]) 5 | 6 | wdg = QWidget() 7 | 8 | hbox = QHBoxLayout() 9 | 10 | vbox = QVBoxLayout() 11 | vbox.addLayout(hbox) 12 | 13 | wdg.setLayout(vbox) 14 | -------------------------------------------------------------------------------- /tests/QtGui/bug_243.py: -------------------------------------------------------------------------------- 1 | 2 | ''' Test bug 243: http://bugs.openbossa.org/show_bug.cgi?id=243''' 3 | 4 | import unittest 5 | import sys 6 | 7 | from PySide.QtGui import QApplication, QMainWindow, QLayout 8 | 9 | class QAppPresence(unittest.TestCase): 10 | 11 | def testBug(self): 12 | app = QApplication(sys.argv) 13 | window = QMainWindow() 14 | l = window.layout() 15 | self.assert_(isinstance(l, QLayout)) 16 | 17 | if __name__ == '__main__': 18 | unittest.main() 19 | -------------------------------------------------------------------------------- /tests/QtGui/bug_300_test.py: -------------------------------------------------------------------------------- 1 | from PySide.QtGui import QStringListModel 2 | from PySide.QtCore import QModelIndex 3 | import unittest 4 | 5 | class TestQAbstractItemModelSignals(unittest.TestCase): 6 | def sigCallback(self, index, r, c): 7 | self._called = True 8 | 9 | def testSignals(self): 10 | self._called = False 11 | m = QStringListModel() 12 | m.rowsAboutToBeInserted[QModelIndex,int,int].connect(self.sigCallback) 13 | m.insertRows(0, 3) 14 | self.assert_(self._called) 15 | 16 | if __name__ == '__main__': 17 | unittest.main() 18 | -------------------------------------------------------------------------------- /tests/QtGui/bug_389.py: -------------------------------------------------------------------------------- 1 | ''' Test bug 389: http://bugs.openbossa.org/show_bug.cgi?id=389''' 2 | 3 | import sys 4 | import unittest 5 | from helper import UsesQApplication 6 | from PySide import QtCore,QtGui 7 | 8 | class BugTest(UsesQApplication): 9 | def testCase(self): 10 | s = QtGui.QWidget().style() 11 | i = s.standardIcon(QtGui.QStyle.SP_TitleBarMinButton) 12 | self.assertEqual(type(i), QtGui.QIcon) 13 | 14 | if __name__ == '__main__': 15 | unittest.main() 16 | -------------------------------------------------------------------------------- /tests/QtGui/bug_429.py: -------------------------------------------------------------------------------- 1 | from PySide.QtCore import * 2 | from PySide.QtGui import * 3 | import sys 4 | 5 | app = QApplication(sys.argv) 6 | scene = QGraphicsScene() 7 | label = QLabel("hello world") 8 | label.show() 9 | QTimer.singleShot(0, label.close) 10 | exit(app.exec_()) 11 | -------------------------------------------------------------------------------- /tests/QtGui/bug_430.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from PySide.QtCore import * 3 | from PySide.QtGui import * 4 | 5 | class ListModel(QAbstractListModel): 6 | def rowCount(self, parent = QModelIndex()): 7 | return 0 8 | 9 | app = QApplication([]) 10 | model = ListModel() 11 | v = QListView() 12 | v.setModel(model) 13 | QTimer.singleShot(0, v.close) 14 | app.exec_() 15 | -------------------------------------------------------------------------------- /tests/QtGui/bug_433.py: -------------------------------------------------------------------------------- 1 | from PySide import QtCore, QtGui 2 | import sys 3 | 4 | class Test(QtGui.QGraphicsView): 5 | def __init__(self, parent=None): 6 | super(Test, self).__init__(parent) 7 | self.s = QtGui.QGraphicsScene() 8 | self.setScene(self.s) 9 | 10 | a = QtGui.QApplication(sys.argv) 11 | t = Test() 12 | t.show() 13 | QtCore.QTimer.singleShot(0, t.close) 14 | sys.exit(a.exec_()) 15 | -------------------------------------------------------------------------------- /tests/QtGui/bug_467.py: -------------------------------------------------------------------------------- 1 | ''' Test bug 367: http://bugs.openbossa.org/show_bug.cgi?id=467''' 2 | 3 | import unittest 4 | from helper import UsesQApplication 5 | from PySide.QtGui import QMainWindow, QApplication 6 | 7 | class MyWidget(QMainWindow): 8 | def __init__(self, parent = None): 9 | QMainWindow.__init__(self, parent) 10 | 11 | 12 | class BugTest(UsesQApplication): 13 | def testCase(self): 14 | w = MyWidget() 15 | widgets = QApplication.allWidgets() 16 | self.assert_(w in widgets) 17 | 18 | if __name__ == '__main__': 19 | unittest.main() 20 | -------------------------------------------------------------------------------- /tests/QtGui/bug_500.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import unittest 4 | 5 | from PySide.QtCore import * 6 | from PySide.QtGui import * 7 | from helper import UsesQApplication 8 | 9 | class NeverDiesTest(UsesQApplication): 10 | 11 | def testIt(self): 12 | QPrintDialog() 13 | 14 | if __name__ == "__main__": 15 | unittest.main() 16 | -------------------------------------------------------------------------------- /tests/QtGui/bug_512.py: -------------------------------------------------------------------------------- 1 | ''' Test bug 512: http://bugs.openbossa.org/show_bug.cgi?id=512''' 2 | 3 | import unittest 4 | from helper import UsesQApplication 5 | from PySide.QtCore import * 6 | from PySide.QtGui import * 7 | 8 | class BugTest(UsesQApplication): 9 | def testCase(self): 10 | w = QWidget(None) 11 | lbl = QLabel("Hello", w); 12 | g = QGridLayout() 13 | g.addWidget(lbl, 0, 0) 14 | w.setLayout(g) 15 | w.show() 16 | 17 | t = g.getItemPosition(0) 18 | self.assertEqual(type(t), tuple) 19 | self.assertEqual(t, (0,0,1,1)) 20 | 21 | if __name__ == '__main__': 22 | unittest.main() 23 | -------------------------------------------------------------------------------- /tests/QtGui/bug_546.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from PySide.QtGui import * 3 | 4 | class TestBug546(unittest.TestCase): 5 | 6 | """Test to check a crash at exit""" 7 | def testIt(self): 8 | app = QApplication([]) 9 | textEdit = QPlainTextEdit() 10 | completer = QCompleter(("foo", "bar"), textEdit) 11 | completer.setWidget(textEdit) 12 | 13 | if __name__=='__main__': 14 | unittest.main() 15 | -------------------------------------------------------------------------------- /tests/QtGui/bug_549.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | from PySide.QtGui import * 4 | 5 | class TestBug549(unittest.TestCase): 6 | def testBug(self): 7 | app = QApplication([]) 8 | w = QGraphicsWidget() 9 | w.setContentsMargins(1, 2, 3, 4) 10 | self.assertEquals(w.getContentsMargins(), (1, 2, 3, 4)) 11 | w.setWindowFrameMargins(5, 6, 7, 8) 12 | self.assertEquals(w.getWindowFrameMargins(), (5, 6, 7, 8)) 13 | 14 | if __name__ == '__main__': 15 | unittest.main() 16 | 17 | -------------------------------------------------------------------------------- /tests/QtGui/bug_569.py: -------------------------------------------------------------------------------- 1 | from PySide.QtCore import * 2 | from PySide.QtGui import * 3 | import unittest 4 | 5 | 6 | class TestBug569(unittest.TestCase): 7 | 8 | def testIt(self): 9 | types = (QTableWidgetItem, QListWidgetItem, QTreeWidgetItem) 10 | for t in types: 11 | a = t() 12 | a.__lt__ = lambda other : True 13 | b = t() 14 | b.__lt__ = lambda other : False 15 | self.assertTrue(a < b) 16 | self.assertFalse(b < a) 17 | 18 | if __name__ == '__main__': 19 | unittest.main() 20 | -------------------------------------------------------------------------------- /tests/QtGui/bug_589.py: -------------------------------------------------------------------------------- 1 | # trimmed down diagramscene.py to demonstrate crash in sizeHint() 2 | 3 | import sys 4 | from PySide import QtCore, QtGui 5 | import unittest 6 | 7 | class CustomWidget(QtGui.QGraphicsProxyWidget): 8 | def itemChange(self, eventType, value): 9 | QtGui.QGraphicsProxyWidget.itemChange(self, eventType, value) 10 | 11 | class Bug589(unittest.TestCase): 12 | def testCase(self): 13 | widget = QtGui.QGraphicsProxyWidget() 14 | custom = CustomWidget() 15 | custom.setParentItem(widget) 16 | 17 | if __name__ == "__main__": 18 | app = QtGui.QApplication(sys.argv) 19 | unittest.main() 20 | -------------------------------------------------------------------------------- /tests/QtGui/bug_617.py: -------------------------------------------------------------------------------- 1 | from PySide.QtCore import QEvent 2 | from PySide.QtGui import QColor 3 | import unittest 4 | 5 | class MyEvent(QEvent): 6 | def __init__(self): 7 | QEvent.__init__(self, QEvent.Type(999)) 8 | 9 | 10 | class Bug617(unittest.TestCase): 11 | def testRepr(self): 12 | c = QColor.fromRgb(1, 2, 3, 4) 13 | s = c.spec() 14 | self.assertEqual(repr(s), repr(QColor.Rgb)) 15 | 16 | def testOutOfBounds(self): 17 | e = MyEvent() 18 | self.assertEqual(repr(e.type()), 'PySide.QtCore.QEvent.Type(999)') 19 | 20 | if __name__ == "__main__": 21 | unittest.main() 22 | -------------------------------------------------------------------------------- /tests/QtGui/bug_640.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from PySide.QtGui import * 3 | import unittest 4 | 5 | class Bug640(unittest.TestCase): 6 | def testIt(self): 7 | option = QStyleOptionGraphicsItem() 8 | a = option.state # crash!? 9 | 10 | if __name__ == "__main__": 11 | unittest.main() 12 | -------------------------------------------------------------------------------- /tests/QtGui/bug_653.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from PySide.QtCore import * 3 | from PySide.QtGui import * 4 | 5 | class TestBug653(unittest.TestCase): 6 | """Crash after calling QWizardPage.wizard()""" 7 | def testIt(self): 8 | app = QApplication([]) 9 | 10 | wizard = QWizard() 11 | page = QWizardPage() 12 | wizard.addPage(page) 13 | page.wizard() # crash here if the bug still exists due to a circular dependency 14 | wizard.show() 15 | 16 | if __name__ == "__main__": 17 | unittest.main() -------------------------------------------------------------------------------- /tests/QtGui/bug_668.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | from PySide.QtCore import * 3 | from PySide.QtGui import * 4 | 5 | import sys 6 | 7 | class A(QMainWindow): 8 | def __init__(self, parent=None): 9 | super(A, self).__init__(parent) 10 | a = QFileSystemModel(self) 11 | a.setRootPath(QDir.homePath()) 12 | 13 | v = QTreeView(self) 14 | v.setModel(a) 15 | self.setCentralWidget(v) 16 | 17 | app = QApplication([]) 18 | m = A() 19 | m.show() 20 | QTimer.singleShot(0, m.close) 21 | app.exec_() 22 | -------------------------------------------------------------------------------- /tests/QtGui/bug_675.py: -------------------------------------------------------------------------------- 1 | from PySide.QtCore import * 2 | from PySide.QtGui import * 3 | 4 | app = QApplication([]) 5 | 6 | scene = QGraphicsScene() 7 | 8 | # don't segfault due to lack of keepReferenceCall 9 | textEdit = scene.addWidget(QTextEdit()) 10 | 11 | layout = QGraphicsLinearLayout() 12 | layout.addItem(textEdit) 13 | 14 | view = QGraphicsView(scene) 15 | view.show() 16 | -------------------------------------------------------------------------------- /tests/QtGui/bug_711.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from PySide.QtGui import QToolBar, QApplication, QAction, QToolButton 3 | 4 | class TestLabelPixmap(unittest.TestCase): 5 | def testReference(self): 6 | toolbar = QToolBar() 7 | 8 | for i in xrange(20): 9 | toolbar.addAction(QAction("Action %d" % i, None)) 10 | 11 | buttons = toolbar.findChildren(QToolButton, "") 12 | toolbar.clear() 13 | 14 | for b in buttons: 15 | self.assertRaises(RuntimeError, b.objectName) 16 | 17 | if __name__ == '__main__': 18 | app = QApplication([]) 19 | unittest.main() 20 | 21 | -------------------------------------------------------------------------------- /tests/QtGui/bug_716.py: -------------------------------------------------------------------------------- 1 | from PySide.QtCore import Qt, QPersistentModelIndex 2 | from PySide.QtGui import QStringListModel 3 | 4 | if __name__ == '__main__': 5 | stringListModel = QStringListModel(['one', 'two']) 6 | idx = stringListModel.index(1, 0) 7 | persistentModelIndex = QPersistentModelIndex(idx) 8 | stringListModel.data(persistentModelIndex, Qt.DisplayRole) 9 | 10 | -------------------------------------------------------------------------------- /tests/QtGui/bug_728.py: -------------------------------------------------------------------------------- 1 | from PySide.QtGui import * 2 | from PySide.QtCore import * 3 | 4 | app = QApplication([]) 5 | QTimer.singleShot(200, app.quit) 6 | 7 | # This test for a dead lock in QFileDialog.getOpenFileNames, the test fail with a timeout if the dead lock exists. 8 | QFileDialog.getOpenFileNames(None, "caption", QDir.homePath(), None, "", QFileDialog.DontUseNativeDialog) 9 | -------------------------------------------------------------------------------- /tests/QtGui/bug_736.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from PySide.QtCore import * 3 | from PySide.QtGui import * 4 | 5 | class TestBug736 (unittest.TestCase): 6 | 7 | def testIt(self): 8 | app = QApplication([]) 9 | slider = QSlider(Qt.Horizontal) 10 | slider2 = QSlider(Qt.Horizontal) 11 | 12 | slider2.setMaximum(10) 13 | slider.valueChanged[int].connect(slider2.setMaximum) 14 | slider.valueChanged[int].emit(100) 15 | self.assertEqual(slider2.maximum(), 100) 16 | 17 | 18 | if __name__ == '__main__': 19 | unittest.main() 20 | -------------------------------------------------------------------------------- /tests/QtGui/bug_740.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | import py3kcompat as py3k 3 | from helper import UsesQApplication 4 | from PySide.QtCore import QSize 5 | from PySide.QtGui import QBitmap, QImage 6 | 7 | class TestQBitmap(UsesQApplication): 8 | def testFromDataMethod(self): 9 | dataBits = py3k.b('\x38\x28\x38\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\xfe\xfe\x7c\x7c\x38\x38\x10\x10') 10 | bim = QBitmap.fromData(QSize(8, 48), dataBits, QImage.Format_Mono) # missing function 11 | 12 | if __name__ == '__main__': 13 | unittest.main() 14 | -------------------------------------------------------------------------------- /tests/QtGui/bug_743.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | from PySide.QtGui import QMatrix4x4 4 | 5 | class TestQMatrix(unittest.TestCase): 6 | def testOperator(self): 7 | m = QMatrix4x4(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) 8 | v = 1 9 | for x in range(4): 10 | for y in range(4): 11 | self.assertEqual(m[x,y], v) 12 | v += 1 13 | 14 | if __name__ == '__main__': 15 | unittest.main() 16 | -------------------------------------------------------------------------------- /tests/QtGui/bug_834.py: -------------------------------------------------------------------------------- 1 | from PySide import QtCore, QtGui 2 | 3 | class Window(QtGui.QMainWindow): 4 | def childEvent(self, event): 5 | super(Window, self).childEvent(event) 6 | 7 | app = QtGui.QApplication([]) 8 | window = Window() 9 | 10 | dock1 = QtGui.QDockWidget() 11 | dock2 = QtGui.QDockWidget() 12 | window.addDockWidget(QtCore.Qt.LeftDockWidgetArea, dock1) 13 | window.addDockWidget(QtCore.Qt.LeftDockWidgetArea, dock2) 14 | window.tabifyDockWidget(dock1, dock2) 15 | 16 | window.show() 17 | QtCore.QTimer.singleShot(0, window.close) 18 | app.exec_() 19 | -------------------------------------------------------------------------------- /tests/QtGui/bug_836.py: -------------------------------------------------------------------------------- 1 | from PySide.QtCore import * 2 | from PySide.QtGui import * 3 | 4 | class Mixin1(object): 5 | pass 6 | 7 | class Mixin2(object): 8 | pass 9 | 10 | class Mixin3(object): 11 | pass 12 | 13 | class MainWindow(Mixin1, Mixin2, Mixin3, QFrame): 14 | def __init__(self): 15 | super(MainWindow, self).__init__() 16 | 17 | def main(): 18 | app = QApplication([]) 19 | # if it doesn't crash it should pass 20 | w = MainWindow() 21 | w.show() 22 | QTimer.singleShot(0, w.close) 23 | app.exec_() 24 | 25 | if __name__ == "__main__": 26 | main() 27 | 28 | 29 | -------------------------------------------------------------------------------- /tests/QtGui/bug_844.py: -------------------------------------------------------------------------------- 1 | from PySide.QtGui import * 2 | from PySide.QtCore import * 3 | 4 | class QtKeyPressListener(QObject): 5 | def __init__(self, obj): 6 | QObject.__init__(self) 7 | obj.installEventFilter(self) 8 | 9 | def eventFilter(self, obj, event): 10 | # This used to crash here due to a misbehaviour of type discovery! 11 | return QObject.eventFilter(self, obj, event) 12 | 13 | app = QApplication([]) 14 | key_listener = QtKeyPressListener(app) 15 | w = QLabel('Hello') 16 | w.show() 17 | QTimer.singleShot(0, w.close) 18 | app.exec_() 19 | -------------------------------------------------------------------------------- /tests/QtGui/bug_882.py: -------------------------------------------------------------------------------- 1 | from PySide.QtGui import * 2 | from PySide.QtCore import * 3 | import os 4 | 5 | if "DISPLAY" in os.environ: 6 | del os.environ["DISPLAY"] 7 | 8 | app = QApplication([], False) 9 | QTimer.singleShot(0, app.quit) 10 | app.exec_() 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/QtGui/bug_941.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from PySide.QtCore import * 3 | from PySide.QtGui import * 4 | 5 | def foo(a, b): 6 | pass 7 | 8 | class TestBug941 (unittest.TestCase): 9 | 10 | def testIt(self): 11 | app = QApplication([]) 12 | view = QHeaderView(Qt.Horizontal) 13 | self.assertTrue(view.sortIndicatorChanged.connect(foo)) 14 | view.sortIndicatorChanged.emit(0, Qt.Vertical) # this can't raise an exception! 15 | 16 | if __name__ == '__main__': 17 | unittest.main() 18 | -------------------------------------------------------------------------------- /tests/QtGui/bug_964.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from PySide.QtCore import * 3 | from PySide.QtGui import * 4 | 5 | class TestBug964 (unittest.TestCase): 6 | 7 | def testIt(self): 8 | app = QApplication([]) 9 | model = QStringListModel(["1", "2"]) 10 | view = QListView() 11 | view.setModel(model) 12 | view.setCurrentIndex(model.index(0,0)) 13 | newCursor = view.moveCursor(QAbstractItemView.MoveDown, Qt.NoModifier) 14 | self.assertEqual(newCursor.row(), 1) 15 | self.assertEqual(newCursor.column(), 0) 16 | 17 | if __name__ == "__main__": 18 | unittest.main() 19 | -------------------------------------------------------------------------------- /tests/QtGui/bug_967.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from PySide.QtGui import * 3 | 4 | class TestBug967 (unittest.TestCase): 5 | 6 | def callback(self, arg): 7 | self.arg = arg 8 | 9 | def testIt(self): 10 | self.arg = None 11 | app = QApplication([]) 12 | obj = QComboBox() 13 | obj.currentIndexChanged.connect(self.callback) 14 | obj.currentIndexChanged.emit(5) 15 | self.assertEqual(self.arg, 5) 16 | 17 | if __name__ == "__main__": 18 | unittest.main() 19 | -------------------------------------------------------------------------------- /tests/QtGui/bug_979.py: -------------------------------------------------------------------------------- 1 | from PySide.QtGui import QDialog 2 | from import_test import PysideImportTest2 3 | 4 | class PysideImportTest1(QDialog, PysideImportTest2): 5 | pass 6 | 7 | if __name__ == '__main__': 8 | quit() 9 | 10 | -------------------------------------------------------------------------------- /tests/QtGui/bug_988.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from PySide.QtGui import * 3 | 4 | class TestBug988 (unittest.TestCase): 5 | 6 | def callback(self, arg): 7 | self.arg = arg 8 | 9 | def testIt(self): 10 | self.arg = None 11 | app = QApplication([]) 12 | obj = QTabWidget() 13 | obj.currentChanged.connect(self.callback) 14 | obj.currentChanged.emit(5) 15 | self.assertEqual(self.arg, 5) 16 | 17 | if __name__ == "__main__": 18 | unittest.main() 19 | -------------------------------------------------------------------------------- /tests/QtGui/bug_991.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from PySide.QtCore import QObject 3 | from PySide.QtGui import QPen, QBrush 4 | 5 | class TestBug991 (unittest.TestCase): 6 | def testReprFunction(self): 7 | reprPen = repr(QPen()) 8 | self.assertTrue(reprPen.startswith(" 2 | main_window 3 | 4 | 5 | 6 | 7 | 8 | 9 | foo 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /tests/QtUiTools/bug_1060.py: -------------------------------------------------------------------------------- 1 | ''' unit test for BUG #1060 ''' 2 | 3 | from PySide.QtGui import QApplication 4 | from PySide.QtUiTools import QUiLoader 5 | from helper import adjust_filename 6 | 7 | class MyQUiLoader(QUiLoader): 8 | def __init__(self): 9 | super(MyQUiLoader, self).__init__() 10 | 11 | def createWidget(self, *args): 12 | return super(MyQUiLoader, self).createWidget(*args) 13 | 14 | if __name__ == "__main__": 15 | app = QApplication([]) 16 | 17 | ui = MyQUiLoader().load(adjust_filename("bug_1060.ui", __file__)) 18 | ui.show() 19 | -------------------------------------------------------------------------------- /tests/QtUiTools/bug_1060.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Dialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 100 10 | 100 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/QtUiTools/bug_376.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | import os 3 | from helper import UsesQApplication 4 | 5 | from PySide import QtCore, QtGui 6 | from PySide.QtUiTools import QUiLoader 7 | 8 | class BugTest(UsesQApplication): 9 | def testCase(self): 10 | w = QtGui.QWidget() 11 | loader = QUiLoader() 12 | 13 | filePath = os.path.join(os.path.dirname(__file__), 'test.ui') 14 | result = loader.load(filePath, w) 15 | self.assert_(isinstance(result.child_object, QtGui.QFrame)) 16 | 17 | if __name__ == '__main__': 18 | unittest.main() 19 | 20 | -------------------------------------------------------------------------------- /tests/QtUiTools/bug_426.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | from PySide import QtCore, QtGui 4 | from PySide.QtUiTools import QUiLoader 5 | 6 | class Window(object): 7 | def __init__(self): 8 | loader = QUiLoader() 9 | filePath = os.path.join(os.path.dirname(__file__), 'bug_426.ui') 10 | self.widget = loader.load(filePath) 11 | self.group = QtGui.QActionGroup(self.widget) 12 | self.widget.show() 13 | QtCore.QTimer.singleShot(0, self.widget.close) 14 | 15 | if __name__ == "__main__": 16 | app = QtGui.QApplication(sys.argv) 17 | win = Window() 18 | sys.exit(app.exec_()) 19 | -------------------------------------------------------------------------------- /tests/QtUiTools/bug_426.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Form 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | Form 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/QtUiTools/bug_797.py: -------------------------------------------------------------------------------- 1 | from PySide import QtUiTools 2 | from PySide import QtCore 3 | from PySide import QtGui 4 | from helper import adjust_filename 5 | 6 | app = QtGui.QApplication([]) 7 | loader = QtUiTools.QUiLoader() 8 | file = QtCore.QFile(adjust_filename('bug_552.ui', __file__)) 9 | w = QtGui.QWidget() 10 | # An exception can't be thrown 11 | mainWindow = loader.load(file, w) 12 | -------------------------------------------------------------------------------- /tests/QtUiTools/bug_965.py: -------------------------------------------------------------------------------- 1 | from PySide.QtUiTools import QUiLoader 2 | import unittest 3 | 4 | from helper import UsesQApplication 5 | from helper import adjust_filename 6 | 7 | class MyQUiLoader(QUiLoader): 8 | def __init__(self): 9 | super(MyQUiLoader, self).__init__() 10 | 11 | def createWidget(self, className, parent=None, name=""): 12 | return None 13 | 14 | class BugTest(UsesQApplication): 15 | def testCase(self): 16 | loader = MyQUiLoader() 17 | self.assertRaises(RuntimeError, loader.load, adjust_filename('bug_965.ui', __file__)) 18 | 19 | if __name__ == '__main__': 20 | unittest.main() 21 | -------------------------------------------------------------------------------- /tests/QtUiTools/minimal.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Form 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/QtUiTools/ui_test.py: -------------------------------------------------------------------------------- 1 | 2 | import unittest 3 | 4 | from PySide.QtUiTools import QUiLoader 5 | 6 | from helper import UsesQApplication 7 | 8 | class QUiLoaderCreation(UsesQApplication): 9 | 10 | def testConstructor(self): 11 | loader = QUiLoader() 12 | 13 | if __name__ == '__main__': 14 | unittest.main() 15 | -------------------------------------------------------------------------------- /tests/QtWebKit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PYSIDE_TEST(bug_448.py) 2 | PYSIDE_TEST(bug_694.py) 3 | PYSIDE_TEST(bug_803.py) 4 | PYSIDE_TEST(bug_899.py) 5 | PYSIDE_TEST(bug_959.py) 6 | PYSIDE_TEST(qvariantlist_property_test.py) 7 | PYSIDE_TEST(qml_plugin_test.py) 8 | PYSIDE_TEST(shouldInterruptjavascript_test.py) 9 | PYSIDE_TEST(webpage_test.py) 10 | PYSIDE_TEST(webview_test.py) 11 | PYSIDE_TEST(webframe_test.py) 12 | -------------------------------------------------------------------------------- /tests/QtWebKit/bug_448.py: -------------------------------------------------------------------------------- 1 | 2 | '''Test cases for bug: http://bugs.openbossa.org/show_bug.cgi?id=448''' 3 | 4 | import unittest 5 | import sys 6 | 7 | from PySide.QtGui import QApplication 8 | from PySide.QtWebKit import QWebView 9 | 10 | class Bug448(unittest.TestCase): 11 | def onError(self, erros): 12 | pass 13 | 14 | def testReturnOwnership(self): 15 | app = QApplication(sys.argv) 16 | webview = QWebView() 17 | webview.page().networkAccessManager().sslErrors.connect(self.onError) 18 | 19 | if __name__ == '__main__': 20 | unittest.main() 21 | -------------------------------------------------------------------------------- /tests/QtWebKit/bug_803.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from PySide.QtGui import * 3 | from PySide.QtWebKit import * 4 | 5 | class TestBug803 (unittest.TestCase): 6 | 7 | def testIt(self): 8 | app = QApplication([]) 9 | page = QWebPage() 10 | frame = page.mainFrame() 11 | frame.setHtml("

1

2

") 12 | elems = frame.findAllElements("p") 13 | self.assertEqual(len(elems), 2) 14 | self.assertEqual(elems[0].toPlainText(), "1") 15 | self.assertEqual(elems[1].toPlainText(), "2") 16 | 17 | if __name__ == "__main__": 18 | unittest.main() 19 | -------------------------------------------------------------------------------- /tests/QtWebKit/fox.html: -------------------------------------------------------------------------------- 1 | 2 | Title 3 | 4 | 5 |

The quick brown fox jumps over the lazy dog.

6 | 7 | 8 | -------------------------------------------------------------------------------- /tests/QtWebKit/qmlplugin/dummy.pys: -------------------------------------------------------------------------------- 1 | Foobar! 2 | -------------------------------------------------------------------------------- /tests/QtWebKit/qmlplugin/index.html: -------------------------------------------------------------------------------- 1 | 2 |

Custom Plugin

3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/QtXml/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PYSIDE_TEST(qdomdocument_test.py) 2 | PYSIDE_TEST(qxmlsimplereader_test.py) 3 | -------------------------------------------------------------------------------- /tests/QtXmlPatterns/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PYSIDE_TEST(import_test.py) 2 | -------------------------------------------------------------------------------- /tests/mac/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PYSIDE_TEST(qmacstyle_test.py) 2 | -------------------------------------------------------------------------------- /tests/mac/qmacstyle_test.py: -------------------------------------------------------------------------------- 1 | from PySide.QtGui import QApplication, QLabel, QMacStyle 2 | from PySide.QtCore import QObject 3 | 4 | import unittest 5 | 6 | from helper import UsesQApplication 7 | 8 | class QMacStyleTest(UsesQApplication): 9 | def testWidgetStyle(self): 10 | w = QLabel('Hello') 11 | self.assertTrue(isinstance(w.style(), QMacStyle)) 12 | 13 | if __name__ == '__main__': 14 | unittest.main() 15 | -------------------------------------------------------------------------------- /tests/manually/README.txt: -------------------------------------------------------------------------------- 1 | To run these tests is necessary some manuall input (most of then not supported by QTest[1]), 2 | because of that this is not part of automatic test context. 3 | 4 | 5 | [1]http://bugreports.qt.nokia.com/browse/QTBUG-13397 6 | -------------------------------------------------------------------------------- /tests/phonon/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT WIN32 OR NOT ${QTVERSION} VERSION_EQUAL 4.7.1) 2 | # Any usage of Phonon::createPath will fail on Win32 and Qt 4.7.1. 3 | # Check: http://bugreports.qt.nokia.com/browse/QTBUG-13062 4 | PYSIDE_TEST(basic_playing_test.py) 5 | endif() 6 | PYSIDE_TEST(bug_328.py) 7 | PYSIDE_TEST(bug_786.py) 8 | PYSIDE_TEST(capabilities_test.py) 9 | PYSIDE_TEST(qobjectdescription_test.py) 10 | -------------------------------------------------------------------------------- /tests/phonon/bug_328.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | from PySide import QtCore, QtGui 4 | from PySide.phonon import Phonon 5 | import unittest 6 | 7 | class TestBug(unittest.TestCase): 8 | def myCB(self): 9 | pass 10 | 11 | def testForNotifierSignals(self): 12 | # this test only check if the signals are present 13 | notifier = Phonon.BackendCapabilities.Notifier() 14 | notifier.capabilitiesChanged.connect(self.myCB) 15 | notifier.availableAudioOutputDevicesChanged.connect(self.myCB) 16 | 17 | self.assert_(True) 18 | 19 | -------------------------------------------------------------------------------- /tests/phonon/tone.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/tests/phonon/tone.wav -------------------------------------------------------------------------------- /tests/pysidetest/bug_1016.py: -------------------------------------------------------------------------------- 1 | from testbinding import * 2 | import unittest 3 | 4 | class TestBug1016 (unittest.TestCase): 5 | 6 | def testIt(self): 7 | obj = getHiddenObject() 8 | self.assertEqual(obj.callMe(), None) 9 | self.assertTrue(obj.wasCalled()) 10 | 11 | if __name__ == "__main__": 12 | unittest.main() 13 | -------------------------------------------------------------------------------- /tests/pysidetest/enum_test.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import unittest 4 | from testbinding import Enum1, TestObjectWithoutNamespace 5 | 6 | class ListConnectionTest(unittest.TestCase): 7 | 8 | def testEnumVisibility(self): 9 | self.assertEqual(Enum1.Option1, 1) 10 | self.assertEqual(Enum1.Option2, 2) 11 | self.assertEqual(TestObjectWithoutNamespace.Enum2.Option3, 3) 12 | self.assertEqual(TestObjectWithoutNamespace.Enum2.Option4, 4) 13 | 14 | if __name__ == '__main__': 15 | unittest.main() 16 | 17 | -------------------------------------------------------------------------------- /tests/pysidetest/pysidetest_global.h: -------------------------------------------------------------------------------- 1 | // PySide global.h file 2 | #include "pyside_global.h" 3 | #include "testobject.h" 4 | #include "testview.h" 5 | #define PYSIDE_API 6 | #include "hiddenobject.h" 7 | -------------------------------------------------------------------------------- /tests/pysidetest/qvariant_test.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | from testbinding import TestObject 4 | from PySide.QtCore import Qt 5 | from PySide.QtGui import QKeySequence 6 | 7 | from helper import UsesQApplication 8 | 9 | class QVariantTest(UsesQApplication): 10 | 11 | def testQKeySequenceQVariantOperator(self): 12 | # bug #775 13 | ks = QKeySequence(Qt.SHIFT, Qt.CTRL, Qt.Key_P, Qt.Key_R) 14 | self.assertEqual(TestObject.checkType(ks), 76) 15 | 16 | if __name__ == '__main__': 17 | unittest.main() 18 | -------------------------------------------------------------------------------- /tests/pysidetest/symbols.filter: -------------------------------------------------------------------------------- 1 | { 2 | local: 3 | _ZSt*; 4 | _ZNSt*; 5 | _ZNSs*; 6 | _ZNKSt*; 7 | }; 8 | -------------------------------------------------------------------------------- /tests/pysidetest/testview.cpp: -------------------------------------------------------------------------------- 1 | #include "testview.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | QVariant 9 | TestView::getData() 10 | { 11 | QModelIndex index; 12 | return m_model->data(index); 13 | } 14 | 15 | QWidget* 16 | TestView::getEditorWidgetFromItemDelegate() const 17 | { 18 | if (!m_delegate) 19 | return 0; 20 | 21 | QModelIndex index; 22 | QStyleOptionViewItem options; 23 | return m_delegate->createEditor(0, options, index); 24 | } 25 | -------------------------------------------------------------------------------- /tests/pysidetest/version_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import unittest 4 | from PySide import __version_info__, __version__, QtCore 5 | 6 | class CheckForVariablesTest(unittest.TestCase): 7 | def testVesions(self): 8 | self.assert_(__version_info__ >= (1, 0, 0)) 9 | self.assert_(__version_info__ < (99, 99, 99)) 10 | self.assert_(__version__) 11 | 12 | self.assert_(QtCore.__version_info__ >= (4, 5, 0)) 13 | self.assert_(QtCore.__version__) 14 | 15 | if __name__ == '__main__': 16 | unittest.main() 17 | 18 | -------------------------------------------------------------------------------- /tests/run_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This is a nasty workaround of a CTest limitation 4 | # of setting the environment variables for the test. 5 | 6 | # $1: LD_LIBRARY_PATH 7 | # $2: $PYTHONPATH 8 | # $3: python executable 9 | # $4: test file 10 | 11 | export LD_LIBRARY_PATH=$1:$LD_LIBRARY_PATH 12 | export PYTHONPATH=$2:$PYTHONPATH 13 | $3 $4 14 | -------------------------------------------------------------------------------- /tests/signals/args_dont_match_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import unittest 4 | from PySide.QtCore import * 5 | 6 | class ArgsDontMatch(unittest.TestCase): 7 | 8 | def callback(self, arg1): 9 | self.ok = True 10 | 11 | def testConnectSignalToSlotWithLessArgs(self): 12 | self.ok = False 13 | obj1 = QObject() 14 | QObject.connect(obj1, SIGNAL('the_signal(int, int, int)'), self.callback) 15 | obj1.emit(SIGNAL('the_signal(int, int, int)'), 1, 2, 3) 16 | 17 | self.assert_(self.ok) 18 | 19 | 20 | 21 | if __name__ == '__main__': 22 | unittest.main() 23 | -------------------------------------------------------------------------------- /tests/signals/leaking_signal_test.py: -------------------------------------------------------------------------------- 1 | 2 | import unittest 3 | from PySide import QtCore 4 | import weakref 5 | 6 | class LeakingSignal(unittest.TestCase): 7 | 8 | def testLeakingSignal(self): 9 | # Was segfaulting when the signal was garbage collected. 10 | class Emitter(QtCore.QObject): 11 | my_signal = QtCore.Signal(object) 12 | 13 | emitter = Emitter() 14 | 15 | if __name__ == '__main__': 16 | unittest.main() 17 | -------------------------------------------------------------------------------- /tests/signals/signal_func_test.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import unittest 4 | 5 | from PySide.QtCore import SIGNAL, SLOT 6 | 7 | class SIGNALSLOTTests(unittest.TestCase): 8 | '''Test the output of SIGNAL and SLOT.''' 9 | 10 | def testSIGNAL(self): 11 | #SIGNAL function 12 | a = "foobar" 13 | self.assertEqual(str(SIGNAL(a)), "2foobar") 14 | 15 | def testSLOT(self): 16 | #SLOT function 17 | a = "foobar" 18 | self.assertEqual(str(SLOT(a)), "1foobar") 19 | 20 | if __name__ == '__main__': 21 | unittest.main() 22 | -------------------------------------------------------------------------------- /tests/util/color.py: -------------------------------------------------------------------------------- 1 | 2 | '''Function to print a colored line to terminal''' 3 | 4 | RED='\033[0;31m%s\033[m' 5 | 6 | def print_colored(message, color=RED): 7 | print color % message 8 | 9 | if __name__ == '__main__': 10 | print '42 - the answer' 11 | print_colored("But what's the question?") 12 | print 'Hum?' 13 | -------------------------------------------------------------------------------- /tests/util/module_wrapper/PySide/QtAssistant.py: -------------------------------------------------------------------------------- 1 | 2 | from PyQt4.QtAssistant import * 3 | -------------------------------------------------------------------------------- /tests/util/module_wrapper/PySide/QtCore.py: -------------------------------------------------------------------------------- 1 | 2 | from PyQt4.QtCore import * 3 | -------------------------------------------------------------------------------- /tests/util/module_wrapper/PySide/QtDesigner.py: -------------------------------------------------------------------------------- 1 | 2 | from PyQt4.QtDesigner import * 3 | -------------------------------------------------------------------------------- /tests/util/module_wrapper/PySide/QtGui.py: -------------------------------------------------------------------------------- 1 | 2 | from PyQt4.QtGui import * 3 | -------------------------------------------------------------------------------- /tests/util/module_wrapper/PySide/QtHelp.py: -------------------------------------------------------------------------------- 1 | 2 | from PyQt4.QtHelp import * 3 | -------------------------------------------------------------------------------- /tests/util/module_wrapper/PySide/QtNetwork.py: -------------------------------------------------------------------------------- 1 | 2 | from PyQt4.QtNetwork import * 3 | -------------------------------------------------------------------------------- /tests/util/module_wrapper/PySide/QtScript.py: -------------------------------------------------------------------------------- 1 | 2 | from PyQt4.QtScript import * 3 | -------------------------------------------------------------------------------- /tests/util/module_wrapper/PySide/QtSql.py: -------------------------------------------------------------------------------- 1 | 2 | from PyQt4.QtSql import * 3 | -------------------------------------------------------------------------------- /tests/util/module_wrapper/PySide/QtSvg.py: -------------------------------------------------------------------------------- 1 | 2 | from PyQt4.QtSvg import * 3 | -------------------------------------------------------------------------------- /tests/util/module_wrapper/PySide/QtTest.py: -------------------------------------------------------------------------------- 1 | 2 | from PyQt4.QtTest import * 3 | -------------------------------------------------------------------------------- /tests/util/module_wrapper/PySide/QtWebKit.py: -------------------------------------------------------------------------------- 1 | 2 | from PyQt4.QtWebKit import * 3 | -------------------------------------------------------------------------------- /tests/util/module_wrapper/PySide/QtXml.py: -------------------------------------------------------------------------------- 1 | 2 | from PyQt4.QtXml import * 3 | -------------------------------------------------------------------------------- /tests/util/module_wrapper/PySide/QtXmlPatterns.py: -------------------------------------------------------------------------------- 1 | 2 | from PyQt4.QtXmlPatterns import * 3 | -------------------------------------------------------------------------------- /tests/util/module_wrapper/PySide/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/bcf6058e9d0e8513f58a0f1062b428ea7eb03f0c/tests/util/module_wrapper/PySide/__init__.py -------------------------------------------------------------------------------- /tests/util/module_wrapper/PySide/phonon.py: -------------------------------------------------------------------------------- 1 | 2 | from PyQt4.phonon import * 3 | -------------------------------------------------------------------------------- /tests/util/py2xfunctions.py: -------------------------------------------------------------------------------- 1 | def b(s): 2 | return s 3 | 4 | def l(n): 5 | return long(n) 6 | 7 | def unicode_(s): 8 | if type(s) == str: 9 | import codecs 10 | c = codecs.lookup('utf-8') 11 | s2 = c.decode(s, 'ignore') 12 | return s2[0] 13 | return u'%s' % s 14 | 15 | unicode = unicode 16 | unichr = unichr 17 | long = long 18 | buffer = buffer 19 | -------------------------------------------------------------------------------- /tests/util/py3xfunctions.py: -------------------------------------------------------------------------------- 1 | def b(s): 2 | if type(s) == bytes: 3 | return s 4 | return bytes(s, "UTF8") 5 | 6 | def buffer_(s): 7 | if s == None: 8 | return None 9 | elif type(s) == str: 10 | return bytes(s, "UTF8") 11 | elif type(s) == bytes: 12 | return s 13 | else: 14 | memoryview(s) 15 | 16 | def l(n): 17 | return n 18 | 19 | def unicode_(s): 20 | return s 21 | 22 | unicode = str 23 | unichr = chr 24 | long = int 25 | unichr = chr 26 | buffer = buffer_ 27 | -------------------------------------------------------------------------------- /tests/util/rename_imports.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Rename import statements from .py script to use a specific module name 3 | set -e 4 | 5 | if [ $# -lt 3 ]; then 6 | echo "Usage: $0 " 7 | exit 1 8 | fi 9 | 10 | old_name=$1; shift 11 | new_name=$1; shift 12 | 13 | find "$@" -name "*.py" -exec sed -ri "s/(import|from) $old_name/\1 $new_name/" '{}' \; 14 | -------------------------------------------------------------------------------- /tests/util/use_pyqt4.sh: -------------------------------------------------------------------------------- 1 | 2 | OLD_PYTHONPATH=$PYTHONPATH 3 | PYTHONPATH=`pwd`/util/module_wrapper:$PYTHONPATH 4 | -------------------------------------------------------------------------------- /tests/util/use_pyside.sh: -------------------------------------------------------------------------------- 1 | 2 | PYTHONPATH=$OLD_PYTHONPATH 3 | unset OLD_PYTHONPATH 4 | --------------------------------------------------------------------------------