├── tests ├── QtWebKit │ ├── qmlplugin │ │ ├── dummy.pys │ │ └── index.html │ ├── fox.html │ ├── CMakeLists.txt │ ├── bug_448.py │ └── bug_803.py ├── util │ ├── module_wrapper │ │ └── PySide │ │ │ ├── __init__.py │ │ │ ├── QtCore.py │ │ │ ├── QtGui.py │ │ │ ├── QtHelp.py │ │ │ ├── QtSql.py │ │ │ ├── QtSvg.py │ │ │ ├── QtTest.py │ │ │ ├── QtXml.py │ │ │ ├── phonon.py │ │ │ ├── QtScript.py │ │ │ ├── QtWebKit.py │ │ │ ├── QtAssistant.py │ │ │ ├── QtDesigner.py │ │ │ ├── QtNetwork.py │ │ │ └── QtXmlPatterns.py │ ├── use_pyside.sh │ ├── use_pyqt4.sh │ ├── color.py │ ├── rename_imports.sh │ ├── py2xfunctions.py │ └── py3xfunctions.py ├── QtHelp │ ├── CMakeLists.txt │ └── help_test.py ├── mac │ ├── CMakeLists.txt │ └── qmacstyle_test.py ├── QtMultimedia │ └── CMakeLists.txt ├── QtScriptTools │ └── CMakeLists.txt ├── QtXmlPatterns │ └── CMakeLists.txt ├── QtGui │ ├── import_test.py │ ├── sample.png │ ├── bug_1048.py │ ├── bug_979.py │ ├── test_module_template.py │ ├── bug_172.py │ ├── bug_429.py │ ├── bug_882.py │ ├── bug_640.py │ ├── bug_998.py │ ├── bug_500.py │ ├── qapplication_singleton_test.py │ ├── bug_430.py │ ├── bug_728.py │ ├── timed_app_test.py │ ├── bug_675.py │ ├── bug_716.py │ ├── bug_1091.py │ ├── bug_433.py │ ├── bug_546.py │ ├── qtableview_test.py │ ├── bug_743.py │ ├── standardpixmap_test.py │ ├── hashabletype_test.py │ ├── qsplitter_test.py │ ├── qapp_test.py │ ├── python_properties_test.py │ ├── bug_389.py │ ├── qicon_test.py │ ├── bug_243.py │ ├── bug_988.py │ ├── bug_967.py │ ├── bug_549.py │ ├── bug_941.py │ ├── qcursor_test.py │ ├── bug_668.py │ ├── qapplication_exit_segfault_test.py │ ├── bug_653.py │ ├── bug_1077.py │ ├── bug_834.py │ ├── bug_569.py │ ├── bug_736.py │ ├── bug_844.py │ ├── bug_300_test.py │ ├── bug_467.py │ ├── grandparent_method_test.py │ ├── qlcdnumber_test.py │ ├── bug_991.py │ ├── bug_1002.py │ ├── qitemselection_test.py │ ├── qkeysequence_test.py │ ├── bug_836.py │ ├── qfontdialog_test.py │ ├── bug_711.py │ ├── bug_964.py │ ├── bug_617.py │ ├── bug_589.py │ ├── qmenuadd_test.py │ ├── qregion_test.py │ ├── bug_740.py │ ├── qvariant_test.py │ ├── bug_512.py │ └── qbrush_test.py ├── QtCore │ ├── quoteEnUS.txt │ ├── sample.png │ ├── translations │ │ ├── trans_latin.qm │ │ ├── trans_russian.qm │ │ ├── trans_latin.ts │ │ └── trans_russian.ts │ ├── bug_1031.py │ ├── resources.qrc │ ├── bug_656.py │ ├── setprop_on_ctor_test.py │ ├── bug_938.py │ ├── bug_987.py │ ├── qfileinfo_test.py │ ├── qhandle_test.py │ ├── bug_699.py │ ├── bug_332.py │ ├── inherits_test.py │ ├── missing_symbols_test.py │ ├── qsysinfo_test.py │ ├── bug_515.py │ ├── bug_PYSIDE-42.py │ ├── qabs_test.py │ ├── qpoint_test.py │ ├── bug_953.py │ ├── qtnamespace_test.py │ ├── bug_278_test.py │ ├── bug_428.py │ ├── qobject_destructor.py │ ├── qsrand_test.py │ ├── deletelater_test.py │ ├── qregexp_test.py │ ├── qlinef_test.py │ ├── bug_505.py │ ├── versioninfo_test.py │ ├── bug_1069.py │ ├── bug_920.py │ └── qtext_codec_test.py ├── phonon │ ├── tone.wav │ ├── CMakeLists.txt │ └── bug_328.py ├── pysidetest │ ├── symbols.filter │ ├── pysidetest_global.h │ ├── bug_1016.py │ ├── qvariant_test.py │ ├── enum_test.py │ ├── version_test.py │ └── testview.cpp ├── QtMaemo5 │ ├── CMakeLists.txt │ ├── qmaemo5import_test.py │ └── pickselector_test.py ├── QtXml │ └── CMakeLists.txt ├── QtScript │ ├── base_test.py │ ├── CMakeLists.txt │ ├── bug_1022.py │ └── engine_test.py ├── QtTest │ └── CMakeLists.txt ├── QtSql │ └── CMakeLists.txt ├── QtSvg │ └── CMakeLists.txt ├── QtDeclarative │ ├── bug_951.qml │ ├── bug_825.qml │ ├── bug_997.qml │ ├── bug_814.qml │ ├── bug_1029.qml │ ├── bug_995.qml │ ├── viewmodel.qml │ ├── bug_926.qml │ ├── bug_995.py │ ├── bug_557.py │ ├── connect_python_qml.qml │ ├── CMakeLists.txt │ ├── bug_847.qml │ └── bug_451.qml ├── QtOpenGL │ ├── CMakeLists.txt │ └── qglwidget_test.py ├── QtUiTools │ ├── minimal.ui │ ├── ui_test.py │ ├── bug_797.py │ ├── CMakeLists.txt │ ├── bug_426.ui │ ├── bug_1060.ui │ ├── action.ui │ ├── bug_1060.py │ ├── bug_376.py │ ├── bug_426.py │ └── bug_965.py ├── manually │ └── README.txt ├── QtNetwork │ ├── CMakeLists.txt │ ├── bug_1084.py │ └── qipv6address_test.py ├── run_test.sh └── signals │ ├── leaking_signal_test.py │ ├── signal_func_test.py │ └── args_dont_match_test.py ├── doc ├── codesnippets │ ├── doc │ │ └── src │ │ │ └── snippets │ │ │ ├── signalmapper │ │ │ ├── accountsfile.txt │ │ │ ├── taxfile.txt │ │ │ ├── reportfile.txt │ │ │ ├── main.cpp │ │ │ └── filereader.h │ │ │ ├── patternist │ │ │ ├── bracesIncludedResult.xml │ │ │ ├── oneElementConstructor.xq │ │ │ ├── pathAB.xq │ │ │ ├── xsBooleanTrue.xq │ │ │ ├── anyHTMLElement.xq │ │ │ ├── bracesIncluded.xq │ │ │ ├── bracesOmitted.xq │ │ │ ├── docPlainHTML.xq │ │ │ ├── pathsAllParagraphs.xq │ │ │ ├── notIndented.xml │ │ │ ├── docPlainHTML2.xq │ │ │ ├── nextLastParagraph.xq │ │ │ ├── tablesInParagraphs.xq │ │ │ ├── emptyParagraphs.xq │ │ │ ├── paragraphsWithTables.xq │ │ │ ├── simpleHTML.xq │ │ │ ├── svgDocumentElement.xml │ │ │ ├── filterOnStep.xq │ │ │ ├── paragraphsExceptTheFiveFirst.xq │ │ │ ├── xsvgDocumentElement.xml │ │ │ ├── filterOnPath.xq │ │ │ ├── indented.xml │ │ │ ├── invalidLetOrderBy.xq │ │ │ ├── xmlStylesheet.xq │ │ │ ├── bracesOmittedResult.xml │ │ │ ├── firstParagraph.xq │ │ │ ├── nodeConstructorsInPaths.xq │ │ │ ├── letOrderBy.xq │ │ │ ├── nodeTestChildElement.xq │ │ │ ├── anyXLinkAttribute.xq │ │ │ ├── forClause.xq │ │ │ ├── forClause2.xq │ │ │ ├── simpleXHTML.xq │ │ │ ├── expressionInsideAttribute.xq │ │ │ ├── items.xq │ │ │ ├── escapeStringLiterals.xml │ │ │ ├── forClauseOnFeed.xq │ │ │ ├── introExample2.xq │ │ │ ├── mobeyDick.xml │ │ │ ├── introductionExample.xq │ │ │ ├── escapeCurlyBraces.xq │ │ │ ├── copyAttribute.xq │ │ │ ├── copyID.xq │ │ │ ├── escapeStringLiterals.xq │ │ │ ├── fnStringOnAttribute.xq │ │ │ ├── directTreeFragment.xq │ │ │ ├── twoSVGElements.xq │ │ │ ├── literalsAndOperators.xq │ │ │ ├── nodeConstructorsAreExpressions.xq │ │ │ ├── embedDataInXHTML.xq │ │ │ ├── embedDataInXHTML2.xq │ │ │ ├── introAcneRemover.xq │ │ │ ├── introFileHierarchy.xml │ │ │ ├── introNavigateFS.xq │ │ │ ├── computedTreeFragment.xq │ │ │ └── doc.txt │ │ │ ├── code │ │ │ ├── src_gui_kernel_qshortcutmap.cpp │ │ │ ├── src_gui_widgets_qgroupbox.cpp │ │ │ ├── src_gui_widgets_qpushbutton.cpp │ │ │ ├── src_gui_widgets_qcheckbox.cpp │ │ │ ├── src_network_socket_qtcpserver.cpp │ │ │ ├── tools_patternist_qapplicationargumentparser.cpp │ │ │ ├── src_gui_widgets_qstatusbar.cpp │ │ │ ├── src_xmlpatterns_api_qabstracturiresolver.cpp │ │ │ ├── src_corelib_kernel_qabstracteventdispatcher.cpp │ │ │ ├── src_gui_graphicsview_qgraphicssceneevent.cpp │ │ │ ├── src_gui_widgets_qradiobutton.cpp │ │ │ ├── src_xml_sax_qxml.cpp │ │ │ ├── src_network_access_qnetworkrequest.cpp │ │ │ ├── src_sql_kernel_qsqlindex.cpp │ │ │ ├── src_gui_itemviews_qtablewidget.cpp │ │ │ ├── src_gui_widgets_qmenubar.cpp │ │ │ ├── src_xmlpatterns_api_qabstractxmlforwarditerator.cpp │ │ │ ├── src_gui_widgets_qtextbrowser.cpp │ │ │ ├── src_gui_image_qbitmap.cpp │ │ │ ├── src_gui_styles_qstyle.cpp │ │ │ ├── src.gui.text.qtextdocumentwriter.cpp │ │ │ ├── src_gui_dialogs_qabstractprintdialog.cpp │ │ │ ├── src_network_ssl_qsslconfiguration.cpp │ │ │ ├── src_gui_kernel_qsound.cpp │ │ │ ├── src_sql_kernel_qsqlerror.cpp │ │ │ ├── src_network_kernel_qhostaddress.cpp │ │ │ ├── src_corelib_plugin_quuid.cpp │ │ │ ├── src_gui_accessible_qaccessible.cpp │ │ │ ├── src_corelib_tools_qqueue.cpp │ │ │ ├── src_gui_widgets_qabstractspinbox.cpp │ │ │ ├── src_gui_widgets_qworkspace.cpp │ │ │ ├── src_gui_kernel_qapplication_x11.cpp │ │ │ ├── src_network_ssl_qsslcertificate.cpp │ │ │ ├── src_script_qscriptengineagent.cpp │ │ │ ├── src_gui_widgets_qframe.cpp │ │ │ ├── src_gui_widgets_qdockwidget.cpp │ │ │ ├── src_gui_widgets_qlineedit.cpp │ │ │ ├── src_xmlpatterns_api_qxmlserializer.cpp │ │ │ ├── src_gui_widgets_qsplitter.cpp │ │ │ ├── src_xmlpatterns_api_qabstractxmlreceiver.cpp │ │ │ ├── src_gui_itemviews_qitemselectionmodel.cpp │ │ │ ├── src_gui_styles_qstyleoption.cpp │ │ │ ├── src.scripttools.qscriptenginedebugger.cpp │ │ │ ├── src_gui_kernel_qlayoutitem.cpp │ │ │ ├── src_corelib_tools_qrect.cpp │ │ │ ├── src_corelib_kernel_qtimer.cpp │ │ │ ├── src_xmlpatterns_api_qxmlformatter.cpp │ │ │ ├── src_corelib_io_qdiriterator.cpp │ │ │ ├── src_gui_image_qmovie.cpp │ │ │ ├── src_network_bearer_qnetworkconfigmanager.cpp │ │ │ ├── src_script_qscriptclass.cpp │ │ │ ├── src_gui_itemviews_qtreewidget.cpp │ │ │ ├── src_corelib_thread_qmutexpool.cpp │ │ │ ├── src_gui_widgets_qscrollarea.cpp │ │ │ ├── tools_designer_src_lib_sdk_abstractformwindowcursor.cpp │ │ │ ├── src_corelib_thread_qthread.cpp │ │ │ ├── src_gui_kernel_qclipboard.cpp │ │ │ ├── src_gui_painting_qbrush.cpp │ │ │ ├── src_gui_text_qtextdocument.cpp │ │ │ ├── src_sql_models_qsqlquerymodel.cpp │ │ │ ├── src_xmlpatterns_api_qxmlname.cpp │ │ │ ├── src_network_socket_qlocalsocket_unix.cpp │ │ │ ├── src_corelib_codecs_qtextcodecplugin.cpp │ │ │ ├── src_gui_kernel_qevent.cpp │ │ │ ├── src_gui_painting_qcolor.cpp │ │ │ ├── tools_shared_qttoolbardialog_qttoolbardialog.cpp │ │ │ ├── src_corelib_concurrent_qthreadpool.cpp │ │ │ ├── src_gui_kernel_qaction.cpp │ │ │ ├── src_corelib_io_qtemporaryfile.cpp │ │ │ ├── src_svg_qgraphicssvgitem.cpp │ │ │ ├── src_gui_widgets_qsplashscreen.cpp │ │ │ ├── src_corelib_concurrent_qfuturewatcher.cpp │ │ │ ├── src_gui_graphicsview_qgraphicslinearlayout.cpp │ │ │ ├── tools_designer_src_lib_sdk_abstractformwindowmanager.cpp │ │ │ ├── src_gui_text_qfontmetrics.cpp │ │ │ ├── src_corelib_concurrent_qfuturesynchronizer.cpp │ │ │ ├── src_gui_graphicsview_qgraphicsgridlayout.cpp │ │ │ ├── src_gui_itemviews_qabstractitemview.cpp │ │ │ ├── src_gui_painting_qmatrix.cpp │ │ │ ├── src_gui_util_qdesktopservices.cpp │ │ │ ├── src_gui_widgets_qplaintextedit.cpp │ │ │ ├── src_network_kernel_qnetworkproxy.cpp │ │ │ ├── src_gui_image_qpixmap.cpp │ │ │ ├── tools_designer_src_lib_sdk_abstractformeditor.cpp │ │ │ ├── tools_designer_src_lib_sdk_abstractobjectinspector.cpp │ │ │ ├── src_script_qscriptable.cpp │ │ │ ├── src_xmlpatterns_api_qxmlresultitems.cpp │ │ │ ├── tools_shared_qtpropertybrowser_qtvariantproperty.cpp │ │ │ ├── src_gui_widgets_qabstractbutton.cpp │ │ │ ├── src_gui_image_qpixmapcache.cpp │ │ │ ├── src_gui_widgets_qtextedit.cpp │ │ │ ├── tools_designer_src_lib_extension_extension.cpp │ │ │ ├── src_opengl_qglpixelbuffer.cpp │ │ │ ├── src_corelib_xml_qxmlstream.cpp │ │ │ ├── src_gui_kernel_qkeysequence.cpp │ │ │ ├── src_gui_painting_qregion.cpp │ │ │ ├── src_gui_image_qimagewriter.cpp │ │ │ ├── src_corelib_tools_qtimeline.cpp │ │ │ ├── src_gui_text_qfont.cpp │ │ │ ├── src_gui_widgets_qmainwindow.cpp │ │ │ ├── src_corelib_concurrent_qfuture.cpp │ │ │ ├── tools_designer_src_lib_uilib_abstractformbuilder.cpp │ │ │ ├── src_gui_kernel_qlayout.cpp │ │ │ ├── src_gui_kernel_qshortcut.cpp │ │ │ ├── src_gui_widgets_qspinbox.cpp │ │ │ ├── doc_src_qnamespace.qdoc │ │ │ ├── tools_designer_src_lib_extension_qextensionmanager.cpp │ │ │ ├── src_gui_widgets_qcalendarwidget.cpp │ │ │ ├── src_gui_painting_qregion_unix.cpp │ │ │ ├── src_gui_image_qimagereader.cpp │ │ │ ├── src_gui_image_qpixmapfilter.cpp │ │ │ ├── src_gui_text_qtextlayout.cpp │ │ │ ├── src_gui_widgets_qmenu.cpp │ │ │ ├── src_gui_util_qcompleter.cpp │ │ │ ├── src_network_socket_qudpsocket.cpp │ │ │ ├── src_xmlpatterns_api_qsimplexmlnodemodel.cpp │ │ │ └── src_gui_widgets_qlabel.cpp │ │ │ ├── widget-mask │ │ │ ├── tux.png │ │ │ └── mask.qrc │ │ │ ├── brushstyles │ │ │ └── qt-logo.png │ │ │ ├── dragging │ │ │ ├── images │ │ │ │ └── file.png │ │ │ └── images.qrc │ │ │ ├── qsplashscreen │ │ │ ├── splash.png │ │ │ └── qsplashscreen.qrc │ │ │ ├── qtscript │ │ │ └── scriptedslot │ │ │ │ ├── scriptedslot.qrc │ │ │ │ └── object.js │ │ │ ├── qtablewidget-dnd │ │ │ ├── Images │ │ │ │ ├── cubed.png │ │ │ │ └── squared.png │ │ │ └── images.qrc │ │ │ ├── quiloader │ │ │ └── mywidget.qrc │ │ │ ├── qtablewidget-using │ │ │ ├── Images │ │ │ │ ├── cubed.png │ │ │ │ └── squared.png │ │ │ └── images.qrc │ │ │ ├── textdocument-images │ │ │ ├── images.qrc │ │ │ └── images │ │ │ │ └── advert.png │ │ │ ├── qsvgwidget │ │ │ └── qsvgwidget.qrc │ │ │ ├── textdocument-imageformat │ │ │ ├── images │ │ │ │ ├── advert.png │ │ │ │ └── newimage.png │ │ │ └── images.qrc │ │ │ ├── console │ │ │ └── dbus_pingpong.txt │ │ │ ├── i18n-non-qt-class │ │ │ ├── resources.qrc │ │ │ ├── myclass.ts │ │ │ └── translations │ │ │ │ ├── i18n-non-qt-class_en.ts │ │ │ │ └── i18n-non-qt-class_fr.ts │ │ │ ├── ntfsp.cpp │ │ │ ├── dockwidgets │ │ │ ├── Resources │ │ │ │ └── titles.txt │ │ │ └── dockwidgets.qrc │ │ │ ├── qxmlquery │ │ │ └── bindingExample.cpp │ │ │ ├── videomedia.cpp │ │ │ ├── stylesheet │ │ │ └── common-mistakes.cpp │ │ │ ├── widgets-tutorial │ │ │ ├── toplevel │ │ │ │ └── main.cpp │ │ │ ├── childwidget │ │ │ │ └── main.cpp │ │ │ └── windowlayout │ │ │ │ └── main.cpp │ │ │ ├── filedialogurls.cpp │ │ │ └── printing-qprinter │ │ │ └── errors.cpp │ ├── examples │ │ ├── dialogs │ │ │ ├── classwizard │ │ │ │ ├── images │ │ │ │ │ ├── logo1.png │ │ │ │ │ ├── logo2.png │ │ │ │ │ ├── logo3.png │ │ │ │ │ ├── banner.png │ │ │ │ │ ├── background.png │ │ │ │ │ ├── watermark1.png │ │ │ │ │ └── watermark2.png │ │ │ │ └── classwizard.qrc │ │ │ └── licensewizard │ │ │ │ ├── images │ │ │ │ ├── logo.png │ │ │ │ └── watermark.png │ │ │ │ └── licensewizard.qrc │ │ ├── mainwindows │ │ │ └── sdi │ │ │ │ └── mainwindow.cpp │ │ └── declarative │ │ │ └── cppextensions │ │ │ ├── imageprovider │ │ │ └── imageprovider-example.qml │ │ │ └── plugins │ │ │ └── plugin.cpp │ ├── webkitsnippets │ │ ├── qtwebkit_qwebinspector_snippet.cpp │ │ ├── simple │ │ │ └── main.cpp │ │ └── qtwebkit_qwebview_snippet.cpp │ └── snippets │ │ └── customstyle │ │ └── main.cpp ├── _themes │ └── pysidedocs │ │ ├── static │ │ ├── minus.png │ │ ├── plus.png │ │ ├── bg_topo.jpg │ │ ├── fakebar.png │ │ ├── logo_qt.png │ │ ├── bg_header.png │ │ ├── logo_indt.jpg │ │ ├── pysidelogo.png │ │ ├── relbar_bg.png │ │ ├── logo_python.jpg │ │ └── logo_openbossa.png │ │ ├── theme.conf │ │ └── searchbox.html ├── tutorials │ ├── qmltutorial │ │ ├── helloworld.tar.bz2 │ │ ├── declarative-tutorial1.png │ │ ├── declarative-tutorial2.png │ │ └── declarative-tutorial3_animation.gif │ ├── qmladvancedtutorial │ │ ├── samegame.tar.bz2 │ │ ├── declarative-samegame.png │ │ ├── declarative-adv-tutorial1.png │ │ ├── declarative-adv-tutorial2.png │ │ ├── declarative-adv-tutorial3.png │ │ ├── declarative-adv-tutorial4.gif │ │ └── samegame │ │ │ ├── shared │ │ │ └── pics │ │ │ │ ├── star.png │ │ │ │ ├── blueStar.png │ │ │ │ ├── redStar.png │ │ │ │ ├── redStone.png │ │ │ │ ├── background.jpg │ │ │ │ ├── blueStone.png │ │ │ │ ├── greenStar.png │ │ │ │ ├── greenStone.png │ │ │ │ └── yellowStone.png │ │ │ ├── samegame4 │ │ │ ├── highscores │ │ │ │ ├── score_data.xml │ │ │ │ └── README │ │ │ └── samegame4.qmlproject │ │ │ ├── samegame1 │ │ │ └── samegame1.qmlproject │ │ │ ├── samegame2 │ │ │ └── samegame2.qmlproject │ │ │ └── samegame3 │ │ │ └── samegame3.qmlproject │ └── index.rst ├── extras │ ├── PySide.QtSql.rst │ ├── PySide.QtXml.rst │ ├── PySide.QtNetwork.rst │ ├── PySide.QtDeclarative.rst │ ├── PySide.QtMultimedia.rst │ ├── PySide.QtGui.rst │ ├── PySide.QtCore.rst │ ├── PySide.QtScriptTools.rst │ ├── PySide.QtTest.rst │ └── PySide.QtCore.ClassInfo.rst └── contents.rst ├── libpyside ├── PySideConfig.cmake.in ├── pysideweakref.h ├── PySideConfigVersion.cmake.in └── pyside.pc.in ├── PySide ├── QtGui │ └── glue │ │ ├── qtgui_qapp.cpp │ │ └── qmenubar_glue.cpp └── pysidewtypes.h └── cmake └── Macros └── icecc.cmake /tests/QtWebKit/qmlplugin/dummy.pys: -------------------------------------------------------------------------------- 1 | Foobar! 2 | -------------------------------------------------------------------------------- /tests/util/module_wrapper/PySide/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/QtHelp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PYSIDE_TEST(help_test.py) 2 | -------------------------------------------------------------------------------- /tests/mac/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PYSIDE_TEST(qmacstyle_test.py) 2 | -------------------------------------------------------------------------------- /tests/QtMultimedia/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PYSIDE_TEST(audio_test.py) 2 | -------------------------------------------------------------------------------- /tests/QtScriptTools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PYSIDE_TEST(debugger_test.py) 2 | -------------------------------------------------------------------------------- /tests/QtXmlPatterns/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PYSIDE_TEST(import_test.py) 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/signalmapper/accountsfile.txt: -------------------------------------------------------------------------------- 1 | 1 + 1 = 2 2 | -------------------------------------------------------------------------------- /tests/QtGui/import_test.py: -------------------------------------------------------------------------------- 1 | class PysideImportTest2(object): 2 | pass 3 | -------------------------------------------------------------------------------- /tests/util/module_wrapper/PySide/QtCore.py: -------------------------------------------------------------------------------- 1 | 2 | from PyQt4.QtCore 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/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/QtXml.py: -------------------------------------------------------------------------------- 1 | 2 | from PyQt4.QtXml import * 3 | -------------------------------------------------------------------------------- /tests/util/module_wrapper/PySide/phonon.py: -------------------------------------------------------------------------------- 1 | 2 | from PyQt4.phonon import * 3 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/bracesIncludedResult.xml: -------------------------------------------------------------------------------- 1 | 6 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/signalmapper/taxfile.txt: -------------------------------------------------------------------------------- 1 | Tax this year = 50% 2 | -------------------------------------------------------------------------------- /tests/QtCore/quoteEnUS.txt: -------------------------------------------------------------------------------- 1 | Fine! Dishonor! Dishonor on you, dishonor on ya cow! 2 | -------------------------------------------------------------------------------- /tests/util/module_wrapper/PySide/QtScript.py: -------------------------------------------------------------------------------- 1 | 2 | from PyQt4.QtScript import * 3 | -------------------------------------------------------------------------------- /tests/util/module_wrapper/PySide/QtWebKit.py: -------------------------------------------------------------------------------- 1 | 2 | from PyQt4.QtWebKit import * 3 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/oneElementConstructor.xq: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/pathAB.xq: -------------------------------------------------------------------------------- 1 | doc('index.html')//p/span 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/xsBooleanTrue.xq: -------------------------------------------------------------------------------- 1 | xs:boolean("true") 2 | -------------------------------------------------------------------------------- /tests/util/module_wrapper/PySide/QtAssistant.py: -------------------------------------------------------------------------------- 1 | 2 | from PyQt4.QtAssistant import * 3 | -------------------------------------------------------------------------------- /tests/util/module_wrapper/PySide/QtDesigner.py: -------------------------------------------------------------------------------- 1 | 2 | from PyQt4.QtDesigner import * 3 | -------------------------------------------------------------------------------- /tests/util/module_wrapper/PySide/QtNetwork.py: -------------------------------------------------------------------------------- 1 | 2 | from PyQt4.QtNetwork import * 3 | -------------------------------------------------------------------------------- /tests/util/use_pyside.sh: -------------------------------------------------------------------------------- 1 | 2 | PYTHONPATH=$OLD_PYTHONPATH 3 | unset OLD_PYTHONPATH 4 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/anyHTMLElement.xq: -------------------------------------------------------------------------------- 1 | doc('data.xml')/*:body 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/bracesIncluded.xq: -------------------------------------------------------------------------------- 1 | {sum((1, 2, 3))} 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/bracesOmitted.xq: -------------------------------------------------------------------------------- 1 | sum({(1, 2, 3)}) 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/docPlainHTML.xq: -------------------------------------------------------------------------------- 1 | doc("myPlainHTML.html")/body 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/pathsAllParagraphs.xq: -------------------------------------------------------------------------------- 1 | doc('index.html')//p 2 | -------------------------------------------------------------------------------- /tests/QtGui/sample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/tests/QtGui/sample.png -------------------------------------------------------------------------------- /tests/phonon/tone.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/tests/phonon/tone.wav -------------------------------------------------------------------------------- /tests/util/module_wrapper/PySide/QtXmlPatterns.py: -------------------------------------------------------------------------------- 1 | 2 | from PyQt4.QtXmlPatterns import * 3 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/notIndented.xml: -------------------------------------------------------------------------------- 1 |

Some Text

2 | -------------------------------------------------------------------------------- /tests/QtCore/sample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/tests/QtCore/sample.png -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/docPlainHTML2.xq: -------------------------------------------------------------------------------- 1 | doc("myPlainHTML.html")/html/body 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/nextLastParagraph.xq: -------------------------------------------------------------------------------- 1 | doc('index.html')//p[last() - 1] 2 | -------------------------------------------------------------------------------- /tests/pysidetest/symbols.filter: -------------------------------------------------------------------------------- 1 | { 2 | local: 3 | _ZSt*; 4 | _ZNSt*; 5 | _ZNSs*; 6 | _ZNKSt*; 7 | }; 8 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/tablesInParagraphs.xq: -------------------------------------------------------------------------------- 1 | doc('index.html')/html/body/p/table 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/signalmapper/reportfile.txt: -------------------------------------------------------------------------------- 1 | Tax this year = 50% 2 | Total profit = 2 3 | -------------------------------------------------------------------------------- /tests/QtMaemo5/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PYSIDE_TEST(pickselector_test.py) 2 | PYSIDE_TEST(qmaemo5import_test.py) 3 | -------------------------------------------------------------------------------- /tests/QtXml/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PYSIDE_TEST(qdomdocument_test.py) 2 | PYSIDE_TEST(qxmlsimplereader_test.py) 3 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/emptyParagraphs.xq: -------------------------------------------------------------------------------- 1 | doc('index.html')//p[string-length(.) = 0] 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/paragraphsWithTables.xq: -------------------------------------------------------------------------------- 1 | doc('index.html')/html/body/p[table] 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/svgDocumentElement.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/util/use_pyqt4.sh: -------------------------------------------------------------------------------- 1 | 2 | OLD_PYTHONPATH=$PYTHONPATH 3 | PYTHONPATH=`pwd`/util/module_wrapper:$PYTHONPATH 4 | -------------------------------------------------------------------------------- /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/paragraphsExceptTheFiveFirst.xq: -------------------------------------------------------------------------------- 1 | doc('index.html')//p[position() > 5] 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/xsvgDocumentElement.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qshortcutmap.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | key = QKeySequence() 3 | //! [0] 4 | -------------------------------------------------------------------------------- /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/indented.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Some Text

5 |
6 | -------------------------------------------------------------------------------- /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/xmlStylesheet.xq: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /doc/_themes/pysidedocs/static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/_themes/pysidedocs/static/minus.png -------------------------------------------------------------------------------- /doc/_themes/pysidedocs/static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/_themes/pysidedocs/static/plus.png -------------------------------------------------------------------------------- /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/patternist/bracesOmittedResult.xml: -------------------------------------------------------------------------------- 1 | 2 | sum(1 2 3) -------------------------------------------------------------------------------- /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/nodeConstructorsInPaths.xq: -------------------------------------------------------------------------------- 1 | doc('feed.rss')//item/

{description/node()}

2 | -------------------------------------------------------------------------------- /tests/QtScript/base_test.py: -------------------------------------------------------------------------------- 1 | from PySide import QtScript 2 | 3 | 4 | #only test if the module import works fine bug #278 5 | -------------------------------------------------------------------------------- /doc/_themes/pysidedocs/static/bg_topo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/_themes/pysidedocs/static/bg_topo.jpg -------------------------------------------------------------------------------- /doc/_themes/pysidedocs/static/fakebar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/_themes/pysidedocs/static/fakebar.png -------------------------------------------------------------------------------- /doc/_themes/pysidedocs/static/logo_qt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/_themes/pysidedocs/static/logo_qt.png -------------------------------------------------------------------------------- /tests/QtCore/translations/trans_latin.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/tests/QtCore/translations/trans_latin.qm -------------------------------------------------------------------------------- /tests/QtCore/translations/trans_russian.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/tests/QtCore/translations/trans_russian.qm -------------------------------------------------------------------------------- /tests/QtTest/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PYSIDE_TEST(click_test.py) 2 | PYSIDE_TEST(eventfilter_test.py) 3 | PYSIDE_TEST(touchevent_test.py) 4 | -------------------------------------------------------------------------------- /doc/_themes/pysidedocs/static/bg_header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/_themes/pysidedocs/static/bg_header.png -------------------------------------------------------------------------------- /doc/_themes/pysidedocs/static/logo_indt.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/_themes/pysidedocs/static/logo_indt.jpg -------------------------------------------------------------------------------- /doc/_themes/pysidedocs/static/pysidelogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/_themes/pysidedocs/static/pysidelogo.png -------------------------------------------------------------------------------- /doc/_themes/pysidedocs/static/relbar_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/_themes/pysidedocs/static/relbar_bg.png -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qpushbutton.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | button = QPushButton("&Download", self) 3 | //! [0] 4 | -------------------------------------------------------------------------------- /doc/tutorials/qmltutorial/helloworld.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/tutorials/qmltutorial/helloworld.tar.bz2 -------------------------------------------------------------------------------- /doc/_themes/pysidedocs/static/logo_python.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/_themes/pysidedocs/static/logo_python.jpg -------------------------------------------------------------------------------- /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_network_socket_qtcpserver.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | server.setProxy(QNetworkProxy.NoProxy) 3 | //! [0] 4 | -------------------------------------------------------------------------------- /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/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/nodeTestChildElement.xq: -------------------------------------------------------------------------------- 1 | doc('index.html')/descendant-or-self::element(p)/child::element(span) 2 | -------------------------------------------------------------------------------- /tests/QtSql/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PYSIDE_TEST(bug_1013.py) 2 | PYSIDE_TEST(qsqldatabaseandqueries_test.py) 3 | PYSIDE_TEST(qvarianttype_test.py) 4 | -------------------------------------------------------------------------------- /tests/QtSvg/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PYSIDE_TEST(qsvggenerator_test.py) 2 | PYSIDE_TEST(qsvgrenderer_test.py) 3 | PYSIDE_TEST(qsvgwidget_test.py) 4 | -------------------------------------------------------------------------------- /doc/_themes/pysidedocs/static/logo_openbossa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/_themes/pysidedocs/static/logo_openbossa.png -------------------------------------------------------------------------------- /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_xmlpatterns_api_qabstracturiresolver.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | return baseURI.resolved(relative); 3 | //! [0] 4 | -------------------------------------------------------------------------------- /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_gui_graphicsview_qgraphicssceneevent.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | 3 | setDropAction(proposedAction()) 4 | 5 | //! [0] 6 | -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/samegame.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/tutorials/qmladvancedtutorial/samegame.tar.bz2 -------------------------------------------------------------------------------- /doc/tutorials/qmltutorial/declarative-tutorial1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/tutorials/qmltutorial/declarative-tutorial1.png -------------------------------------------------------------------------------- /doc/tutorials/qmltutorial/declarative-tutorial2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/tutorials/qmltutorial/declarative-tutorial2.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/patternist/anyXLinkAttribute.xq: -------------------------------------------------------------------------------- 1 | declare namespace xlink = "http://www.w3.org/1999/xlink"; 2 | doc('image.svg')//@xlink:* 3 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/widget-mask/tux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/codesnippets/doc/src/snippets/widget-mask/tux.png -------------------------------------------------------------------------------- /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.QtXml.rst: -------------------------------------------------------------------------------- 1 | To include the definitions of the module's classes, use the following directive: 2 | 3 | :: 4 | 5 | import PySide.QtXml 6 | -------------------------------------------------------------------------------- /tests/QtOpenGL/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(${QTVERSION} VERSION_GREATER 4.6.9) 2 | PYSIDE_TEST(qglbuffer_test.py) 3 | endif() 4 | PYSIDE_TEST(qglwidget_test.py) 5 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/brushstyles/qt-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/codesnippets/doc/src/snippets/brushstyles/qt-logo.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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/dragging/images/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/codesnippets/doc/src/snippets/dragging/images/file.png -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/qsplashscreen/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/codesnippets/doc/src/snippets/qsplashscreen/splash.png -------------------------------------------------------------------------------- /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/tutorials/qmladvancedtutorial/declarative-samegame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/tutorials/qmladvancedtutorial/declarative-samegame.png -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/dragging/images.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/file.png 4 | 5 | 6 | -------------------------------------------------------------------------------- /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/qtscript/scriptedslot/scriptedslot.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | object.js 4 | 5 | 6 | -------------------------------------------------------------------------------- /doc/codesnippets/examples/dialogs/classwizard/images/logo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/codesnippets/examples/dialogs/classwizard/images/logo1.png -------------------------------------------------------------------------------- /doc/codesnippets/examples/dialogs/classwizard/images/logo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/codesnippets/examples/dialogs/classwizard/images/logo2.png -------------------------------------------------------------------------------- /doc/codesnippets/examples/dialogs/classwizard/images/logo3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/codesnippets/examples/dialogs/classwizard/images/logo3.png -------------------------------------------------------------------------------- /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/tutorials/qmltutorial/declarative-tutorial3_animation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/tutorials/qmltutorial/declarative-tutorial3_animation.gif -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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_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/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/qsplashscreen/qsplashscreen.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | splash.png 4 | 5 | 6 | -------------------------------------------------------------------------------- /doc/codesnippets/examples/dialogs/classwizard/images/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/codesnippets/examples/dialogs/classwizard/images/banner.png -------------------------------------------------------------------------------- /doc/codesnippets/examples/dialogs/licensewizard/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/codesnippets/examples/dialogs/licensewizard/images/logo.png -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/declarative-adv-tutorial1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/tutorials/qmladvancedtutorial/declarative-adv-tutorial1.png -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/declarative-adv-tutorial2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/tutorials/qmladvancedtutorial/declarative-adv-tutorial2.png -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/declarative-adv-tutorial3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/tutorials/qmladvancedtutorial/declarative-adv-tutorial3.png -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/declarative-adv-tutorial4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/tutorials/qmladvancedtutorial/declarative-adv-tutorial4.gif -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/samegame/shared/pics/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/tutorials/qmladvancedtutorial/samegame/shared/pics/star.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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_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_xmlpatterns_api_qabstractxmlforwarditerator.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | OutputType inputToOutputItem(const InputType &inputType) const; 3 | //! [0] 4 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/expressionInsideAttribute.xq: -------------------------------------------------------------------------------- 1 | declare variable $additionalClass := "example"; 2 |

3 | -------------------------------------------------------------------------------- /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/qtablewidget-dnd/Images/cubed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/codesnippets/doc/src/snippets/qtablewidget-dnd/Images/cubed.png -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/quiloader/mywidget.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | myform.ui 4 | 5 | 6 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/widget-mask/mask.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | tux.png 4 | 5 | 6 | -------------------------------------------------------------------------------- /doc/codesnippets/examples/dialogs/classwizard/images/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/codesnippets/examples/dialogs/classwizard/images/background.png -------------------------------------------------------------------------------- /doc/codesnippets/examples/dialogs/classwizard/images/watermark1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/codesnippets/examples/dialogs/classwizard/images/watermark1.png -------------------------------------------------------------------------------- /doc/codesnippets/examples/dialogs/classwizard/images/watermark2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/codesnippets/examples/dialogs/classwizard/images/watermark2.png -------------------------------------------------------------------------------- /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/tutorials/qmladvancedtutorial/samegame/shared/pics/blueStar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/tutorials/qmladvancedtutorial/samegame/shared/pics/blueStar.png -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/samegame/shared/pics/redStar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/tutorials/qmladvancedtutorial/samegame/shared/pics/redStar.png -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/samegame/shared/pics/redStone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/tutorials/qmladvancedtutorial/samegame/shared/pics/redStone.png -------------------------------------------------------------------------------- /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/QtUiTools/minimal.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Form 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /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/qtablewidget-dnd/Images/squared.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/codesnippets/doc/src/snippets/qtablewidget-dnd/Images/squared.png -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/qtablewidget-using/Images/cubed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/codesnippets/doc/src/snippets/qtablewidget-using/Images/cubed.png -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/textdocument-images/images.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/advert.png 4 | 5 | 6 | -------------------------------------------------------------------------------- /doc/codesnippets/examples/dialogs/licensewizard/images/watermark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/codesnippets/examples/dialogs/licensewizard/images/watermark.png -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/samegame/shared/pics/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/tutorials/qmladvancedtutorial/samegame/shared/pics/background.jpg -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/samegame/shared/pics/blueStone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/tutorials/qmladvancedtutorial/samegame/shared/pics/blueStone.png -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/samegame/shared/pics/greenStar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/tutorials/qmladvancedtutorial/samegame/shared/pics/greenStar.png -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/samegame/shared/pics/greenStone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/tutorials/qmladvancedtutorial/samegame/shared/pics/greenStone.png -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/qsvgwidget/qsvgwidget.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | spheres.svg 4 | 5 | 6 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/qtablewidget-using/Images/squared.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/codesnippets/doc/src/snippets/qtablewidget-using/Images/squared.png -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/textdocument-images/images/advert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/codesnippets/doc/src/snippets/textdocument-images/images/advert.png -------------------------------------------------------------------------------- /doc/tutorials/qmladvancedtutorial/samegame/shared/pics/yellowStone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/tutorials/qmladvancedtutorial/samegame/shared/pics/yellowStone.png -------------------------------------------------------------------------------- /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/QtScript/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PYSIDE_TEST(base_test.py) 2 | PYSIDE_TEST(bug_1022.py) 3 | PYSIDE_TEST(engine_test.py) 4 | PYSIDE_TEST(property_test.py) 5 | PYSIDE_TEST(qscriptvalue_test.py) 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 | -------------------------------------------------------------------------------- /tests/QtWebKit/qmlplugin/index.html: -------------------------------------------------------------------------------- 1 | 2 |

Custom Plugin

3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /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/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/textdocument-imageformat/images/advert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/codesnippets/doc/src/snippets/textdocument-imageformat/images/advert.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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_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/textdocument-imageformat/images/newimage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyside/PySide/HEAD/doc/codesnippets/doc/src/snippets/textdocument-imageformat/images/newimage.png -------------------------------------------------------------------------------- /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/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/mobeyDick.xml: -------------------------------------------------------------------------------- 1 | 3 | Mobey Dick ... 4 | 5 | -------------------------------------------------------------------------------- /tests/QtCore/resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | quoteEnUS.txt 4 | sample.png 5 | 6 | 7 | 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_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/patternist/introductionExample.xq: -------------------------------------------------------------------------------- 1 | 2 | {doc("library.xml")/bib/book[publisher="Addison-Wesley" and @year>1991]/{title}} 3 | 4 | -------------------------------------------------------------------------------- /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.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | Images/squared.png 4 | Images/cubed.png 5 | 6 | 7 | -------------------------------------------------------------------------------- /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/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/examples/dialogs/licensewizard/licensewizard.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/logo.png 4 | images/watermark.png 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/QtWebKit/fox.html: -------------------------------------------------------------------------------- 1 | 2 | Title 3 | 4 | 5 |

The quick brown fox jumps over the lazy dog.

6 | 7 | 8 | -------------------------------------------------------------------------------- /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/patternist/copyAttribute.xq: -------------------------------------------------------------------------------- 1 | 2 | 3 |

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

8 | 9 | 10 | -------------------------------------------------------------------------------- /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/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_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_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/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/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/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/fnStringOnAttribute.xq: -------------------------------------------------------------------------------- 1 | 2 | 3 |

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

8 | 9 | 10 | -------------------------------------------------------------------------------- /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_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 | -------------------------------------------------------------------------------- /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_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_qworkspace.cpp: -------------------------------------------------------------------------------- 1 | //! [0] 2 | class MainWindow(...): 3 | def __init__(self): 4 | self.workspace = QWorkspace() 5 | self.setCentralWidget(workspace) 6 | ... 7 | //! [0] 8 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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_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_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/patternist/directTreeFragment.xq: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | some text 7 | 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/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/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/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/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_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_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/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/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 | -------------------------------------------------------------------------------- /tests/QtGui/test_module_template.py: -------------------------------------------------------------------------------- 1 | from PySide.QtGui import QWidget 2 | from PySide.QtCore import QObject 3 | 4 | class MyQObject(QObject): 5 | pass 6 | 7 | class MyQWidget(QWidget): 8 | pass 9 | 10 | class Sentinel(): 11 | value = 10 12 | 13 | -------------------------------------------------------------------------------- /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_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_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_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.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_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/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/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 | -------------------------------------------------------------------------------- /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_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_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/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 | -------------------------------------------------------------------------------- /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/tutorials/qmladvancedtutorial/samegame/samegame4/highscores/score_data.xml: -------------------------------------------------------------------------------- 1 | 1000000Alan the Tester0x00 2 | 6213Alan12x1751 3 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/QtNetwork/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PYSIDE_TEST(bug_446.py) 2 | PYSIDE_TEST(bug_1084.py) 3 | PYSIDE_TEST(basic_auth_test.py) 4 | PYSIDE_TEST(accessManager_test.py) 5 | PYSIDE_TEST(http_test.py) 6 | PYSIDE_TEST(tcpserver_test.py) 7 | PYSIDE_TEST(udpsocket_test.py) 8 | PYSIDE_TEST(qipv6address_test.py) 9 | -------------------------------------------------------------------------------- /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_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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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_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_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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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/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/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 | -------------------------------------------------------------------------------- /tests/QtGui/bug_998.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from PySide.QtGui import QApplication 3 | 4 | class TestBug998 (unittest.TestCase): 5 | def testNoFocusWindow(self): 6 | widget = QApplication.focusWidget() 7 | self.assertTrue(widget == None) 8 | 9 | if __name__ == '__main__': 10 | unittest.main() 11 | -------------------------------------------------------------------------------- /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_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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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_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_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_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_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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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/qapplication_singleton_test.py: -------------------------------------------------------------------------------- 1 | 2 | import unittest 3 | 4 | from PySide.QtGui import QApplication 5 | 6 | class TestSingleton(unittest.TestCase): 7 | def testBasic(self): 8 | a = QApplication([]) 9 | self.assertRaises(RuntimeError, QApplication, []) 10 | 11 | if __name__ == '__main__': 12 | unittest.main() 13 | -------------------------------------------------------------------------------- /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/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/QtHelp/help_test.py: -------------------------------------------------------------------------------- 1 | 2 | import unittest 3 | 4 | from PySide.QtHelp import QHelpEngine 5 | 6 | from helper import UsesQApplication 7 | 8 | class QHelpEngineCreation(UsesQApplication): 9 | 10 | def testConstructor(self): 11 | helpEngine = QHelpEngine('mycollection.qch') 12 | 13 | if __name__ == '__main__': 14 | unittest.main() 15 | -------------------------------------------------------------------------------- /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_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_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/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/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/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/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 | -------------------------------------------------------------------------------- /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.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | QObject 6 | 7 | Hello World! 8 | привет мир! 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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_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 | -------------------------------------------------------------------------------- /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/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/timed_app_test.py: -------------------------------------------------------------------------------- 1 | 2 | import unittest 3 | 4 | from helper import TimedQApplication 5 | 6 | class TestTimedApp(TimedQApplication): 7 | '''Simple test case for TimedQApplication''' 8 | 9 | def testFoo(self): 10 | #Simple test of TimedQApplication 11 | self.app.exec_() 12 | 13 | if __name__ == '__main__': 14 | unittest.main() 15 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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/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/QtScript/bug_1022.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | from PySide.QtCore import * 4 | from PySide.QtScript import * 5 | 6 | class QScriptValueTest(unittest.TestCase): 7 | def testQScriptValue(self): 8 | app = QCoreApplication([]) 9 | engine = QScriptEngine() 10 | repr(engine.evaluate('1 + 1')) 11 | 12 | if __name__ == '__main__': 13 | unittest.main() 14 | -------------------------------------------------------------------------------- /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/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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/QtUiTools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PYSIDE_TEST(bug_360.py) 2 | PYSIDE_TEST(bug_376.py) 3 | PYSIDE_TEST(bug_392.py) 4 | PYSIDE_TEST(bug_426.py) 5 | PYSIDE_TEST(bug_552.py) 6 | PYSIDE_TEST(bug_797.py) 7 | PYSIDE_TEST(bug_909.py) 8 | PYSIDE_TEST(bug_913.py) 9 | PYSIDE_TEST(bug_958.py) 10 | PYSIDE_TEST(bug_965.py) 11 | PYSIDE_TEST(bug_1060.py) 12 | PYSIDE_TEST(uiloader_test.py) 13 | PYSIDE_TEST(ui_test.py) 14 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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_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_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/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 | -------------------------------------------------------------------------------- /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/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/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/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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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_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_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_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_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/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/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_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/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/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 | -------------------------------------------------------------------------------- /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/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/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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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/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/QtGui/qtableview_test.py: -------------------------------------------------------------------------------- 1 | 2 | import unittest 3 | 4 | from PySide.QtCore import QAbstractTableModel 5 | from PySide.QtGui import QTableWidget 6 | from helper import UsesQApplication 7 | 8 | class QPenTest(UsesQApplication): 9 | 10 | def testItemModel(self): 11 | tv = QTableWidget() 12 | 13 | self.assertEqual(type(tv.model()), QAbstractTableModel) 14 | 15 | if __name__ == '__main__': 16 | unittest.main() 17 | 18 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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/standardpixmap_test.py: -------------------------------------------------------------------------------- 1 | 2 | import unittest 3 | 4 | from PySide.QtGui import QPixmap, QStyle 5 | 6 | from helper import UsesQApplication 7 | 8 | class StandardPixmapTest(UsesQApplication): 9 | def testDefaultOptions(self): # Bug 253 10 | pixmap = self.app.style().standardPixmap(QStyle.SP_DirClosedIcon) 11 | self.assert_(isinstance(pixmap, QPixmap)) 12 | 13 | if __name__ == '__main__': 14 | unittest.main() 15 | 16 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/QtGui/hashabletype_test.py: -------------------------------------------------------------------------------- 1 | '''Test cases for __hash__''' 2 | 3 | import unittest 4 | 5 | from PySide.QtGui import QTreeWidgetItem 6 | from helper import UsesQApplication 7 | 8 | class HashableTest(UsesQApplication): 9 | 10 | def testQTreeWidgetItemHash(self): 11 | h = {} 12 | obj = QTreeWidgetItem() 13 | h[obj] = 2 14 | self.assert_(h.get(obj), 2) 15 | 16 | if __name__ == '__main__': 17 | unittest.main() 18 | 19 | -------------------------------------------------------------------------------- /tests/QtGui/qsplitter_test.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from PySide.QtGui import QSplitter 3 | 4 | from helper import UsesQApplication 5 | 6 | class QSplitterTest(UsesQApplication): 7 | 8 | def testGetRange(self): 9 | splitter = QSplitter() 10 | _min, _max = splitter.getRange(0) 11 | self.assert_(isinstance(_min, int)) 12 | self.assert_(isinstance(_max, int)) 13 | 14 | if __name__ == "__main__": 15 | unittest.main() 16 | 17 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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/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 | -------------------------------------------------------------------------------- /tests/QtGui/qapp_test.py: -------------------------------------------------------------------------------- 1 | 2 | ''' Test the presence of qApp Macro''' 3 | 4 | import unittest 5 | 6 | from PySide.QtGui import * 7 | 8 | class QAppPresence(unittest.TestCase): 9 | 10 | def testQApp(self): 11 | #QtGui.qApp variable is instance of QApplication 12 | self.assert_(isinstance(qApp, QApplication)) 13 | 14 | def main(): 15 | app = QApplication([]) 16 | unittest.main() 17 | 18 | if __name__ == '__main__': 19 | main() 20 | -------------------------------------------------------------------------------- /doc/codesnippets/doc/src/snippets/patternist/introFileHierarchy.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | ... 10 | 11 | 12 | ... 13 | 14 | 15 | -------------------------------------------------------------------------------- /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/QtGui/python_properties_test.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from PySide import QtGui, QtCore 3 | 4 | class Properties(unittest.TestCase): 5 | 6 | def testStaticProperty(self): 7 | self.assertEqual(QtGui.QGraphicsItem.UserType, 65536) 8 | 9 | def testInstanceProperty(self): 10 | p = QtGui.QStyleOptionViewItemV3() 11 | self.assert_(isinstance(p.locale, QtCore.QLocale)) 12 | 13 | 14 | if __name__ == '__main__': 15 | unittest.main() 16 | -------------------------------------------------------------------------------- /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_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/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/QtNetwork/bug_1084.py: -------------------------------------------------------------------------------- 1 | ''' unit test for BUG #1084 ''' 2 | 3 | import unittest 4 | from PySide import QtNetwork 5 | import py3kcompat as py3k 6 | 7 | class QTcpSocketTestCase(unittest.TestCase): 8 | def setUp(self): 9 | self.sock = QtNetwork.QTcpSocket() 10 | self.sock.connectToHost('127.0.0.1', 25) 11 | 12 | def testIt(self): 13 | self.sock.write(py3k.unicode_('quit')) 14 | 15 | if __name__ == "__main__": 16 | unittest.main() 17 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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/qicon_test.py: -------------------------------------------------------------------------------- 1 | 2 | import unittest 3 | 4 | from helper import TimedQApplication 5 | from PySide.QtGui import QIcon 6 | 7 | 8 | class QIconCtorWithNoneTest(TimedQApplication): 9 | '''Test made by seblin, see Bug #944: http://bugs.pyside.org/show_bug.cgi?id=944''' 10 | 11 | def testQIconCtorWithNone(self): 12 | icon = QIcon(None) 13 | pixmap = icon.pixmap(48, 48) 14 | self.app.exec_() 15 | 16 | if __name__ == '__main__': 17 | unittest.main() 18 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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_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_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/QtMaemo5/qmaemo5import_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | import unittest 3 | from PySide.QtMaemo5 import * 4 | from PySide import QtGui 5 | 6 | from helper import UsesQApplication 7 | 8 | class QtMamo5Test(UsesQApplication): 9 | 10 | def testObjectCreate(self): 11 | bar = QMaemo5EditBar() 12 | self.assert_(isinstance(bar, QMaemo5EditBar)) 13 | 14 | def testGui(self): 15 | getattr(QtGui, 'QAbstractKineticScroller') 16 | 17 | if __name__ == '__main__': 18 | unittest.main() 19 | 20 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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/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/QtGui/qcursor_test.py: -------------------------------------------------------------------------------- 1 | '''Test for Bug 630 - Fails to resolve overload for QCursor(QBitmap, QBitmap, int, int) 2 | http://bugs.openbossa.org/show_bug.cgi?id=630 3 | ''' 4 | 5 | import unittest 6 | from PySide.QtGui import QBitmap, QCursor, QPixmap 7 | from helper import UsesQApplication 8 | 9 | class TestQCursor(UsesQApplication): 10 | def testQCursorConstructor(self): 11 | bmp = QBitmap(16, 16) 12 | cursor = QCursor(bmp, bmp, 16, 16) 13 | 14 | if __name__ == '__main__': 15 | unittest.main() 16 | 17 | -------------------------------------------------------------------------------- /tests/QtOpenGL/qglwidget_test.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from PySide.QtGui import * 3 | from PySide.QtOpenGL import * 4 | 5 | class TestQGLWidget (unittest.TestCase): 6 | def testIt(self): 7 | """Just test if the bindTexture(*, GLenum, GLint) methods overloads exists""" 8 | app = QApplication([]) 9 | img = QImage() 10 | w = QGLWidget() 11 | a = w.bindTexture(img, 0, 0) # ok if it throws nothing.. :-) 12 | 13 | 14 | 15 | 16 | 17 | if __name__ == "__main__": 18 | unittest.main() 19 | -------------------------------------------------------------------------------- /tests/QtScript/engine_test.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | from PySide.QtCore import QObject 4 | from PySide.QtScript import QScriptEngine 5 | 6 | class QScriptEngineTest(unittest.TestCase): 7 | 8 | def testQScriptEngine(self): 9 | engine = QScriptEngine() 10 | obj = engine.evaluate("({ unitName: 'Celsius', toKelvin: function(x) { return x + 273; } })") 11 | toKelvin = obj.property("toKelvin") 12 | result = toKelvin.call(obj, [100]) 13 | self.assertEqual(result.toNumber(), 373) 14 | -------------------------------------------------------------------------------- /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/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/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/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 | -------------------------------------------------------------------------------- /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_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 | -------------------------------------------------------------------------------- /tests/QtGui/qapplication_exit_segfault_test.py: -------------------------------------------------------------------------------- 1 | 2 | import unittest 3 | import sys 4 | 5 | from PySide.QtGui import QApplication, QPushButton, QWidget, QSpinBox 6 | 7 | class QApplicationDelete(unittest.TestCase): 8 | '''Test for segfault when deleting a QApplication before a QWidget''' 9 | 10 | def testQPushButton(self): 11 | #QApplication deleted before QPushButton 12 | a = QApplication([]) 13 | b = QPushButton('aaaa') 14 | del a 15 | 16 | if __name__ == '__main__': 17 | unittest.main() 18 | -------------------------------------------------------------------------------- /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/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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/QtUiTools/action.ui: -------------------------------------------------------------------------------- 1 | 2 | main_window 3 | 4 | 5 | 6 | 7 | 8 | 9 | foo 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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_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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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/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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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_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/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 | -------------------------------------------------------------------------------- /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/QtMaemo5/pickselector_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | import unittest 3 | from PySide.QtMaemo5 import QMaemo5ListPickSelector, QMaemo5ValueButton 4 | 5 | from helper import UsesQApplication 6 | 7 | class PickSelectorTest(UsesQApplication): 8 | def testOwnership(self): 9 | pickselector = QMaemo5ListPickSelector() 10 | button = QMaemo5ValueButton("test") 11 | button.setPickSelector(pickselector) 12 | del pickselector 13 | self.assert_(button.pickSelector()) 14 | 15 | if __name__ == '__main__': 16 | unittest.main() 17 | 18 | -------------------------------------------------------------------------------- /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/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/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/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/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/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/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/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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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_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/grandparent_method_test.py: -------------------------------------------------------------------------------- 1 | 2 | '''Tests for calling methods further than the direct parent''' 3 | 4 | import unittest 5 | 6 | from PySide.QtGui import QPushButton, QWidget 7 | 8 | from helper import UsesQApplication 9 | 10 | class Dummy(QPushButton): 11 | 12 | def show(self): 13 | QWidget.show(self) 14 | self.called = True 15 | 16 | class GrandParentMethod(UsesQApplication): 17 | def testMethod(self): 18 | obj = Dummy() 19 | obj.show() 20 | self.assert_(obj.called) 21 | 22 | if __name__ == '__main__': 23 | unittest.main() 24 | -------------------------------------------------------------------------------- /tests/QtGui/qlcdnumber_test.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | from PySide.QtGui import QApplication, QLCDNumber 4 | 5 | class QLCDNumberOverflow(unittest.TestCase): 6 | '''Test case for unhandled overflow on QLCDNumber() numDigits argument (see bug #215).''' 7 | 8 | def setUp(self): 9 | self.app = QApplication([]) 10 | 11 | def testnumDigitsOverflow(self): 12 | # NOTE: PyQt4 raises TypeError, but boost.python raises OverflowError 13 | self.assertRaises(OverflowError, QLCDNumber, 840835495615213080) 14 | 15 | if __name__ == '__main__': 16 | unittest.main() 17 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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("